Datasets:
Upload folder using huggingface_hub (part 8)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- md/train/QRBvLayFXI/QRBvLayFXI.md +257 -0
- md/train/QWIvzSQaX5/QWIvzSQaX5.md +256 -0
- md/train/QYjO70ACDK/QYjO70ACDK.md +278 -0
- md/train/QZpx42n0BWr/QZpx42n0BWr.md +253 -0
- md/train/Q_64PF6XNut/Q_64PF6XNut.md +349 -0
- md/train/QbVza2PKM7T/QbVza2PKM7T.md +347 -0
- md/train/QgX15Mdi1E_/QgX15Mdi1E_.md +322 -0
- md/train/QjINdYOfq0b/QjINdYOfq0b.md +390 -0
- md/train/QkRbdiiEjM/QkRbdiiEjM.md +416 -0
- md/train/QkVi6KogNbu/QkVi6KogNbu.md +536 -0
- md/train/QkljT4mrfs/QkljT4mrfs.md +219 -0
- md/train/QmxFsofRvW9/QmxFsofRvW9.md +287 -0
- md/train/QpNz8r_Ri2Y/QpNz8r_Ri2Y.md +0 -0
- md/train/QpT9Q_NNfQL/QpT9Q_NNfQL.md +454 -0
- md/train/QpU7n-6l0n/QpU7n-6l0n.md +317 -0
- md/train/QtTKTdVrFBB/QtTKTdVrFBB.md +537 -0
- md/train/R-616EWWKF5/R-616EWWKF5.md +235 -0
- md/train/RHY_9ZVcTa_/RHY_9ZVcTa_.md +467 -0
- md/train/RJ7XFI15Q8f/RJ7XFI15Q8f.md +267 -0
- md/train/RLRXCV6DbEJ/RLRXCV6DbEJ.md +307 -0
- md/train/RO4DM85Z4P7/RO4DM85Z4P7.md +192 -0
- md/train/RQfcckT1M_4/RQfcckT1M_4.md +289 -0
- md/train/RSU17UoKfJF/RSU17UoKfJF.md +376 -0
- md/train/RUQ1zwZR8_/RUQ1zwZR8_.md +200 -0
- md/train/RYcgfqmAOHh/RYcgfqmAOHh.md +396 -0
- md/train/Rcmk0xxIQV/Rcmk0xxIQV.md +553 -0
- md/train/Rd138pWXMvG/Rd138pWXMvG.md +319 -0
- md/train/Re_VXFOyyO/Re_VXFOyyO.md +375 -0
- md/train/Rld-9OxQ6HU/Rld-9OxQ6HU.md +0 -0
- md/train/RmuXDtjDhG/RmuXDtjDhG.md +292 -0
- md/train/Rnn8zoAkrwr/Rnn8zoAkrwr.md +406 -0
- md/train/RovX-uQ1Hua/RovX-uQ1Hua.md +453 -0
- md/train/Rt5mjXAqHrY/Rt5mjXAqHrY.md +295 -0
- md/train/RtNpzLdHUAW/RtNpzLdHUAW.md +324 -0
- md/train/Rx9dBZaV_IP/Rx9dBZaV_IP.md +263 -0
- md/train/RzYrn625bu8/RzYrn625bu8.md +312 -0
- md/train/S11KBYclx/S11KBYclx.md +258 -0
- md/train/S18Su--CW/S18Su--CW.md +353 -0
- md/train/S191YzbRZ/S191YzbRZ.md +311 -0
- md/train/S19dR9x0b/S19dR9x0b.md +285 -0
- md/train/S19eAF9ee/S19eAF9ee.md +249 -0
- md/train/S1AG8zYeg/S1AG8zYeg.md +392 -0
- md/train/S1ANxQW0b/S1ANxQW0b.md +747 -0
- md/train/S1Bb3D5gg/S1Bb3D5gg.md +258 -0
- md/train/S1CChZ-CZ/S1CChZ-CZ.md +292 -0
- md/train/S1DWPP1A-/S1DWPP1A-.md +538 -0
- md/train/S1Dh8Tg0-/S1Dh8Tg0-.md +318 -0
- md/train/S1E3Ko09F7/S1E3Ko09F7.md +0 -0
- md/train/S1EHOsC9tX/S1EHOsC9tX.md +381 -0
- md/train/S1Euwz-Rb/S1Euwz-Rb.md +418 -0
md/train/QRBvLayFXI/QRBvLayFXI.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Revisiting the Calibration of Modern Neural Networks
|
| 2 |
+
|
| 3 |
+
# Matthias Minderer Josip Djolonga Rob Romijnders Frances Hubis Xiaohua Zhai Neil Houlsby Dustin Tran Mario Lucic
|
| 4 |
+
|
| 5 |
+
Google Research, Brain Team {mjlm, lucic}@google.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Accurate estimation of predictive uncertainty (model calibration) is essential for the safe application of neural networks. Many instances of miscalibration in modern neural networks have been reported, suggesting a trend that newer, more accurate models produce poorly calibrated predictions. Here, we revisit this question for recent state-of-the-art image classification models. We systematically relate model calibration and accuracy, and find that the most recent models, notably those not using convolutions, are among the best calibrated. Trends observed in prior model generations, such as decay of calibration with distribution shift or model size, are less pronounced in recent architectures. We also show that model size and amount of pretraining do not fully explain these differences, suggesting that architecture is a major determinant of calibration properties.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Neural networks, especially vision models, are increasingly used in safety-critical applications such as autonomous driving (Bojarski et al., 2016), medical diagnosis (Esteva et al., 2017; Jiang et al., 2012), and meteorological forecasting (Sønderby et al., 2020). For such applications, it is essential that model predictions are not just accurate, but also well calibrated. Model calibration refers to the accuracy with which the scores provided by the model reflect its predictive uncertainty. For example, in a medical application, we would like to defer images for which the model makes low-confidence predictions to a physician for review (Kompa et al., 2021). Skipping human review due to confident, but incorrect, predictions, could have disastrous consequences.
|
| 14 |
+
|
| 15 |
+
While intense research and engineering effort has focused on improving the predictive accuracy of models, less attention has been given to model calibration. In fact, over the last few years, there have been many reports that calibration of modern neural networks can be surprisingly poor, despite the advances in accuracy (e.g. Guo et al. 2017; Lakshminarayanan et al. 2017; Malinin & Gales 2018; Thulasidasan et al. 2019; Hendrycks et al. 2020b; Ovadia et al. 2019; Wenzel et al. 2020; Havasi et al. 2021; Rahaman & Thiery 2020; Leathart & Polaczuk 2020). Some works suggest a trend for larger, more accurate models to be worse calibrated (Guo et al., 2017).
|
| 16 |
+
|
| 17 |
+
These concerns are more relevant than ever, since the architecture size, amount of training data, and computing power used by state-of-the-art models continue to increase. At the same time, rapid advances in model architecture (Tolstikhin et al., 2021; Dosovitskiy et al., 2021) and training approaches (Chen et al., 2020; Mahajan et al., 2018; Radford et al., 2021) raise the question whether past results on calibration, largely obtained on standard convolutional architectures, extend to current state-of-the-art models. Since model advances are quickly translated to real-world, safety-critical applications (e.g. Mustafa et al. 2021), there is an urgent need to re-assess the calibration properties of current state-of-the-art models.
|
| 18 |
+
|
| 19 |
+
Contributions. To address this need, we provide a systematic comparison of recent image classification models, relating their accuracy, calibration, and design features. We find that:
|
| 20 |
+
|
| 21 |
+
1. The best current models, including the non-convolutional MLP-Mixer (Tolstikhin et al., 2021) and Vision Transformers (Dosovitskiy et al., 2021), are well calibrated compared to past models and their performance is more robust to distribution shift.
|
| 22 |
+
2. In-distribution calibration slightly deteriorates with increasing model size, but this is outweighed by a simultaneous improvement in accuracy.
|
| 23 |
+
3. Under distribution shift, calibration improves with model size, reversing the trend seen indistribution.
|
| 24 |
+
4. Accuracy and calibration are correlated under distribution shift, such that optimizing for accuracy may also benefit calibration.
|
| 25 |
+
5. Model size, pretraining duration, and pretraining dataset size cannot fully explain differences in calibration properties between model families.
|
| 26 |
+
|
| 27 |
+
Our results suggest that further improvements in model accuracy will continue to benefit calibration. They also hint at architecture as an important determinant of model calibration. We provide code and a large dataset of calibration measurements, comprising 180 distinct models from 16 families, each evaluated on 79 ImageNet-scale datasets and 28 metric variants.1
|
| 28 |
+
|
| 29 |
+
# 2 Related Work
|
| 30 |
+
|
| 31 |
+
Measures of model calibration. The losses that are commonly used to train classification models, such as cross-entropy and squared error, are proper scoring rules (Gneiting et al., 2007) and are therefore guaranteed to yield perfectly calibrated models at their minimum—in the infinite-data limit. However, in practice, due to model mismatch and overfitting, even losses based on proper scoring rules may result in poor model calibration. Miscalibration is commonly quantified in terms of Expected Calibration Error (ECE; Naeini et al. 2015), which measures the absolute difference between predictive confidence and accuracy. We focus on ECE because it is a widely used and accepted calibration metric. Nevertheless, it is well understood that estimating ECE accurately is difficult because estimators can be strongly biased and many estimator variants exist (Nixon et al., 2019; Roelofs et al., 2020; Vaicenavicius et al., 2019; Gupta et al., 2021). Section 5 discusses these issues and our approaches to mitigate them.
|
| 32 |
+
|
| 33 |
+
Alternatives to ECE include likelihood measures, Brier score (Brier, 1950), Bayesian methods (Gelman et al., 2013), and conformal prediction (Shafer & Vovk, 2008). Further, model calibration can be represented visually with reliability diagrams (DeGroot & Fienberg, 1983). Figure 8 and Appendix F provide likelihoods, Brier scores, and reliability diagrams for our main analyses.
|
| 34 |
+
|
| 35 |
+
Empirical studies of model calibration. There have been many recent empirical studies on the robustness (accuracy under distribution shift) of image classifiers (Geirhos et al., 2019; Taori et al., 2020; Djolonga et al., 2020; Hendrycks et al., 2020a). Several works have also studied calibration. Most notable is Guo et al. (2017), who found that “modern neural networks, unlike those from a decade ago, are poorly calibrated”, that larger networks tend to be calibrated worse, and that “miscalibration worsen[s] even as classification error is reduced.” Other works have corroborated some of these findings (e.g., Thulasidasan et al. 2019; Wen et al. 2021). This line of work suggests a trend that larger models are worse calibrated, which would have major implications for research toward bigger models and datasets. We show that for more recent models, this trend is negligible in-distribution and in fact reverses under distribution shift.
|
| 36 |
+
|
| 37 |
+
Ovadia et al. (2019) empirically study calibration under distribution shift and provide a large comparison of methods for improving calibration. They report that both accuracy and calibration deteriorate with distribution shift. While we observe the same trend, we find that the calibration of some recent model families decays so slowly under distribution shift that the decay in accuracy is likely more relevant in practice (Section 4.3).
|
| 38 |
+
|
| 39 |
+
Ovadia et al. also find that, across methods for improving calibration, improvements on in-distribution data do not necessarily translate to out-of-distribution data. This finding may suggest that there is little correlation between in-distribution and out-of-distribution calibration in general. However, our results show that, across model architectures, the models with the best in-distribution calibration are also the best-calibrated on a range of out-of-distribution benchmarks. The important implication of this result is that designing models based on in-distribution performance likely also benefits their out-of-distribution performance.
|
| 40 |
+
|
| 41 |
+
Improving calibration. Many strategies have been proposed to improve model calibration such as post-hoc rescaling of predictions (Guo et al., 2017), averaging multiple predictions (Lakshminarayanan et al., 2017; Wen et al., 2020), and data augmentation (Thulasidasan et al., 2019; Wen et al., 2021). Here, we focus on the intrinsic calibration properties of state-of-the-art model families, rather than methods to further improve calibration.
|
| 42 |
+
|
| 43 |
+
As a baseline on top of a model’s intrinsic calibration properties, we study temperature scaling (Guo et al., 2017). It is effective in improving calibration and so simple that it can be applied in many cases at minimal additional cost, in contrast to many more sophisticated methods. Temperature scaling re-scales a model’s logits by a single parameter, chosen to optimize the model’s likelihood on a held-out portion of the training data. This temperature factor changes the model’s confidence, i.e., whether the model predictions are on average too certain (overconfident), optimally confident, or too uncertain (underconfident). The classification accuracy of the model is not affected by temperature scaling. A large fraction of model miscalibration is typically due to average over- or underconfidence, e.g. due to suboptimal training duration (Guo et al., 2017). By normalizing a model’s confidence, temperature scaling not only improves calibration, but also removes a primary confounder that can hide trends in calibration between models (see Section 4.2 and Appendix D). Therefore, we study both unscaled and temperature-scaled predictions in the paper.
|
| 44 |
+
|
| 45 |
+
# 3 Definitions and Notation
|
| 46 |
+
|
| 47 |
+
We consider the multi-class classification problem, as analyzed by Bröcker (2009), where we observe a variable $X$ and predict a categorical variable $Y \in \{ 1 , 2 , \dots , k \}$ . We model our predictor $f$ as a function that maps every input instance $X$ to a categorical distribution over $k$ labels, represented using a vector $f ( X )$ belonging to the $\left( k - 1 \right)$ -dimensional simplex $\Delta = \{ p \in [ 0 , 1 ] ^ { k } \mid \sum _ { y = 1 } ^ { k } p _ { y } = 1 \}$ .
|
| 48 |
+
|
| 49 |
+
Intuitively, a model $f$ is well-calibrated if its output truthfully quantifies the predictive uncertainty. For example, if we take all data points $x$ for which the model predicts $[ f ( x ) ] _ { y } \stackrel { - } { = } 0 . 3$ , we expect $3 0 \%$ of them to indeed take on the label $y$ . Formally, the model $f$ is said to be calibrated if (Bröcker, 2009)
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\forall p \in \Delta \colon P ( Y = y \mid f ( X ) = p ) = p _ { y } .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
We will focus on a slightly weaker, but more practical condition, called top-label or argmax calibration (Kumar et al., 2019; Guo et al., 2017). This requires that the above holds only for the most likely label, i.e., $\forall p ^ { * } \in [ 0 , 1 ]$
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
P ( Y \in \arg \operatorname* { m a x } { p } \mid \operatorname* { m a x } { f ( X ) } = p ^ { * } ) = p ^ { * } ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where the max and arg max act coordinate-wise.
|
| 62 |
+
|
| 63 |
+
The most common measure of the degree of miscalibration is the Expected Calibration Error $( E C E )$ , which computes the expected disagreement between the two sides of eq. (2)
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathbb { E } \big [ | p ^ { * } - E [ Y \in \arg \operatorname* { m a x } f ( X ) \mid \operatorname* { m a x } f ( X ) = p ^ { * } | \big ] .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Unfortunately, eq. (3) cannot be estimated without quantization as it conditions on a null event. Hence, one typically first buckets the predictions into $m$ bins $B _ { 1 } , \ldots , B _ { m }$ based on their top predicted probability, and then takes the expectation over these buckets. Namely, if we are given a set of $n$ i.i.d. samples $( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { n } , y _ { n } )$ distributed as $P ( X , Y )$ , then we assign each $\bar { \boldsymbol j } \in \{ 1 , \dots , n \}$ $B _ { i }$ n max and th $f ( x _ { j } )$ . Tracy $B _ { i }$ nfidenc, where $( B _ { i } ) =$ $\begin{array} { r } { \frac { 1 } { | B _ { i } | } \sum _ { j \in B _ { i } } \operatorname* { m a x } f ( x _ { j } ) } \end{array}$ $\begin{array} { r } { \mathbf { \Gamma } ^ { \prime } ( B _ { i } ) = \frac { 1 } { | B _ { i } | } \sum _ { j \in B _ { i } } \mathbb { [ } y _ { j } \in \arg \operatorname* { m a x } f ( x _ { j } ) \mathbb { I } } \end{array}$ $[ [ \cdot ] ]$ Iverson bracket. Finally, we construct an estimator by taking the expectation over the bins
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
{ \widehat { \mathrm { E C E } } } = \sum _ { i = 1 } ^ { m } { \frac { | B _ { i } | } { n } } \left| { \mathrm { a c c u r a c y } } ( B _ { i } ) - { \mathrm { c o n f i d e n c e } } ( B _ { i } ) \right| .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
In Section 5 we discuss the statistical properties of this estimator, possible pitfalls, and several mitigation strategies.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 1: Some modern neural network families are both highly accurate and well-calibrated. Left: Expected calibration error (ECE) vs. classification error on IMAGENET for state-of-the-art image classification models. Marker size indicates relative model size within its family. Points labeled “Guo et al.” are the values reported for DenseNet-161 and ResNet-152 in Guo et al. (2017). Right: Confidence distribution (top row) and reliability diagrams (bottom row) for some of the models.
|
| 79 |
+
|
| 80 |
+
# 4 Empirical Evaluation
|
| 81 |
+
|
| 82 |
+
# 4.1 Experimental Setup
|
| 83 |
+
|
| 84 |
+
Model families. In this study, we consider a range of recent and some historic state-of-the-art image classification models. Our selection of models covers convolutional and non-convolutional architectures, as well as supervised, weakly supervised, unsupervised and zero-shot training. We follow the original publications in naming the model variants within each family (e.g. different model sizes). See Appendix A.1 for a detailed description of all used models.
|
| 85 |
+
|
| 86 |
+
1. MLP-Mixer (Tolstikhin et al., 2021) is based exclusively on multi-layer perceptrons (MLPs) and is pre-trained on large supervised datasets.
|
| 87 |
+
2. ViT (Dosovitskiy et al., 2021) processes images with a transformer architecture originally designed for language (Vaswani et al., 2017) and is also pre-trained on large supervised datasets.
|
| 88 |
+
3. BiT (Kolesnikov et al., 2020) is a ResNet-based architecture (He et al., 2016). It is also pre-trained on large supervised datasets.
|
| 89 |
+
4. ResNext-WSL (Mahajan et al., 2018) is based on the ResNeXt architecture and trained with weak supervision from billions of hashtags on social media images.
|
| 90 |
+
5. SimCLR (Chen et al., 2020) is a ResNet, pretrained with an unsupervised contrastive loss.
|
| 91 |
+
6. CLIP (Radford et al., 2021) is pretrained on raw text and imagery using a contrastive loss.
|
| 92 |
+
7. AlexNet (Krizhevsky et al., 2012; Krizhevsky, 2014) was the first convolutional neural network to win the ImageNet challenge.
|
| 93 |
+
|
| 94 |
+
All models are either trained or fine-tuned on the IMAGENET training set, except for CLIP, which makes zero-shot predictions using IMAGENET class names as queries.
|
| 95 |
+
|
| 96 |
+
Datasets. We evaluate accuracy and calibration on the IMAGENET validation set and the following out-of-distribution benchmarks using the Robustness Metrics library (Djolonga et al., 2020):
|
| 97 |
+
|
| 98 |
+
1. IMAGENETV2 (Recht et al., 2019) is a new IMAGENET test set collected by closely following the original IMAGENET labeling protocol.
|
| 99 |
+
2. IMAGENET-C (Hendrycks & Dietterich, 2019) consists of the images from IMAGENET, modified with synthetic perturbations such as blur, pixelation, and compression artifacts at a range of severities.
|
| 100 |
+
3. IMAGENET-R (Hendrycks et al., 2020a) contains artificial renditions of IMAGENET classes such as art, cartoons, drawings, sculptures, and others.
|
| 101 |
+
4. IMAGENET-A (Hendrycks et al., 2021) contains images that are classified as belonging to IMAGENET classes by humans, but adversarially selected to be hard to classify for a ResNet50 trained on IMAGENET.
|
| 102 |
+
|
| 103 |
+
For the post-hoc recalibration of models, we reserve $20 \%$ of the IMAGENET validation set (randomly sampled) for fitting the temperature scaling parameter. All reported metrics are computed on the remaining $80 \%$ of the data. For evaluations on IMAGENET-C, we also exclude the $20 \%$ of images that are based on the IMAGENET images used for temperature scaling.
|
| 104 |
+
|
| 105 |
+
Calibration metric. Throughout the paper, we estimate ECE using equal-mass binning and 100 bins. Appendix E shows that our results hold for other ECE variants and are consistent with the Brier score and model likelihood.
|
| 106 |
+
|
| 107 |
+
# 4.2 In-Distribution Calibration
|
| 108 |
+
|
| 109 |
+
We begin by considering ECE on clean IMAGENET images (referred to as in-distribution). Figure 1 shows in-distribution ECE and reliability diagrams before any recalibration of the predicted probabilities. We find that several recent model families (MLP-Mixer, ViT, and BiT) are both highly accurate and well-calibrated compared to prior models, such as AlexNet or the models studied by Guo et al. (2017). This suggests that there may be no continuing trend for highly accurate modern neural networks to be poorly calibrated, as suggested previously (Guo et al., 2017; Lakshminarayanan et al., 2017; Malinin & Gales, 2018; Thulasidasan et al., 2019; Hendrycks et al., 2020b; Ovadia et al., 2019; Wenzel et al., 2020; Havasi et al., 2021; Rahaman & Thiery, 2020; Leathart & Polaczuk, 2020). In addition, we find that a recent zero-shot model, CLIP, is well-calibrated given its accuracy.
|
| 110 |
+
|
| 111 |
+
Temperature scaling reveals consistent properties of model families. The poor calibration of past models can often be remedied by post-hoc recalibration such as temperature scaling (Guo et al., 2017), which raises the question whether a difference between models remains after recalibration. We find that the most recent architectures are better calibrated than past models even after temperature scaling (Figure 2, right).
|
| 112 |
+
|
| 113 |
+
More generally, temperature scaling reveals consistent trends in the calibration properties between families that are obscured in the unscaled data by simple over- or underconfidence miscalibration. Before temperature scaling (Figure 2, left), several families overlap in their accuracy/calibration properties (MLP-Mixer, ViT, BiT). After temperature scaling (Figure 2, right), a clearer separation of families and consistent trends between accuracy and calibration within each family become apparent. Notably, temperature scaling reconciles our results for BiT (a ResNet architecture) with the results reported by Guo et al. for ResNets trained on IMAGENET. Furthermore, models pretrained without addi
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 2: Temperature scaling reveals consistent properties of model families. Left: ECE vs. classification error as in Figure 1. Right: ECE after applying temperature scaling.
|
| 117 |
+
|
| 118 |
+
tional labels (SimCLR) or with noisy labels (ResNeXt-WSL) tend to be calibrated worse for a given accuracy than ResNets trained with supervision (BiT and the models studied by Guo et al.). Finally, non-convolutional model families like MLP-Mixer and ViT can perform just as well, if not better, than convolutional ones.
|
| 119 |
+
|
| 120 |
+
Differences between families are not explained by model size or pretraining amount. We next attempt to disentangle how the differences between model families affect their calibration properties. We focus on model size and amount of pretraining, both important trends in state of-the-art models.
|
| 121 |
+
|
| 122 |
+
We first consider model size. Prior work has suggested that larger neural networks are worse calibrated (Guo et al., 2017). We also find that within most families, larger members tend to have higher calibration error (Figure 2, right). However, at the same time, larger models have consistently lower classification error. This means that each model family occupies a different Pareto set in the tradeoff between accuracy and calibration. For example, our results suggest that, at any given accuracy, ViT models are better calibrated than BiT models. Changing the size of a BiT model cannot move it into the Pareto set of ViT models. Model size can therefore not fully explain the intrinsic calibration differences between these model families.2
|
| 123 |
+
|
| 124 |
+
We next consider model pretraining. Many current state-of-the-art image models use transfer learning, in which a model is pre-trained on a large dataset and then fine-tuned to the task of interest (Kolesnikov et al., 2020; Chen et al., 2020; Xie et al., 2020). With transfer learning, large data sources can be exploited to train the model, even if little data are available for the final task. To test how the amount of pretraining affects calibration, we compare BiT models pretrained on IMAGENET (1.3M images), IMAGENET-21K (12.8M images), or JFT-300 (300M images; Sun et al. 2017).
|
| 125 |
+
|
| 126 |
+
More pretraining data consistently increases accuracy, especially for larger models. It has no consistent effect on calibration (Figure 3). In particular, after temperature scaling, ECE is essentially unchanged across this 300-fold increase in pretraining dataset size (e.g. for BiTR50x1 pretrained on IMAGENET, IMAGENET21K and JFT-300, the ECEs are 0.0185, 0.0182, 0.0185, respectively; for BiT-R101x3, they are 0.0272, 0.0311, 0.0236; Figure 3, bottom). Therefore, regardless of the pretraining dataset, BiT always remains Pareto-dominant over SimCLR and Pareto-dominated by ViT and MLPMixer in our experiments.
|
| 127 |
+
|
| 128 |
+
The BiT models compared in Figure 3 differ in both the amount of pretraining data and the duration of pretraining (see Kolesnikov et al. (2020) for details). To further disentangle these variables, we trained BiT models on varying numbers of pretraining examples while holding the number of training steps constant, and vice versa. We find that pretraining dataset size has no significant effect on calibration, while pretraining duration only shifts the model within its accuracy/calibration Pareto set (longer-trained models are more accurate and worse calibrated; Figure 10). These results suggest that pretraining alone cannot explain the differences between model families that we observe.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 3: Family differences are not fully explained by the amount of pretraining. Each column shows ECE vs. classification error on ImageNet for BiT models pre-trained with a different dataset: IMAGENET (1.3M images), IMAGENET-21K (12.8M images), or JFT-300 (300M images). The values for other models are provided for reference in light shading (same values as in Figure 2). Note how all BiT models remain in the same relative location between ViT and SimCLR across a 300-fold difference in pretraining data size.
|
| 132 |
+
|
| 133 |
+
In summary, our results show that some modern neural network families combine high accuracy and state-of-the-art calibration on in-distribution data, both before and after post-hoc recalibration by temperature scaling. In Figure 8 and Appendices E and F, we show that these results generally hold for other measures of model calibration (other ECE variants, Brier score, and model likelihood). Our experiments further suggest that model size and pretraining amount do not fully explain the intrinsic calibration differences between model families. Given that the best-calibrated families (MLP-Mixer and ViT) are non-convolutional, we speculate that model architecture, and in particular its spatial inductive bias, play an important role.
|
| 134 |
+
|
| 135 |
+
# 4.3 Accuracy and Calibration Under Distribution Shift
|
| 136 |
+
|
| 137 |
+
For safety-critical applications, the model should produce reasonable uncertainty estimates not just in-distribution, but also under distribution shifts that were not anticipated at training time. We first assess out-of-distribution calibration on the IMAGENET-C dataset, which consists of images that have been synthetically corrupted at five different severities. As expected, both classification and calibration error generally increase with distribution shift (Figure 4; Ovadia et al. 2019; Hendrycks & Dietterich 2019). Interestingly, this decay in calibration performance is slower for MLP-Mixer and ViT than for the other model families, both before and after temperature scaling.
|
| 138 |
+
|
| 139 |
+
Regarding the effect of model size on calibration, we observed some trend towards worse calibration of larger models on in-distribution data. However, the trend is reversed for most model families as we move out of distribution, especially after accounting for confidence bias by temperature scaling (note positive slope of the gray lines at high corruption severities in Figure 4, bottom row). In other words, the calibration of larger models is more robust to distribution shift (Figure 5).
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 4: Calibration and accuracy on IMAGENET-C before (top) and after (bottom) temperature scaling on IMAGENET. Severity 0 refers to the clean IMAGENET test set; marker size indicates relative model size within its family (see Table 1 for model details). The calibration of some recent model families, e.g. MLP-Mixer and ViT, is more robust to distribution shift than past models.
|
| 143 |
+
|
| 144 |
+
We next consider to what degree the insights from in-distribution and IMAGENET-C calibration transfer to natural out-of-distribution data. Previous work on IMAGENET-C suggests that, when comparing recalibration methods, better in-distribution calibration and accuracy do not usually predict better calibration under distribution shift (Ovadia et al., 2019). Here, comparing model families, we find that the performance on several natural out-of-distribution datasets is largely consistent with that on IMAGENET (Figure 6). In particular, models that are Pareto-optimal (i.e. no other model is both more accurate and better calibrated) on IMAGENET remain Pareto-optimal on the OOD datasets. Further, we observe a strong correlation between accuracy and calibration on the OOD datasets. This relationship is consistent across models within a family and across datasets, over a wide range of accuracies (Figure 11).
|
| 145 |
+
|
| 146 |
+
These results suggest that larger and more accurate models, and in particular MLP-Mixer and ViT, can maintain their good in-distribution calibration even under severe distribution shifts. Based on the observed relationship between calibration and accuracy, we can reasonably hope that good calibration on in-distribution data (and anticipated distribution shifts) generally translates into good calibration on unanticipated outof-distribution data, similar to what has been observed for accuracy (Djolonga et al., 2020).
|
| 147 |
+
|
| 148 |
+
# 4.4 Relating Accuracy and Calibration Within Model Families
|
| 149 |
+
|
| 150 |
+
Our data suggest that most model families lie on different Pareto sets in the accuracy/calibration space, which establishes a clear preference between families. We next consider how to compare individual models within a family (or more specifically, within a Pareto set), where one model is more accurate but worse calibrated, and the other is less accurate but better calibrated. Which model should a practitioner choose for a safety-critical application?
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 5: Classification error and ECE for the top three families on IMAGENET-C, relative to the largest model variant in each family. As distribution shift increases, both errors tend to increase more slowly for larger models. Also note that changes in ECE are much smaller than changes in classification error.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 6: Calibration and accuracy before (top row) and after (bottom row) temperature scaling on out-of-distribution benchmarks. Marker size indicates relative model size within its family. IMAGENET-R and IMAGENET-A use a reduced subset of 200 classes; we follow the literature and select the subset of the model logits for these classes before evaluation. Out-of-distribution calibration tends to correlate with in-distribution calibration (Figure 1) and out-of-distribution accuracy.
|
| 157 |
+
|
| 158 |
+
The answer depends on the cost structure of the specific application (Hernández-Orallo et al., 2012). As an example, consider the scenario of selective prediction, which is common in medical diagnosis. In this task, one can choose to ignore the model prediction (“abstain”) at a fixed cost if the prediction confidence is low, rather than risking a (more costly) prediction error.
|
| 159 |
+
|
| 160 |
+
Figure 7 compares the expected cost for two BiT variants, one with better classification error $( \mathrm { R } 1 5 2 \mathrm { x } 4 $ , by 0.08), and one with better ECE (R50x1, by 0.009). For abstention rates up to $70 \%$ (which covers most practical scenarios with abstention rates low enough for the model to be useful), the model with better accuracy has a lower overall cost than the model with better ECE. The same is true for all other model families we study (Appendix B.3). For these families and this cost scenario, a practitioner should therefore always choose the most accu
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 7: Relative cost of BiT-R $1 5 2 \mathrm { x } 4$ and BiT$\mathrm { R } 5 0 \mathrm { x } 1$ models in a selective prediction scenario, computed as a combination of the misclassification and abstention costs at a given cost ratio $\mathbf { \dot { x } }$ -axis) and abstention rate (y-axis). Blue indicates regions where the higher-accuracy model $( \mathrm { R } 1 5 2 \mathrm { x } 4 )$ achieves a lower cost than the bettercalibrated model (R50x1). The accuracy advantage outweighs the calibration advantage for practical rejection rates, across all tested abstention costs.
|
| 164 |
+
|
| 165 |
+
rate available model regardless of differences in calibration. Ultimately, real-world cost structures are complex and may yield different results; Figure 7 presents one common scenario with downstream ramifications for the importance of the calibration differences compared to accuracy.
|
| 166 |
+
|
| 167 |
+
# 5 Pitfalls and Limitations
|
| 168 |
+
|
| 169 |
+
For this study, we approached calibration with a simple, practical question: Given two models, one more accurate and the other better calibrated, which should a practitioner choose? While working towards answering this question, we encountered several pitfalls that complicate the interpretation of calibration results.
|
| 170 |
+
|
| 171 |
+
Measuring calibration is challenging, and while the quantity we want to estimate is well specified, the estimator itself can be biased. There are two sources of bias: (i) from estimating ECE by binning, and (ii) from the finite sample size used to estimate the per-bin statistics.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 8: Alternative calibration metrics: negative log-likelihood (NLL) and Brier score. For comparison, the first row shows ECE as in Figure 6. Since NLL, Brier score, and classification error are all highly correlated, we also provide the residuals of NLL and Brier score after regressing out classification error (third and fifth row). Specifically, we first fit a linear regression $y _ { i } = \beta _ { 0 } + \beta _ { 1 } x _ { i }$ , where $x _ { i }$ is the classification error and $y _ { i }$ is the calibration measure of model $i$ . We then report the residual $y _ { i } - \left( \beta _ { 0 } + \beta _ { 1 } x _ { i } \right)$ on the $y$ -axis of the plots in the third and fifth row. The residuals show which models have better (or worse) NLL and Brier score than what can be expected from their accuracy alone. The relationships between model families are largely similar across all calibration metrics.
|
| 175 |
+
|
| 176 |
+
The first of these biases is always negative (Kumar et al., 2019), while the second one is always positive. Thus, the estimator can both under- and over-estimate the true value, and the magnitude of the bias can depend on multiple factors. In practice, this means that the ranking of models depends on which ECE variant is chosen to estimate calibration (Nixon et al., 2019). As we show below, this is especially problematic for the positive bias, because this bias depends on the accuracy of the model. It is therefore possible to arrive at opposite conclusions about the relationship between accuracy and calibration, depending on the chosen bin size (Figure 9), especially when comparing models with widely varying accuracies.
|
| 177 |
+
|
| 178 |
+
Intuitively, a larger number of bins implies fewer points per bin and thus higher variance of the estimate of the model accuracy in each bin, which adds positive bias to the estimate of ECE. More formally, to estimate accuracy $( B _ { i } )$ precisely, we need a number of samples inversely proportional to the standard deviation $\sqrt { p _ { i } ( 1 - p _ { i } ) } / | B _ { i } |$ , where $p _ { i }$ is the expected accuracy in $B _ { i }$ . This indicates that the bias would be smaller for models with extreme average accuracies (i.e. close to 0 or 1) and larger for models with an accuracy close to 0.5. A detailed analysis reveals additional effects that further reduce the bias for higher-accuracy models (Appendix C). In particular, if we estimate $( \mathbb { E } [ \mathrm { a c c u r a c y } ( B _ { i } ) ] - \mathbb { E } [ \mathrm { \bar { c } o n f i d e n c e } ( B _ { i } ) ] ) ^ { 2 }$ for any bin $i$ with $n _ { i }$ samples (using the sample means of the confidences and the accuracies), the bias can be shown to be equal to (conditioning on $X \in B _ { i }$ omitted for brevity)
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 9: The effect of binning-induced bias in ECE depends on accuracy. Each dot represents a BiT ResNet model. Plotted models differ in model size, pretraining dataset size, and pretraining duration. All models are fine-tuned and evaluated on IMAGENET. After temperature scaling, there is a near-linear relationship between ECE and classification error. However, whether this relationship is positive or negative depends on the number of bins used for estimating ECE. This effect is explained by an accuracy-dependent bias that increases with the number of bins.
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\frac { 1 } { n _ { i } } ( \mathbb { V } [ A ] + \mathbb { V } [ C ] - 2 { \bf C o v } [ C , A ] ) ,
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
where $A = [ [ Y \in \arg \operatorname* { m a x } { f ( X ) } ] ]$ and $C = \operatorname* { m a x } f ( X )$ . Hence, from Equation 5 we can conclude J Kthat higher accuracy models have a lower bias not only due to higher accuracy (lower $\mathbb { V } [ A ] )$ , but also because their outputs correlate more with the correct label (higher covariance).
|
| 188 |
+
|
| 189 |
+
In addition to a careful choice of bin size, considering accuracy and calibration jointly mitigates this issue, because the Pareto-optimal models rarely change, even if the ranking based on ECE alone does (Appendix E). In Appendices E and F, we provide the main figures of the paper for other ECE variants (number of bins, binning scheme, normalization metric, top-label, all-label, class-wise).
|
| 190 |
+
|
| 191 |
+
Finally, metrics such as Brier score (Brier, 1950) and likelihood provide alternative assessments of model calibration that do not require estimating expected calibration error. We find that the relationships between model families are consistent across ECE, NLL and Brier score (Figure 8). In particular, the same models (specifically the largest MLP-Mixer and ViT variants) remain Paretooptimal with respect to the calibration metric and classification error in most cases. The relationship between models is visualized especially clearly after regressing out from the calibration metrics their correlation with classification error (Figure 8, third and fifth row).
|
| 192 |
+
|
| 193 |
+
# 6 Conclusion
|
| 194 |
+
|
| 195 |
+
We performed a large study of the calibration of recent state-of-the-art image models and its relationship with accuracy. We find that modern image models are well calibrated across distribution shifts despite being designed with a focus on accuracy. Our results suggest that there is no general trend for recent or highly accurate neural networks to be poorly calibrated compared to older or less accurate models.
|
| 196 |
+
|
| 197 |
+
Our experiments suggest that simple dimensions such as model size and pretraining amount do not fully account for the performance differences between families, pointing towards architecture as a major determinant of calibration. Of particular note is the finding that MLP-Mixer and Vision Transformers—two recent architectures that are not based on convolutions—are among the best-calibrated models both in-distribution and out-of-distribution. Self-attention (which Vision Transformers employ heavily) has been shown previously to be beneficial for certain kinds of outof-distribution robustness (Hendrycks et al., 2020a). Our work now hints at calibration benefits of non-convolutional architectures more broadly, for certain kinds of distribution shift. Further work on the influence of architectural inductive biases on calibration and out-of-distribution robustness will be necessary to tell whether these results generalize. If so, they may further hasten the end of the convolutional era in computer vision.
|
| 198 |
+
|
| 199 |
+
# Acknowledgments and Disclosure of Funding
|
| 200 |
+
|
| 201 |
+
We thank Carlos Riquelme and Balaji Lakshminarayanan for valuable comments on the manuscript.
|
| 202 |
+
The authors declare no competing interests.
|
| 203 |
+
References
|
| 204 |
+
Bojarski, M., Del Testa, D., Dworakowski, D., Firner, B., Flepp, B., Goyal, P., Jackel, L. D., Monfort, M., Muller, U., Zhang, J., et al. End to end learning for self-driving cars. arXiv: 1604.07316, 2016.
|
| 205 |
+
Brier, G. W. Verification of forecasts expressed in terms of probability. Monthly weather review, 1950.
|
| 206 |
+
Bröcker, J. Reliability, sufficiency, and the decomposition of proper scores. Journal of the Royal Meteorological Society, 2009.
|
| 207 |
+
Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. E. A simple framework for contrastive learning of visual representations. In International Conference on Machine Learning, 2020.
|
| 208 |
+
DeGroot, M. H. and Fienberg, S. E. The comparison and evaluation of forecasters. Journal of the Royal Statistical Society, 1983.
|
| 209 |
+
Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In Conference on Computer Vision and Pattern Recognition, 2009.
|
| 210 |
+
Djolonga, J., Matthias, M., Nado, Z., Nixon, J., Romijnders, R., Tran, D., and Lucic, M. Robustness Metrics, 2020. URL https://github.com/google-research/robustness_metrics.
|
| 211 |
+
Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
|
| 212 |
+
Esteva, A., Kuprel, B., Novoa, R. A., Ko, J., Swetter, S. M., Blau, H. M., and Thrun, S. Dermatologistlevel classification of skin cancer with deep neural networks. Nature, 2017.
|
| 213 |
+
Geirhos, R., Rubisch, P., Michaelis, C., Bethge, M., Wichmann, F. A., and Brendel, W. Imagenettrained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019.
|
| 214 |
+
Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., and Rubin, D. B. Bayesian data analysis. CRC press, 2013.
|
| 215 |
+
Gneiting, T., Balabdaoui, F., and Raftery, A. E. Probabilistic forecasts, calibration and sharpness. Journal of the Royal Statistical Society, 2007.
|
| 216 |
+
Guo, C., Pleiss, G., Sun, Y., and Weinberger, K. Q. On calibration of modern neural networks. In International Conference on Machine Learning, 2017.
|
| 217 |
+
Gupta, K., Rahimi, A., Ajanthan, T., Mensink, T., Sminchisescu, C., and Hartley, R. Calibration of neural networks using splines. International Conference on Learning Representations, 2021.
|
| 218 |
+
Havasi, M., Jenatton, R., Fort, S., Liu, J. Z., Snoek, J., Lakshminarayanan, B., Dai, A. M., and Tran, D. Training independent subnetworks for robust prediction. In International Conference on Learning Representations, 2021.
|
| 219 |
+
He, K., Zhang, X., Ren, S., and Sun, J. Identity mappings in deep residual networks. In European Conference on Computer Vision, 2016.
|
| 220 |
+
Hendrycks, D. and Dietterich, T. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019.
|
| 221 |
+
Hendrycks, D., Basart, S., Mu, N., Kadavath, S., Wang, F., Dorundo, E., Desai, R., Zhu, T., Parajuli, S., Guo, M., et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. arXiv: 2006.16241, 2020a.
|
| 222 |
+
Hendrycks, D., Mu, N., Cubuk, E. D., Zoph, B., Gilmer, J., and Lakshminarayanan, B. Augmix: A simple data processing method to improve robustness and uncertainty. In International Conference on Learning Representations, 2020b.
|
| 223 |
+
Hendrycks, D., Zhao, K., Basart, S., Steinhardt, J., and Song, D. Natural adversarial examples. In Conference on Computer Vision and Pattern Recognition, 2021.
|
| 224 |
+
Hernández-Orallo, J., Flach, P. A., and Ferri, C. A unified view of performance metrics: translating threshold choice into expected classification loss. Journal of Machine Learning Research, 2012.
|
| 225 |
+
Jiang, X., Osl, M., Kim, J., and Ohno-Machado, L. Calibrating predictive model estimates to support personalized medicine. Journal of the American Medical Informatics Association, 2012.
|
| 226 |
+
Kolesnikov, A., Beyer, L., Zhai, X., Puigcerver, J., Yung, J., Gelly, S., and Houlsby, N. Big transfer (bit): General visual representation learning. In European Conference on Computer Vision, 2020.
|
| 227 |
+
Kompa, B., Snoek, J., and Beam, A. L. Second opinion needed: communicating uncertainty in medical machine learning. NPJ Digital Medicine, 2021.
|
| 228 |
+
Krizhevsky, A. One weird trick for parallelizing convolutional neural networks. arXiv: 1404.5997, 2014.
|
| 229 |
+
Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, 2012.
|
| 230 |
+
Kumar, A., Liang, P. S., and Ma, T. Verified uncertainty calibration. In Advances in Neural Information Processing Systems, 2019.
|
| 231 |
+
Lakshminarayanan, B., Pritzel, A., and Blundell, C. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, 2017.
|
| 232 |
+
Leathart, T. and Polaczuk, M. Temporal probability calibration. arXiv: 2002.02644, 2020.
|
| 233 |
+
Mahajan, D., Girshick, R. B., Ramanathan, V., He, K., Paluri, M., Li, Y., Bharambe, A., and van der Maaten, L. Exploring the limits of weakly supervised pretraining. In European Conference on Computer Vision, 2018.
|
| 234 |
+
Malinin, A. and Gales, M. J. F. Predictive uncertainty estimation via prior networks. In Advances in Neural Information Processing Systems, 2018.
|
| 235 |
+
Müller, R., Kornblith, S., and Hinton, G. E. When does label smoothing help? In Advances in Neural Information Processing Systems, 2019.
|
| 236 |
+
Mustafa, B., Loh, A., Freyberg, J., MacWilliams, P., Wilson, M., McKinney, S. M., Sieniek, M., Winkens, J., Liu, Y., Bui, P., Prabhakara, S., Telang, U., Karthikesalingam, A., Houlsby, N., and Natarajan, V. Supervised transfer learning at scale for medical imaging. arXiv: 2101.05913, 2021.
|
| 237 |
+
Naeini, M. P., Cooper, G., and Hauskrecht, M. Obtaining well calibrated probabilities using bayesian binning. In AAAI Conference on Artificial Intelligence, 2015.
|
| 238 |
+
Nixon, J., Dusenberry, M. W., Zhang, L., Jerfel, G., and Tran, D. Measuring calibration in deep learning. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2019.
|
| 239 |
+
Ovadia, Y., Fertig, E., Lakshminarayanan, B., Nowozin, S., Sculley, D., Dillon, J. V., Ren, J., Nado, Z., and Snoek, J. Can you trust your model’s uncertainty? evaluating predictive uncertainty under dataset shift. In Advances in Neural Information Processing Systems, 2019.
|
| 240 |
+
Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural language supervision. Technical report, OpenAI, 2021.
|
| 241 |
+
Rahaman, R. and Thiery, A. H. Uncertainty quantification and deep ensembles. arXiv: 2007.08792, 2020.
|
| 242 |
+
|
| 243 |
+
Recht, B., Roelofs, R., Schmidt, L., and Shankar, V. Do imagenet classifiers generalize to imagenet? In International Conference on Machine Learning, 2019.
|
| 244 |
+
Roelofs, R., Cain, N., Shlens, J., and Mozer, M. C. Mitigating bias in calibration error estimation. arXiv: 2012.08668, 2020.
|
| 245 |
+
Shafer, G. and Vovk, V. A tutorial on conformal prediction. Journal of Machine Learning Research, 2008.
|
| 246 |
+
Sønderby, C. K., Espeholt, L., Heek, J., Dehghani, M., Oliver, A., Salimans, T., Agrawal, S., Hickey, J., and Kalchbrenner, N. Metnet: A neural weather model for precipitation forecasting. arXiv: 2003.12140, 2020.
|
| 247 |
+
Sun, C., Shrivastava, A., Singh, S., and Gupta, A. Revisiting unreasonable effectiveness of data in deep learning era. In International Conference on Computer Vision, 2017.
|
| 248 |
+
Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z. Rethinking the inception architecture for computer vision. In Conference on Computer Vision and Pattern Recognition, 2016.
|
| 249 |
+
Taori, R., Dave, A., Shankar, V., Carlini, N., Recht, B., and Schmidt, L. Measuring robustness to natural distribution shifts in image classification. Advances in Neural Information Processing Systems, 2020.
|
| 250 |
+
Thulasidasan, S., Chennupati, G., Bilmes, J. A., Bhattacharya, T., and Michalak, S. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. In Advances in Neural Information Processing Systems, 2019.
|
| 251 |
+
Tolstikhin, I., Houlsby, N., Kolesnikov, A., Beyer, L., Zhai, X., Unterthiner, T., Yung, J., Steiner, A., Keysers, D., Uszkoreit, J., Lucic, M., and Dosovitskiy, A. MLP-Mixer: An all-MLP architecture for vision. arXiv: 2105.01601, 2021.
|
| 252 |
+
Vaicenavicius, J., Widmann, D., Andersson, C. R., Lindsten, F., Roll, J., and Schön, T. B. Evaluating model calibration in classification. In International Conference on Artificial Intelligence and Statistics, 2019.
|
| 253 |
+
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
|
| 254 |
+
Wen, Y., Tran, D., and Ba, J. Batchensemble: an alternative approach to efficient ensemble and lifelong learning. In Advances in Neural Information Processing Systems, 2020.
|
| 255 |
+
Wen, Y., Jerfel, G., Muller, R., Dusenberry, M. W., Snoek, J., Lakshminarayanan, B., and Tran, D. Combining ensembles and data augmentation can harm your calibration. In International Conference on Learning Representations, 2021.
|
| 256 |
+
Wenzel, F., Snoek, J., Tran, D., and Jenatton, R. Hyperparameter ensembles for robustness and uncertainty quantification. In Advances in Neural Information Processing Systems, 2020.
|
| 257 |
+
Xie, Q., Luong, M.-T., Hovy, E., and Le, Q. V. Self-training with noisy student improves imagenet classification. In Conference on Computer Vision and Pattern Recognition, 2020.
|
md/train/QWIvzSQaX5/QWIvzSQaX5.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Why Generalization in RL is Difficult: Epistemic POMDPs and Implicit Partial Observability
|
| 2 |
+
|
| 3 |
+
Dibya Ghosh∗,1 Jad Rahme∗,2 Aviral Kumar1 Amy Zhang1,3
|
| 4 |
+
|
| 5 |
+
Ryan P. Adams2
|
| 6 |
+
|
| 7 |
+
Sergey Levine1
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Generalization is a central challenge for the deployment of reinforcement learning (RL) systems in the real world. In this paper, we show that the sequential structure of the RL problem necessitates new approaches to generalization beyond the well-studied techniques used in supervised learning. While supervised learning methods can generalize effectively without explicitly accounting for epistemic uncertainty, we show that, perhaps surprisingly, this is not the case in RL. We show that generalization to unseen test conditions from a limited number of training conditions induces implicit partial observability, effectively turning even fullyobserved MDPs into POMDPs. Informed by this observation, we recast the problem of generalization in RL as solving the induced partially observed Markov decision process, which we call the epistemic POMDP. We demonstrate the failure modes of algorithms that do not appropriately handle this partial observability, and suggest a simple ensemble-based technique for approximately solving the partially observed problem. Empirically, we demonstrate that our simple algorithm derived from the epistemic POMDP achieves significant gains in generalization over current methods on the Procgen benchmark suite.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Generalization is a central challenge in machine learning. However, much of the research on reinforcement learning (RL) has been concerned with the problem of optimization: how to master a specific task through online or logged interaction. Generalization to new test-time contexts has received comparatively less attention, although several works have observed empirically [1, 2, 3, 4] that generalization to new situations poses a significant challenge to RL policies learned from a fixed training set of situations. In standard supervised learning, it is known that in the absence of distribution shift and with appropriate inductive biases, optimizing for performance on the training set (i.e., empirical risk minimization) translates into good generalization performance. It is tempting to suppose that the generalization challenges in RL can be solved in the same manner as empirical risk minimization in supervised learning: when provided a training set of contexts, learn the optimal policy within these contexts and then use that policy in new contexts at test-time.
|
| 16 |
+
|
| 17 |
+
Perhaps surprisingly, we show that such “empirical risk minimization” approaches can be sub-optimal for generalizing to new contexts in RL, even when these new contexts are drawn from the same distribution as the training contexts. As an anecdotal example of why this sub-optimality arises, imagine a robotic zookeeper for feeding otters that must be trained on some set of zoos. When placed in a new zoo, the robot must find and enter the otter enclosure. It can use one of two strategies: either peek through all the habitat windows looking for otters, which succeeds with $9 5 \%$ probability in all zoos, or to follow an image of a hand-drawn map of the zoo that unambiguously identifies the otter enclosure, which will succeed as long as the agent is able to successfully parse the image. In every training zoo, the otters can be found more reliably using the image of the map, and so an agent trained to seek the optimal policy in the training zoos would learn a classifier to predict the identity of the otter enclosure from the map, and enter the predicted enclosure. This classification strategy is optimal on the training environments because the agent can learn to perfectly classify the training zoo maps, but it is sub-optimal for generalization, because the learned classifier will never be able to perfectly classify every new zoo map at test-time. Note that this task is not partially observed, because the map provides full state information even for a memoryless policy. However, if the learned map classifier succeeds on anything less than $9 5 \%$ of new zoos at test-time, the strategy of peeking through the windows, although always sub-optimal in the training environments, turns out to be a more reliable strategy for finding the otter habitat in a new zoo, and results in higher expected returns at test-time.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Visualization of the robotic zookeeper example. Standard RL algorithms learn the classifier strategy, since it is optimal in every training zoo, but this strategy is sub-optimal for generalization because peeking generalizes better than the classifier at test-time. This failure occurs due to the following disconnect: while the task is fully-observed since the image uniquely specifies the location of the otter habitat, to an agent that has limited training data, the location is implicitly partially observed at test-time because of the agent’s epistemic uncertainty about the parameters of the image classifier.
|
| 21 |
+
|
| 22 |
+
Although with enough training zoos, the zookeeper can learn a policy by solving the map classification problem, to generalize optimally when given a limited number of zoos requires a more intricate policy that is not learned by standard RL methods. How can we more generally describe the set of behaviors needed for a policy to generalize from a finite number of training contexts in the RL setting? We make the observation that, even in fully-observable domains, the agent’s epistemic uncertainty renders the environment implicitly partially observed at test-time. In the zookeeper example, although the hand-drawn map provides the exact location of the otter enclosure (and so the enclosure’s location is technically fully observed), the agent cannot identify the true parameters of the map classifier from the small set of maps seen at training time, and so the location of the otters is implicitly obfuscated from the agent. We formalize this observation, and show that generalizing optimally at test-time corresponds to solving a partially-observed Markov decision process that we call an epistemic POMDP, induced by the agent’s epistemic uncertainty about the test environment.
|
| 23 |
+
|
| 24 |
+
That uncertainty about MDP parameters can be modelled as a POMDP is well-studied in Bayesian RL when training and testing on a single task in an online setting, primarily in the context of exploration [5, 6, 7, 8]. However, as we will discuss, this POMDP interpretation has significant consequences for the generalization problem in RL, where an agent cannot collect more data online, and must instead learn a policy from a fixed set of training contexts that generalizes to new contexts at test-time. We show that standard RL methods that do not explicitly account for this implicit partial observability can be arbitrarily sub-optimal for test-time generalization in theory and in practice. The epistemic POMDP underscores the difficulty of the generalization problem in RL, as compared to supervised learning, and provides an avenue for understanding how we should approach generalization under the sequential nature and non-uniform reward structure of the RL setting. Maximizing expected return in an approximation of the epistemic POMDP emerges as a principled approach to learning policies that generalize well, and we propose LEEP, an algorithm that uses an ensemble of policies to approximately learn the Bayes-optimal policy for maximizing test-time performance.
|
| 25 |
+
|
| 26 |
+
The primary contribution of this paper is to use Bayesian RL techniques to reframe generalization in RL as the problem of solving a partially observed Markov decision process, which we call the epistemic POMDP. The epistemic POMDP highlights the difficulty of generalizing well in RL, as compared to supervised learning. We demonstrate the practical failure modes of standard RL methods, which do not reason about this partial observability, and show that maximizing test-time performance may require algorithms to explicitly consider the agent’s epistemic uncertainty during training. Our work highlights the importance of not only finding ways to help neural networks in RL generalize better, but also on learning policies that degrade gracefully when the underlying neural network eventually does fail to generalize. Empirically, we demonstrate that LEEP, which maximizes return in an approximation to the epistemic POMDP, achieves significant gains in test-time performance over standard RL methods on several ProcGen benchmark tasks.
|
| 27 |
+
|
| 28 |
+
# 2 Related Work
|
| 29 |
+
|
| 30 |
+
Many empirical studies have demonstrated the tendency of RL algorithms to overfit significantly to their training environments [1, 2, 3, 4], and the more general increased difficulty of learning policies that generalize in RL as compared to seemingly similar supervised learning problems [9, 10, 11, 12]. These empirical observations have led to a newfound interest in algorithms for generalization in RL, and the development of benchmark RL environments that focus on generalization to new contexts from a limited set of training contexts sharing a similar structure (state and action spaces) but possibly different dynamics and rewards [13, 14, 15, 16, 17].
|
| 31 |
+
|
| 32 |
+
Generalization in RL. Approaches for improving generalization in RL have fallen into two main categories: improving the ability of function approximators to generalize better with inductive biases, and incentivizing behaviors that are easier to generalize to unseen contexts. To improve the representations learned in RL, prior work has considered imitating environment dynamics [18, 19], seeking bisimulation relations [20, 21], and more generally, addressing representational challenges in the RL optimization process [22, 23]. In image-based domains, inductive biases imposed via neural network design have also been proposed to improve robustness to certain factors of variation in the state [24, 25, 26]. The challenges with generalization in RL that we will describe in this paper stem from the deficiencies of MDP objectives, and cannot be fully solved by choice of representations or functional inductive biases. In the latter category, one approach is domain randomization, varying environment parameters such as coefficients of friction or textures, to obtain behaviors that are effective across many candidate parameter settings [27, 28, 29, 30, 31]. Domain randomization sits within a class of methods that seek robust policies by injecting noise into the agent-environment loop, whether in the state [32], the action (e.g., via max-entropy RL) [14], or intermediary layers of a neural network policy (e.g., through information bottlenecks) [22, 33]. In doing so, these methods effectively introduce partial observability into the problem; while not necessarily equivalent to that of the epistemic POMDP, it may indicate why these methods generalize well empirically.
|
| 33 |
+
|
| 34 |
+
Bayesian RL: Our work recasts generalization in RL within the Bayesian RL framework, the problem of acting optimally under a belief distribution over MDPs (see Ghavamzadeh et al. [8] for a survey). Bayesian uncertainty has been studied in many sub-fields of RL [34, 35, 36, 37], the most prominent being for exploration and learning efficiently in the online RL setting. Bayes-optimal behavior in RL is often reduced to acting optimally in a POMDP, or equivalently, a belief-state MDP [6], of which our epistemic POMDP is a specific instantiation. Learning the Bayes-optimal policy exactly is intractable in all but the simplest problems [38, 39], and many works in Bayesian RL have studied relaxations that remain asymptotically optimal for learning, for example with value of perfect information [5, 40] or Thompson sampling [7, 41, 42]. Our main contribution is to revisit these classic ideas in the context of generalization for RL. We find that the POMDP interpretation of Bayesian RL [5, 6, 43] provides new insights on inadequacies of current algorithms used in practice, and explains why generalization in RL can be more challenging than in supervised learning. Being Bayesian in the generalization setting also requires new tools and algorithms beyond those classically studied in Bayesian RL, since test-time generalization is measured using regret over a single evaluation episode, instead of throughout an online training process. As a result, algorithms and policies that minimize short-term regret (i.e., are more exploitative) are preferred over traditional algorithms like Thompson sampling that explore thoroughly to ensure asymptotic optimality at the cost of short-term regret.
|
| 35 |
+
|
| 36 |
+
# 3 Problem Setup
|
| 37 |
+
|
| 38 |
+
We consider the problem of learning RL policies given a set of training contexts that generalize well to new unseen contexts. This problem can be formalized in a Markov decision process (MDP) where the agent does not have full access to the MDP at training time, but only particular initial states or conditions. Before we describe what this means, we must describe the MDP $\mathcal { M }$ , which is given by a tuple $( S , { \mathcal { A } } , r , T , \rho , \gamma )$ , with state space $s$ , action space $\mathcal { A }$ , Markovian transition function $T ( s _ { t + 1 } | s _ { t } , a _ { t } )$ , bounded reward function $r ( s _ { t } , a _ { t } )$ , and initial state distribution $\rho ( s _ { 0 } )$ . A policy $\pi$ induces a discounted state distribution $\begin{array} { r } { d ^ { \pi } ( s ) \doteq ( 1 - \gamma ) \mathbb { E } _ { \pi } [ \sum _ { t \ge 0 } \gamma ^ { t } 1 ( s _ { t } = s ) ] } \end{array}$ , and achieves return $\begin{array} { r } { J _ { \mathcal { M } } ( \pi ) = \mathbb { E } _ { \pi } [ \sum _ { t \geq 0 } \gamma ^ { t } r ( s _ { t } , a _ { t } ) ] } \end{array}$ in the MDP. Classical results establish that a deterministic Markovian (memoryless) policy $\pi ^ { * }$ maximizes this objective amongst all history-dependent policies.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 2: Sequential Classification RL Problem. In this task, an agent must keep guessing the label for an image until it gets it correct. To avoid low test return, policies should change actions if the label guessed was incorrect, but standard RL methods fail to do so, instead guessing the same incorrect label repeatedly.
|
| 42 |
+
|
| 43 |
+
We focus on generalization in contextual MDPs where the agent is only trained on a training set of contexts, and seeks to generalize well to new contexts. A contextual MDP is an MDP in which the state can be decomposed as $s _ { t } = \left( c , s _ { t } ^ { \prime } \right)$ , a context vector $c \in { \mathcal { C } }$ that remains constant throughout an episode, and a sub-state $s ^ { \prime } \in S ^ { \prime }$ that may vary: $\boldsymbol { S } : = \boldsymbol { \mathcal { C } } \times \boldsymbol { \mathcal { S } } ^ { \prime }$ . Each context vector corresponds to a different situation that the agent might be in, each with slightly different dynamics and rewards, but some shared structure across which an agent can generalize. During training, the agent is allowed to interact only within a sampled subset of contexts $\mathcal { C } _ { \mathrm { t r a i n } } \subset \mathcal { C }$ . The generalization performance of the agent is measured by the return of the agent’s policy in the full contextual MDP $J ( \pi )$ , corresponding to expected performance when placed in potentially new contexts. While our examples and experiments will be in contextual MDPs, our theoretical results also apply to other RL generalization settings where the full MDP cannot be inferred unambiguously from the data available during training, for example in offline reinforcement learning [44].
|
| 44 |
+
|
| 45 |
+
# 4 Warmup: A Sequential Classification RL Problem
|
| 46 |
+
|
| 47 |
+
We begin our study of generalization in RL with an example problem that is set up to be close to a supervised learning task where generalization is relatively well understood: image classification on the FashionMNIST dataset [45]. In this environment (visualized in Figure 2), an image from the dataset is sampled (the context) at the beginning of an episode and held fixed; the agent must identify the label of the image to complete the episode. If the agent guesses correctly, it receives a reward of 0 and the episode ends; if incorrect, it receives a reward of $- 1$ and the episode continues, so it must attempt another guess for the same image at the next time step. This RL problem is near identical to supervised classification, the core distinction being that an agent may interact with the same image over several timesteps in an episode instead of only one attempt as in supervised learning. Note that since episodes may last longer than a single timestep, this problem is not a contextual bandit.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 3: DQN on RL FashionMNIST. DQN achieves lower test performance than simple variants that leverage the structure of the RL problem.
|
| 51 |
+
|
| 52 |
+
The optimal policy in both the one-step and sequential RL version of the problem deterministically outputs the correct label for the image, because the image fully determines the label (in other words, it is a fully observed MDP). However, this optimal strategy generally cannot be learned from a finite training set, since some generalization error is unavoidable. With a fixed training set, the strategy for generalizing in classification remains the same: deterministically choose the label the agent is most confident about. However, the RL setting introduces two new factors: the agent gets multiple tries at classifying the same image, and it knows if an attempted label is incorrect. To generalize best to new test images, an RL policy must leverage this additional structure, for example by trying many possible labels, or by changing actions if the previous guess was incorrect.
|
| 53 |
+
|
| 54 |
+
A standard RL algorithm, which estimates the optimal policy on the empirical MDP defined by the dataset of training images does not learn to leverage these factors, and instead learns behavior highly sub-optimal for generalization. We obtained a policy by running DQN [46] (experimental details in Appendix A.1), whose policy deterministically chooses the same label for the image at every timestep. Determinism is not specific to DQN, and is inevitable in any RL method that models the problem as an MDP because the optimal policy in the MDP is always deterministic and Markovian. The learned deterministic policy either guesses the correct label immediately, or guesses incorrectly and proceeds to make the same incorrect guess on every subsequent time-step. We compare performance in Figure 3 with a version of the agent that starts to guess randomly if incorrect on the first timestep, and a different agent that acts by process of elimination: first choosing the action it is most confident about, if incorrect, then the second, and so forth. Although all three versions have the same training performance, the learned RL policy generalizes more poorly than these alternative variants that exploit the sequential nature of the problem. In Section 5.2, we will see that this process-of-elimination is, in some sense, the optimal way to generalize for this task. This experiment reveals a tension: learning policies for generalization that rely on an MDP model fail, even though the underlying environment is an MDP. This failure holds in any MDP model with limited data, whether the empirical MDP or more sophisticated MDPs that use uncertainty estimates in their construction.
|
| 55 |
+
|
| 56 |
+
# 5 Modeling Generalization in RL as an Epistemic POMDP
|
| 57 |
+
|
| 58 |
+
To better understand test-time generalization in RL, we study the problem under a Bayesian perspective. We show that training on limited training contexts leads to an implicit partial observability at test-time that we describe using a formalism called the epistemic POMDP.
|
| 59 |
+
|
| 60 |
+
# 5.1 The Epistemic POMDP
|
| 61 |
+
|
| 62 |
+
In the Bayesian framework, when learning given a limited amount of evidence $\mathcal { D }$ from an MDP $\mathcal { M }$ , we can use a prior $\mathcal { P } ( \mathcal { M } )$ to construct a posterior belief distribution $\mathcal { P } ( \mathcal { M } | \mathcal { D } )$ over the identity of the MDP. For learning in a contextual MDP, $\mathcal { D }$ corresponds to the environment dynamics and reward in training contexts $\mathcal { C } _ { \mathrm { t r a i n } }$ that the agent can interact with, and the posterior belief distribution $\mathcal { P } ( \mathcal { M } | \mathcal { D } )$ models the agent’s uncertainty about the behavior of the environment in contexts that it has not seen before (e.g. uncertainty about the label for a test-set image in the example from Section 4).
|
| 63 |
+
|
| 64 |
+
Since the agent only has partial access to the MDP $\mathcal { M }$ during training, the agent does not know which MDP from the posterior distribution is the true environment, and must act at test-time under this uncertainty. Following a reduction common in Bayesian RL [6, 8], we model this test-time uncertainty using a partially observed MDP that we will call the epistemic POMDP. The epistemic POMDP is structured as follows: each new episode in the POMDP begins by sampling a single MDP $\mathcal { M } \sim \mathcal { P } ( \mathcal { M } | \mathcal { D } )$ from the posterior, and then the agent interacts with $\mathcal { M }$ until the episode ends in this MDP. The agent does not observe which MDP was sampled, and since the MDP remains fixed for the duration of the episode, this induces implicit partial observability. Effectively, each episode in the epistemic POMDP corresponds to acting in one of the possible environments that is consistent with the evidence that the agent is allowed access to at training time.
|
| 65 |
+
|
| 66 |
+
The epistemic POMDP is formally defined as the tuple $\mathcal { M } ^ { \mathrm { p o } } = ( S ^ { \mathrm { p o } } , \mathcal { O } ^ { \mathrm { p o } } , \mathcal { A } , T ^ { \mathrm { p o } } , r ^ { \mathrm { p o } } , \rho ^ { \mathrm { p o } } , \gamma )$ . A state in this POMDP $s _ { t } ^ { \mathrm { p o } } = ( \mathcal { M } , \dot { s _ { t } } )$ contains the identity of the current MDP being acted in $\mathcal { M }$ , and the current state in this MDP $s _ { t }$ ; we write the state space as $S ^ { \mathrm { p o } } = \mathbf { M } \times S$ , where $\mathbf { M }$ is the space of MDPs with support under the prior. The agent only observes $o _ { t } ^ { \mathrm { p o } } = s _ { t }$ , the state in the MDP ${ \mathcal { O } } ^ { \mathrm { p o } } = S$ ), but not the identity of the MDP, $\mathcal { M }$ . The initial state distribution is defined by the posterior distribution: $\rho ^ { \mathrm { p o } } ( ( \mathcal { M } , s _ { 0 } ) ) = \mathcal { P } ( \mathcal { M } | \mathcal { D } ) \rho _ { \mathcal { M } } ( s _ { 0 } )$ , and the transition and reward functions in the POMDP reflect the dynamics in the current MDP:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
T ^ { \mathrm { p o } } ( ( { \mathcal M } ^ { \prime } , s ^ { \prime } ) \mid ( { \mathcal M } , s ) , a ) = \delta ( { \mathcal M } ^ { \prime } = { \mathcal M } ) T _ { { \mathcal M } } ( s ^ { \prime } | s , a ) \quad \quad r ^ { \mathrm { p o } } ( ( { \mathcal M } , s ) , a ) = r _ { { \mathcal M } } ( s , a ) .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Example (Sequential Image Classification). We begin by explicitly describing the induced epistemic POMDP for the task from Section 4. The agent’s uncertainty concerns how images are mapped to labels, and each MDP $\mathcal { M }$ in the posterior distribution corresponds to a different potential labelling function $Y _ { \mathcal { M } } : x \mapsto y$ that is consistent with the training dataset. Each episode in the epistemic POMDP, a different MDP $\mathcal { M }$ and corresponding labeller $Y _ { \mathcal { M } }$ is sampled from the posterior distribution, alongside an image $x \sim p ( x )$ . The agent must guess the label assigned by this labelling function $y : = Y _ { \mathcal { M } } ( x )$ , but is only provided the image $x$ and not the identity of the labeller $Y _ { \mathcal { M } }$ . We emphasize that the context remains fully observed in the epistemic POMDP (the image $x$ is provided to the agent); what is partially observed is how the environment dynamics will behave for the context (what label the image corresponds to).
|
| 73 |
+
|
| 74 |
+
What makes the epistemic POMDP a useful tool for understanding generalization in RL is that performance in the epistemic POMDP ${ \mathcal { M } } ^ { { \mathfrak { p o } } }$ corresponds exactly to the expected return of the agent at test-time when the prior is well-specified.
|
| 75 |
+
|
| 76 |
+
Proposition 5.1. If the true MDP $\mathcal { M }$ is sampled from $\mathcal { P } ( \mathcal { M } )$ , and evidence $\mathcal { D }$ from $\mathcal { M }$ is provided to an algorithm during training, then the expected test-time return of $\pi$ is equal to its performance in the epistemic POMDP $\mathcal { M } ^ { p o }$ .
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
J _ { \mathcal { M } ^ { p o } } ( \pi ) = \mathbb { E } _ { \mathcal { M } \sim \mathcal { P } ( \mathcal { M } ) } [ J _ { \mathcal { M } } ( \pi ) \mid \mathcal { D } ] .
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
In particular, the optimal policy in $\mathcal { M } ^ { p o }$ is Bayes-optimal for generalization to the unknown MDP $\mathcal { M }$ : it receives the highest expected test-time return amongst all possible policies.
|
| 83 |
+
|
| 84 |
+
The epistemic POMDP is based on well-understood concepts in Bayesian reinforcement learning, and Bayesian modeling more generally. However, in contrast to prior works on Bayesian RL, we are specifically concerned with settings where there is a training-test split, and performance is measured by a single test episode. While using Bayesian RL to accelerate exploration or minimize regret has been well-explored [8], we rather use the Bayesian lens specifically to understand generalization – a perspective that is distinct from prior work on Bayesian RL. Towards this goal, the equivalence between test-time return and expected return in the epistemic POMDP allows us to use performance in the POMDP as a proxy for understanding how well current RL methods can generalize.
|
| 85 |
+
|
| 86 |
+
# 5.2 Understanding Optimality in the Epistemic POMDP
|
| 87 |
+
|
| 88 |
+
We now study the structure of the epistemic POMDP, and use it to characterize properties of Bayesoptimal test-time behavior and the sub-optimality of alternative policy learning approaches. The majority of our results follow from well-known results about POMDPs, so we present them here informally, with formal statements and proofs in Appendix B.
|
| 89 |
+
|
| 90 |
+
Example ctd. Acting optimally in the epistemic POMDP for the sequential image classification task requires maximizing return over the distribution of labels that is induced by the posterior distribution $p ( y | \boldsymbol { x } , \mathcal { D } ) = \mathrm { \bar { E } } _ { \mathcal { M } \sim \mathcal { P } ( \mathcal { M } | \mathcal { D } ) } [ 1 ( Y _ { \mathcal { M } } ( \boldsymbol { x } ) = y ) ]$ . A deterministic policy (as is learned by standard RL algorithms) is a high-risk strategy in the POMDP; it receives exceedingly low return if the labeller outputs a different label than the one predicted. The Bayes-optimal generalization strategy corresponds to a process of elimination: first choose the most likely label $a = \arg \operatorname* { m a x } p ( y | x , \mathcal { D } )$ ; if this is incorrect, eliminate it and choose the next-most likely, repeating until the correct label is finally chosen. Amongst memoryless policies, the optimal behavior is stochastic, sampling actions according to the distribution $\pi ^ { * } ( a | x ) \propto \sqrt { p ( y | x , \mathcal { D } ) }$ (derivation in Appendix A.2).
|
| 91 |
+
|
| 92 |
+
The characteristics of the optimal policy in the epistemic POMDP for the image classification RL problem match well-established results that optimal POMDP policies are generally memory-based [47], and amongst memoryless policies, the optimal policy may be stochastic [48, 49]. Because of the equivalence between the epistemic POMDP and test-time behavior, these maxims are also true for Bayes-optimal behavior when maximizing test-time performance.
|
| 93 |
+
|
| 94 |
+
Remark 5.1. The Bayes-optimal policy for maximizing test-time performance is in general nonMarkovian. When restricted to Markovian policies, the Bayes-optimal policy is in general stochastic.
|
| 95 |
+
|
| 96 |
+
The reason that Bayes-optimal generalization often requires memory is that the experience collected thus far in the episode contains information about the identity of the MDP being acted in (which is hidden from the agent observation), and to maximize expected return, the agent must adapt its subsequent behavior to incorporate this new information. The fact that acting optimally at test-time formally requires adaptivity (or stochasticity for memoryless policies) highlights the difficulty of generalizing well in RL, and provides a new perspective for understanding the success various empirical studies have found in improving generalization performance using recurrent networks [50, 51] and stochastic regularization penalties [32, 14, 22, 33].
|
| 97 |
+
|
| 98 |
+
It is useful to understand to what degree the partial observability plays a role in determining Bayesoptimal behavior. When the partial observability is insignificant, the epistemic POMDP objective can coincide with a surrogate MDP approximation, and Bayes-optimal solutions can be attained with standard fully-observed RL algorithms. For example, if there is a policy that is simultaneously optimal in every MDP from the posterior, then an agent need not worry about the (hidden) identity of the MDP, and just follow this policy. Perhaps surprisingly, this kind of condition is difficult to relax: we show in Proposition B.1 that even if a policy is optimal in many (but not all) of the MDPs from the posterior, this seemingly “optimal” policy can generalize poorly at test-time.
|
| 99 |
+
|
| 100 |
+
Moreover, under partial observability, optimal policies for the MDPs in the posterior may differ substantially from Bayes-optimal behavior: in Proposition B.2, we show that the Bayes-optimal policy may take actions that are sub-optimal in every environment in the posterior. These results indicate the brittleness of learning policies based on optimizing return in an MDP model when the agent has not yet fully resolved the uncertainty about the true MDP parameters.
|
| 101 |
+
|
| 102 |
+
Remark 5.2 (Failure of MDP-Optimal Policies, Propositions B.1, B.2). The expected test-time return of policies that are learned by maximizing reward in any MDP from the posterior, as standard RL methods do, may be arbitrarily low compared to that of Bayes-optimal behavior.
|
| 103 |
+
|
| 104 |
+
As Bayes-optimal memoryless policies are stochastic, one may wonder if simple strategies for inducing stochasticity, such as adding $\epsilon$ -greedy noise or entropy regularization, can alleviate the suboptimality that arose with deterministic policies in the previous paragraph. In some cases, this may be true; one particularly interesting result is that in certain goal-reaching problems, entropy-regularized RL can be interpreted as optimizing an epistemic POMDP objective with a specific form of posterior distribution over reward functions (Proposition B.3) [52]. For the more general setting, we show in Proposition B.4 that entropy regularization and other general-purpose techniques can similarly catastrophically fail in epistemic POMDPs.
|
| 105 |
+
|
| 106 |
+
Remark 5.3 (Failure of Generic Stochasticity, Proposition B.4). The expected test-time return of policies learned with stochastic regularization techniques like maximum-entropy RL that are agnostic of the posterior $\mathcal { P } ( \mathcal { M } | \mathcal { D } )$ may be arbitrarily low compared to that of Bayes-optimal behavior.
|
| 107 |
+
|
| 108 |
+
This failure happens because the degree of stochasticity used by the Bayes-optimal policy reflects the agent’s epistemic uncertainty about the environment; since standard regularizations are agnostic to this uncertainty, the learned behaviors often do not reflect the appropriate level of stochasticity needed. A maze-solving agent acting Bayes-optimally, for example, may choose to act deterministically in mazes like those it has seen at training, and on others where it is less confident, rely on random exploration to exit the maze, inimitable behavior by regularization techniques agnostic to this uncertainty.
|
| 109 |
+
|
| 110 |
+
Our analysis of the epistemic POMDP highlights the difficulty of generalizing well in RL, in the complexity of Bayes-optimal policies (Remark 5.1) and the deficiencies of our standard MDP-based RL algorithms (Remark 5.2, 5.3) . While MDP-based algorithms can serve as a useful starting point for acquiring generalizable skills, learning policies that perform well in new test-time scenarios may require more complex algorithms that attend to the epistemic POMDP structure that is implicitly induced by the agent’s epistemic uncertainty.
|
| 111 |
+
|
| 112 |
+
# 6 Learning Policies that Generalize Well Using the Epistemic POMDP
|
| 113 |
+
|
| 114 |
+
When the epistemic POMDP ${ \mathcal { M } } ^ { { \mathfrak { p o } } }$ can be exactly obtained, we can learn RL policies that generalize well to the true (unknown) MDP $\mathcal { M }$ by learning an optimal policy in the POMDP. In this oracle setting, any POMDP-solving method will suffice, and design choices like policy function classes (e.g. recurrent vs Markovian policies) or agent representations (e.g. belief state vs PSRs) made based on the requirements of the specific domain. However, in practice, the epistemic POMDP can be challenging to approximate due to the difficulties of learning coherent MDP models and maintaining a posterior over such MDP models in high-dimensional domains.
|
| 115 |
+
|
| 116 |
+
In light of these challenges, we now focus on practical methods for learning generalizable policies when the exact posterior distribution (and therefore true epistemic POMDP) cannot be recovered exactly. We derive an algorithm for learning the optimal policy in the epistemic POMDP induced by an approximate posterior distribution $\hat { \mathcal { P } } ( \mathcal { M } | \mathcal { D } )$ with finite support. We use this to motivate LEEP, a simple ensemble-based algorithm for learning policies in the contextual MDP setting.
|
| 117 |
+
|
| 118 |
+
# 6.1 Policy Optimization in an Empirical Epistemic POMDP
|
| 119 |
+
|
| 120 |
+
Towards a tractable algorithm, we assume that instead of the true posterior $\mathcal { P } ( \mathcal { M } | \mathcal { D } )$ , we only have access to an empirical posterior distribution $\hat { \mathcal { P } } ( \mathcal { M } | \mathcal { D } )$ defined by $n$ MDP samples from the posterior distribution $\{ \mathcal { M } _ { i } \} _ { i \in [ n ] }$ . This empirical posterior distribution induces an empirical epistemic POMDP $\hat { \mathcal { M } } ^ { \mathrm { p o } }$ ; our ambition is to learn the optimal policy in this POMDP. Rather than directly learning this optimal policy as a generic POMDP solver might, we recognize that $\hat { \mathcal { M } } ^ { \mathrm { p o } }$ corresponds to a collection of $n$ MDPs 2 and decompose the optimization problem to mimic this structure. We will learn $n$ policies $\pi _ { 1 } , \cdots , \pi _ { n }$ , each policy $\pi _ { i }$ in one of the MDPs $\mathcal { M } _ { i }$ from the empirical posterior, and combine these policies together to recover a single policy $\pi$ for the POMDP. Reducing the POMDP policy learning problem into a set of MDP policy learning problems can allow us to leverage the many recent advances in deep RL for scalably solving MDPs. The following theorem links the expected return of a policy $\pi$ in the empirical epistemic POMDP $\hat { \mathcal { M } } ^ { \mathrm { p o } }$ , in terms of the performance of the policies $\pi _ { i }$ on their respective MDPs $\mathcal { M } _ { i }$ .
|
| 121 |
+
|
| 122 |
+
Proposition 6.1. Let $\pi , \pi _ { 1 } , \cdots \pi _ { n }$ be memoryless , and define $r _ { \mathrm { m a x } } = \mathrm { m a x } _ { i , s , a } \left| r _ { \mathcal { M } _ { i } } ( s , a ) \right|$ . The expected return of $\pi$ in $\hat { \mathcal { M } } ^ { p o }$ is bounded below as:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
J _ { \hat { \mathcal { M } } ^ { p o } } ( \pi ) \geq \frac { 1 } { n } \sum _ { i = 1 } ^ { n } J _ { M _ { i } } ( \pi _ { i } ) - \frac { \sqrt { 2 } r _ { \operatorname* { m a x } } } { ( 1 - \gamma ) ^ { 2 } n } \sum _ { i = 1 } ^ { n } \mathbb { E } _ { s \sim d _ { M _ { i } } ^ { \pi _ { i } } } \left[ \sqrt { D _ { K L } \left( \pi _ { i } ( \cdot | s ) \mid \mid \pi ( \cdot | s ) \right) } \right] ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
This proposition indicates that if the policies in the collection $\{ \pi _ { i } \} _ { i \in [ n ] }$ all achieve high return in their respective MDPs (first term) and are imitable by a single policy $\pi$ (second term), then $\pi$ is guaranteed to achieve high return in the epistemic POMDP. In contrast, if the policies cannot be closely imitated by a single policy, this collection of policies may not be useful for learning in the epistemic POMDP using the lower bound. This means that it may not sufficient to naively optimize each policy $\pi _ { i }$ on its MDP $\mathcal { M } _ { i }$ without any consideration to the other policies or MDPs, since the learned policies are likely to be different and difficult to jointly imitate. To be useful for the lower bound, each policy $\pi _ { i }$ should balance between maximizing performance on its MDP and minimizing its deviation from the other policies in the set. The following proposition shows that if the policies are trained jointly to ensure this balance, it in fact recovers the optimal policy in the empirical epistemic POMDP.
|
| 129 |
+
|
| 130 |
+
Proposition 6.2. Let $f : \{ \pi _ { i } \} _ { i \in [ n ] } \mapsto \pi$ be a function that maps n policies to a single policy satisfying $f ( \pi , \cdot \cdot \cdot , \pi ) = \pi$ for every policy $\pi$ , and let $\alpha$ be a hyperparameter satisfying $\begin{array} { r } { \alpha \ge \frac { \sqrt { 2 } r _ { m a x } } { ( 1 - \gamma ) ^ { 2 } n } } \end{array}$ . Then letting $\pi _ { 1 } ^ { * } , \ldots \pi _ { n } ^ { * }$ be the optimal solution to the following optimization problem:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\{ \pi _ { i } ^ { * } \} _ { i \in [ n ] } = \underset { \pi _ { 1 } , \cdots , \pi _ { n } } { \mathrm { a r g } \operatorname* { m a x } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } J _ { M _ { i } } ( \pi _ { i } ) - \alpha \sum _ { i = 1 } ^ { n } \mathbb { E } _ { s \sim d _ { M _ { i } } ^ { \pi _ { i } } } \left[ \sqrt { D _ { K L } \left( \pi _ { i } ( \cdot | s ) \mid | \ f ( \{ \pi _ { i } \} ) ( \cdot | s ) \right) } \right] ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
the policy $\pi ^ { * } : = f ( \{ \pi _ { i } ^ { * } \} _ { i \in [ n ] } )$ is optimal for the empirical epistemic POMDP $\hat { \mathcal { M } } ^ { p o }$ .
|
| 137 |
+
|
| 138 |
+
# 6.2 A Practical Algorithm for Contextual MDPs: LEEP
|
| 139 |
+
|
| 140 |
+
Proposition 6.2 provides a foundation for a practical algorithm for learning policies when provided training contexts $\mathcal { C } _ { \mathrm { t r a i n } }$ from an unknown contextual MDP. In order to use the proposition in a practical algorithm, we must discuss two problems: how posterior samples $\mathcal { M } _ { i } \sim \mathcal { P } ( \mathcal { M } | \mathcal { D } )$ can be approximated, and how the function $f$ that combines policies should be chosen.
|
| 141 |
+
|
| 142 |
+
Approximating the posterior distribution: Rather than directly maintaining a posterior over
|
| 143 |
+
transition dynamics and reward models, which is especially difficult with image-based observations,
|
| 144 |
+
we can approximate samples from the posterior via a bootstrap sampling technique [53]. To sample a
|
| 145 |
+
candidate MDP $\mathcal { M } _ { i }$ , we sample with replacement from the training contexts $\mathcal { C } _ { \mathrm { t r a i n } }$ to get a new set of
|
| 146 |
+
contexts out trials $ { \mathcal { C } } _ { \mathrm { t r a i n } } ^ { i }$ , and define the posteri $\mathcal { M } _ { i }$ to bmple empirical MDPthen correspond this subset of training contexts. R selecting a context at random from distribution $\mathcal { M } _ { i }$ $ { \mathcal { C } } _ { \mathrm { t r a i n } } ^ { i }$ $\mathcal { M } _ { i }$
|
| 147 |
+
contexts, not a single context, since our goal is to sample from the posterior entire contextual MDPs.
|
| 148 |
+
|
| 149 |
+
Choosing a link function: The link function $f$ in Proposition 6.2 that combines the set of policies together effectively serves as an inductive bias: since we are optimizing in an approximation to the true epistemic POMDP and policy optimization is not exact in practice, different choices can yield combined policies with different characteristics. Since optimal behavior in the epistemic POMDP must consider all actions, even those that are potentially sub-optimal in all MDPs in the posterior (as discussed in Section 5.2), we use an “optimistic” link function
|
| 150 |
+
|
| 151 |
+
1: Receive training contexts 2: Bootstrap sample training $\mathcal { C } _ { \mathrm { t r a i n } }$ , number of etexts to create bers , wh $n$ e . ${ \mathcal { C } } _ { \operatorname { t r a i n } } ^ { 1 } , \ldots { \mathcal { C } } _ { \operatorname { t r a i n } } ^ { n }$ ${ \mathcal { C } } _ { \mathrm { t r a i n } } ^ { i } \subset { \mathcal { C } } _ { \mathrm { t r a i n } }$
|
| 152 |
+
3: Initialize $n$ policies: $\pi _ { 1 } , \ldots , \pi _ { n }$
|
| 153 |
+
4: for iteration $k = 1 , 2 , 3 , \ldots$ do
|
| 154 |
+
5: for policy $i = 1 , \ldots , n$ do
|
| 155 |
+
6: Collect environment samples in training contexts $ { \mathcal { C } } _ { \mathrm { t r a i n } } ^ { i }$ using policy $\pi _ { i }$
|
| 156 |
+
7: Take gradient steps wrt $\pi _ { i }$ on these samples with augmented RL loss: $\pi _ { i } \pi _ { i } - \eta \nabla _ { i } ( \mathcal L ^ { R L } ( \pi _ { i } ) + \alpha \mathbb E _ { s \sim \pi _ { i } , \mathcal L _ { \operatorname { u n } } ^ { i } } [ D _ { K L } ( \pi _ { i } ( a | s ) \| \operatorname* { m a x } _ { j } \pi _ { j } ( a | s ) ) ] )$
|
| 157 |
+
8: Return π = maxi π: π(a|s) = P maxi πi(a|s)a0 maxi πi(a0|s) .
|
| 158 |
+
|
| 159 |
+
that does not dismiss any action that is considered by at least one of the policies, specifically f ({πi}i∈[n]) = (maxi πi)(a|s) := P max πi(a|s)a0 max πi(a0|s) .
|
| 160 |
+
|
| 161 |
+
Algorithm: We learn a set of $n$ policies $\{ \pi _ { i } \} _ { i \in [ n ] }$ , using a policy gradient algorithm to implement the update step. To update the parameters for $\pi _ { i }$ , we take gradient steps via the surrogate loss used for the policy gradient, augmented by a disagreement penalty between the policy and the combined policy ${ \bar { f } } ( \{ \pi _ { i } \} _ { i \in [ n ] } )$ with a penalty parameter $\alpha > 0$ , as in Equation 5:
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\mathcal { L } ( \pi _ { i } ) = \mathcal { L } ^ { R L } ( \pi _ { i } ) + \alpha \mathbb { E } _ { s \sim \pi _ { i } , M _ { i } } [ D _ { K L } ( \pi _ { i } ( a | s ) | | \operatorname* { m a x } _ { j } \pi _ { j } ( a | s ) ) ] .
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
Combining these elements together leads to our method, LEEP, which we summarize in Algorithm 1. In our implementation, we use PPO for training contexts to create overlapping set $\mathcal { L } ^ { R L } ( \pi _ { i } )$ [54]. In sung contexts bootstrap samples the. Every iteration, each ${ \mathcal { C } } _ { \operatorname { t r a i n } } ^ { 1 } , \ldots { \mathcal { C } } _ { \operatorname { t r a i n } } ^ { n }$ policy $\pi _ { i }$ generates rollouts in training contexts chosen uniformly from its corresponding $\mathcal { C } _ { \mathrm { t r a i n } } ^ { i }$ , and is then updated according to Equation 5, which both maximizes the expected reward and minimizes the disagreement penalty between each $\pi _ { i }$ and the combined policy $\pi = \operatorname* { m a x } _ { j } \pi _ { j }$ .
|
| 168 |
+
|
| 169 |
+
While this algorithm is structurally similar to algorithms for multi-task learning that train a separate policy for each context or group of contexts with a disagreement penalty [55, 56], the motivation and the interpretation of these approaches are completely distinct. In multi-task learning, the goal is to solve a given set of tasks, and these methods promote transfer via a loss that encourages the solutions to the tasks to be in agreement. In our setting, while we also receive a set of tasks (contexts), the goal is not to maximize performance on the training tasks, but rather to learn a policy that maximizes performance on unseen test tasks. The method also has a subtle but important distinction: each of our policies $\pi _ { i }$ acts on a sample from the contextual MDP posterior (which captures epistemic uncertainty), not a single training context [55] or element from a disjoint partitioning [56] (which does not). This distinction is crucial, since our generalization performance requires our aim is not to make it easier to solve the training contexts, but the opposite: prevent the algorithm from overfitting to the individual training contexts. Correspondingly, our experiments confirm that such multi-task learning approaches do not provide the same generalization benefits as our approach.
|
| 170 |
+
|
| 171 |
+
# 7 Experiments
|
| 172 |
+
|
| 173 |
+
The primary ambition of our empirical study is to test the hypothesis that policies that are learned through (approximations of) the epistemic POMDP do in fact attain better test-time performance than those learned by standard RL algorithms. We do so on the Procgen benchmark [16], a challenging suite of diverse tasks with image-based observations testing generalization to unseen contexts.
|
| 174 |
+
|
| 175 |
+
1. Does LEEP derived from the epistemic POMDP lead to improved test-time performance over standard RL methods? 2. Can LEEP prevent overfitting when provided a limited number of training contexts? 3. How do different algorithmic components of LEEP affect test-time performance ?
|
| 176 |
+
|
| 177 |
+
The Procgen benchmark is a set of procedurally generated games, each with different generalization challenges. In each game, during training, the algorithm can interact with 200 training levels, before it is asked to generalize to the full distribution of levels. The agent receives a $6 4 \times 6 4 \times 3$ image observation, and must output one of 15 possible actions. We instantiate our method using an ensemble of $n = 4$ policies, a penalty parameter of $\alpha = 1$ , and PPO [54] to train the individual policies (full implementation details in Appendix C).
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 4: Test set return for LEEP and PPO throughout training in four Procgen environments (averaged across 5 random seeds). LEEP achieves higher test returns than PPO on three tasks (Maze, Heist and Dodgeball) and matches test return on Bigfish while having less variance across seeds.
|
| 181 |
+
|
| 182 |
+
We evaluate our method on four games in which prior work has found a large gap between training and test performance, and which we therefore conclude pose a significant generalization challenge [16, 23, 26]: Maze, Heist, BigFish, and Dodgeball. In Figure 4, we compare the test-time performance of the policies learned using our method to those learned by a PPO agent with entropy regularization. In three of these environments (Maze, Heist, and Dodgeball), our method outperforms PPO by a significant margin, and in all cases, we find that the generalization gap between training and test performance is lower for our method than PPO (Appendix D.1).
|
| 183 |
+
|
| 184 |
+
To understand how LEEP behaves with fewer training contexts, we ran on the Maze task with only 50 levels (Figure 5 (top)); the test return of the PPO policy decreases through training, leading to final performance worse than the starting random policy, but our method avoids this degradation.
|
| 185 |
+
|
| 186 |
+
We perform an ablation study on the Maze and Heist environments (Maze in Figure 4, Heist in Appendix D.1) to rule out potential confounding causes for the improved generalization that our method displays on the Procgen benchmark tasks. First, to see if the performance benefit derives solely from the use of ensembles, we compare LEEP to a Bayesian model averaging strategy that trains an ensemble of policies without regularization (“Ensemble (no reg)”), and uses a mixture of these policies. This strategy does improve performance over the PPO policy, but does not match LEEP, indicating the usefulness of the regularization. Second, we compared to a version of LEEP that combines the ensemble policies together using the average Pni=1 πi(a|s) (“LEEP (avg)”). This link function achieves worse test-time performance than the optimistic version, which indicates that the inductive bias conferred by the $\operatorname* { m a x } _ { i } \pi _ { i }$ link function is a useful component of the algorithm. We also compare to Distral, a multi-task learning method with different motivations but similar structure to LEEP: this method helps accelerate learning on the provided training contexts (figures in Appendix D.1), but does not improve generalization performance as LEEP does. We additionally ablated the two key hyperparameters in LEEP, the number of ensemble members $n$ and the penalty coefficient $\alpha$ (Table in Appendix D.2).
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 5: (top) Performance of LEEP and PPO with only 50 training levels on Maze. (bottom) Ablations of LEEP in Maze.
|
| 190 |
+
|
| 191 |
+
# 8 Discussion
|
| 192 |
+
|
| 193 |
+
It has often been observed experimentally that generalization in RL poses a significant challenge, but it has so far remained an open question as to whether the RL setting itself presents additional generalization challenges beyond those seen in supervised learning. In this paper, we answer this question in the affirmative, and show that, in contrast to supervised learning, generalization in RL results in a new type of problem that cannot be solved with standard MDP solution methods, due to partial observability induced by epistemic uncertainty. We call the resulting partially observed setting the epistemic POMDP, where uncertainty about the true underlying MDP results in a challenging partially observed problem. We present a practical approximate method that optimizes a bound for performance in an approximation of the epistemic POMDP, and show empirically that this approach, which we call LEEP, attains significant improvements in generalization over other RL methods that do not properly incorporate the agent’s epistemic uncertainty into policy optimization. A limitation of this approach is that it optimizes a crude approximation to the epistemic POMDP with a small number of posterior samples, and may be challenging to scale to better approximations to the true objective. Developing algorithms that better model the epistemic POMDP and optimize policies within is an exciting avenue for future work, and we hope that this direction will lead to further improvements in generalization in RL.
|
| 194 |
+
|
| 195 |
+
# Acknowledgements
|
| 196 |
+
|
| 197 |
+
This research was supported by an NSF graduate fellowship, the DARPA assured autonomy program, the NSF IIS-2007278 grant, a Princeton SEAS Innovation Grant and compute support from Google and Microsoft. We thank Benjamin Eysenbach, Xinyang Geng, and Justin Fu as well as members of the Princeton Laboratory for Intelligent Probabilistic Systems for helpful discussions and feedback.
|
| 198 |
+
|
| 199 |
+
# References
|
| 200 |
+
|
| 201 |
+
[1] Jesse Farebrother, Marlos C. Machado, and Michael H. Bowling. Generalization and regularization in dqn. ArXiv, abs/1810.00123, 2018. [2] C. Zhang, Oriol Vinyals, R. Munos, and S. Bengio. A study on overfitting in deep reinforcement learning. ArXiv, abs/1804.06893, 2018.
|
| 202 |
+
[3] Niels Justesen, R. Torrado, Philip Bontrager, Ahmed Khalifa, J. Togelius, and S. Risi. Illuminating generalization in deep reinforcement learning through procedural level generation. arXiv: Learning, 2018. [4] Xingyou Song, Yiding Jiang, Stephen Tu, Yilun Du, and Behnam Neyshabur. Observational overfitting in reinforcement learning. ArXiv, abs/1912.02975, 2020. [5] R. Dearden, N. Friedman, and Stuart J. Russell. Bayesian q-learning. In AAAI/IAAI, 1998. [6] M. Duff and A. Barto. Optimal learning: computational procedures for bayes-adaptive markov decision processes. 2002.
|
| 203 |
+
[7] M. Strens. A bayesian framework for reinforcement learning. In ICML, 2000. [8] M. Ghavamzadeh, Shie Mannor, Joelle Pineau, and Aviv Tamar. Bayesian reinforcement learning: A survey. Found. Trends Mach. Learn., 8:359–483, 2015.
|
| 204 |
+
[9] A. Zhang, Yuxin Wu, and Joelle Pineau. Natural environment benchmarks for reinforcement learning. ArXiv, abs/1811.06032, 2018.
|
| 205 |
+
[10] A. Zhang, Nicolas Ballas, and Joelle Pineau. A dissection of overfitting and generalization in continuous reinforcement learning. ArXiv, abs/1806.07937, 2018.
|
| 206 |
+
[11] S. Whiteson, B. Tanner, Matthew E. Taylor, and P. Stone. Protecting against evaluation overfitting in empirical reinforcement learning. 2011 IEEE Symposium on Adaptive Dynamic Programming and Reinforcement Learning (ADPRL), pages 120–127, 2011.
|
| 207 |
+
[12] Zhuang Liu, Xuanlin Li, Bingyi Kang, and Trevor Darrell. Regularization matters in policy optimization – an empirical study on continuous control. arXiv: Learning, 2020.
|
| 208 |
+
[13] Alex Nichol, Vicki Pfau, Christopher Hesse, Oleg Klimov, and John Schulman. Gotta learn fast: A new benchmark for generalization in rl. ArXiv, abs/1804.03720, 2018.
|
| 209 |
+
[14] K. Cobbe, Oleg Klimov, Christopher Hesse, Taehoon Kim, and John Schulman. Quantifying generalization in reinforcement learning. In ICML, 2019.
|
| 210 |
+
[15] Heinrich Kuttler, Nantas Nardelli, Alexander H. Miller, Roberta Raileanu, Marco Selvatici, Edward Grefenstette, and Tim Rocktäschel. The nethack learning environment. ArXiv, abs/2006.13760, 2020.
|
| 211 |
+
[16] K. Cobbe, Christopher Hesse, Jacob Hilton, and John Schulman. Leveraging procedural generation to benchmark reinforcement learning. ArXiv, abs/1912.01588, 2020.
|
| 212 |
+
[17] Austin Stone, Oscar Ramirez, K. Konolige, and Rico Jonschkowski. The distracting control suite - a challenging benchmark for reinforcement learning from pixels. ArXiv, abs/2101.02722, 2021.
|
| 213 |
+
[18] Max Jaderberg, V. Mnih, Wojciech Czarnecki, Tom Schaul, Joel Z. Leibo, D. Silver, and K. Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. ArXiv, abs/1611.05397, 2017.
|
| 214 |
+
[19] Adam Stooke, Kimin Lee, P. Abbeel, and M. Laskin. Decoupling representation learning from reinforcement learning. ArXiv, abs/2009.08319, 2020.
|
| 215 |
+
[20] A. Zhang, Rowan McAllister, R. Calandra, Y. Gal, and Sergey Levine. Learning invariant representations for reinforcement learning without reconstruction. ArXiv, abs/2006.10742, 2020.
|
| 216 |
+
[21] Rishabh Agarwal, Marlos C. Machado, P. S. Castro, and Marc G. Bellemare. Contrastive behavioral similarity embeddings for generalization in reinforcement learning. ArXiv, abs/2101.05265, 2021.
|
| 217 |
+
[22] Maximilian Igl, K. Ciosek, Yingzhen Li, Sebastian Tschiatschek, C. Zhang, Sam Devlin, and Katja Hofmann. Generalization in reinforcement learning with selective noise injection and information bottleneck. In NeurIPS, 2019.
|
| 218 |
+
[23] Minqi Jiang, Edward Grefenstette, and Tim Rocktäschel. Prioritized level replay. ArXiv, abs/2010.03934, 2020.
|
| 219 |
+
[24] Kimin Lee, Kibok Lee, Jinwoo Shin, and H. Lee. Network randomization: A simple technique for generalization in deep reinforcement learning. In ICLR, 2020.
|
| 220 |
+
[25] Ilya Kostrikov, Denis Yarats, and R. Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. ArXiv, abs/2004.13649, 2020.
|
| 221 |
+
[26] Roberta Raileanu, Maxwell Goldstein, Denis Yarats, Ilya Kostrikov, and R. Fergus. Automatic data augmentation for generalization in deep reinforcement learning. ArXiv, abs/2006.12862, 2020.
|
| 222 |
+
[27] Fereshteh Sadeghi and Sergey Levine. (cad)2rl: Real single-image flight without a single real image. ArXiv, abs/1611.04201, 2017.
|
| 223 |
+
[28] Joshua Tobin, Rachel Fong, Alex Ray, J. Schneider, W. Zaremba, and P. Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 23–30, 2017.
|
| 224 |
+
[29] A. Rajeswaran, Sarvjeet Ghotra, Sergey Levine, and Balaraman Ravindran. Epopt: Learning robust neural network policies using model ensembles. ArXiv, abs/1610.01283, 2017.
|
| 225 |
+
[30] Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 1–8, May 2018.
|
| 226 |
+
[31] Katie Kang, Suneel Belkhale, Gregory Kahn, Pieter Abbeel, and Sergey Levine. Generalization through simulation: Integrating simulated and real data into deep reinforcement learning for vision-based autonomous flight. In 2019 international conference on robotics and automation (ICRA), pages 6008–6014. IEEE, 2019.
|
| 227 |
+
[32] F. Stulp, E. Theodorou, J. Buchli, and S. Schaal. Learning to grasp under uncertainty. 2011 IEEE International Conference on Robotics and Automation, pages 5703–5708, 2011.
|
| 228 |
+
[33] X. Lu, Kimin Lee, P. Abbeel, and Stas Tiomkin. Dynamics generalization via information bottleneck in deep reinforcement learning. ArXiv, abs/2008.00614, 2020.
|
| 229 |
+
[34] Deepak Ramachandran and E. Amir. Bayesian inverse reinforcement learning. In IJCAI, 2007.
|
| 230 |
+
[35] A. Lazaric and M. Ghavamzadeh. Bayesian multi-task reinforcement learning. In ICML, 2010.
|
| 231 |
+
[36] Wonseok Jeon, Seokin Seo, and Kee-Eung Kim. A bayesian approach to generative adversarial imitation learning. In NeurIPS, 2018.
|
| 232 |
+
[37] Luisa M. Zintgraf, K. Shiarlis, Maximilian Igl, Sebastian Schulze, Y. Gal, Katja Hofmann, and S. Whiteson. Varibad: A very good method for bayes-adaptive deep rl via meta-learning. ArXiv, abs/1910.08348, 2020.
|
| 233 |
+
[38] R. Weber. On the gittins index for multiarmed bandits. Annals of Applied Probability, 2:1024– 1033, 1992.
|
| 234 |
+
[39] P. Poupart, N. Vlassis, J. Hoey, and K. Regan. An analytic solution to discrete bayesian reinforcement learning. Proceedings of the 23rd international conference on Machine learning, 2006.
|
| 235 |
+
[40] R. Dearden, N. Friedman, and D. Andre. Model based bayesian exploration. In UAI, 1999.
|
| 236 |
+
[41] Ian Osband, Daniel Russo, and Benjamin Van Roy. (more) efficient reinforcement learning via posterior sampling. In NIPS, 2013.
|
| 237 |
+
[42] Daniel Russo and Benjamin Van Roy. Learning to optimize via posterior sampling. Math. Oper. Res., 39:1221–1243, 2014.
|
| 238 |
+
[43] Stephane Ross, Brahim Chaib-draa, and Joelle Pineau. Bayes-adaptive pomdps. In NIPS, pages 1225–1232, 2007.
|
| 239 |
+
[44] Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
|
| 240 |
+
[45] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
|
| 241 |
+
[46] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 242 |
+
[47] George E Monahan. State of the art—a survey of partially observable markov decision processes: theory, models, and algorithms. Management science, 28(1):1–16, 1982.
|
| 243 |
+
[48] Satinder P. Singh, Tommi S. Jaakkola, and Michael I. Jordan. Learning without state-estimation in partially observable markovian decision processes. In Proceedings of the Eleventh International Conference on International Conference on Machine Learning, page 284–292, San Francisco, CA, USA, 1994. Morgan Kaufmann Publishers Inc.
|
| 244 |
+
[49] Guido Montúfar, K. Zahedi, and N. Ay. Geometry and determinism of optimal stationary control in partially observable markov decision processes. ArXiv, abs/1503.07206, 2015.
|
| 245 |
+
[50] Ilge Akkaya, Marcin Andrychowicz, Maciek Chociej, Mateusz Litwin, Bob McGrew, Arthur Petron, Alex Paino, Matthias Plappert, Glenn Powell, Raphael Ribas, et al. Solving rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019.
|
| 246 |
+
[51] Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. CoRR, abs/1710.06537, 2017.
|
| 247 |
+
[52] Benjamin Eysenbach and Sergey Levine. If maxent rl is the answer, what is the question? arXiv preprint arXiv:1910.01913, 2019.
|
| 248 |
+
[53] Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016.
|
| 249 |
+
[54] John Schulman, F. Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. ArXiv, abs/1707.06347, 2017.
|
| 250 |
+
[55] Yee Teh, Victor Bapst, Wojciech M. Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
|
| 251 |
+
[56] Dibya Ghosh, Avi Singh, Aravind Rajeswaran, Vikash Kumar, and Sergey Levine. Divide-andconquer reinforcement learning. In International Conference on Learning Representations, 2018.
|
| 252 |
+
[57] Scott Fujimoto, H. V. Hoof, and D. Meger. Addressing function approximation error in actorcritic methods. ArXiv, abs/1802.09477, 2018.
|
| 253 |
+
[58] Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https:// github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018.
|
| 254 |
+
[59] Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In In Proc. 19th International Conference on Machine Learning. Citeseer, 2002.
|
| 255 |
+
|
| 256 |
+
[60] Kimin Lee, Younggyo Seo, Seunghyun Lee, Honglak Lee, and Jinwoo Shin. Context-aware dynamics model for generalization in model-based reinforcement learning. ArXiv, abs/2005.06800, 2020.
|
md/train/QYjO70ACDK/QYjO70ACDK.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DISTRIBUTIONAL SLICED-WASSERSTEIN AND APPLICATIONS TO GENERATIVE MODELING
|
| 2 |
+
|
| 3 |
+
Khai Nguyen VinAI Research, Vietnam v.khainb@vinai.io
|
| 4 |
+
|
| 5 |
+
Nhat $\mathbf { H o } ^ { * }$ University of Texas, Austin VinAI Research, Vietnam minhnhat@utexas.edu
|
| 6 |
+
|
| 7 |
+
Tung Pham VinAI Research, Vietnam v.tungph4@vinai.io
|
| 8 |
+
|
| 9 |
+
# Hung Bui
|
| 10 |
+
|
| 11 |
+
VinAI Research, Vietnam v.hungbh1@vinai.io
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Sliced-Wasserstein distance (SW) and its variant, Max Sliced-Wasserstein distance (Max-SW), have been used widely in the recent years due to their fast computation and scalability even when the probability measures lie in a very high dimensional space. However, SW requires many unnecessary projection samples to approximate its value while Max-SW only uses the most important projection, which ignores the information of other useful directions. In order to account for these weaknesses, we propose a novel distance, named Distributional Sliced-Wasserstein distance (DSW), that finds an optimal distribution over projections that can balance between exploring distinctive projecting directions and the informativeness of projections themselves. We show that the DSW is a generalization of Max-SW, and it can be computed efficiently by searching for the optimal push-forward measure over a set of probability measures over the unit sphere satisfying certain regularizing constraints that favor distinct directions. Finally, we conduct extensive experiments with large-scale datasets to demonstrate the favorable performances of the proposed distances over the previous sliced-based distances in generative modeling applications.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Optimal transport (OT) is a classical problem in mathematics and operation research. Due to its appealing theoretical properties and flexibility in practical applications, it has recently become an important tool in the machine learning and statistics community; see for example, (Courty et al., 2017; Arjovsky et al., 2017; Tolstikhin et al., 2018; Gulrajani et al., 2017) and references therein. The main usage of OT is to provide a distance named Wasserstein distance, to measure the discrepancy between two probability distributions. However, that distance suffers from expensive computational complexity, which is the main obstacle to using OT in practical applications.
|
| 20 |
+
|
| 21 |
+
There have been two main approaches to overcome the high computational complexity problem: either approximate the value of OT or apply the OT adaptively to specific situations. The first approach was initiated by (Cuturi, 2013) using an entropic regularizer to speed up the computation of the OT (Sinkhorn, 1967; Knight, 2008). The entropic regularization approach has demonstrated its usefulness in several application domains (Courty et al., 2014; Genevay et al., 2018; Bunne et al., 2019). Along this direction, several works proposed efficient algorithms for solving the entropic OT (Altschuler et al., 2017; Lin et al., 2019b;a) as well as methods to stabilize these algorithms (Chizat et al., 2018; Peyré & Cuturi, 2019; Chizat et al., 2018; Schmitzer, 2019). However, these algorithms have complexities of the order $\mathcal { O } ( k ^ { 2 } )$ , where $k$ is the number of supports. It is expensive when we need to compute the OT repeatedly, especially in learning the data distribution.
|
| 22 |
+
|
| 23 |
+
The second approach, known as "slicing", takes a rather different perspective. It leverages two key ideas: the OT closed-form expression for two distributions in one-dimensional space, and the transformation of a distribution into a set of projected one-dimensional distributions by the Radon transform (RT) (Helgason, 2010). The popular proposal along this direction is Sliced-Wasserstein (SW) distance (Bonneel et al., 2015), which samples the projecting directions uniformly over a unit sphere in the data ambient space and takes the expectation of the resulting one-dimensional OT distance. The SW distance hence requires a significantly lower computation cost than the original Wasserstein distance and is more scalable than the first approach. Due to its solid statistical guarantees and efficient computation, the SW distance has been successfully applied to a variety of practical tasks (Deshpande et al., 2018; Liutkus et al., 2019; Kolouri et al., 2018; Wu et al., 2019; Deshpande et al., 2019) where it has been shown to have comparative performances to other distances and divergences between probability distributions. However, there is an inevitable bottleneck of computing the SW distance. Specifically, the expectation with respect to the uniform distribution of projections in SW is intractable to compute; therefore, the Monte Carlo method is employed to approximate it. Nevertheless, drawing from a uniform distribution of directions in high-dimension can result in an overwhelming number of irrelevant directions, especially when the actual data lies in a low-dimensional manifold. Hence, SW typically needs to have a large number of samples to yield an accurate estimation of the discrepancy. Alternatively, in the other extreme, Max Sliced-Wasserstein (Max-SW) distance (Deshpande et al., 2019) uses only one important direction to distinguish the probability distributions. However, other potentially relevant directions are ignored in Max-SW. Therefore, Max-SW can miss some important differences between the two distributions in high dimension. We note that the linear projections in the Radon transform can be replaced by non-linear projections resulting in the generalized sliced-Wasserstein distance and its variants (Beylkin, 1984; Kolouri et al., 2019).
|
| 24 |
+
|
| 25 |
+
Apart from these main directions, there are also few proposals that try either to modify them or to combine the advantages of the above-mentioned approaches. In particular, Paty & Cuturi (2019) extended the idea of the max-sliced distance to the max-subspace distance by considering finding an optimal orthogonal subspace. However, this approach is computationally expensive, since it could not exploit the closed-form of the one-dimensional Wasserstein distance. Another approach named the Projected Wasserstein distance (PWD), which was proposed in (Rowland et al., 2019), uses sliced decomposition to find multiple one-dimension optimal transport maps. Then, it computes the average cost of those maps equally in the original dimension.
|
| 26 |
+
|
| 27 |
+
Our contributions. Our paper also follows the slicing approach. However, we address key friction in this general line of work: how to obtain a relatively small number of slices simultaneously to maintain the computational efficiency, but at the same time, cover the major differences between two high-dimensional distributions. We take a probabilistic view of slicing by using a probability measure on the unit sphere to represent how important each direction is. From this viewpoint, SW uses the uniform distribution while Max-SW searches for the best delta-Dirac distribution over the projections, both can be considered as special cases. In this paper, we propose to search for an optimal distribution of important directions. We regularize this distribution such that it prefers directions that are far away from one another, hence encouraging an efficient exploration of the space of directions. In the case of no regularization, our proposed method recovers max-(generalized) SW as a special case. In summary, our main contributions are two-fold:
|
| 28 |
+
|
| 29 |
+
1. First, we introduce a novel distance, named Distributional Sliced-Wasserstein distance (DSW), to account for the issues of previous sliced distances. Our main idea is to search for not just a single most important projection, but an optimal distribution over projections that could balance between an expansion of the area around important projections and the informativeness of projections themselves, i.e., how well they can distinguish the two target probability measures. We show that DSW is a proper metric in the probability space and possesses appealing statistical and computational properties as the previous sliced distances.
|
| 30 |
+
|
| 31 |
+
2. Second, we apply the DSW distance to generative modeling tasks based on the generative adversarial framework. The extensive experiments on real and large-scale datasets show that DSW distance significantly outperforms the SW and Max-SW distances under similar computational time on these tasks. Furthermore, the DSW distance helps model distribution converge to the data distribution faster and provides more realistic generated images than the SW and Max-SW distances.
|
| 32 |
+
|
| 33 |
+
Organization. The remainder of the paper is organized as follows. In Section 2, we provide backgrounds for Wasserstein distance and its slice-based versions. In Section 3, we propose distributional (generalized) sliced-Wasserstein distance and analyze some of its theoretical properties. Section 4 includes extensive experiment results followed by discussions in Section 5. Finally, we defer the proofs of key results and extra materials in the Appendices.
|
| 34 |
+
|
| 35 |
+
Notation. For any $\theta , \theta ^ { \prime } \in \mathbb { R } ^ { d }$ , $\begin{array} { r } { \cos ( \theta , \theta ^ { \prime } ) = \frac { \theta ^ { \dagger } \overset { \star } { \theta ^ { \prime } } } { \| \theta \| \| \theta ^ { \prime } \| } } \end{array}$ θ>θ0kθkkθ0k , where k.k is \`2 norm. For any d ≥ 2, Sd−1 denotes the unit sphere in $d$ dimension in $\ell _ { 2 }$ norm . Furthermore, $\delta$ denotes the Dirac delta function, and $\langle \cdot , \cdot \rangle$ is the Euclidean inner-product. For any $p \geq 1$ , $\mathbb { L } ^ { p } ( \mathbb { R } ^ { d } )$ is the set of real-valued functions on $\mathbb { R } ^ { d }$ with finite $p$ -th moment.
|
| 36 |
+
|
| 37 |
+
# 2 BACKGROUND
|
| 38 |
+
|
| 39 |
+
In this section, we provide necessary backgrounds for the (generalized) Radon transform, the Wasserstein, and sliced-Wasserstein distances.
|
| 40 |
+
|
| 41 |
+
# 2.1 WASSERSTEIN DISTANCE
|
| 42 |
+
|
| 43 |
+
We start with a formal definition of Wasserstein distance. For any $p \geq 1$ , we define $\mathcal { P } _ { p } ( \mathbb { R } ^ { d } )$ as the set of Borel probability measures with finite $p$ -th moment defined on a given metric space $( \mathbb { R } ^ { d } , \lVert . \rVert )$ For any probability measures $\mu , \nu$ defined on $\boldsymbol { \mathcal { X } } , \boldsymbol { \mathcal { Y } } \subseteq \mathbb { R } ^ { d }$ , we denote their corresponding probability density functions as $I _ { \mu }$ and $I _ { \nu }$ . The Wasserstein distance of order $p$ between $\mu$ and $\nu$ is given by (Villani, 2008; Peyré & Cuturi, 2019):
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
W _ { p } ( \mu , \nu ) : = \Big ( \operatorname* { i n f } _ { \pi \in \Pi ( \mu , \nu ) } \int _ { \mathcal { X } \times \mathcal { Y } } \| x - y \| ^ { p } d \pi ( x , y ) \Big ) ^ { \frac { 1 } { p } } ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\Pi ( \mu , \nu )$ is a set of all transportation plans $\pi$ such that the marginal distributions of $\pi$ are $\mu$ and $\nu$ , respectively. In order to simplify the presentation, we abuse the notation by using both $W _ { p } ( \mu , \nu )$ and $W _ { p } ( I _ { \mu } , I _ { \nu } )$ interchangeably for the Wasserstein distance between $\mu$ and $\nu$ . When $\mu$ and $\nu$ are one-dimension measures, the Wasserstein distance between $\mu$ and $\nu$ has a closed-form expression $\begin{array} { l } { { W _ { p } ( \mu , \nu ) ~ = ~ ( \int _ { 0 } ^ { 1 } | F _ { \mu } ^ { - 1 } ( z ) - F _ { \nu } ^ { - 1 } ( z ) | ^ { p } d z ) ^ { 1 / p } } } \end{array}$ where $F _ { \mu }$ and $F _ { \nu }$ are the cumulative distribution function (CDF) of $I _ { \mu }$ and $I _ { \nu }$ , respectively.
|
| 50 |
+
|
| 51 |
+
# 2.2 (GENERALIZED) RADON TRANSFORMS
|
| 52 |
+
|
| 53 |
+
Now, we review (generalized) Radon transform maps, which are key to the notion of (generalized) sliced-Wasserstein distance and its variants. The Radon transform (RT) maps a function $\mathbf { \bar { \chi } } _ { I } \in \mathbb { L } ^ { 1 } ( \mathbb { R } ^ { d } )$ to the space of functions defined over space of lines in $\mathbb { R } ^ { d }$ . In particular, for any $t \in \mathbb { R }$ and direction $\theta \in \mathbb { S } ^ { d - 1 }$ , the RT is defined as follows (Helgason, $\begin{array} { r } { 2 0 1 0 ) : \mathcal { R } \bar { I } ( t , \theta ) : = \int _ { \mathbb { R } ^ { d } } I ( \bar { x } ) \delta ( t - \langle x , \theta \rangle ) d x } \end{array}$ .
|
| 54 |
+
|
| 55 |
+
The generalized Radon transform (GRT) (Beylkin, 1984) extends the original one from integration over hyperplanes of $\mathbb { R } ^ { d }$ to integration over hypersurfaces. In particular, it is defined as: $\mathcal { G } I ( t , { \boldsymbol { \theta } } ) : =$ $\textstyle \int _ { \mathbb { R } ^ { d } } I ( { \bar { x } } ) \delta ( { \bar { t } } - g ( x , \theta ) ) d x$ , where $t \in \mathbb R$ and $\theta \in \Omega _ { \theta }$ . Here, $\Omega _ { \theta }$ is a compact subset of $\mathbb { R } ^ { d }$ and $\boldsymbol { g } : \mathbb { R } ^ { d } \times \mathbb { S } ^ { d - 1 } \mapsto \mathbb { R }$ is a defining function (cf. Assumptions H1-H4 in (Kolouri et al., 2019) for the definition of defining function) inducing the hypersurfaces. When $g ( x , \theta ) = \langle x , \theta \rangle$ and $\Omega _ { \theta } = \mathbb { S } ^ { d - 1 }$ , the generalized Radon transform becomes the standard Radon transform.
|
| 56 |
+
|
| 57 |
+
# 2.3 (GENERALIZED) SLICED-WASSERSTEIN DISTANCES
|
| 58 |
+
|
| 59 |
+
The sliced-Wasserstein distance (SW) between two probability measures $\mu$ and $\nu$ is defined as (Bonneel et al., 2015): $\begin{array} { r } { S W _ { p } ( \mu , \nu ) : = ( \int _ { \mathbb { S } ^ { d - 1 } } W _ { p } ^ { p } \big ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) \big ) d \theta ) ^ { 1 / p } } \end{array}$ . Similarly, the generalized sliced-Wasserstein distance (Kolouri et al., 2019) (GSW) is given by $\mathrm { G S W } _ { p } ( \mu , \nu ) : =$ $\begin{array} { r } { ( \int _ { \Omega _ { \theta } } W _ { p } ^ { p } \bigl ( \mathcal { G } I _ { \mu } ( \cdot , \theta ) , \mathcal { G } I _ { \nu } ( \cdot , \theta ) \bigr ) d \theta ) ^ { 1 / p } } \end{array}$ , where $\Omega _ { \theta }$ is the compact set of feasible parameter. However, these integrals are usually intractable. Thus, they are often approximated by using Monte Carlo scheme to draw uniform samples $\{ \theta _ { i } \} _ { i = 1 } ^ { N }$ from $\bar { \mathbb { S } } ^ { d - 1 }$ and $\Omega _ { \theta }$ . In particular, $S W _ { p } ^ { p } ( \mu , \nu ) \approx$ $\begin{array} { r } { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } W _ { p _ { \cdot } } ^ { p } \big ( \mathscr { R } I _ { \mu } ( \cdot , \theta _ { i } ) , \mathscr { R } I _ { \nu } ( \cdot , \theta _ { i } ) \big ) } \end{array}$ and $\begin{array} { r } { \mathbf { G S W } _ { p } ^ { p } ( \mu , \nu ) \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } W _ { p } ^ { p } \big ( \mathcal { G } I _ { \mu } ( \cdot , \theta _ { i } ) , \mathcal { G } I _ { \nu } ( \cdot , \theta _ { i } ) \big ) } \end{array}$ . In order to obtain a good approximation of (generalized) SW distances, $N$ needs to be sufficiently large.
|
| 60 |
+
|
| 61 |
+
However, important directions are not distributed uniformly over the sphere. Thus, this approach will draw potentially many unimportant projections that are not only expensive but also greatly reduce the effect of the SW distance.
|
| 62 |
+
|
| 63 |
+
# 2.4 MAX (GENERALIZED) SLICED-WASSERSTEIN DISTANCES
|
| 64 |
+
|
| 65 |
+
An approach to using only informative directions is to simply take the best slice in discriminating two given probability distributions. That distance is max sliced-Wasserstein distance (Max-SW) (Deshpande et al., 2019), which is given by $\begin{array} { r l } & { \operatorname* { m a x } S W _ { p } ( \mu , \nu ) : = \operatorname* { m a x } _ { \theta \in \mathbb { S } ^ { d - 1 } } W _ { p } ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) ) } \end{array}$ . By combining this idea with non-linear projections from generalized Radon transform, we obtain max generalized sliced-Wasserstein distance (Max-GSW) (Kolouri et al., 2019). The formal definition of that distance is: $\begin{array} { r } { \operatorname* { m a x } G S W _ { p } ( \mu , \nu ) : = \operatorname* { m a x } _ { \theta \in \Omega _ { \theta } } W _ { p } ( \mathcal { G } I _ { \mu } ( \cdot , \theta ) , \mathcal { G } I _ { \nu } ( \cdot , \theta ) ) } \end{array}$ . The (generalized) MaxSW distances focus on finding only the most important direction. Meanwhile, other informative directions play no role in the distance. Therefore, (generalized) Max-SW distances can ignore useful information about the structure of high dimensional probability measures.
|
| 66 |
+
|
| 67 |
+
# 3 DISTRIBUTIONAL SLICED-WASSERSTEIN DISTANCE
|
| 68 |
+
|
| 69 |
+
With the aim of improving the limitations of the previous sliced distances, we propose a novel distance, named Distributional Sliced-Wasserstein distance (DSW), that can search for not just a single but a distribution of important directions on the unit sphere. We prove that it is a well-defined metric and discuss its connection to the existing sliced-based distances in Section 3.1. Then, we provide a procedure to approximate DSW based on its dual form in Section 3.2.
|
| 70 |
+
|
| 71 |
+
# 3.1 DEFINITION AND METRICITY
|
| 72 |
+
|
| 73 |
+
We first start with a definition of distributional sliced-Wasserstein distance. We say $C > 0$ admissible if the set $\mathbb { M } _ { C }$ of probability measures $\sigma$ on $\mathbb { S } ^ { d - 1 }$ satisfying $\begin{array} { r } { \mathbb { E } _ { \boldsymbol { \theta } , \boldsymbol { \theta } ^ { \prime } \sim \sigma } \left[ \vert \boldsymbol { \theta } ^ { \top } \boldsymbol { \theta } ^ { \prime } \vert \right] \le \dot { C } } \end{array}$ is not empty.
|
| 74 |
+
|
| 75 |
+
Definition 1. Given two probability measures $\mu$ and $\nu$ on $\mathbb { R } ^ { d }$ with finite $p$ -th moments where $p \geq 1$ and an admissible regularizing constant $C > 0$ . The distributional sliced-Wasserstein distance (DSW) of order $p$ between $\mu$ and $\nu$ is given by:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
{ D S W } _ { p } ( \mu , \nu ; C ) : = \operatorname* { s u p } _ { \sigma \in \mathbb { M } _ { C } } \bigg ( \mathbb { E } _ { \theta \sim \sigma } \bigg [ W _ { p } ^ { p } ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) ) \bigg ] \bigg ) ^ { \frac { 1 } { p } } ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { R }$ is the Radon transform operator.
|
| 82 |
+
|
| 83 |
+
The DSW aims to find the optimal probability measure of slices on the unit sphere $\mathbb { S } ^ { d - 1 }$ . Note that, the Max-SW distance is equivalent to searching for the best Dirac measure on a single point in $\mathbb { S } ^ { d - 1 }$ , which puts all weights in only one direction. Meanwhile, the uniform measure in the formulation of SW distance distributes the same weights in all directions. Indeed, the uniform and Dirac measures are two special cases, because they view that either all directions are equally important or only one direction is important. That view is too restricted if the data actually lie on low dimensional space. Thus, we aim to find a probability measure which concentrates only on areas around important directions. Furthermore, we do not want these directions to lie in only one small area, because under the orthogonal projection of RT, their corresponding one-dimensional distributions will become similar. In order to achieve this, we search for an optimal measure $\sigma$ that satisfies the regularization constraint $\begin{array} { r } { \mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } [ \left| \theta ^ { \top } \theta ^ { ' } \right| ] \leq C } \end{array}$ . By Cauchy-Schwarz inequality, $C$ is no greater than 1, thus $\mathbb { M } _ { 1 }$ contains all probability measures on the unit sphere. Optimizing over $\mathbb { M } _ { 1 }$ simply returns the best Dirac measure corresponding to the Max-SW distance. When $C$ is small, the constraint forces the measure $\sigma$ to distribute more weights to directions that are far from each other (in terms of their angles). Thus, a small appropriate value of $C$ will help to balance between the distinctiveness and informativeness of these targeted directions. For further discussion about $C$ , see Appendix B.1.
|
| 84 |
+
|
| 85 |
+
Next, we show that DSW is a well-defined metric on the probability space.
|
| 86 |
+
|
| 87 |
+
Theorem 1. For any $p \geq 1$ and admissible $C > 0$ , $D S W _ { p } ( \cdot , \cdot ; C )$ is a well-defined metric in the space of Borel probability measures with finite $p$ -th moment. In particular, it is non-negative, symmetric, identity, and satisfies the triangle inequality.
|
| 88 |
+
|
| 89 |
+
The proof of Theorem 1 is in Appendix A.1. Our next result establishes the topological equivalence between DSW distance and (max)-sliced Wasserstein and Wasserstein distances.
|
| 90 |
+
|
| 91 |
+
Theorem 2. For any $p \geq 1$ and admissible $C > 0 ;$ , the following holds
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
D S W _ { p } ( \mu , \nu ; C ) \leq m a x S W _ { p } ( \mu , \nu ) \leq W _ { p } ( \mu , \nu ) .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
(b) If $C \geq 1 / d ,$ , we have $\begin{array} { r } { D S W _ { p } ( \mu , \nu ; C ) \geq \left( \frac { 1 } { d } \right) ^ { 1 / p } m a x { S W _ { p } ( \mu , \nu ) } \geq \left( \frac { 1 } { d } \right) ^ { 1 / p } S W _ { p } ( \mu , \nu ) . } \end{array}$
|
| 98 |
+
|
| 99 |
+
As a consequence, when $p \geq 1$ and $C \geq 1 / d , D S W _ { p } ( \cdot , \cdot ; C ) , \cdot$ $S W _ { p }$ , max $S W _ { p }$ , and $W _ { p }$ are topologically equivalent, namely, the convergence of probability measures under $D \bar { S } W _ { p } ( \cdot , \cdot ; \mathbf { \bar { C } } )$ implies the convergence of these measures under other metrics and vice versa.
|
| 100 |
+
|
| 101 |
+
The proof of Theorem 2 is in Appendix A.2. As a consequence of Theorem 2, the statistical error of estimating the unknown distribution based on the empirical distribution of $n$ i.i.d data under DSW distance is $C _ { d } \cdot n ^ { - 1 / 2 }$ with high probability where $C _ { d }$ is some universal constant depending on dimension $d$ (see Appendix B.3). Therefore, as other sliced-based Wasserstein distances, the DSW distance does not suffer from the curse of dimensionality.
|
| 102 |
+
|
| 103 |
+
# 3.2 COMPUTATION OF DSW DISTANCE
|
| 104 |
+
|
| 105 |
+
Direct computation of DSW distance is challenging. Hence we consider a dual form of DSW distance and a reparametrization of $\sigma$ as follows.
|
| 106 |
+
|
| 107 |
+
Definition 2. For any $p \geq 1$ and admissible $C > 0$ , there exists a non-negative constant $\lambda _ { C }$ depending on $C$ such that the dual form of DSW distance takes the following form
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r } { { 2 } S W _ { p } ^ { * } ( \mu , \nu ; C ) = \underset { \sigma \in \mathbb { H } } { \operatorname* { s u p } } \left. \left( \mathbb { E } _ { \theta \sim \sigma } \left[ W _ { p } ^ { p } ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) ) \right] \right) ^ { \frac { 1 } { p } } - \lambda _ { C } \mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \left[ | \theta ^ { \top } \theta ^ { \prime } | \right] \right. + \lambda _ { C } C , } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where M denotes the space of all probability measures on the unit sphere $\mathbb { S } ^ { d - 1 }$
|
| 114 |
+
|
| 115 |
+
By the Lagrangian duality theory, $\mathrm { D S W } _ { p } ( \mu , \nu ; C ) \geq \mathrm { D S W } _ { p } ^ { * } ( \mu , \nu ; C )$ for any $p \geq 1$ and admissible $C > 0$ . In Definition 2, the set $\mathbb { M } _ { C }$ disappears and $\lambda _ { C }$ plays the tuning role for the regularized term $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ . When $\lambda _ { C }$ is large, $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } ^ { \sim } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ needs to be small, meaning that $C$ is small. When $\lambda _ { C }$ is small, the value of $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ becomes less important, i.e., $C$ is large.
|
| 116 |
+
|
| 117 |
+
For reparametrizing the measure $\sigma$ , we use a pushforward of uniform measure on the unit sphere through some measurable function $f$ . In particular, let $f$ be a Borel measurable function from $\mathbb { S } ^ { d - 1 }$ to ${ \mathbb S } ^ { d - 1 }$ . For any Borel set $A \subset \mathbb { S } ^ { d - \mathrm { \ i } }$ , we define $\sigma ( A ) \stackrel { \circ } { = } \sigma ^ { d - 1 } ( f ^ { - 1 } ( A ) )$ , where $\sigma ^ { d - 1 }$ is the uniform probability measure on $\mathbb { S } ^ { d - 1 }$ . Then for any Borel measurable function $g : { \mathbb { S } } ^ { d - 1 } \mathbb { R }$ , we have $\begin{array} { r } { \int _ { \theta \sim \sigma } g ( \theta ) \dot { d } \sigma ( \theta ) = \int _ { \theta \sim \sigma ^ { d - 1 } } ( g \circ f ) ( \theta ) d \sigma ^ { d - \bar { 1 } } ( \theta ) } \end{array}$ . Therefore, we obtain the equivalent dual form of DSW as follows:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { r l } & { \mathrm { D S W } _ { p } ^ { * } ( \mu , \nu ; C ) = \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \Bigg \{ \Bigg ( \mathbb { E } _ { \theta \sim \sigma ^ { d - 1 } } \big [ W _ { p } ^ { p } \big ( \mathcal { R } I _ { \mu } ( \cdot , f ( \theta ) ) , \mathcal { R } I _ { \nu } ( \cdot , f ( \theta ) ) \big ) \big ] \Bigg ) ^ { 1 / p } } \\ & { \qquad - \lambda _ { C } \mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma ^ { d - 1 } } \Big [ \big | f ( \theta ) ^ { \top } f ( \theta ^ { \prime } ) \big | \Big ] \Bigg \} + \lambda _ { C } C : = \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \mathrm { D S } ( f ) , } \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $\mathcal { F }$ is a class of all Borel measurable functions from $\mathbb { S } ^ { d - 1 }$ to $\mathbb { S } ^ { d - 1 }$ .
|
| 124 |
+
|
| 125 |
+
Finding the optimal $f$ : We parameterize $f$ in the dual form (2) by using a deep neural network with parameter $\phi$ , defined as $f _ { \phi }$ . Then, we estimate the gradient of the objective function $\mathrm { D S } ( f _ { \phi } )$ in equation (2) with respect to $\phi$ and use stochastic gradient ascent algorithm to update $\phi$ . Since there are expectations over uniform distribution in the gradient of $\mathrm { D S } ( f _ { \phi } )$ , we use the Monte Carlo method to approximate these expectations. Note that, we can use the fixed point from the stochastic ascent algorithm to approximate the dual value of DSW in equation (2). A detailed argument for this point is in Appendix B.2. Finally, in generative model applications with DSW being the loss function, we only need to use the gradient of the function $\mathrm { D S } ( . )$ to update the parameters of interest. Therefore, we can treat $\lambda _ { C }$ as a regularized parameter and tune it to find suitable value in these applications.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 1: Empirical behavior of optimal measure $\sigma$ , approximated by 1000 samples, on a circle for different values of $\lambda _ { C }$ (the constant in the dual form of DSW in Definition 2) when $\mu$ and $\nu$ are bivariate Gaussian distributions sharing the same eigenvectors. When $\lambda _ { C } = 0$ , $C = 1$ . When $\lambda _ { C }$ increases, $C$ becomes small.
|
| 129 |
+
|
| 130 |
+
Illustration of the roles of $\lambda _ { C }$ and $C$ : To illustrate the roles of $\lambda _ { C }$ and $C$ in finding optimal distribution $\sigma$ , we conduct a simple experiment on two Gaussian distributions with zero means and covariance matrices given by $\left( \begin{array} { l l } { 2 } & { 0 } \\ { 0 } & { 2 } \end{array} \right)$ and $\left( \begin{array} { l l } { 5 } & { 0 } \\ { 0 } & { 1 } \end{array} \right)$ . The experiment optimizes the empirical form of Definition 2 with different choices of $\lambda _ { C }$ . The results are shown in Figure 1 with the reported value of $\lambda _ { C }$ and $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ . For $\lambda _ { C } = 0$ , the obtained distribution concentrates only on one direction. When $\lambda _ { C } = 5 0$ , optimal $\sigma$ distributes more weights to other directions on the circle. When $\lambda _ { C } = 1 0 0 0$ , optimal $\sigma$ is close to the discrete distribution concentrated on two eigenvectors of the covariance matrices, which are the main directions differentiating the two Gaussian distributions.
|
| 131 |
+
|
| 132 |
+
Extension of DSW and comparison of DSW to Max-GSW-NN: Similar to SW, we extend DSW to distributional generalized sliced Wasserstein (DGSW) by using the non-linear projecting operator via GRT. The definition of the DGSW and its properties are in Appendix C. Finally, in Appendix E.1, we show the distinction of the DSW to Max-GSW-NN (Kolouri et al., 2019) when the neural network defining function in Max-GSW-NN is $g ( x , \theta ) = \langle x , f ( \theta ) \rangle$ where $f : \mathbb { S } ^ { d - 1 } \to \mathbb { S } ^ { d - 1 }$ .
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
In this section, we conduct extensive experiments comparing the performance in both generative quality and computational speed of the proposed DSW distance with other sliced-based distances, namely the SW, Max-SW, Max-GSW-NN (Kolouri et al., 2019) and projected robust subspace Wasserstein (PRW) (Paty & Cuturi, 2019; Lin et al., 2020) using the minimum expected distance estimator (MEDE) (Bernton et al., 2019) on MNIST (LeCun et al., 1998), CIFAR10 (Krizhevsky, 2009), CelebA (Liu et al., 2015) and LSUN (Yu et al., 2015) datasets. The details of the MEDE framework are described in Appendix D. We would like to note that the wall-clock timing of different methods may be subject to the differences in the hyperparameter settings and software implementations of different methods. On MNIST dataset, we train generative models with different distances and then evaluate their performances by comparing Wasserstein-2 distances between 10000 random generated images and all images from the MNIST test set. Due to the very large size of other datasets, e.g., 3 million images in LSUN, it is expensive to compute empirical Wasserstein-2 distance as its complexity is of order ${ \mathcal { O } } ( k ^ { 2 } \log k )$ where $k$ is the number of support points. Therefore, after we train generative models, we use FID score (Heusel et al., 2017) to evaluate the generative quality of these generators. The FID score is calculated from 10000 random generated images and all training samples using precomputed statistics in (Heusel et al., 2017). Finally, for $\lambda _ { C }$ in DSW (see Definition 2), it is chosen in the set $\{ 1 , 1 0 , 1 0 0 , 1 0 0 0 \}$ such that its Wasserstein-2 (FID score) (between 10000 random generated images and all images from corresponding validation set) is the lowest among the four values. Detailed experiment settings are in Appendix G. Finally, we also apply the DSW into color transfer task (Rabin et al., 2010; 2014; Bonneel et al., 2015; Perrot et al., 2016) in Appendix F, where we find that DSW also performs better than SW and Max-SW in this task.
|
| 137 |
+
|
| 138 |
+
# 4.1 RESULTS ON MNIST
|
| 139 |
+
|
| 140 |
+
Generative quality and computational speed: We report the performance of the learned generative models for MNIST in Figure 2(a). To plot this figure, we vary the number of projections $N \in$ $\{ 1 , 1 0 , 1 0 ^ { 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } \}$ for the SW, and $N \in \{ 1 , 1 0 , 1 0 ^ { 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } \}$ for the DSW. Then we measure the computational time per minibatch and the Wasserstein-2 score of the learned generators for each $N$ . We plot the Wasserstein-2 score and computational time of Max-SW and Max-GSW-NN in their standard settings (Kolouri et al., 2019). Except for the regime with very fast but low-quality learned models, DSW is better than all the existing slice-based baselines in terms of both model quality and computational speed. Moreover, DSW can learn good models with very few projections, e.g., DSW-10 achieves better model quality than Max-GSW-NN and Max-SW and is one order-of-magnitude faster than these sliced distances. Finally, with a similar computational time, a learned generator by DSW has the Wasserstein-2 score that is roughly $1 0 \%$ lower than the one got from SW. For the qualitative comparison between these distances, we show random generated images from their generative models in Figure 7 in Appendix E.1. We observe that generated images from DSW are sharper and easier to classify into numbers than those from other baseline distances.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 2: (a) Comparison between DSW, SW, Max-SW, Max-GSW-NN, PRW and WD based on execution time and performance. Here, each dot of SW and DSW corresponds to the number of projections chosen in $\{ 1 , 1 0 , 1 0 ^ { \cdot 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } \}$ . Each dot of PRW corresponds to the dimension of the subspace chosen in $\{ 2 , 5 , 1 0 , 5 0 \}$ ; (b) Comparison between SW, DSW, Max-SW and Max-GSW-NN based on Wasserstein-2 distance between distributions of learned model and test set over iterations; (c) Computation speed of distances based on the number of minibatch’s samples (log-log scale); (d) Effect of $\lambda _ { C }$ on the mean of absolute values of pairwise cosine similarity between 10 random directions from the found distribution $\sigma$ of DSW.
|
| 144 |
+
|
| 145 |
+
Comparison with projected robust subspace Wasserstein (PRW) and Wasserstein distance: In Figure 2(a), we plot the Wasserstein-2 score and computational time of Wasserstein distance (WD) and PRW, where the subspace dimension of PRW varies in the range $\{ 2 , 5 , 1 0 , 5 0 \}$ . PRW is able to improve upon the model quality of slice-based methods including DSW, however at the cost of being an order of magnitude slower than DSW with 10 projections (DSW-10). We observe that DSW-10 obtains a better Wasserstein-2 score than PRW with 5-dimensional subspace, while its corresponding computational time is 30 times faster than that of PRW-5. Using 50 dimension, PRW’s Wasserstein-2 score improves about $2 9 \%$ to that of DSW-10 but the computational cost is also around 40 times slower. The model trained by WD gives good Wasserstein-2 score; however, it is computational expensive (about 40 times slower than DSW-10). The main computational advantage of DSW comes from the exact calculation of Wasserstein distance in one-dimension. The visual comparison between PRW, WD and DSW based on their generated images is in Figure 12 in Appendix E.2.
|
| 146 |
+
|
| 147 |
+
Convergence behavior: Figure 2(b) shows that DSW learns better models at a faster speed of convergence than other baseline distances with a very small number of projections, e.g., DSW-10 is the second lowest curve compared to curves from other sliced-based distances.
|
| 148 |
+
|
| 149 |
+
Scalability over sample size of minibatch: Results in Figure 2(c) show that DSW has a computational complexity of the order ${ \mathcal { O } } ( k \log k )$ , which is similar to those of other sliced-based distances, where $k$ is the number of samples per batch.
|
| 150 |
+
|
| 151 |
+
Effect of the reguloptimal distribution ization paraof DSW with $\lambda _ { C }$ : For each value of projections, and the $\lambda _ { C } \in \{ 1 , 1 0 , 1 0 0 , 1 0 0 0 \}$ $\sigma$ $N = 1 0$ $\begin{array} { r } { A _ { N } = \frac { 1 } { N ^ { 2 } } \sum _ { i , j = 1 } ^ { N } | \boldsymbol { \theta } _ { i } ^ { \top } \boldsymbol { \theta } _ { j } | } \end{array}$ an approximation of the regularized term $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \left[ \left| \theta ^ { \top } \theta ^ { \prime } \right| \right]$ in the dual form of DSW in equation (2), where $\{ \theta _ { i } \} _ { i = 1 } ^ { N } \sim \sigma$ . The results are shown in Figure 2(d). We observe that when $\lambda _ { C }$ increases, $A _ { N }$ goes down. When $\lambda _ { C } = 0$ , i.e., no regularization, $A _ { N }$ gets close to 1, meaning that all projected directions collapse to one direction. When $\lambda _ { C } = 1 0 0 0$ , $A _ { N }$ is close to 0.1, suggesting that all projected directions are nearly orthogonal.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Comparison between DSW, SW, Max-SW and Max-GSW-NN in terms of execution time and performance. Here, each dot of SW and DSW corresponds to the number of projections chosen in $\{ 1 0 ^ { 2 } , 5 \times$ $\mathrm { \dot { 1 } 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } } \}$ . We set the minibatch size be 512 on CelebA and CIFAR, and be 4096 on LSUN.
|
| 155 |
+
|
| 156 |
+
Additional experiments: We also investigate how the number of gradient-steps used for updating distribution of directions $\sigma$ , and how the size of minibatches affects the quality of DSW (see Appendix E.1). The results show that an increasing number of gradient steps to update $\sigma$ leads to better performance of DSW but also slows down the computation speed. Furthermore, we carry out experiments with DGSW, an extension of DSW to non-linear projections, and test the new proposed distances in training encoder-generator models on MNIST using joint contrastive inference (JCI) in Appendices E.1 and E.3. The description of these models is in Appendix D.
|
| 157 |
+
|
| 158 |
+
# 4.2 RESULTS ON LARGE-SCALE DATASETS
|
| 159 |
+
|
| 160 |
+
Next, we conduct large-scale experiments on a range of more realistic image datasets. We train generative models using CIFAR10, CelebA, and LSUN datasets (all these datasets are rescaled to $6 4 \mathrm { x } 6 4$ resolution). When working with high dimensional distributions, Deshpande et al. (2018) proposed a trick to improve the quality of the generator by learning a feature function which maps data to a new feature space that is more manageable in size. When the feature function is fixed, the generator is trained to match the distribution of features. When the generator is fixed, the feature function tries to tease apart the data empirical features from the generated feature distribution. For the experiments in this section, we use the same technique with DSW and all other baseline distances.
|
| 161 |
+
|
| 162 |
+
We compare DSW with SW, Max-SW, and Max-GSW-NN in both generative quality (FID score) and computational time in Figure 3. We could not compare DSW with PRW on the large-scale datasets since PRW is computationally expensive to train to obtain good generated images. On CelebA and CIFAR10, we let $N$ , the number of projections of both DSW and SW, vary in the set $\{ 1 0 ^ { 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } \}$ . For LSUN, since it takes considerably longer time to train each model, we only vary $N$ in the set $\{ 1 0 ^ { 2 } , 1 0 ^ { 4 } \}$ . On all these large datasets, DSW outperforms all the other baselines in both FID score of the learned model and computational efficiency. The gap of FID scores between DSW and other methods is especially large on CIFAR10 and LSUN. For example, on CIFAR10, with the same computational time, FID scores of DSW are always lower than those of SW about 20 units. On LSUN, with 100 projections, DSW can achieve an FID score of 46 while SW with 10000 projections still has a worse FID score of over 60. It is interesting to note that on these high-dimensional datasets, Max-SW performs rather poorly: it obtains the highest FID scores among all distances while requires heavy computation. Max-GSW-NN has better FID scores than (Max)-SW; however, it is still worse than DSW and while being slower. This is consistent with the intuition that as the number of dimension of the data grows, the use of a single important slice in Max-SW becomes a less efficient approximation. DSW, on the other hand, is able to make use of more important slices, and at the same time avoids SW’s inefficiency of uniform slice-sampling.
|
| 163 |
+
|
| 164 |
+
Generated images from CelebA, CIFAR10 and LSUN are deferred to Appendix E.1. Comparing to other sliced-based Wasserstein distances, generated samples obtained from the DSW’s generative model are also more visually realistic. Further experiments to compare DGSW with GSW, Max-GSW, and Max-GSW-NN are also given in the Appendix E.1. Based on these experiments, we can conclude that the distributional approach also improves the generative quality of non-linear slicing distances.
|
| 165 |
+
|
| 166 |
+
# 5 CONCLUSION
|
| 167 |
+
|
| 168 |
+
In this paper, we have presented the novel distributional sliced-Wasserstein (DSW) distances between two probability measures. Our main idea is to search for the best distribution of important directions while regularizing towards orthogonal directions. We prove that they are well-defined metrics and provide their theoretical and computational properties. We compare our proposed distances to other sliced-based distances in a variety of generative modeling tasks, including estimating generative models and jointly estimating both generators and inference models. Extensive experiments demonstrate that our new distances yield significantly better models and convergence behaviors during training than the previous sliced-based distances. One important future direction is to investigate theoretically the optimal choice of the regularization parameter $\lambda _ { C }$ such that the DSW distance can capture all the important directions that can distinguish two target probability measures well.
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Jason Altschuler, Jonathan Niles-Weed, and Philippe Rigollet. Near-linear time approximation algorithms for optimal transport via Sinkhorn iteration. In Advances in neural information processing systems, pp. 1964–1974, 2017.
|
| 173 |
+
|
| 174 |
+
Luca Ambrogioni, Umut Güçlü, Yagmur Güçlütürk, Max Hinne, Marcel AJ van Gerven, and Eric ˘ Maris. Wasserstein variational inference. In Advances in Neural Information Processing Systems, pp. 2473–2482, 2018.
|
| 175 |
+
|
| 176 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International Conference on Machine Learning, pp. 214–223, 2017.
|
| 177 |
+
|
| 178 |
+
Erhan Bayraktar and Gaoyue Guo. Strong equivalence between metrics of Wasserstein type. arXiv preprint arXiv:1912.08247, 2019.
|
| 179 |
+
|
| 180 |
+
Espen Bernton, Pierre E Jacob, Mathieu Gerber, and Christian P Robert. On parameter estimation with the Wasserstein distance. Information and Inference: A Journal of the IMA, 8(4):657–676, 2019.
|
| 181 |
+
|
| 182 |
+
Gregory Beylkin. The inversion problem and applications of the generalized Radon transform. Communications on pure and applied mathematics, 37(5):579–599, 1984.
|
| 183 |
+
|
| 184 |
+
Nicolas Bonneel and David Coeurjolly. Spot: sliced partial optimal transport. ACM Transactions on Graphics (TOG), 38(4):1–13, 2019.
|
| 185 |
+
|
| 186 |
+
Nicolas Bonneel, Julien Rabin, Gabriel Peyré, and Hanspeter Pfister. Sliced and Radon Wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision, 1(51):22–45, 2015.
|
| 187 |
+
|
| 188 |
+
Nicolas Bonnotte. Unidimensional and evolution methods for optimal transportation. PhD thesis, Paris 11, 2013.
|
| 189 |
+
|
| 190 |
+
Charlotte Bunne, David Alvarez-Melis, Andreas Krause, and Stefanie Jegelka. Learning generative models across incomparable spaces. In International Conference on Machine Learning, 2019.
|
| 191 |
+
|
| 192 |
+
Xiongjie Chen, Yongxin Yang, and Yunpeng Li. Augmented sliced Wasserstein distances. arXiv preprint arXiv:2006.08812, 2020.
|
| 193 |
+
|
| 194 |
+
Lenaic Chizat, Gabriel Peyré, Bernhard Schmitzer, and François-Xavier Vialard. Scaling algorithms for unbalanced optimal transport problems. Mathematics of Computation, 87(314):2563–2609, 2018.
|
| 195 |
+
|
| 196 |
+
Nicolas Courty, Rémi Flamary, and Devis Tuia. Domain adaptation with regularized optimal transport. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 274–289. Springer, 2014.
|
| 197 |
+
|
| 198 |
+
Nicolas Courty, Rémi Flamary, Amaury Habrard, and Alain Rakotomamonjy. Joint distribution optimal transportation for domain adaptation. In Advances in Neural Information Processing Systems, pp. 3730–3739, 2017.
|
| 199 |
+
|
| 200 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pp. 2292–2300, 2013.
|
| 201 |
+
|
| 202 |
+
Ishan Deshpande, Ziyu Zhang, and Alexander G Schwing. Generative modeling using the sliced Wasserstein distance. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3483–3491, 2018.
|
| 203 |
+
|
| 204 |
+
Ishan Deshpande, Yuan-Ting Hu, Ruoyu Sun, Ayis Pyrros, Nasir Siddiqui, Sanmi Koyejo, Zhizhen Zhao, David Forsyth, and Alexander G Schwing. Max-sliced Wasserstein distance and its use for GANs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 10648–10656, 2019.
|
| 205 |
+
|
| 206 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
|
| 207 |
+
|
| 208 |
+
R’emi Flamary and Nicolas Courty. Pot python optimal transport library, 2017. URL https: //pythonot.github.io/.
|
| 209 |
+
|
| 210 |
+
Aude Genevay, Gabriel Peyre, and Marco Cuturi. Learning generative models with Sinkhorn divergences. In International Conference on Artificial Intelligence and Statistics, pp. 1608–1617, 2018.
|
| 211 |
+
|
| 212 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein Gans. In Advances in neural information processing systems, pp. 5767–5777, 2017.
|
| 213 |
+
|
| 214 |
+
Sigurdur Helgason. Integral geometry and Radon transforms. Springer Science & Business Media, 2010.
|
| 215 |
+
|
| 216 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
|
| 217 |
+
|
| 218 |
+
Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 219 |
+
|
| 220 |
+
Philip A Knight. The Sinkhorn–Knopp algorithm: convergence and applications. SIAM Journal on Matrix Analysis and Applications, 30(1):261–275, 2008.
|
| 221 |
+
|
| 222 |
+
Max Kochurov, Rasul Karimov, and Serge Kozlukov. Geoopt: Riemannian optimization in pytorch, 2020.
|
| 223 |
+
|
| 224 |
+
Soheil Kolouri, Phillip E Pope, Charles E Martin, and Gustavo K Rohde. Sliced Wasserstein auto-encoders. In International Conference on Learning Representations, 2018.
|
| 225 |
+
|
| 226 |
+
Soheil Kolouri, Kimia Nadjahi, Umut Simsekli, Roland Badeau, and Gustavo Rohde. Generalized sliced Wasserstein distances. In Advances in Neural Information Processing Systems, pp. 261–272, 2019.
|
| 227 |
+
|
| 228 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
Bing Li, Shaoli Wang, et al. On directional regression for dimension reduction. Journal of the American Statistical Association, 102:997–1008, 2007.
|
| 233 |
+
|
| 234 |
+
Ker-Chau Li. Sliced inverse regression for dimension reduction. Journal of the American Statistical Association, 86(414):316–328, 1991.
|
| 235 |
+
|
| 236 |
+
Tianyi Lin, Nhat Ho, and Michael Jordan. On efficient optimal transport: An analysis of greedy and accelerated mirror descent algorithms. In International Conference on Machine Learning, pp. 3982–3991, 2019a.
|
| 237 |
+
|
| 238 |
+
Tianyi Lin, Nhat Ho, and Michael I Jordan. On the acceleration of the Sinkhorn and Greenkhorn algorithms for optimal transport. arXiv preprint arXiv:1906.01437, 2019b.
|
| 239 |
+
|
| 240 |
+
Tianyi Lin, Chenyou Fan, Nhat Ho, Marco Cuturi, and Michael I. Jordan. Projection robust Wasserstein distance and Riemannian optimization. arXiv preprint arXiv:2006.07458, 2020.
|
| 241 |
+
|
| 242 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
|
| 243 |
+
|
| 244 |
+
Antoine Liutkus, Umut Simsekli, Szymon Majewski, Alain Durmus, and Fabian-Robert Stöter. Sliced-Wasserstein flows: Nonparametric generative modeling via optimal transport and diffusions. In International Conference on Machine Learning, pp. 4104–4113, 2019.
|
| 245 |
+
|
| 246 |
+
Cheng Meng, Yuan Ke, Jingyi Zhang, Mengrui Zhang, Wenxuan Zhong, and Ping Ma. Large-scale optimal transport map estimation using projection pursuit. In Advances in Neural Information Processing Systems, pp. 8118–8129, 2019.
|
| 247 |
+
|
| 248 |
+
Boris Muzellec and Marco Cuturi. Subspace detours: Building transport plans that are optimal on subspace projections. In Advances in Neural Information Processing Systems, pp. 6917–6928, 2019.
|
| 249 |
+
|
| 250 |
+
Kimia Nadjahi, Alain Durmus, Umut Simsekli, and Roland Badeau. Asymptotic guarantees for learning generative models with the sliced-Wasserstein distance. In Advances in Neural Information Processing Systems, pp. 250–260, 2019.
|
| 251 |
+
|
| 252 |
+
François-Pierre Paty and Marco Cuturi. Subspace robust Wasserstein distances. In International Conference on Machine Learning, pp. 5072–5081, 2019.
|
| 253 |
+
|
| 254 |
+
Michaël Perrot, Nicolas Courty, Rémi Flamary, and Amaury Habrard. Mapping estimation for discrete optimal transport. Advances in Neural Information Processing Systems, 29:4197–4205, 2016.
|
| 255 |
+
|
| 256 |
+
Gabriel Peyré and Marco Cuturi. Computational optimal transport. Foundations and Trends® in Machine Learning, 11(5-6):355–607, 2019.
|
| 257 |
+
|
| 258 |
+
Julien Rabin, Julie Delon, and Yann Gousseau. Regularization of transportation maps for color and contrast transfer. In 2010 IEEE International Conference on Image Processing, pp. 1933–1936. IEEE, 2010.
|
| 259 |
+
|
| 260 |
+
Julien Rabin, Sira Ferradans, and Nicolas Papadakis. Adaptive color transfer with relaxed optimal transport. In 2014 IEEE International Conference on Image Processing (ICIP), pp. 4852–4856. IEEE, 2014.
|
| 261 |
+
|
| 262 |
+
Erik Reinhard, Michael Adhikhmin, Bruce Gooch, and Peter Shirley. Color transfer between images. IEEE Computer graphics and applications, 21(5):34–41, 2001.
|
| 263 |
+
|
| 264 |
+
Mark Rowland, Jiri Hron, Yunhao Tang, Krzysztof Choromanski, Tamas Sarlos, and Adrian Weller. Orthogonal estimation of Wasserstein distances. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 186–195, 2019.
|
| 265 |
+
|
| 266 |
+
Bernhard Schmitzer. Stabilized sparse scaling algorithms for entropy regularized transport problems. SIAM Journal on Scientific Computing, 41(3):A1443–A1481, 2019.
|
| 267 |
+
|
| 268 |
+
Richard Sinkhorn. Diagonal equivalence to matrices with prescribed row and column sums. The American Mathematical Monthly, 74(4):402–405, 1967.
|
| 269 |
+
|
| 270 |
+
Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein auto-encoders. In International Conference on Learning Representations, 2018.
|
| 271 |
+
|
| 272 |
+
Cédric Villani. Optimal transport: Old and New. Springer, 2008.
|
| 273 |
+
|
| 274 |
+
Martin J Wainwright. High-dimensional statistics: A non-asymptotic viewpoint. Cambridge University Press, 2019.
|
| 275 |
+
|
| 276 |
+
Jiqing Wu, Zhiwu Huang, Dinesh Acharya, Wen Li, Janine Thoma, Danda Pani Paudel, and Luc Van Gool. Sliced Wasserstein generative models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3713–3722, 2019.
|
| 277 |
+
|
| 278 |
+
Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a largescale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
|
md/train/QZpx42n0BWr/QZpx42n0BWr.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FINE Samples for Learning with Noisy Labels
|
| 2 |
+
|
| 3 |
+
Taehyeon Kim ∗
|
| 4 |
+
KAIST AI
|
| 5 |
+
KAIST
|
| 6 |
+
Daejeon, South Korea
|
| 7 |
+
potter32@kaist.ac.kr
|
| 8 |
+
Jongwoo Ko ∗
|
| 9 |
+
KAIST AI
|
| 10 |
+
KAIST
|
| 11 |
+
Daejeon, South Korea
|
| 12 |
+
jongwoo.ko@kaist.ac.kr
|
| 13 |
+
Sangwook Cho
|
| 14 |
+
KAIST AI
|
| 15 |
+
KAIST
|
| 16 |
+
Daejeon, South Korea
|
| 17 |
+
sangwookcho@kaist.ac.kr
|
| 18 |
+
Jinhwan Choi
|
| 19 |
+
KAIST AI
|
| 20 |
+
KAIST
|
| 21 |
+
Daejeon, South Korea
|
| 22 |
+
jinhwanchoi@kaist.ac.kr
|
| 23 |
+
Se-Young Yun
|
| 24 |
+
KAIST AI
|
| 25 |
+
KAIST
|
| 26 |
+
Daejeon, South Korea
|
| 27 |
+
yunseyoung@kaist.ac.kr
|
| 28 |
+
|
| 29 |
+
# Abstract
|
| 30 |
+
|
| 31 |
+
Modern deep neural networks (DNNs) become weak when the datasets contain noisy (incorrect) class labels. Robust techniques in the presence of noisy labels can be categorized into two types: developing noise-robust functions or using noisecleansing methods by detecting the noisy data. Recently, noise-cleansing methods have been considered as the most competitive noisy-label learning algorithms. Despite their success, their noisy label detectors are often based on heuristics more than a theory, requiring a robust classifier to predict the noisy data with loss values. In this paper, we propose a novel detector for filtering label noise. Unlike most existing methods, we focus on each data point’s latent representation dynamics and measure the alignment between the latent distribution and each representation using the eigen decomposition of the data gram matrix. Our framework, coined as filtering noisy instances via their eigenvectors (FINE), provides a robust detector using derivative-free simple methods with theoretical guarantees. Under our framework, we propose three applications of the FINE: sample-selection approach, semi-supervised learning (SSL) approach, and collaboration with noiserobust loss functions. Experimental results show that the proposed methods consistently outperform corresponding baselines for all three applications on various benchmark datasets 1.
|
| 32 |
+
|
| 33 |
+
# 1 Introduction
|
| 34 |
+
|
| 35 |
+
Deep neural networks (DNNs) have achieved remarkable success in numerous tasks as the amount of accessible data has dramatically increased [21, 15]. On the other hand, accumulated datasets are typically labeled by a human, a labor-intensive job or through web crawling [48] so that they may be easily corrupted (label noise) in real-world situations. Recent studies have shown that deep neural networks have the capacity to memorize essentially any labeling of the data [49]. Even a small amount of such noisy data can hinder the generalization of DNNs owing to their strong memorization of noisy labels [49, 29]. Hence, it becomes crucial to train DNNs that are robust to corrupted labels. As label noise problems may appear anywhere, such robustness increases reliability in many applications such as the e-commerce market [9], medical fields [45], on-device AI [46], and autonomous driving systems [11].
|
| 36 |
+
|
| 37 |
+
To improve the robustness against noisy data, the methods for learning with noisy labels (LNL) have been evolving in two main directions [18]: (1) designing noise-robust objective functions or regularizations and (2) detecting and cleansing the noisy data. In general, the former noise-robust direction uses explicit regularization techniques [6, 52, 50] or robust loss functions [38, 13, 40, 51], but their performance is far from state-of-the-art [49, 26] on datasets with severe noise rates. Recently, researchers have designed noise-cleansing algorithms focused on segregating the clean data (i.e., samples with uncorrupted labels) from the corrupted data [19, 14, 47, 18, 32, 42]. One of the popular criteria for the segregation process is the loss value between the prediction of the noisy classifier and its noisy label, where it is generally assumed that the noisy data have a large loss [19, 14, 47, 18] or the magnitude of the gradient during training [51, 40]. However, these methods may still be biased by the corrupted linear classifier towards label noise because their criterion (e.g., loss values or weight gradient) uses the posterior information of such a linear classifier [24]. Maennel et al. [31] analytically showed that the principal components of the weights of a neural network align with the randomly labeled data; this phenomenon can yield more negative effects on the classifier as the number of randomly labeled classes increases. Recently, Wu et al. [42] used an inherent geometric structure induced by nearest neighbors (NN) in latent space and filtered out isolated data in such topology, and its quality was sensitive to its hyperparameters regarding NN clustering in the presence of severe noise rates.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Illustration of (a) basic concept of this work and (b) proposed detection framework, FINE. Noise-cleansing learning generally separates clean data from the original dataset by using prediction outputs. We propose a novel derivative-free detector based on an unsupervised clustering algorithm on the high-order topological space. FINE measures the alignment of pre-logits (i.e., penultimate layer representation vectors) toward the class-representative vector that is extracted through the eigen decomposition of the gram matrix of data representations.
|
| 41 |
+
|
| 42 |
+
To mitigate such issues for label noise detectors, we provide a novel yet simple detector framework, filtering noisy labels via their eigenvectors (FINE) with theoretical guarantees to provide a high-quality splitting of clean and corrupted examples (without the need to estimate noise rates). Instead of using the neural network’s linear classifier, FINE utilizes the principal components of latent representations made by eigen decomposition which is one of the most widely used unsupervised learning algorithms and separates clean data and noisy data by these components (Figure 1a). To motivate our approach, as Figure 1b shows, we find that the clean data (blue points) are mainly aligned on the principal component (black dotted line), whereas the noisy data (orange points) are not; thus, the dataset is well clustered with the alignment of representations toward the principal component by fitting them into Gaussian mixture models (GMM). We apply our framework to various LNL methods: the sample selection approach, a semi-supervised learning (SSL) approach, and collaboration with noise-robust loss functions. The key contributions of this work are summarized as follows:
|
| 43 |
+
|
| 44 |
+
• We propose a novel framework, termed FINE (filtering noisy labels via their eigenvectors), for detecting clean instances from noisy datasets. FINE makes robust decision boundary for the high-order topological information of data in latent space by using eigen decomposition of their gram matrix.
|
| 45 |
+
• We provide provable evidence that FINE allows a meaningful decision boundary made by eigenvectors in latent space. We support our theoretical analysis with various experimental results regarding the characteristics of the principal components extracted by our FINE detector.
|
| 46 |
+
• We develop a simple sample-selection method by replacing the existing detector method with FINE. We empirically validate that a sample-selection learning with FINE provides consistently superior detection quality and higher test accuracy than other existing alternative methods such as the Co-teaching family [14, 47], TopoFilter [42], and CRUST [32].
|
| 47 |
+
|
| 48 |
+
• We experimentally show that our detection framework can be applied in various ways to existing LNL methods and validate that ours consistently improves the generalization in the presence of noisy data: sample-selection approach [14, 47], SSL approach [25], and collaboration with noise-robust loss functions [51, 40, 29].
|
| 49 |
+
|
| 50 |
+
Organization. The remainder of this paper is organized as follows. In Section 2, we discuss the recent literature on LNL solutions and meaningful detectors. In Section 3, we address our motivation for creating a noisy label detector with theoretical insights and provide our main method, filtering the noisy labels via their eigenvectors (FINE). In Section 4, we present the experimental results. Finally, Section 5 concludes the paper.
|
| 51 |
+
|
| 52 |
+
# 2 Related Works
|
| 53 |
+
|
| 54 |
+
Zhang et al. [49] empirically showed that any convolutional neural networks trained using stochastic gradient methods easily fit a random labeling of the training data. To tackle this issue, numerous works have examined the classification task with noisy labels. We do not consider the works that assumed the availability of small subsets of training data with clean labels [17, 36, 39, 53, 3].
|
| 55 |
+
|
| 56 |
+
Noise-Cleansing-based Approaches. Noise-cleansing methods have evolved following the improvement of noisy detectors. Han et al. [14] suggested a noisy detection approach, named coteaching, that utilizes two networks, extracts subsets of instances with small losses from each network, and trains each network with subsets of instances filtered by another network. Yu et al. [47] combined a disagreement training procedure with co-teaching, which only selects instances predicted differently by two networks. Huang et al. [18] provided a simple noise-cleansing framework, training-filtering-training; the empirical efficacy was improved by first finding label errors, then training the model only on data predicted as clean. Recently, new noisy detectors with theoretical support have been developed. Wu et al. [42] proposed a method called TopoFilter that filters noisy data by utilizing the $\mathbf { k }$ -nearest neighborhood algorithm and Euclidean distance between pre-logits. Mirzasoleiman et al. [32] introduced an algorithm that selects subsets of clean instances that provide an approximately low-rank Jacobian matrix and proved that gradient descent applied to the subsets prevents overfitting to noisy labels. Pleiss et al. [34] proposed an area under margin (AUM) statistic that measures the average difference between the logit values of the assigned class and its highest non-assigned class to divide clean and noisy samples. Cheng et. al [8] progressively filtered out corrupted instances using a novel confidence regularization term. The noise-cleansing method was also developed in a semi-supervised learning (SSL) manner. Li et al. [25] modeled the per-sample loss distribution and divide it into a labeled set with clean samples and an unlabeled set with noisy samples, and they leverage the noisy samples through the well-known SSL technique MixMatch [4].
|
| 57 |
+
|
| 58 |
+
Noise-Robust Models. Noise-robust models have been studied in the following directions: robustloss functions, regularizations, and strategies. First, for robust-loss functions, Ghosh et al. [13] showed that the mean absolute error (MAE) might be robust against noisy labels. Zhang & Sabuncu et al. [51] argued that MAE performed poorly with DNNs and proposed a GCE loss function, which can be seen as a generalization of MAE and cross-entropy (CE). Wang et al. [40] introduced the reverse version of the cross-entropy term (RCE) and suggested that the SCE loss function is a weighted sum of the CE and RCE. Some studies have stated that the early-stopped model can prevent the memorization phenomenon for noisy labels [2, 49] and theoretically analyzed it [26]. Based on this hypothesis, Liu et al. [29] proposed an early-learning regularization (ELR) loss function to prohibit memorizing noisy data by leveraging the semi-supervised learning techniques. Xia et al. [43] clarified which neural network parameters cause memorization and proposed a robust training strategy for these parameters. Efforts have been made to develop regularizations on the prediction level by smoothing the one-hot vector [30], using linear interpolation between data instances [50], and distilling the rescaled prediction of other models [20]. However, these works have limitations in terms of performance as the noise rate of the dataset increases.
|
| 59 |
+
|
| 60 |
+
Dataset Resampling. Label-noise detection may be a category of data resampling which is a common technique in the machine learning community that extracts a “helpful” dataset from the distribution of the original dataset to remove the dataset bias. In class-imbalance tasks, numerous studies have conducted over-sampling of minority classes [7, 1] or undersampling the majority classes [5] to balance the amount of data per class. Li & Vasconcelos et al. [27] proposed a resampling procedure to reduce the representation bias of the data by learning a weight distribution that favors difficult instances for a given feature representation. Le Bras et al. [22] suggested an adversarial filteringbased approach to remove spurious artifacts in a dataset. Analogously, in anomaly detection and
|
| 61 |
+
|
| 62 |
+
INPUT : Noisy training data $\mathcal { D }$ , feature extractor $g$ , number of classes $K$ , clean probability threshold $\zeta$ , set of FINE scores for class $k \mathcal { F } _ { k }$
|
| 63 |
+
OUTPUT : Collected clean data $\mathcal { C }$
|
| 64 |
+
1: Initialize $c \gets \emptyset$ , $\hat { \mathcal { D } } \gets \mathcal { D }$ , $\Sigma _ { k } \gets \mathbf { 0 }$ for all $k = 1 , \ldots , K$ $/ { * }$ Update the convariance matrices for all classes $^ { * }$
|
| 65 |
+
2: for $( \boldsymbol { x } _ { i } , \boldsymbol { y } _ { i } ) \in \mathcal { D }$ do
|
| 66 |
+
3: ${ z _ { i } \gets g ( { \pmb x } _ { i } ) }$
|
| 67 |
+
4: Update the gram matrix $\Sigma _ { y _ { i } } \gets \Sigma _ { y _ { i } } + z _ { i } z _ { i } ^ { \top }$
|
| 68 |
+
5: end for $/ { * }$ Generate the principal component with eigen decomposition $^ { * }$
|
| 69 |
+
6: for $k = 1 , \ldots , K$ do
|
| 70 |
+
7: $\mathbf { U } _ { k } , \mathbf { \Lambda } \Lambda _ { k } \gets$ EIGEN DECOMPOSITION OF $\Sigma _ { k }$
|
| 71 |
+
8: $\mathbf { u } _ { k } \gets$ THE FIRST COLUMN OF $\mathbf { U } _ { k }$
|
| 72 |
+
9: end for $/ { * }$ Compute the alignment score and get clean subset $\mathcal { C }$ \*/
|
| 73 |
+
10: for $( \boldsymbol { x } _ { i } , \boldsymbol { y } _ { i } ) \in \mathcal { D }$ do
|
| 74 |
+
11: Compute the FINE score $f _ { i } = \left. \mathbf { u } _ { y _ { i } } , z _ { i } \right. ^ { 2 }$ and $\mathcal { F } _ { y _ { i } } \gets \mathcal { F } _ { y _ { i } } \cup \{ f _ { i } \}$
|
| 75 |
+
12: end for $/ { * }$ Finding the samples whose clean probability is larger than $\zeta$ \*/
|
| 76 |
+
13: ${ \mathcal { C } } \gets { \mathcal { C } } \cup$ GMM $( \mathcal { F } _ { k } , \zeta )$ for all $k = 1 , \ldots , K$
|
| 77 |
+
|
| 78 |
+
out-of-distribution detection problems [16, 28, 23], the malicious data are usually detected by examining the loss value or negative behavior in the feature representation space. While our research is motivated by such previous works, this paper focuses on the noisy image classification task.
|
| 79 |
+
|
| 80 |
+
# 3 Method
|
| 81 |
+
|
| 82 |
+
In this section, we present our detector framework and the theoretical motivation behind using the detector in high-dimensional classification. To segregate the clean data, we utilize the degree of alignment between the representations and the eigenvector of the representations’ gram matrices for all classes, called FINE (FIltering Noisy instnaces via their Eigenvectors). Our algorithm is as follows (Algorithm 1). FINE first creates a gram matrix of the representation in the noisy training dataset for each class and conducts the eigen decomposition for those gram matrices. Then, FINE finds clean and noisy instances using the square of inner product values between the representations and the first eigenvector having the largest eigenvalue. In this manner, we treat the data as clean if aligned onto the first eigenvector, while most of the noisy instances are not. Here, we formally define ‘alignment’ and ‘alignment clusterability’ in Definition 1 and Definition 2, respectively.
|
| 83 |
+
|
| 84 |
+
# Definition 1. (Alignment) $D$
|
| 85 |
+
|
| 86 |
+
Definition 2. (Alignment Clusterability) For all features labeled as class $k$ in dataset $\mathcal { D }$ , let fit a Gaussian Mixture Model (GMM) on their alignment (Definition 1) distribution to divide current samples into a clean set and a noisy set; the set having larger mean value is treated as a clean set, and another one is a noisy set. Then, we say a dataset $\mathcal { D }$ satisfies alignment clusterability if the representation $_ z$ labeled as the same true class belongs to the clean set.
|
| 87 |
+
|
| 88 |
+
As an empirical evaluation, the quality of our detector for noisy data is measured with the $\boldsymbol { F }$ -score, a widely used criterion in noisy label detection, anomaly detection and out-of-distribution detection [8, 16, 28, 23]. We treat the selected clean samples as the positive class and the noisy samples as negative class. The $F _ { \mathrm { \ell } }$ -score is the harmonic mean of the precision and the recall; the precision indicates the fraction of clean samples among all samples that are predicted as clean, and the recall indicates the portion of clean samples that are identified correctly.
|
| 89 |
+
|
| 90 |
+
# 3.1 Alignment Analysis for Noisy Label Detector
|
| 91 |
+
|
| 92 |
+
To design a robust label noise filtering framework, we explore the linear nature of the topological space of feature vectors for data resampling techniques and deal with the classifier contamination due to random labels. Recent studies on the distribution of latent representations in DNNs provide insight regarding how correctly the outlier samples can be filtered with the hidden space’s geometrical information. For instance, in [23, 24], the authors proposed frameworks for novelty detection using the topological information of pre-logit based on the Mahalanobis distance, and, in [42], the authors filtered the noisy data based on the Euclidean distance between pre-logits. Maennel et al. [31] analytically showed that an alignment between the principal components of network parameters and those of data takes place when training with random labels. This finding points out that random labels can corrupt a classifier, and thus building a robust classifier is required.
|
| 93 |
+
|
| 94 |
+
Motivated by these works, we aim to design a novel detector using the principal components of latent features to satisfy Definition 2. However, it is intractable to find the optimal classifier to maximize the separation of alignment clusterability because clean data distribution and noisy data distribution are inaccessible. To handle this issue, we attempt to approximate the clean eigenvector to maximize the alignment values of clean data rather than to maximize the separation; the algorithm utilizes the eigenvector of the data for each class (Figure 2). Below, we provide the upper bound for the perturbation toward the clean data’s eigenvector under simple problem settings with noisy labels referred to in other studies [29, 42]. We first introduce notations. Next, we establish the theoretical evidence that our FINE algorithm approximates the clean data’s eigenvectors under some assumptions for its analytic tractability (Theorem 1). We mainly present the theorem and its interpretation; details of the proofs can be found in the Appendix.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 2: Illustration for the problem settings and Theorem 1. The perturbation (green shade) is the angle between the first eigenvector of clean instances (blue line) and the estimated first eigenvector (green line) which is perturbed by that of noisy instances (orange line). Note that blue and orange points are clean instances and noisy instances, respectively.
|
| 98 |
+
|
| 99 |
+
Notations. Consider a binary classification task. Assume that the data points and labels lie in $\mathcal { X } \times \mathcal { V }$ , where the feature space $\mathcal { X } \subset \mathbb { R } ^ { d }$ and label space $\mathcal { Y } = \{ - 1 , + 1 \}$ . A single data point $_ { \textbf { \em x } }$ and its true label $y$ follow a distribution $( \pmb { x } , y ) \sim P _ { { \pmb { \chi } } \times { \pmb { y } } }$ . Denote by $\tilde { y }$ the observed label (potentially corrupted). Without loss of generality, we focus on the set of data points whose observed label is $\tilde { y } = + 1$ .
|
| 100 |
+
|
| 101 |
+
Let $\mathbf x \subset \mathcal X$ be the finite set of features with clean instances whose true label is $y = + 1$ . Similarly, let $\tilde { \textbf { X } } ( ~ \mathcal { X } ~ $ be the set of noisy instances whose true label is $y = - 1$ . To establish our theorem, we assume the following reasonable conditions referred to other works using linear discriminant analysis (LDA) assumptions [24, 12]:
|
| 102 |
+
|
| 103 |
+
Assumption 1. The feature distribution is comprised of two Gaussians, each identified as a clean cluster and a noisy cluster.
|
| 104 |
+
|
| 105 |
+
Assumption 2. The features of all instances with $y = + 1$ are aligned on the unit vector v with the white noise, i.e., $\mathbb { E } _ { \pmb { x } \in \mathbf { X } } \left[ \pmb { x } \right] = \pmb { v }$ . Similarly, features of all instances with $y = - 1$ are aligned on the unit vector $\pmb { w }$ , i.e., $\mathbb { E } _ { { \pmb x } \in \tilde { \bf X } } \left[ { \pmb x } \right] = { \pmb w }$ .
|
| 106 |
+
|
| 107 |
+
Theorem 1. (Upper bound for the perturbation towards the clean data’s eigenvector v) Let $N _ { + }$ and $N _ { - }$ be the number of clean instances and noisy instances, respectively, and u be the FINE’s eigenvector which is the first column of U from the eigen decomposition of the whole data’s matrix $\pmb { \Sigma }$ . For any $\delta \in ( 0 , 1 )$ , its perturbation towards the v in assumption 2 (i.e., 2-norm for difference of projection matrices; left hand side of Eq. $( l )$ ) holds the following with probability $1 - \delta$ :
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\| \pmb { u } \pmb { u } ^ { \top } - \pmb { v } \pmb { v } ^ { \top } \| _ { 2 } \leq \frac { 3 \tau \cos \theta + \mathcal { O } ( \sigma ^ { 2 } \sqrt { \frac { d + \log ( 4 / \delta ) } { N _ { + } } } ) } { 1 - \tau ( \sin \theta + 3 \cos \theta ) - \mathcal { O } ( \sigma ^ { 2 } \sqrt { \frac { d + \log ( 4 / \delta ) } { N _ { + } } } ) }
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where w is the first eigenvector of noisy instances, $\tau$ is the fraction between noisy and clean instances $( \frac { N _ { - } } { N _ { + } } ) , \theta$ is $\scriptstyle \angle ( w , v )$ , and $\sigma ^ { 2 }$ is a variance of white noise.
|
| 114 |
+
|
| 115 |
+
Theorem 1 states that the upper bound for the perturbation toward $\textbf { { v } }$ are dependent on both the ratio $\tau$ and the angle $\theta$ between $\pmb { w }$ and $\textbf { { v } }$ ; small upper bound can be guaranteed as the number of clean data increases, $\tau$ decreases, and $\theta$ approaches $\frac { \pi } { 2 }$ . We also derive the lower bound for the precision and the recall when using the eigenvector $\textbf { \em u }$ in Appendix. In this theoretical analysis, we can ensure that such lower bound values become larger as $\pmb { v }$ and $\textbf { \em w }$ become orthogonal to each other. To verify these assumptions, we provide various experimental results for the separation of alignment clusterability, the perturbation values, the scalability to the number of samples, the quality of our detector in the application of sample selection approach, and the comparison with an alternative clustering-based estimator [24].
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: (a), (b): Heatmaps of Eq. (2) values on unit circle in random hyperplane. We evaluate this visualization on the ResNet34 model trained with common cross-entropy loss on CIFAR-10 with asymmetric noise $40 \%$ and CIFAR-100 with symmetric noise $80 \%$ , respectively. Colors closer to yellow indicate larger the values; (c): comparison of perturbations of Eq. (1) on CIFAR-10 with symmetric noise $20 \%$ ; (d): comparison of cosine similarity values between FINE’s principal components and approximated principal components using fraction of data on CIFAR-10 with symmetric noise $80 \%$ .
|
| 119 |
+
|
| 120 |
+
Validation for our Estimated Eigenvector. To validate our FINE’s principal components, we first propose a simple visualization scheme based on the following steps: (1) Pick the first eigenvector $( { \pmb u } )$ extracted by FINE algorithm, (2) Generate a random hyperplane spanned by such eigenvector $( { \pmb u } )$ and a random vector, (3) Calculate the value of the following Eq. (2) on any unit vectors $\mathbf { \Pi } ( \mathbf { a } )$ in such hyperplane and plot a heatmap with them:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
{ \frac { 1 } { \left| \mathbf { X } \right| } } \sum _ { \pmb { x } _ { i } \in \mathbf { X } } \left. \pmb { a } , \pmb { x } _ { i } \right. ^ { 2 } - { \frac { 1 } { \left| \tilde { \mathbf { X } } \right| } } \sum _ { \pmb { x } _ { j } \in \tilde { \mathbf { X } } } \left. \pmb { a } , \pmb { x } _ { j } \right. ^ { 2 }
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Eq. (2) is maximized when the unit vector $^ { a }$ not only maximizes the FINE scores of clean data for the first term in Eq. (2), but also minimizes those of noisy data for the second term in Eq. (2). This visualization shows in 2-D how FINE’s first eigenvector $( \pmb { u } )$ optimizes such values in the presence of noisy instances (Figure 3a and 3b). As the figures show, the FINE’s eigenvector $\textbf { \em u }$ (red dotted line) has almost maximum value of Eq. (2). Furthermore, we empirically evaluate the perturbation values in Theorem 1 as the noise rate changes (Figure 3c); FINE has small perturbation values even in a severe noise rate.
|
| 127 |
+
|
| 128 |
+
Scalability to Number of Samples. Despite FINE’s superiority, it may require high computational costs if the whole dataset is used for eigen decomposition. To address this issue, we approximate the eigenvector with a small portion of the dataset and measure the cosine similarity values between the approximated term and the original one $( u )$ (Figure 3d). Interestingly, we verify that far accurate eigenvector is computed even using $1 \%$ data (i.e., a cosine similarity value is 0.99), and thus the eigenvector can be accurately estimated with little computation time.
|
| 129 |
+
|
| 130 |
+
Validation for Dynamics of Sample-selection Approach. We evaluate the F-score dynamics of every training epoch on the symmetric and the asymmetric label noise in Figure 4. We compare FINE with the following sample-selection approaches: Co-teaching [14] and TopoFilter [42]. In Figure 4, during the training process, F-scores of FINE becomes consistently higher on both symmetric noise and asymmetric noise settings, while Co-teaching and TopoFilter achieve lower quality. Unlike TopoFilter and FINE, Co-teaching even performs the sample-selection with the access of noise rate. This evidence show that FINE is also applicable to the naive sample-selection approaches.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 4: Comparisons of F-scores on CIFAR10 and CIFAR100 under symmetric and asymmetric label noise. C10 and C100 denote CIFAR-10 and CIFAR-100, respectively.
|
| 134 |
+
|
| 135 |
+
Comparison for Mahalanobis Distance Estimator Under similar conditions, Lee et al. [24] measured the Mahalanobis distance of pre-logits using the minimum covariance determinant (MCD) estimator and selected clean samples based on this distance. While they also utilized the LDA assumptions on pre-logits, FINE consistently outperforms MCD in both precision and recall, thus yielding better Fscore (Figure 5). The experimental results justify our proposed detector, in comparison with a similar alternative.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: Comparisons of F-scores on CIFAR-10 and CIFAR-100 under symmetric (S) and asymmetric noise (A) settings.
|
| 139 |
+
|
| 140 |
+
# 4 Experiment
|
| 141 |
+
|
| 142 |
+
In this section, we demonstrate the effectiveness of our FINE detector for three applications: sample selection approach, SSL, and collaboration with noise-robust loss functions.
|
| 143 |
+
|
| 144 |
+
# 4.1 Experimental Settings
|
| 145 |
+
|
| 146 |
+
Noisy Benchmark Dataset. Following the previous setups [25, 29], we artificially generate two types of random noisy labels: injecting uniform randomness into a fraction of labels (symmetric) and corrupting a label only to a specific class (asymmetric). For example, we generate noise by mapping TRUCK AUTOMOBILE, BIRD AIRPLANE, DEER $ \mathrm { H O R S E }$ , $\mathbf { C A T } \mathbf { D O G }$ to make asymmetric noise for CIFAR-10. For CIFAR-100, we create 20 five-size super-classes and generate asymmetric noise by changing each class to the next class within super-classes circularly. For a real-world dataset, Clothing1M [44] containing inherent noisy labels is used. This dataset contains 1 million clothing images obtained from online shopping websites with 14 classes2. The dataset provides $5 0 k , 1 4 k$ , and $1 0 k$ verified as clean data for training, validation, and testing. Instead of using the $5 0 k$ clean training data, we use a randomly sampled pseudo-balanced subset as a training set with $1 2 0 k$ images. For evaluation, we compute the classification accuracy on the $1 0 k$ clean dataset.
|
| 147 |
+
|
| 148 |
+
Networks and Hyperparameter Settings. We use the architectures and hyperparameter settings for all baseline experiments following the setup of Liu et al. [29] except with SSL approaches. For SSL approaches, we follow the setup of Li et al. [25]. We set the threshold $\zeta$ as 0.5.
|
| 149 |
+
|
| 150 |
+
# 4.2 Application of FINE
|
| 151 |
+
|
| 152 |
+
# 4.2.1 Sample Selection-Based Approaches
|
| 153 |
+
|
| 154 |
+
We apply our FINE detector for various sample selection algorithms. In detail, after warmup training, at every epoch, FINE selects the clean data with the eigenvectors generated from the gram matrices of data predicted to be clean in the previous round, and then the neural networks are trained with them. We compare our proposed method with the following sample selection approaches: (1) Bootstrap [35], (2) Forward [33], (3) Co-teaching [14]; (4) Co-teaching $^ +$ [47]; (5) TopoFilter [42]; (6) CRUST [32]. We evaluate these algorithms three times and report error bars.
|
| 155 |
+
|
| 156 |
+
Table 1: Test accuracies $( \% )$ on CIFAR-10 and CIFAR-100 under different noisy types and fractions. All comparison methods are reproduced with publicly available code, while the results for Bootstrap [35] and Forward [33] are taken from [29]. For CRUST [32], we experiment without mixup to compare the intrinsic sample selection effect of each method. The average accuracies and standard deviations over three trials are reported. Here, we substitute the sample selection method of Co-teaching [14, 47] with FINE (i.e., F-Co-teaching). The best results sharing the noisy fraction and method are highlighted in bold.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Dataset</td><td colspan="4">CIFAR-10</td><td colspan="4">CIFAR-100</td></tr><tr><td>Noisy Type</td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td><td colspan="2"></td></tr><tr><td>Noise Ratio</td><td>20</td><td>50</td><td>80</td><td>40</td><td>20</td><td>50</td><td>80</td><td>40</td></tr><tr><td>Standard</td><td>87.0 ± 0.1</td><td>78.2 ±0.8</td><td>53.8 ±1.0</td><td>85.0±0.0</td><td>58.7 ±0.3</td><td>42.5± 0.3</td><td>18.1 ± 0.8</td><td>42.7 ± 0.6</td></tr><tr><td>Bootstrap [35]</td><td>86.2 ±0.2</td><td>1</td><td>54.1 ± 1.3</td><td>81.2 ± 1.5</td><td>58.3 ±0.2</td><td>-</td><td>21.6 ± 1.0</td><td>45.1 ± 0.6</td></tr><tr><td>Forward [33]</td><td>88.0±0.4</td><td></td><td>54.6 ± 0.4</td><td>83.6± 0.6</td><td>39.2 ± 2.6</td><td></td><td>9.0±0.6</td><td>34.4 ± 1.9</td></tr><tr><td>Co-teaching[14]</td><td>89.3 ±0.3</td><td>83.3 ±0.6</td><td>66.3 ± 1.5</td><td>88.4±2.8</td><td>63.4 ± 0.0</td><td>49.1 ± 0.4</td><td>20.5 ± 1.3</td><td>47.7 ± 1.2</td></tr><tr><td>Co-teaching+[47]</td><td>89.1 ± 0.5</td><td>84.9 ±0.4</td><td>63.8± 2.3</td><td>86.5 ± 1.2</td><td>59.2 ± 0.4</td><td>47.1 ± 0.3</td><td>20.2 ± 0.9</td><td>44.7 ± 0.6</td></tr><tr><td>TopoFilter[42]</td><td>90.4± 0.2</td><td>86.8 ±0.3</td><td>46.8 ± 1.0</td><td>87.5± 0.4</td><td>66.9 ± 0.4</td><td>53.4 ±1.8</td><td>18.3 ± 1.7</td><td>56.6±0.5</td></tr><tr><td>CRUST[32]</td><td>89.4 ±0.2</td><td>87.0 ± 0.1</td><td>64.8 ± 1.5</td><td>82.4± 0.0</td><td>69.3 ±0.2</td><td>62.3 ± 0.2</td><td>21.7 ± 0.7</td><td>56.1 ± 0.5</td></tr><tr><td>FINE</td><td>91.0 ± 0.1</td><td>87.3 ± 0.2</td><td>69.4 ± 1.1</td><td>89.5 ± 0.1</td><td>70.3 ± 0.2</td><td>64.2 ± 0.5</td><td>25.6 ± 1.2</td><td>61.7 ± 1.0</td></tr><tr><td>F-Coteaching</td><td>92.0 ± 0.1</td><td>87.5 ± 0.1</td><td>74.2 ± 0.8</td><td>90.5 ± 0.2</td><td>71.1 ± 0.2</td><td>64.7 ± 0.3</td><td>31.6 ± 1.0</td><td>64.8 ± 0.7</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 1 summarizes the performances of different sample selection approaches on various noise distribution and datasets. We observe that our FINE method consistently outperforms the competitive methods over the various noise rates. Our FINE methods can filter the clean instances without losing essential information, leading to training the robust network.
|
| 161 |
+
|
| 162 |
+
To go further, we improve the performance of Co-teaching [14] by substituting its sample selection state with our FINE algorithm. To combine FINE and the Co-teaching family, unlike the original methods that utilize the small loss instances to train with clean labels, we train one model with extracted samples by conducting FINE on another model. The results of the experiments are shown in the eighth and ninth rows of Table 1.
|
| 163 |
+
|
| 164 |
+
# 4.2.2 SSL-Based Approaches
|
| 165 |
+
|
| 166 |
+
SSL approaches [25, 10, 41] divide the training data into clean instances as labeled instances and noisy instances as unlabeled instances and use both the labeled and unlabeled samples to train the networks in SSL. Recently, methods belonging to this category have shown the best performance among the various LNL methods, and these methods can train robust networks for even extremely high noise rates. We compare the performances of the existing semi-supervised approaches and that in which the sample selection state of DivideMix [25] is substituted with our FINE algorithm (i.e., F-DivideMix). The results of the experiments are shown in Table 2. We achieve consistently higher performance than DivideMix by utilizing FINE instead of its loss-based filtering method and show comparable performance to the state-of-the-art SSL methods such as DST [41] and LongReMix [10]. Interestingly, as Figure 6 shows, clean and noisy data are well classified in F-DivideMix under extreme noise cases.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 6: Comparisons of F-scores on CIFAR-10 under symmetric $90 \%$ noise. Blue line indicates the error bar of two networks’ F-score used in Dividemix [25], and Orange line indicates those replaced by our FINE detector.
|
| 170 |
+
|
| 171 |
+
# 4.2.3 Collaboration with Noise-Robust Loss Functions
|
| 172 |
+
|
| 173 |
+
The goal of the noise-robust loss function is to achieve a small risk for unseen clean data even when noisy labels exist in the training data. There have been few collaboration studies of the noise-robust loss function methodology and dynamic sample selection. Most studies have selected clean and noisy data based on cross-entropy loss.
|
| 174 |
+
|
| 175 |
+
Here, we state the collaboration effects of FINE with various noise-robust loss functions: generalized cross entropy (GCE) [51], symmetric cross entropy (SCE) [40], and early-learning regularization (ELR) [29]. Figure 7 shows that FINE facilitates generalization in the application of noise-robust loss functions on severe noise rate settings. The detailed results are reported in the Appendix. Unlike other methods, it is still theoretically supported because FINE extracts clean data with a robust classifier using representation.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 7: Test accuracies $( \% )$ on CIFAR-10 and CIFAR-100 under different noisy types and fractions for noise-robust loss approaches. Note that the blue and orange bars are results for without and with FINE, respectively. The average accuracies and standard deviations over three trials are reported.
|
| 179 |
+
|
| 180 |
+
# 4.3 Experiments on Real-World Dataset
|
| 181 |
+
|
| 182 |
+
As Table 3 shows, FINE and F-DivideMix work fairly well on the Clothing 1M dataset compared to other approaches when we reproduce the experimental results under the same settings.
|
| 183 |
+
|
| 184 |
+
Table 2: Comparison of test accuracies $( \% )$ for FINE collaborating with DivideMix and existing semi-supervised approaches on CIFAR-10 and CIFAR-100 under different noisy types and fractions. The results for all comparison methods are taken from their original works.
|
| 185 |
+
Table 3: Test accuracy on Clothing1M dataset
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Method</td><td>Standard</td><td>GCE[51]</td><td>SCE[40]</td><td>ELR [29]</td><td>DivideMix [25]</td><td>CORES² [8]</td><td>FINE</td><td>F-DivideMix</td></tr><tr><td>Accuracy</td><td>68.94</td><td>69.75</td><td>71.02</td><td>72.87</td><td>74.30</td><td>73.24</td><td>72.91</td><td>74.37</td></tr></table>
|
| 188 |
+
|
| 189 |
+
# 5 Conclusion
|
| 190 |
+
|
| 191 |
+
This paper introduces FINE for detecting label noise by designing a robust noise detector. Our main idea is utilizing the principal components of latent representations made by eigen decomposition. Most existing detection methods are dependent on the loss values, while such losses may be biased by corrupted classifier [24, 31]. Our methodology alleviates this issue by extracting key information from representations without using explicit knowledge of the noise rates. We show that the FINE detector has an excellent ability to detect noisy labels in theoretical and experimental results. We propose three applications of the FINE detector: sample-selection approach, SSL approach, and collaboration with noise-robust loss functions. FINE yields strong results on standard benchmarks and a real-world dataset for various LNL approaches.
|
| 192 |
+
|
| 193 |
+
We believe that our work opens the door to detecting samples having noisy labels with explainable results. It is a non-trivial task and of social significance, and thus, our work will have a substantial social impact on DL practitioners because it avoids the a labor-intensive job of checking data label quality. As future work, we hope that our work will trigger interest in the design of new labelnoise detectors and bring a fresh perspective for other data-resampling approaches (e.g., anomaly detection and novelty detection). The development of robustness against label noise even leads to an improvement in the performance of network trained with data collected through web crawling. We believe that our contribution will lower the barriers to entry for developing robust models for DL practitioners and greatly impact the internet industry. On the other hand, we are concerned that it can be exploited to train robust models using data collected illegally and indiscriminately on the dark web (e.g., web crawling), and thus it may raise privacy concerns (e.g., copyright).
|
| 194 |
+
|
| 195 |
+
# Acknowledgments and Disclosure of Funding
|
| 196 |
+
|
| 197 |
+
This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) [No.2019-0-00075, Artificial Intelligence Graduate School Program (KAIST)] and [No. 2021-0-00907, Development of Adaptive and Lightweight Edge-Collaborative Analysis Technology for Enabling Proactively Immediate Response and Rapid Learning]. We thank Seongyoon Kim for discussing about the concept of perturbation.
|
| 198 |
+
|
| 199 |
+
# References
|
| 200 |
+
|
| 201 |
+
[1] Shin Ando and Chun Yuan Huang. Deep over-sampling framework for classifying imbalanced data. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 770–785. Springer, 2017.
|
| 202 |
+
[2] Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In International Conference on Machine Learning, pages 233–242. PMLR, 2017.
|
| 203 |
+
[3] Dara Bahri, Heinrich Jiang, and Maya Gupta. Deep k-nn for noisy labels. In International Conference on Machine Learning, pages 540–550. PMLR, 2020.
|
| 204 |
+
[4] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, pages 5049–5059, 2019.
|
| 205 |
+
[5] 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.
|
| 206 |
+
[6] Kaidi Cao, Yining Chen, Junwei Lu, Nikos Arechiga, Adrien Gaidon, and Tengyu Ma. Heteroskedastic and imbalanced deep learning with adaptive regularization. arXiv preprint arXiv:2006.15766, 2020.
|
| 207 |
+
[7] 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.
|
| 208 |
+
[8] Hao Cheng, Zhaowei Zhu, Xingyu Li, Yifei Gong, Xing Sun, and Yang Liu. Learning with instance-dependent label noise: A sample sieve approach. arXiv preprint arXiv:2010.02347, 2020.
|
| 209 |
+
[9] Charles Corbiere, Hedi Ben-Younes, Alexandre Ramé, and Charles Ollion. Leveraging weakly annotated data for fashion image retrieval and label prediction. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pages 2268–2274, 2017.
|
| 210 |
+
[10] Filipe R Cordeiro, Ragav Sachdeva, Vasileios Belagiannis, Ian Reid, and Gustavo Carneiro. Longremix: Robust learning with high confidence samples in a noisy label environment. arXiv preprint arXiv:2103.04173, 2021.
|
| 211 |
+
[11] Di Feng, Christian Haase-Schutz, Lars Rosenbaum, Heinz Hertlein, Claudius Glaser, Fabian Timm, Werner Wiesbeck, and Klaus Dietmayer. Deep multi-modal object detection and semantic segmentation for autonomous driving: Datasets, methods, and challenges. IEEE Transactions on Intelligent Transportation Systems, 22(3):1341–1360, Mar 2021.
|
| 212 |
+
[12] Ronald A Fisher. The use of multiple measurements in taxonomic problems. Annals of eugenics, 7(2):179–188, 1936.
|
| 213 |
+
[13] Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In AAAI, 2017.
|
| 214 |
+
[14] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in neural information processing systems, pages 8527–8537, 2018.
|
| 215 |
+
[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 216 |
+
[16] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-ofdistribution examples in neural networks. arXiv preprint arXiv:1610.02136, 2016.
|
| 217 |
+
[17] Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. arXiv preprint arXiv:1802.05300, 2018.
|
| 218 |
+
[18] Jinchi Huang, Lie Qu, Rongfei Jia, and Binqiang Zhao. O2u-net: A simple noisy label detection approach for deep neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3326–3334, 2019.
|
| 219 |
+
[19] Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels, 2018.
|
| 220 |
+
[20] Taehyeon Kim, Jaehoon Oh, NakYil Kim, Sangwook Cho, and Se-Young Yun. Comparing kullback-leibler divergence and mean squared error loss in knowledge distillation, 2021.
|
| 221 |
+
[21] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097– 1105, 2012.
|
| 222 |
+
[22] Ronan Le Bras, Swabha Swayamdipta, Chandra Bhagavatula, Rowan Zellers, Matthew Peters, Ashish Sabharwal, and Yejin Choi. Adversarial filters of dataset biases. In International Conference on Machine Learning, pages 1078–1088. PMLR, 2020.
|
| 223 |
+
[23] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, pages 7167–7177, 2018.
|
| 224 |
+
[24] Kimin Lee, Sukmin Yun, Kibok Lee, Honglak Lee, Bo Li, and Jinwoo Shin. Robust inference via generative classifiers for handling noisy labels. In International Conference on Machine Learning, pages 3763–3772. PMLR, 2019.
|
| 225 |
+
[25] Junnan Li, Richard Socher, and Steven C.H. Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In International Conference on Learning Representations, 2020.
|
| 226 |
+
[26] Mingchen Li, Mahdi Soltanolkotabi, and Samet Oymak. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. In International Conference on Artificial Intelligence and Statistics, pages 4313–4324. PMLR, 2020.
|
| 227 |
+
[27] Yi Li and Nuno Vasconcelos. Repair: Removing representation bias by dataset resampling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9572–9581, 2019.
|
| 228 |
+
[28] Shiyu Liang, Yixuan Li, and Rayadurgam Srikant. Enhancing the reliability of out-ofdistribution image detection in neural networks. arXiv preprint arXiv:1706.02690, 2017.
|
| 229 |
+
[29] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. arXiv preprint arXiv:2007.00151, 2020.
|
| 230 |
+
[30] Michal Lukasik, Srinadh Bhojanapalli, Aditya Menon, and Sanjiv Kumar. Does label smoothing mitigate label noise? In International Conference on Machine Learning, pages 6448–6458. PMLR, 2020.
|
| 231 |
+
[31] Hartmut Maennel, Ibrahim Alabdulmohsin, Ilya Tolstikhin, Robert JN Baldock, Olivier Bousquet, Sylvain Gelly, and Daniel Keysers. What do neural networks learn when trained with random labels? arXiv preprint arXiv:2006.10455, 2020.
|
| 232 |
+
[32] Baharan Mirzasoleiman, Kaidi Cao, and Jure Leskovec. Coresets for robust training of neural networks against noisy labels. arXiv preprint arXiv:2011.07451, 2020.
|
| 233 |
+
[33] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1944–1952, 2017.
|
| 234 |
+
[34] Geoff Pleiss, Tianyi Zhang, Ethan R Elenberg, and Kilian Q Weinberger. Identifying mislabeled data using the area under the margin ranking. arXiv preprint arXiv:2001.10528, 2020.
|
| 235 |
+
[35] Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014.
|
| 236 |
+
[36] 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.
|
| 237 |
+
[37] Hwanjun Song, Minseok Kim, Dongmin Park, and Jae-Gil Lee. Prestopping: How does early stopping help generalization against label noise?, 2020.
|
| 238 |
+
[38] Brendan Van Rooyen, Aditya Krishna Menon, and Robert C Williamson. Learning with symmetric label noise: The importance of being unhinged. arXiv preprint arXiv:1505.07634, 2015.
|
| 239 |
+
[39] Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 839–847, 2017.
|
| 240 |
+
[40] Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 322–330, 2019.
|
| 241 |
+
[41] Yi Wei, Xue Mei, Xin Liu, and Pengxiang Xu. Dst: Data selection and joint training for learning with noisy labels. arXiv preprint arXiv:2103.00813, 2021.
|
| 242 |
+
[42] Pengxiang Wu, Songzhu Zheng, Mayank Goswami, Dimitris Metaxas, and Chao Chen. A topological filter for learning with label noise. arXiv preprint arXiv:2012.04835, 2020.
|
| 243 |
+
[43] Xiaobo Xia, Tongliang Liu, Bo Han, Chen Gong, Nannan Wang, Zongyuan Ge, and Yi Chang. Robust early-learning: Hindering the memorization of noisy labels. In International Conference on Learning Representations, 2021.
|
| 244 |
+
[44] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2691–2699, 2015.
|
| 245 |
+
[45] Yilun Xu, Peng Cao, Yuqing Kong, and Yizhou Wang. L_dmi: A novel information-theoretic loss function for training deep nets robust to label noise. In NeurIPS, pages 6222–6233, 2019.
|
| 246 |
+
[46] Seunghan Yang, Hyoungseob Park, Junyoung Byun, and Changick Kim. Robust federated learning with noisy labels, 2020.
|
| 247 |
+
[47] Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor W Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? arXiv preprint arXiv:1901.04215, 2019.
|
| 248 |
+
[48] Xiyu Yu, Tongliang Liu, Mingming Gong, and Dacheng Tao. Learning with biased complementary labels. In Proceedings of the European conference on computer vision (ECCV), pages 68–83, 2018.
|
| 249 |
+
[49] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 250 |
+
[50] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 251 |
+
[51] Zhilu Zhang and Mert R Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. arXiv preprint arXiv:1805.07836, 2018.
|
| 252 |
+
[52] Zizhao Zhang, Han Zhang, Sercan O Arik, Honglak Lee, and Tomas Pfister. Distilling effective supervision from severe label noise. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9294–9303, 2020.
|
| 253 |
+
[53] Zizhao Zhang, Han Zhang, Sercan O. Arik, Honglak Lee, and Tomas Pfister. Distilling effective supervision from severe label noise. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
md/train/Q_64PF6XNut/Q_64PF6XNut.md
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Stochastic Optimization of Areas Under Precision-Recall Curves with Provable Convergence
|
| 2 |
+
|
| 3 |
+
Qi Qi †∗, Youzhi Luo‡∗, Zhao $\mathbf { X } \mathbf { u } ^ { \ddag * }$ , Shuiwang $\mathbf { J } \mathbf { i } ^ { \ddag }$ , Tianbao Yang† †Department of Computer Science, The University of Iowa ‡Department of Computer Science & Engineering, Texas A&M University {qi-qi,tianbao-yang} $@$ uiowa.edu, {yzluo,zhaoxu,sji} $@$ tamu.edu
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Areas under ROC (AUROC) and precision-recall curves (AUPRC) are common metrics for evaluating classification performance for imbalanced problems. Compared with AUROC, AUPRC is a more appropriate metric for highly imbalanced datasets. While stochastic optimization of AUROC has been studied extensively, principled stochastic optimization of AUPRC has been rarely explored. In this work, we propose a principled technical method to optimize AUPRC for deep learning. Our approach is based on maximizing the averaged precision (AP), which is an unbiased point estimator of AUPRC. We cast the objective into a sum of coupled compositional functions with inner functions dependent on random variables of the outer level. We propose efficient adaptive and non-adaptive stochastic algorithms named SOAP with provable convergence guarantee under mild conditions by leveraging recent advances in stochastic compositional optimization. Extensive experimental results on image and graph datasets demonstrate that our proposed method outperforms prior methods on imbalanced problems in terms of AUPRC. To the best of our knowledge, our work represents the first attempt to optimize AUPRC with provable convergence. The SOAP has been implemented in the libAUC library at https://libauc.org/.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Although deep learning (DL) has achieved tremendous success in various domains, the standard DL methods have reached a plateau as the traditional objective functions in DL are no longer sufficient to model all requirements in new applications, which slows down the democratization of AI. For instance, in healthcare applications, data is often highly imbalanced, e.g., patients suffering from rare diseases are much less than those suffering from common diseases. In these applications, accuracy (the proportion of correctly predicted examples) is deemed as an inappropriate metric for evaluating the performance of a classifier. Instead, area under the curve (AUC), including area under ROC curve (AUROC) and area under the Precision-Recall curve (AUPRC), is widely used for assessing the performance of a model. However, optimizing accuracy on training data does not necessarily lead to a satisfactory solution to maximizing AUC [12].
|
| 12 |
+
|
| 13 |
+
To break the bottleneck for further advancement, DL must be empowered with the capability of efficiently handling novel objectives such as AUC. Recent studies have demonstrated great success along this direction by maximizing AUROC [60]. For example, Yuan et al. [60] proposed a robust deep AUROC maximization method with provable convergence and achieved great success for classification of medical image data. However, to the best of our knowledge, novel DL by maximizing AUPRC has not yet been studied thoroughly. Previous studies [14, 20] have found that when dealing with highly skewed datasets, Precision-Recall (PR) curves could give a more informative picture of an algorithm’s performance, which entails the development of efficient stochastic optimization algorithms for DL by maximizing AUPRC.
|
| 14 |
+
|
| 15 |
+
Compared with maximizing AUROC, maximizing AUPRC is more challenging. The challenges for optimization of AUPRC are two-fold. First, the analytical form of AUPRC by definition involves a complicated integral that is not readily estimated from model predictions of training examples. In practice, AUPRC is usually computed based on some point estimators, e.g., trapezoidal estimators and interpolation estimators of empirical curves, non-parametric average precision estimator, and parametric binomial estimator [3]. Among these estimators, non-parametric average precision (AP) is an unbiased estimate in the limit and can be directly computed based on the prediction scores of samples, which lends itself well to the task of model parameters optimization. Second, a surrogate function for AP is highly complicated and non-convex. In particular, an unbiased stochastic gradient is not readily computed, which makes existing stochastic algorithms such as SGD provide no convergence guarantee. Most existing works for maximizing AP-like function focus on how to compute an (approximate) gradient of the objective function [4, 6, 8, 11, 24, 38, 40, 43, 47, 48], which leave stochastic optimization of AP with provable convergence as an open question.
|
| 16 |
+
|
| 17 |
+
Can we design direct stochastic optimization algorithms both in SGD-style and Adam-style for maximizing AP with provable convergence guarantee?
|
| 18 |
+
|
| 19 |
+
In this paper, we propose a systematic and principled solution for addressing this question towards maximizing AUPRC for DL. By using a surrogate loss in lieu of the indicator function in the definition of AP, we cast the objective into a sum of non-convex compositional functions, which resembles a two-level stochastic compositional optimization problem studied in the literature [52, 53]. However, different from existing two-level stochastic compositional functions, the inner functions in our problem are dependent on the random variable of the outer level, which requires us developing a tailored stochastic update for computing an error-controlled stochastic gradient estimator. Specifically, a key feature of the proposed method is to maintain and update two scalar quantities associated with each positive example for estimating the stochastic gradient of the individual precision score at the threshold specified by its prediction score. By leveraging recent advances in stochastic compositional optimization, we propose both adaptive (Adam-style) and non-adaptive (SGD-style) algorithms, and establish their convergence under mild conditions. We conduct comprehensive empirical studies on class imbalanced graph and image datasets for learning graph neural networks and deep convolutional neural networks, respectively. We demonstrate that the proposed method can consistently outperform prior approaches in terms of AUPRC. In addition, we show that our method achieves better results when the sample distribution is highly imbalanced between classes and is insensitive to mini-batch size.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
AUROC Optimization. AUROC optimization 2 has attracted significant attention in the literature. Recent success of DL by optimizing AUROC on large-scale medical image data has demonstrated the importance of large-scale stochastic optimization algorithms and the necessity of accurate surrogate function [60]. Earlier papers [25, 28] focus on learning a linear model based on the pairwise surrogate loss and could suffer from a high computational cost, which could be as high as quadratic of the size of training data. To address the computational challenge, online and stochastic optimization algorithms have been proposed [18, 35, 42, 58, 63]. Recently, [21, 22, 36, 57] proposed stochastic deep AUC maximization algorithms by formulating the problem as non-convex strongly-concave minmax optimization problem, and derived fast convergence rate under PL condition, and in federated learning setting as well [21]. More recently, Yuan et al. [60] demonstrated the success of their methods on medical image classification tasks, e.g., X-ray image classification, melanoma classification based on skin images. However, an algorithm that maximizes the AUROC might not necessarily maximize AUPRC, which entails the development of efficient algorithms for DL by maximizing AUPRC.
|
| 24 |
+
|
| 25 |
+
AUPRC Optimization. AUPRC optimization is much more challenging than AUROC optimization since the objective is even not decomposable over pairs of examples. Although AUPRC optimization has been considered in the literature (cf. [15, 47, 41] and references therein), efficient scalable algorithms for DL with provable convergence guarantee is still lacking. Some earlier works tackled this problem by using traditional optimization techniques, e.g., hill climbing search [37], cuttingplane method [61], dynamic programming [50], and by developing acceleration techniques in the framework of SVM [39]. These approaches are not scalable to big data for DL. There is a long list of studies in information retrieval [5, 11, 38, 47] and computer vision [4, 6, 8, 9, 24, 40, 48, 43], which have made efforts towards maximizing the AP score. However, most of them focus on how to compute an approximate gradient of the AP function or its smooth approximation, and provide no convergence guarantee for stochastic optimization based on mini-batch averaging. Due to lack of principled design, these previous methods when applied to deep learning are sensitive to the mini-batch size [6, 47, 48] and usually require a large mini-batch size in order to achieve good performance. In contrast, our stochastic algorithms are designed in a principled way to guarantee convergence without requiring a large mini-batch size as confirmed by our studies as well. Recently, [15] formulates the objective function as a constrained optimization problem using a surrogate function, and then casts it into a min-max saddle-point problem, which facilitates the use of stochastic min-max algorithms. However, they do not provide any convergence analysis for AUPRC maximization. In contrast, this is the first work that directly optimizes a surrogate function of AP (an unbaised estimator of AUPRC in the limit) and provides theoretical convergence guarantee for the proposed stochastic algorithms.
|
| 26 |
+
|
| 27 |
+
Stochastic Compositional Optimization. Optimization of a two-level compositional function in the form of $\mathbb { E } _ { \xi } [ \bar { f } ( \mathbb { E } _ { \zeta } [ g ( \mathbf { w } ; \zeta ) ] ; \xi ) ]$ where $\xi$ and $\zeta$ are independent random variables, or its finite-sum variant has been studied extensively in the literature [1, 10, 52, 27, 30, 31, 33, 34, 46, 53, 59, 62, 45]. In this paper, we formulate the surrogate function of AP into a similar but more complicated two-level compositional function of the form $\mathbb { E } _ { \xi } [ f ( \mathbb { E } _ { \zeta } g ( { \mathbf w } ; \zeta , \xi ) ) ]$ , where $\xi$ and $\zeta$ are independent and $\xi$ has a finite support. The key difference between our formulated compositional function and the ones considered in previous work is that the inner function $g ( \mathbf { w } ; \zeta , \xi )$ also depends on the random variable $\xi$ of the outer level. Such subtle difference will complicate the algorithm design and the convergence analysis as well. Nevertheless, the proposed algorithm and its convergence analysis are built on previous studies of stochastic two-level compositional optimization.
|
| 28 |
+
|
| 29 |
+
# 3 The Proposed Method
|
| 30 |
+
|
| 31 |
+
Notations. We consider binary classification problem. Denote by $\left( \mathbf { x } , y \right)$ a data pair, where $\mathbf { x } \in \mathbb { R } ^ { d }$ denotes the input data and $y \in \{ 1 , - 1 \}$ denotes its class label. Let $h ( \mathbf { x } ) = h _ { \mathbf { w } } ( \mathbf { x } )$ denote the predictive function parameterized by a parameter vector $\mathbf { w } \in \mathbb { R } ^ { D }$ (e.g., a deep neural network). Denote by $\mathbf { I } ( \cdot )$ an indicator function that outputs 1 if the argument is true and zero otherwise. To facilitate the presentation, denote by $X$ a random data, by $Y$ its label and by $F = h ( X )$ its prediction score. Let $\mathcal { D } = \{ ( \mathbf { x } _ { 1 } , y _ { 1 } ) , : . . , ( \mathbf { x } _ { n } , y _ { n } ) \}$ denote the set of all training examples and $\mathbf { \bar { \mathcal { D } } } _ { + } = \{ \mathbf { x } _ { i } : y _ { i } = 1 \}$ denote the set of all positive examples. Let $n _ { + } = | \mathcal { D } _ { + } |$ denote the number of positive examples. $\mathbf { x } _ { i } \sim \mathcal { D }$ means that $\mathbf { x } _ { i }$ is randomly sampled from $\mathcal { D }$ .
|
| 32 |
+
|
| 33 |
+
# 3.1 Background on AUPRC and its estimator AP
|
| 34 |
+
|
| 35 |
+
Following the work of Bamber [2], AUPRC is an average of the precision weighted by the probability of a given threshold, which can be expressed as
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
A = \int _ { - \infty } ^ { \infty } \dot { \operatorname* { P r } } ( Y = 1 | F \geq c ) d \operatorname* { P r } ( F \leq c | Y = 1 ) ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\operatorname* { P r } ( Y = 1 | F \geq c )$ is the precision at the threshold value of $c$ . The above integral is an importance-sampled Monte Carlo integral, by which we may interpret AUPRC as the fraction of positive examples among those examples whose output values exceed a randomly selected threshold $c \sim F ( X ) | Y = 1$ .
|
| 42 |
+
|
| 43 |
+
For a finite set of examples $\mathcal { D } = \{ ( \mathbf { x } _ { i } , y _ { i } ) , i = 1 , \dots , n \}$ with the prediction score for each example $\mathbf { x } _ { i }$ given by $h _ { \mathbf { w } } ( \mathbf { x } _ { i } )$ , we consider to use AP to approximate AUPRC, which is given by
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\mathrm { A P } = \frac { 1 } { n _ { + } } \sum _ { i = 1 } ^ { n } \mathbf { I } ( y _ { i } = 1 ) \frac { \displaystyle \sum _ { s = 1 } ^ { n } \mathbf { \hat { I } } ( y _ { s } = 1 ) \mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) ) } { \displaystyle \sum _ { s = 1 } ^ { n } \mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) ) } ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $n _ { + }$ denotes the number of positive examples. It can be shown that AP is an unbiased estimator in the limit $n \to \infty$ [3].
|
| 50 |
+
|
| 51 |
+
However, the non-continuous indicator function $\mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) )$ in both numerator and denominator in (1) makes the optimization non-tractable. To tackle this, we use a loss function $\ell ( \mathbf { w } ; \mathbf { x } _ { s } , \mathbf { x } _ { i } )$ as a surrogate function of $\mathbf { I } ( h _ { \mathbf { w } } ( \mathbf { x } _ { s } ) \geq h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) )$ . One can consider different surrogate losses, e.g., hinge loss, squared hinge loss, and smoothed hinge loss, and exponential loss. In this paper, we will consider a smooth surrogate loss function to facilitate the development of an optimization algorithm, e.g., a squared hinge loss $\ell ( \mathbf { w } ; \mathbf { x } _ { s } ; \mathbf { x } _ { i } ) = ( \mathrm { m a x } \{ m - ( h _ { \mathbf { w } } ( \mathbf { x } _ { i } ) - \dot { h } _ { \mathbf { w } } ( \mathbf { x } _ { s } ) ) , 0 \} ) ^ { \dot { 2 } }$ , where $m$ is a margin parameter. Note that we do not require $\ell$ to be a convex function, hence one can also consider non-convex surrogate loss such as ramp loss. As a result, our problem becomes
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\operatorname* { m i n } _ { \mathbf { w } } P ( \mathbf { w } ) = \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } \frac { - \displaystyle \sum _ { s = 1 } ^ { n } \mathbf { I } ( y _ { s } = \mathrm { 1 } ) \ell ( \mathbf { w } ; \mathbf { x } _ { s } ; \mathbf { x } _ { i } ) } { \displaystyle \sum _ { s = 1 } ^ { n } \ell ( \mathbf { w } ; \mathbf { x } _ { s } ; \mathbf { x } _ { i } ) } .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
# 3.2 Stochastic Optimization of AP (SOAP)
|
| 58 |
+
|
| 59 |
+
We cast the problem into a finite-sum of compositional functions. To this end, let us define a few notations:
|
| 60 |
+
|
| 61 |
+
$\begin{array} { r l } & { \operatornamewithlimits { m a x } _ { j } \operatorname { m a x } _ { j } , } \\ & { g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) = [ g _ { 1 } ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) , g _ { 2 } ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ] ^ { \top } = [ \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) \mathbf { I } ( y _ { j } = 1 ) , \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ] ^ { \top } } \end{array}$ $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ]$ ,
|
| 62 |
+
|
| 63 |
+
where $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) : \mathbb { R } ^ { d } \mathbb { R } ^ { 2 }$ . Let $\begin{array} { r } { f ( \mathbf { s } ) = - \frac { s _ { 1 } } { s _ { 2 } } : \mathbb { R } ^ { 2 } \mathbb { R } } \end{array}$ . Then, we can write the objective function for maximizing AP as a sum of compositional functions:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
P ( \mathbf { w } ) = \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } ^ { } f ( g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ) = \mathbb { E } _ { \mathbf { x } _ { i } \sim \mathcal { D } _ { + } } [ f ( g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ) ] .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
We refer to the above problem as an instance of two-level stochastic coupled compositional functions. It is similar to the two-level stochastic compositional functions considered in literature [52, 53] but with a subtle difference. The difference is that in our formulation the inner function $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) ]$ depends on the random variable $\mathbf { x } _ { i }$ of the outer level. This difference makes the proposed algorithm slightly complicated by estimating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ separately for each positive example. It also complicates the analysis of the proposed algorithms. Nevertheless, we can still employ the techniques developed for optimizing stochastic compositional functions to design the algorithms and develop the analysis for optimizing the objective (4).
|
| 70 |
+
|
| 71 |
+
In order to motivate the proposed method, let us consider how to compute the gradient of $P ( \mathbf { w } )$ . Let the gradient of $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ be denoted by $\nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \top } = ( \nabla _ { \mathbf { w } } [ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 1 } , \nabla _ { \mathbf { w } } [ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 2 } )$ . Then we have
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { l } { \displaystyle { \boldsymbol { \mathbf { \mathit { v } } } } ) \mathrm { ~ b e ~ d e n o t e d ~ t o y ~ V _ w } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \prime } = ( \nabla _ { \mathbf { w } } | g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) | _ { 1 } , \nabla _ { \mathbf { w } } | g _ { \mathbf { x } _ { i } } ( \mathbf { w } } \\ { { \nabla _ { \mathbf { w } } } P ( \mathbf { w } ) = \displaystyle \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } \nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \top } \nabla f ( g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ) } \\ { { \displaystyle ~ = \frac { 1 } { n _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { D } _ { + } } \nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ^ { \top } \left( \frac { - 1 } { \left[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \right] _ { 2 } } , \frac { \left[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \right] _ { 1 } } { \left( \left[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \right] _ { 2 } \right) ^ { 2 } } \right) ^ { \top } } . } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
The major cost for computing $\nabla _ { \mathbf { w } } P ( \mathbf { w } )$ lies at evaluating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ and its gradient $\nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ , which involves passing through all examples in $\mathcal { D }$ .
|
| 78 |
+
|
| 79 |
+
To this end, we will approximate these quantities by stochastic samples. The gradient $\nabla _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ can be simply approximated by the stochastic gradient, i.e.,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r } { \hat { \nabla } _ { \mathbf { w } } g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \left( \begin{array} { c } { \frac { 1 } { B } \breve { \sum } _ { \mathbf { x } _ { j } \in B } \mathbf { I } ( y _ { j } = 1 ) \nabla \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) } \\ { \frac { 1 } { B } \sum _ { \mathbf { x } _ { j } \in B } \nabla \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) } \end{array} \right) , } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\boldsymbol { B }$ denote a set of $B$ random samples from $\mathcal { D }$ . For estimating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) = \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } )$ , however, we need to ensure its approximation error is controllable due to the compositional structure such that the convergence can be guaranteed. We borrow a technique from the literature of stochastic compositional optimization [52] by using moving average estimator for estimating $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ for all positive examples. To this end, we will maintain a matrix $\mathbf { u } = [ \mathbf { u } ^ { 1 } , \mathbf { u } ^ { 2 } ]$ with each column indexable by any positive example, i.e., $\mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } , \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 }$ correspond to the moving average estimator of $[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 1 }$ and $[ g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) ] _ { 2 }$ , respectively. The matrix $\mathbf { u }$ is updated by the subroutine UG in Algorithm 2, where $\gamma \in ( 0 , 1 )$ is a parameter. It is notable that in Step 3 of Algorithm 2, we clip the moving average update of $\mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 }$ by a lower bound $u _ { 0 }$ , which is a given parameter. This step can ensure the division in computing the stochastic gradient estimator in (7) always valid and is also important for convergence
|
| 86 |
+
|
| 87 |
+
# Algorithm 1: SOAP
|
| 88 |
+
|
| 89 |
+
1: Input: $\gamma , \alpha , u _ { 0 }$ , and other parameters for SGD-stype update or Adam-stype update.
|
| 90 |
+
2: Initialize w1 ∈ Rd, u ∈ R|n+|×2
|
| 91 |
+
3: for $t = 1 , \dots , T$ do
|
| 92 |
+
4: Draw a batch of $B _ { + }$ positive samples denoted by $B _ { + }$ .
|
| 93 |
+
5: Draw a batch of $B$ samples denoted by $\boldsymbol { B }$ .
|
| 94 |
+
6: ${ \bf u } = { \bf U } { \bf G } ( B , B _ { + } , { \bf u } , { \bf w } _ { t } , \gamma , u _ { 0 } )$
|
| 95 |
+
7: Compute (biased) Stochastic Gradient Estimator
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
G ( \mathbf { w } _ { t } ) = \frac { 1 } { B _ { + } } \sum _ { \mathbf { x } _ { i } \in \mathcal { B } _ { + } } \sum _ { \mathbf { x } _ { j } \in B } \frac { ( \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } - \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } \mathbf { I } ( \mathbf { y } _ { j } = 1 ) ) \nabla \ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) } { B ( \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } ) ^ { 2 } }
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
8: Update $\mathbf { w } _ { t + 1 }$ by a SGD-style method or by a Adam-style method
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathbf { w } _ { t + 1 } = \mathbf { U } \mathbf { W } ( \mathbf { w } _ { t } , G ( \mathbf { w } _ { t } ) )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
9: end for
|
| 108 |
+
10: Return: last solution.
|
| 109 |
+
|
| 110 |
+
analysis. With these stochastic estimators, we can compute an estimate of $\nabla P ( \mathbf { w } )$ by equation (7), where $B _ { + }$ includes a batch of sampled positive data. With this stochastic gradient estimator, we can employ SGD-style method and Adam-style shown in Algorithm 3 to update the model parameter w. The final algorithm named as SOAP is presented in Algorithm 1.
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\overline { { \mathrm { A l g o r i t h m ~ 2 : ~ U G } ( \mathcal { B } , \mathcal { B } _ { + } , \mathbf { u } , \mathbf { w } _ { t } , \gamma , u _ { 0 } ) } }
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\overline { { \mathbf { A l g o r i t h m 3 : U W } ( \mathbf { w } _ { t } , G ( \mathbf { w } _ { t } ) ) } }
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
1: for each positive $\mathbf { x } _ { i } \in B _ { + }$ do
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
[ \overset { \mathbf { \hat { g } } } { \mathbf { x } } _ { i } ( \mathbf { w } _ { t } ) ] _ { 1 } = \frac { 1 } { | \mathcal { B } | } \sum _ { \underset { y _ { j } = 1 } { x _ { j } \in \mathcal { B } } } \ell ( \mathbf { w } _ { t } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } )
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\mathbf { w } _ { t + 1 } = \mathbf { w } _ { t } - \alpha G ( \mathbf { w } _ { t } )
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
[ \tilde { g } _ { { \bf x } _ { i } } ( { \bf w } _ { t } ) ] _ { 2 } = \frac { 1 } { | B | } \sum _ { { \bf x } _ { j } \in B } \ell ( { \bf w } _ { t } ; { \bf x } _ { j } , { \bf x } _ { i } )
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { r l } & { \mathbf { \tau } , \epsilon , \eta _ { 1 } , \eta _ { 2 } ) } \\ & { \quad h _ { t + 1 } = \eta _ { 1 } h _ { t } + ( 1 - \eta _ { 1 } ) G ( \mathbf { w } _ { t } ) } \\ & { \quad v _ { t + 1 } = \eta _ { 2 } \hat { v } _ { t } + ( 1 - \eta _ { 2 } ) ( G ( \mathbf { w } _ { t } ) ) ^ { 2 } } \\ & { \quad \mathbf { w } _ { t + 1 } = \mathbf { w } _ { t } - \alpha \frac { h _ { t + 1 } } { \sqrt { \epsilon + \hat { v } _ { t + 1 } } } } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
# 3: Compute
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { r l } & { \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } = ( 1 - \gamma ) \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 1 } + \gamma [ \tilde { g } _ { \mathbf { x } _ { i } } ( \mathbf { w } _ { t } ) ] _ { 1 } } \\ & { \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } = \operatorname* { m a x } ( ( 1 - \gamma ) \mathbf { u } _ { \mathbf { x } _ { i } } ^ { 2 } + \gamma [ \tilde { g } _ { \mathbf { x } _ { i } } ( \mathbf { w } _ { t } ) ] _ { 2 } , u _ { 0 } ) } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
4: end for
|
| 145 |
+
5: Return u
|
| 146 |
+
|
| 147 |
+
# 3.3 Convergence Analysis
|
| 148 |
+
|
| 149 |
+
In this subsection, we present the convergence results of SOAP and also highlight its convergence analysis. To this end, we first present the following assumption.
|
| 150 |
+
|
| 151 |
+
Assumption 1. Assume that (a) there exists $\Delta _ { 1 }$ such that $P ( \mathbf { w } _ { 1 } ) - \operatorname* { m i n } _ { \mathbf { w } } P ( \mathbf { w } ) \leq \Delta _ { 1 }$ ; $( b )$ there exist $C , M > 0$ such that $\ell ( \mathbf { w } ; \mathbf { x } _ { i } , \mathbf { x } _ { i } ) \geq C$ for any $\mathbf { x } _ { i } \in \mathcal { D } _ { + }$ , $\ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) \le M$ , and $\ell ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } )$ is Lipscthiz continuous and smooth with respect to w for any $\mathbf { x } _ { i } \in \mathcal { D } _ { + } , \mathbf { x } _ { j } \in \mathcal { D } ,$ ; (c) there exists $V > 0$ such that $\begin{array} { r } { \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ \| g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) - g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \| ^ { 2 } ] \leq V } \end{array}$ , and $\begin{array} { r } { \mathbb { E } _ { \mathbf { x } _ { j } \sim \mathcal { D } } [ \| \nabla g ( \mathbf { w } ; \mathbf { x } _ { j } , \mathbf { x } _ { i } ) - \nabla g _ { \mathbf { x } _ { i } } ( \mathbf { w } ) \| ^ { 2 } ] \leq V } \end{array}$ for any $\mathbf { x } _ { i }$ .
|
| 152 |
+
|
| 153 |
+
With a bounded score function $h _ { \mathbf { w } } ( \mathbf { x } )$ the above assumption can be easily satisfied. Based on the above assumption, we can prove that the objective function $P ( \mathbf { w } )$ is smooth.
|
| 154 |
+
|
| 155 |
+
Lemma 1. Suppose Assumption $^ { l }$ holds, then there exists $L > 0$ such that $P ( \cdot )$ is $L$ -smooth. In addition, there exists $u _ { 0 } \geq C / n$ such that gxi(w $\begin{array} { r } { v ) \in \Omega = \{ \mathbf { u } \in \mathbb { R } ^ { 2 } , 0 \leq [ \mathbf { u } ] _ { 1 } \leq M , u _ { 0 } \leq [ \mathbf { u } ] _ { 2 } \leq } \end{array}$ $M \}$ , $\forall \mathbf { x } _ { i } \in \mathcal { D } _ { + }$ .
|
| 156 |
+
|
| 157 |
+
Next, we highlight the convergence analysis of SOAP employing the SGD-stype update and include that for employing Adam-style update in the supplement. Without loss of generality, we assume $| \boldsymbol { B } _ { + } | = 1$ and the positive sample in $B _ { + }$ is randomly selected from $\mathcal { D } _ { + }$ with replacement. When the context is clear, we abuse the notations $g _ { i } ( \mathbf { w } )$ and $\mathbf { u } _ { i }$ to denote $g _ { \mathbf { x } _ { i } } ( \mathbf { w } )$ and $\mathbf { u } _ { \mathbf { x } _ { i } }$ below, respectively. We first establish the following lemma following the analysis of non-convex optimization.
|
| 158 |
+
|
| 159 |
+
Lemma 2. With $\alpha \leq 1 / 2$ , running $T$ iterations of $S O A P$ (SGD-style) updates, we have $\frac { \alpha } { 2 } \mathbb { E } [ \sum _ { t = 1 } ^ { T } \| \nabla P ( \mathbf { w } _ { t } ) \| ^ { 2 } ] \leq \mathbb { E } [ \sum _ { t } ( P ( \mathbf { w } _ { t } ) - P ( \mathbf { w } _ { t + 1 } ) ) ] + \frac { \alpha C _ { 1 } } { 2 } \mathbb { E } [ \sum _ { t = 1 } ^ { T } \| g _ { i _ { t } } ( \mathbf { w } _ { t } ) - \mathbf { u } _ { i _ { t } } \| ^ { 2 } ] + \alpha ^ { 2 } T C _ { 2 } ,$ where $i _ { t }$ denotes the index of the sampled positive data at iteration $t$ , $C _ { 1 }$ and $C _ { 2 }$ are proper constants.
|
| 160 |
+
|
| 161 |
+
Our key contribution is the following lemma that bounds the second term in the above upper bound.
|
| 162 |
+
|
| 163 |
+
Lemma 3. Suppose Assumption 1 holds, with u initialized by (6) for every $\mathbf { x } _ { i } \in \mathcal { D } _ { + }$ we have
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\mathbb { E } [ \sum _ { t = 1 } ^ { T } \| g _ { i _ { t } } ( \mathbf { w } _ { t } ) - \mathbf { u } _ { i _ { t } } \| ^ { 2 } ] \leq \frac { n _ { + } V } { \gamma } + \gamma V T + 2 \frac { n _ { + } ^ { 2 } \alpha ^ { 2 } T C _ { 3 } } { \gamma ^ { 2 } } ,
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
where $C _ { 3 }$ is a proper constant.
|
| 170 |
+
|
| 171 |
+
Remark: The innovation of proving the above lemma is by grouping $\mathbf { u } _ { i _ { t } } , t = 1 , \dots , T$ into $n _ { + }$ groups corresponding to the $n _ { + }$ positive examples, and then establishing the recursion of the error $\| g _ { i _ { t } } ( \mathbf { w } _ { t } ) - \mathbf { u } _ { i _ { t } } \| ^ { 2 }$ within each group, and then summing up these recursions together.
|
| 172 |
+
|
| 173 |
+
Based on the two lemmas above, we establish the following convergence of SOAP with a SGD-style update.
|
| 174 |
+
|
| 175 |
+
Theorem 1. Suppose Assumption 1 holds, let the parameters be $\begin{array} { r } { \alpha = \frac { 1 } { n _ { + } ^ { 2 / 5 } T ^ { 3 / 5 } } , \gamma = \frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } } } \end{array}$ , $\forall t \in$ $1 , \cdots , T _ { \mathrm { { \scriptsize ~ 2 } } }$ , and $T > n _ { + }$ . Then after running $T$ iterations, SOAP with a $S G D$ -style update satisfies $\begin{array} { r } { \mathbb { E } \left[ \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \| \nabla P ( \mathbf { w } _ { t } ) \| ^ { 2 } \right] \leq O ( \frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } } ) } \end{array}$ $O$
|
| 176 |
+
|
| 177 |
+
Remark: To the best of our knowledge, this is the first time a stochastic algorithm was proved to converge for AP maximization.
|
| 178 |
+
|
| 179 |
+
Similarly, we can establish the following convergence of SOAP by employing an Adam-style update, specifically the AMSGrad update.
|
| 180 |
+
|
| 181 |
+
Theorem 2. Suppose Assumption $^ { l }$ holds, let the parameters $\eta _ { 1 } \leq \sqrt { \eta _ { 2 } } \leq 1$ , $\begin{array} { r } { \alpha = \frac { 1 } { n _ { + } ^ { 2 / 5 } T ^ { 3 / 5 } } , \gamma = } \end{array}$ n2/5+ $\frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } }$ , $\forall t \in 1 , \cdots , T$ , and $T > n _ { + }$ . Then after running $T$ iterations, SOAP with an AMSGRAD update satisfies $\widehat { \sf z } \left[ \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \| \nabla P ( \mathbf { w } _ { t } ) \| ^ { 2 } \right] \leq O ( \frac { n _ { + } ^ { 2 / 5 } } { T ^ { 2 / 5 } } )$ , where $O$ suppresses constant numbers.
|
| 182 |
+
|
| 183 |
+
# 4 Experiments
|
| 184 |
+
|
| 185 |
+
In this section, we evaluate the proposed method through comprehensive experiments on imbalanced datasets. We show that the proposed method can outperform prior state-of-the-art methods for imbalanced classification problems. In addition, we conduct experiments on (i) the effects of imbalance ratio; (ii) the insensitivity to batch size and (iii) the convergence speed on testing data; and observe that our method (i) is more advantageous when data is more imbalanced, (ii) is not sensitive to batch size, and (iii) converges faster than baseline methods.
|
| 186 |
+
|
| 187 |
+
Our proposed optimization algorithm is independent of specific datasets and tasks. Therefore, we perform experiments on both graph and image prediction tasks. In particular, the graph prediction tasks in the contexts of molecular property prediction and drug discovery suffer from very severe imbalance problems as positive labels are very rare while negative samples are abundantly available. Thus, we choose to use graph data intensively in our experiments. Additionally, the graph data we use allow us to vary the imbalance ratio to observe the performance change of different methods.
|
| 188 |
+
|
| 189 |
+
In all experiments, we compare our method with the following baseline methods. CB-CE refers to a method using a class-balanced weighed cross entropy loss function, in which the weights for positive and negative samples are adjusted with the strategy proposed by Cui et al. [13]. Focal is to up-weight the penalty on hard examples using focal loss [32]. LDAM refers to training with labeldistribution-aware margin loss [7]. AUC-M is an AUROC maximization method using a surrogate loss [60]. In addition, we compare with three methods for optimizing AUPRC or AP, namely, the MinMax method [15] - a method for optimizing a discrete approximation of AUPRC, SmoothAP [4] - a method that optimizes a smoothed approximation of AP, and FastAP - a method that uses soft histogram binning to approximate the gradient of AP [6]. For all of these methods, we use the
|
| 190 |
+
|
| 191 |
+
Table 1: The test AUPRC on the image datasets with two ResNet models. We report the average AUPRC and standard deviation (within brackets) over 5 runs.
|
| 192 |
+
|
| 193 |
+
<table><tr><td>Datasets</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td></tr><tr><td>Networks</td><td>ResNet18</td><td>ResNet34</td><td>ResNet18</td><td>ResNet34</td></tr><tr><td>CE</td><td>0.7155 (± 0.0058)</td><td>0.6844(± 0.0031)</td><td>0.5946 (± 0.0031)</td><td>0.5792 (± 0.0028)</td></tr><tr><td>CB-CE</td><td>0.7325 (± 0.0039)</td><td>0.6936(±0.0021)</td><td>0.6165 (± 0.0096)</td><td>0.5632(± 0.0129)</td></tr><tr><td>Focal</td><td>0.7183(± 0.0082)</td><td>0.6943(± 0.0007)</td><td>0.6107(± 0.0093)</td><td>0.5585(± 0.0285)</td></tr><tr><td>LDAM</td><td>0.7346 (± 0.0125)</td><td>0.6745(± 0.0043)</td><td>0.6153 (± 0.0100)</td><td>0.5662(± 0.0212)</td></tr><tr><td>AUC-M</td><td>0.7399(± 0.0013)</td><td>0.6825(± 0.0089)</td><td>0.6103 (± 0.0075)</td><td>0.5306(± 0.0230)</td></tr><tr><td>SmoothAP</td><td>0.7365 (± 0.0088)</td><td>0.6909 (± 0.0049)</td><td>0.6071(± 0.0143)</td><td>0.5208 (± 0.0505)</td></tr><tr><td>FastAP</td><td>0.7028 (± 0.0341)</td><td>0.6798 (± 0.0032)</td><td>0.5618(± 0.0351)</td><td>0.5151(± 0.0450)</td></tr><tr><td>MinMax</td><td>0.7228 (± 0.0118)</td><td>0.6806(± 0.0027)</td><td>0.6071(± 0.0064)</td><td>0.5518(± 0.0030)</td></tr><tr><td>SOAP</td><td>0.7629(± 0.0014)</td><td>0.7012(± 0.0056)</td><td>0.6251 (± 0.0053)</td><td>0.6001(± 0.0060)</td></tr></table>
|
| 194 |
+
|
| 195 |
+
SGD-style with momentum optimization for image prediction tasks and the Adam-style optimization algorithms for graph prediction tasks and unless specified otherwise. We refer to imbalance ratio as the number of positive samples over the total number of examples of a considered set. The hyper-parameters of all methods are fine tuned using cross-validation with training/validation splits mentioned below. For AP maximization methods, we use a sigmoid function to produce the prediction score. For simplicity, we set $u _ { 0 } = 0$ for SOAP and encounter no numerical problems in experiments. As SOAP requires positive samples for updating u to approximate the gradient of surrogate objective, we use a data sampler which samples a few positive examples (e.g., 2) and some negative examples per iteration. The same sampler applies to all methods for fair comparison. The code for reproducing the results is released here [44].
|
| 196 |
+
|
| 197 |
+
# 4.1 Image Classification
|
| 198 |
+
|
| 199 |
+
Data. We first conduct experiments on three image datasets: CIFAR10, CIFAR100 and Melanoma dataset [49]. We construct imbalanced version of CIFAR10 and CIFAR100 for binary classification. In particular, for each dataset we manually take the last half of classes as positive class and first half of classes as negative class. To construct highly imbalanced data, we remove $98 \%$ of the positive images from the training data and keep the test data unchanged (i.e., the testing data is still balanced). And we split the training dataset into train/validation set at $80 \% / 2 0 \%$ ratio. The Melanoma dataset is from a medical image Kaggle competition, which serves as a natural real imbalanced image dataset. It contains 33,126 labeled medical images, among which 584 images are related to malignant melanoma and labelled as positive samples. Since the test set used by Kaggle organization is not available, we manually split the training data into train/validation/test set at $8 0 \% / 1 0 \% / 1 0 \%$ ratio and report the achieved AUPRC on the test set by our method and baselines. The images of Melanoma dataset are always resized to have a resolution of $3 8 4 \times 3 8 4$ in our experiments.
|
| 200 |
+
|
| 201 |
+
Setup. We use two ResNet [23] models, i.e., ResNet18 and ResNet34, as the backbone networks for image classification. For all methods except for CE, the ResNet models are initialized with a model pre-trained by CE with a SGD optimizer. We tune the learning rate in a range $\{ 1 \mathrm { e } \mathrm { - } 5 $ , 1e-4, 1e-3, 1e-2} and the weight decay parameter in a range $\{ 1 \mathrm { e } { - } 6 , 1 \mathrm { e } { - } 5 , 1 \mathrm { e } { - } 4 \}$ . Then the last fully connected layer is randomly re-initialized and the network is trained by different methods with the same weight decay parameter but other hyper-parameters individually tuned for fair comparison, e.g., we tune $\gamma$ of SOAP in a range $\{ 0 . 9 , 0 . 9 9 , 0 . 9 9 9 \}$ , and tune $m$ in $\{ 0 . 5 , 1 , 2 , 5 , 1 0 \}$ . We refer to this scheme as two-stage training, which is widely used for imbalanced data [60]. We consistently observe that this strategy can bring the model to a good initialization state and improve the final performance of our method and baselines.
|
| 202 |
+
|
| 203 |
+
Results. Table 1 shows the AUPRC on testing sets of CIFAR-10 and CIFAR-100. We report the results on Melanoma in Table 3. We can observe that the proposed method SOAP outperforms all baselines. It is also striking to see that on Melanoma dataset, our proposed SOAP can outperform all baselines by a large margin, and all other methods have very poor performance. The reason is that the testing set of Melanoma is also imbalanced (imbalanced ratio $\mathrm { \Omega } = 1 . 7 2 \%$ ), while the testing sets of CIFAR-10 and CIFAR-100 are balanced. We also observe that the AUROC maximization (AUC-M) does not necessarily optimize AUPRC. We also plot the final PR curves in Figure 3 in the supplement.
|
| 204 |
+
|
| 205 |
+
Table 2: The test AUPRC values on the HIV and MUV datasets with three graph neural network models. We report the average AUPRC and standard deviation (within brackets) over 3 runs.
|
| 206 |
+
|
| 207 |
+
<table><tr><td>Dataset</td><td>Method</td><td>GINE</td><td>MPNN</td><td>ML-MPNN</td></tr><tr><td rowspan="6">HIV</td><td>CE CB-CE</td><td>0.2774 (± 0.0101) 0.3082 (± 0.0101)</td><td>0.3197 (± 0.0050) 0.3056 (± 0.0018)</td><td>0.2988 (± 0.0076) 0.3291 (± 0.0189)</td></tr><tr><td>Focal</td><td></td><td>0.3136 (± 0.0197)</td><td>0.3279 (± 0.0173)</td></tr><tr><td>LDAM</td><td>0.3179 (± 0.0068)</td><td></td><td></td></tr><tr><td>AUC-M</td><td>0.2904 (± 0.0008)</td><td>0.2994 (± 0.0128)</td><td>0.3044 (± 0.0116)</td></tr><tr><td>SmothAP</td><td>0.2998 (± 0.0010)</td><td>0.2786 (± 0.0456)</td><td>0.3305 (± 0.0165)</td></tr><tr><td>FastAP</td><td>0.2686 (± 0.0007)</td><td>0.3276 (± 0.0063)</td><td>0.3235 (± 0.0092)</td></tr><tr><td rowspan="6"></td><td>MinMax</td><td>0.0169 (± 0.0031) 0.2874(± 0.0073)</td><td>0.0826 (± 0.0112) 0.3119 (± 0.0075)</td><td>0.0202 (± 0.0002) 0.3098 (± 0.0167)</td></tr><tr><td>SOAP</td><td>0.3385 (± 0.0024)</td><td>0.3401 (± 0.0045)</td><td>0.3547 (± 0.0077)</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>CE</td><td>0.0017 (±0.0001)</td><td>0.0021 (±0.0002)</td><td>0.0025 (±0.0004)</td></tr><tr><td>CB-CE</td><td>0.0055 (±0.0011)</td><td>0.0483 (±0.0083)</td><td>0.0121 (±0.0016)</td></tr><tr><td>Focal</td><td>0.0041 (±0.0007)</td><td>0.0281 (±0.0141)</td><td>0.0122 (±0.0001)</td></tr><tr><td rowspan="6">MUV</td><td>LDAM</td><td>0.0044(±0.0022)</td><td>0.0118 (±0.0098)</td><td>0.0059 (±0.0021)</td></tr><tr><td>AUC-M</td><td>0.0026 (±0.0001)</td><td>0.0040 (±0.0012)</td><td>0.0028 (±0.0012)</td></tr><tr><td>SmoothAP</td><td>0.0073 (±0.0012)</td><td>0.0068(±0.0038)</td><td>0.0029 (±0.0005)</td></tr><tr><td>FastAP</td><td>0.0016 (±0.0000)</td><td>0.0023 (±0.0021)</td><td>0.0022 (±0.0012)</td></tr><tr><td>MinMax</td><td>0.0028 (±0.0008)</td><td>0.0027 (±0.0005)</td><td>0.0043 (±0.0015)</td></tr><tr><td>SOAP</td><td>0.0254 (±0.0261)</td><td>0.3352 (±0.0008)</td><td>0.0236 (±0.0038)</td></tr></table>
|
| 208 |
+
|
| 209 |
+
# 4.2 Graph Classification for Molecular Property Prediction
|
| 210 |
+
|
| 211 |
+
Data. To further demonstrate the advantages of our method, we conduct experiments on two graph classification datasets. We use the datasets HIV and MUV from the MoleculeNet [55], which is a benchmark for molecular property prediction. The HIV dataset has 41,913 molecules from the Drug Therapeutics Program (DTP), and the positive samples are molecules tested to have inhibition ability to HIV. The MUV dataset has 93,127 molecules from the PubChem library, and molecules are labelled by whether a bioassay property exists or not. Note that the MUV dataset provides labels of 17 properties in total and we only conduct experiments to predict the third property as this property is more imbalanced. The percentage of positive samples in HIV and MUV datasets are $3 . 5 1 \%$ and $0 . 2 0 \%$ , respectively. We use the split of train/validation/test set provided by MoleculeNet. Molecules are treated as 2D graphs in our experiments, and we use the feature extraction procedure of MoleculeKit [54] to obtain node features of graphs. The same data preprocessing is used for all of our experiments on graph data.
|
| 212 |
+
|
| 213 |
+
Setup. Many recent studies have shown that graph neural networks (GNNs) are powerful models for graph data analysis [29, 17, 16]. Hence, we use three different GNNs as the backbone network for graph classification, including the message passing neural network (MPNN) [19], an invariant of graph isomorphism network [56] named by GINE [26], and the multi-level message passing neural network (ML-MPNN) proposed by Wang et al. [54]. We use the same two-stage training scheme with a similar hyper-parameter tuning. We pre-train the networks by Adam with 100 epochs and a tuned initial learning rate 0.0005, which is decayed by half after 50 epochs.
|
| 214 |
+
|
| 215 |
+
Results. The achieved AUPRC on the test set by all methods are presented in Table 2. Results show that our method can outperform all baselines by a large margin in terms of AUPRC, regardless of which model structure is used. These results clearly demonstrate that our method is effective for classification problems in which the sample distribution is highly imbalanced between classes.
|
| 216 |
+
|
| 217 |
+
# 4.3 Graph Classification for Drug Discovery
|
| 218 |
+
|
| 219 |
+
Data. In addition to molecular property prediction, we explore applying our method to drug discovery. Recent studies have shown that GNNs are effective in drug discovery through predicting the antibacterial property of chemical compounds [51]. Such application scenarios involves training a GNN model on labeled datasets and making predictions on a large library of chemical compounds so as to discover new antibiotic. However, because the positive samples in the training data, i.e., compounds known to have antibacterial property, are very rare, there exists very severe class imbalance.
|
| 220 |
+
|
| 221 |
+
We show that our method can serve as a useful solution to the above problem. We conduct experiments on the MIT AICURES dataset from an open challenge (https://www.aicures.mit.edu/tasks)
|
| 222 |
+
|
| 223 |
+
Table 3: The test AUPRC values on the MIT AICURES dataset with two graph neural networks, and on the Kaggle Melanoma dataset with two CNN models. We report the average AUPRC and standard deviation (within brackets) from 3 independent runs over 3 different train/validation/test splits.
|
| 224 |
+
|
| 225 |
+
<table><tr><td>Data</td><td colspan="2">MITAICURES</td><td colspan="2">Kaggle Melanoma</td></tr><tr><td>Networks</td><td>GINE</td><td>MPNN</td><td>ResNet18</td><td>ResNet34</td></tr><tr><td>CE</td><td>0.5037 (± 0.0718)</td><td>0.6282 (± 0.0634)</td><td>0.0701 (± 0.0031)</td><td>0.0582 (± 0.0016)</td></tr><tr><td>CB-CE</td><td>0.5655 (± 0.0453)</td><td>0.6308 (± 0.0263)</td><td>0.0631 (± 0.0065)</td><td>0.0721 (± 0.0054)</td></tr><tr><td>Focal</td><td>0.5143 (± 0.1062)</td><td>0.5875 (± 0.0774)</td><td>0.0549 (± 0.0083)</td><td>0.0663 (± 0.0034)</td></tr><tr><td>LDAM</td><td>0.5236 (± 0.0551)</td><td>0.6489 (± 0.0556)</td><td>0.0547 (± 0.0046)</td><td>0.0539 (± 0.0069)</td></tr><tr><td>AUC-M</td><td>0.5149 (± 0.0748)</td><td>0.5542 (± 0.0474)</td><td>0.1013 (± 0.0071)</td><td>0.0972 (± 0.0035)</td></tr><tr><td>SmothAP</td><td>0.2899 (± 0.0220)</td><td>0.4081 (± 0.0352)</td><td>0.1981 (± 0.0527)</td><td>0.2787 (± 0.0232)</td></tr><tr><td>FastAP</td><td>0.4777 (± 0.0896)</td><td>0.4518 (± 0.1495)</td><td>0.0324 (± 0.0087)</td><td>0.0359 (± 0.0062)</td></tr><tr><td>MinMax</td><td>0.5292 (± 0.0330)</td><td>0.5774 (± 0.0468)</td><td>0.0593 (± 0.0037)</td><td>0.0663 (± 0.0084)</td></tr><tr><td>SOAP</td><td>0.6639 (± 0.0515)</td><td>0.6547 (± 0.0616)</td><td>0.2624 (± 0.0410)</td><td>0.3152 (± 0.0337)</td></tr></table>
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 1: Comparison of convergence of different methods in terms of test AUPRC scores on CIFAR-10, CIFAR100 and MIT AICURES data.
|
| 229 |
+
|
| 230 |
+
in drug discovery. The dataset consists of 2097 molecules. There are 48 positive samples that have antibacterial activity to Pseudomonas aeruginosa, which is the pathogen leading to secondary lungs infections of COVID-19 patients. We conduct experiments on three random train/validation/test splits at $8 0 \% / 1 0 \% / 1 0 \%$ ratio, and report the average AUPRC on the test set over three splits.
|
| 231 |
+
|
| 232 |
+
Setup. Following the setup in Sec. 4.2, we use three GNNs: MPNN, GINE and ML-MPNN. We use the same two-stage training scheme with a similar hyper-parameter tuning. We pre-train GNNs by the Adam method for 100 epochs with a batch size of 64 and a tuned learning rate of 0.0005, which is decayed by half at the 50th epoch. Due to the limit of space, Table 3 only reports GINE and MPNN results. Please refer to Table 6 in the supplement for the full results of all three GNNs.
|
| 233 |
+
|
| 234 |
+
Results. The average test AUPRC from three independent runs over three splits are summarized in Table 3, Table 6. We can see that our SOAP can consistently outperform all baselines on all three GNN models. Our proposed optimization method can significantly improve the achieved AUPRC of GNN models, indicating that models tend to assign higher confidence scores to molecules with antibacterial activity. This can help identify a larger number of candidate drugs.
|
| 235 |
+
|
| 236 |
+
We have employed the proposed AUPRC maximization method for improving the testing performance on MIT AICures Challenge and achieved the 1st place. For details, please refer to [54].
|
| 237 |
+
|
| 238 |
+
# 4.4 Ablation Studies
|
| 239 |
+
|
| 240 |
+
Effects of Imbalance Ratio. We now study the effects of imbalance ratio on the performance improvements of our method. We use two datasets Tox21 and ToxCast from the MoleculeNet [55]. The Tox21 and ToxCast contain 8014 and 8589 molecules, respectively. There are 12 property prediction tasks in Tox21, and we conduct experiments on Task 0 and Task 2. Similarly, we select Task 12 and Task 8 of ToxCast for experiments. We use the split of train/validation/test set provided by MoleculeNet. The imbalanced ratios on the training sets are $4 . 1 4 \%$ for Task 0 of Tox21, $1 2 . 0 0 \%$ for Task 2 of Tox21, $2 . 9 7 \%$ for Task 12 of ToxCast, $8 . 6 7 \%$ for Task 8 of ToxCast.
|
| 241 |
+
|
| 242 |
+
Following Sec. 4.2, we test three neural network models MPNN, GINE and ML-MPNN. The hyperparameters for training models are also the same as those in Sec. 4.2. We present the results of Tox21 and ToxCast in Table 5 in the supplement. Our SOAP can consistently achieve improved performance when the data is extremely imbalanced. However, it sometimes fails to do so if the imbalance ratio is not too low. Clearly, the improvements from our method are higher when the imbalance ratio of labels is lower. In other words, our method is more advantageous for data with extreme class imbalance.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 2: Left most: insensitivity to batch size of SOAP. Right two: consistency between AP and Surrogate Objective $\mathbf { \nabla } _ { - } P ( \mathbf { w } )$ vs Iterations on CIFAR10 and CIFAR100.
|
| 246 |
+
|
| 247 |
+
Table 4: The test AUPRC over 3 independent runs by SOAP with different surrogate functions.
|
| 248 |
+
|
| 249 |
+
<table><tr><td>Data</td><td colspan="2">CIFAR10</td><td colspan="2">CIFAR100</td></tr><tr><td>Networks</td><td>ResNet18</td><td>ResNet34</td><td>ResNet18</td><td>ResNet34</td></tr><tr><td>Squared Hinge</td><td>0.7629 (±0.0014)</td><td>0.7012 (±0.0056)</td><td>0.6251 (±0.0053)</td><td>0.6001(±0.0060)</td></tr><tr><td>Logistic</td><td>0.7542 (±0.0024)</td><td>0.6968 (±0.0121)</td><td>0.6378 (±0.0031)</td><td>0.5923 (±0.0101)</td></tr><tr><td>Sigmoid</td><td>0.7652 (±0.0035)</td><td>0.6983 (±0.0084)</td><td>0.6271 (±0.0043)</td><td>0.5832 (±0.0054)</td></tr><tr><td>Data</td><td>HIV</td><td></td><td>MUV</td><td></td></tr><tr><td>Networks</td><td>GINE</td><td>MPNN</td><td>GINE</td><td>MPNN</td></tr><tr><td>Squared Hinge</td><td>0.3485(±0.0083)</td><td>0.3401(±0.0045)</td><td>0.0354(±0.0025)</td><td>0.3365 (±0.0008)</td></tr><tr><td>Logistic</td><td>0.3436 (±0.0043)</td><td>0.3617 (±0.0031)</td><td>0.0493 (±0.0261)</td><td>0.3352 (±0.0008)</td></tr><tr><td>Sigmoid</td><td>0.3387 (±0.0051)</td><td>0.3629 (±0.0063)</td><td>0.0298 (±0.0043)</td><td>0.3362 (±0.0009)</td></tr></table>
|
| 250 |
+
|
| 251 |
+
Insensitivity to Batch Size. We conduct experiments on CIFAR-10 and CIFAR-100 data by varying the mini-batch size for the SOAP algorithm and report results in Figure 2 (Left most). We can see that SOAP is not sensitive to the mini-batch size. This is consistent with our theory. In contrast, many previous methods for AP maximization are sensitive to the mini-batch size [47, 48, 6].
|
| 252 |
+
|
| 253 |
+
Convergence Speed. We report the convergence curves of different methods for maximizing AUPRC or AP in Figure 1 on different datasets. We can see that the proposed SOAP algorithms converge much faster than other baseline methods.
|
| 254 |
+
|
| 255 |
+
More Surrogate Losses. To verify the generality of SOAP, we evaluate the performance of SOAP with two more different surrogate loss functions $\ell ( \mathbf { w } ; \mathbf { x } _ { s } , \mathbf { x } _ { i } )$ as a surrogate function of the indicator I(hw(xs) ≥ hw(xi)), namely, the logistic loss, \`(w; xs, xi) = − log 11+exp(−c(\`(hw(xi)−hw(xs))) , and the sigmoid loss, \`(w; xs, xi) = 11+exp(c(\`(hw(xi)−hw(xs))) where $c$ is a hyperparameter. We tune $c \in \{ 1 , 2 \}$ in our experiments. We conduct experiments on CIFAR10, CIFAR100 following the experimental setting in Section 4.1 for the image data. For the graph data, we conduct experiments on HIV, MUV data following the experimental setting in Section 4.2. We report the results in Table 4. We can observe that SOAP has similar results with different surrogate loss functions.
|
| 256 |
+
|
| 257 |
+
Consistency. Finally, we show the consistency between the Surrogate Objective - $\mathbf { \nabla } \cdot P ( \mathbf { w } )$ and AP by plotting the convergence curves on different datasets in Figure 2 (Right two). It is obvious two see the consistency between our surrogate objective and the true AP.
|
| 258 |
+
|
| 259 |
+
# 5 Conclusions and Outlook
|
| 260 |
+
|
| 261 |
+
In this work, we have proposed a stochastic method to optimize AUPRC that can be used in deep learning for tackling highly imbalanced data. Our approach is based on maximizing the averaged precision, and we cast the objective into a sum of coupled compositional functions. We proposed efficient adaptive and non-adaptive stochastic algorithms with provable convergence guarantee to compute the solutions. Extensive experimental results on graph and image datasets demonstrate that our proposed method can achieve promising results, especially when the class distribution is highly imbalanced. One limitation of SOAP is its convergence rate is still slow. In the future, we will consider to improve the convergence rate to address the limitation of the present work.
|
| 262 |
+
|
| 263 |
+
# Acknowledgments
|
| 264 |
+
|
| 265 |
+
We thank Bokun Wang for discussing the proofs, and thank anonymous reviewers for constructive comments. Q.Q contributed to the algorithm design, analysis, and experiments under supervision of T.Y. Y.L and Z.X contributed to the experiments under supervision of S.J. Q.Q and T.Y were partially supported by NSF Career Award #1844403, NSF Award #2110545 and NSF Award #1933212. Y.L, Z.X and S.J were partially supported by NSF IIS-1955189.
|
| 266 |
+
|
| 267 |
+
# References
|
| 268 |
+
|
| 269 |
+
[1] Balasubramanian, K., Ghadimi, S., and Nguyen, A. Stochastic multi-level composition optimization algorithms with level-independent convergence rates. CoRR, abs/2008.10526, 2020.
|
| 270 |
+
[2] Bamber, D. The area above the ordinal dominance graph and the area below the receiver operating characteristic graph. Journal of Mathematical Psychology, 12:387–415, 1975.
|
| 271 |
+
[3] Boyd, K., Eng, K. H., and Page, C. D. Area under the precision-recall curve: Point estimates and confidence intervals. In Blockeel, H., Kersting, K., Nijssen, S., and Zelezny, F. (eds.), Machine Learning and Knowledge Discovery in Databases, pp. 451–466, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg.
|
| 272 |
+
[4] Brown, A., Xie, W., Kalogeiton, V., and Zisserman, A. Smooth-ap: Smoothing the path towards large-scale image retrieval. In European Conference on Computer Vision, pp. 677–694. Springer, 2020.
|
| 273 |
+
[5] Burges, C., Ragno, R., and Le, Q. Learning to rank with nonsmooth cost functions. In Schölkopf, B., Platt, J., and Hoffman, T. (eds.), Advances in Neural Information Processing Systems, volume 19. MIT Press, 2007.
|
| 274 |
+
[6] Cakir, F., He, K., Xia, X., Kulis, B., and Sclaroff, S. Deep metric learning to rank. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 275 |
+
[7] Cao, K., Wei, C., Gaidon, A., Arechiga, N., and Ma, T. Learning imbalanced datasets with label-distribution-aware margin loss. In Advances in Neural Information Processing Systems, pp. 1567–1578, 2019.
|
| 276 |
+
[8] Chen, K., Li, J., Lin, W., See, J., Wang, J., Duan, L., Chen, Z., He, C., and Zou, J. Towards accurate one-stage object detection with ap-loss. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 277 |
+
[9] Chen, K., Lin, W., See, J., Wang, J., Zou, J., et al. Ap-loss for accurate one-stage object detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
|
| 278 |
+
[10] Chen, T., Sun, Y., and Yin, W. Solving stochastic compositional optimization is nearly as easy as solving stochastic optimization. IEEE Transactions on Signal Processing, 69:4937–4948, 2021.
|
| 279 |
+
[11] Chen, W., Liu, T.-Y., Lan, Y., Ma, Z., and Li, H. Ranking measures and loss functions in learning to rank. In Proceedings of the 22nd International Conference on Neural Information Processing Systems, NIPS’09, pp. 315–323, Red Hook, NY, USA, 2009. Curran Associates Inc. ISBN 9781615679119.
|
| 280 |
+
[12] Cortes, C. and Mohri, M. Auc optimization vs. error rate minimization. In Thrun, S., Saul, L. K., and Schölkopf, B. (eds.), Advances in Neural Information Processing Systems 16, pp. 313–320. 2004.
|
| 281 |
+
[13] Cui, Y., Jia, M., Lin, T.-Y., Song, Y., and Belongie, S. Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9268–9277, 2019.
|
| 282 |
+
|
| 283 |
+
[14] Davis, J. and Goadrich, M. The Relationship Between Precision-Recall and ROC Curves. In ICML ’06: Proceedings of the 23rd international conference on Machine learning, pp. 233–240, New York, NY, USA, 2006. ACM. ISBN 1-59593-383-2.
|
| 284 |
+
|
| 285 |
+
[15] Eban, E., Schain, M., Mackey, A., Gordon, A., Saurous, R. A., and Elidan, G. Scalable learning of non-decomposable objectives. In International Conference on Arti cial Intelligence and Statistics (AISTATS), 2017.
|
| 286 |
+
|
| 287 |
+
[16] Gao, H. and Ji, S. Graph u-nets. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 2083–2092. PMLR, 09–15 Jun 2019.
|
| 288 |
+
|
| 289 |
+
[17] Gao, H., Wang, Z., and Ji, S. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’18, pp. 1416–1424, New York, NY, USA, 2018. Association for Computing Machinery.
|
| 290 |
+
|
| 291 |
+
[18] Gao, W., Jin, R., Zhu, S., and Zhou, Z.-H. One-pass auc optimization. In ICML (3), pp. 906–914, 2013.
|
| 292 |
+
|
| 293 |
+
[19] Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyals, O., and Dahl, G. E. Neural message passing for quantum chemistry. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1263–1272, International Convention Centre, Sydney, Australia, 2017.
|
| 294 |
+
|
| 295 |
+
[20] Goadrich, M., Oliphant, L., and Shavlik, J. Gleaner: Creating ensembles of firstorder clauses to improve recall-precision curves. In Machine Learning, pp. 2006, 2006.
|
| 296 |
+
|
| 297 |
+
[21] Guo, Z., Liu, M., Yuan, Z., Shen, L., Liu, W., and Yang, T. Communication-efficient distributed stochastic auc maximization with deep neural networks. In Proceedings of the 37th International Conference on Machine Learning (ICML), pp. 3864–3874, 2020.
|
| 298 |
+
|
| 299 |
+
[22] Guo, Z., Yuan, Z., Yan, Y., and Yang, T. Fast objective and duality gap convergence for non-convex strongly-concave min-max problems. arXiv preprint arXiv:2006.06889, 2020.
|
| 300 |
+
|
| 301 |
+
[23] He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 302 |
+
|
| 303 |
+
[24] Henderson, P. and Ferrari, V. End-to-end training of object class detectors for mean average precision. In Computer Vision – ACCV 2016, pp. 198–213. Springer International Publishing, 2017. doi: 10.1007/978-3-319-54193-8_13. URL https://doi.org/10.1007% 2F978-3-319-54193-8_13.
|
| 304 |
+
|
| 305 |
+
[25] Herschtal, A. and Raskutti, B. Optimising area under the ROC curve using gradient descent. In Proceedings of the 21st International Conference on Machine Learning (ICML), pp. 49, 2004.
|
| 306 |
+
|
| 307 |
+
[26] Hu, W., Liu, B., Gomes, J., Zitnik, M., Liang, P., Pande, V., and Leskovec, J. Strategies for pre-training graph neural networks. In Proceddings of the 7th international conference on learning representations, 2019.
|
| 308 |
+
|
| 309 |
+
[27] Huo, Z., Gu, B., Liu, J., and Huang, H. Accelerated method for stochastic composition optimization with nonsmooth regularization. In McIlraith, S. A. and Weinberger, K. Q. (eds.), Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), pp. 3287–3294, 2018.
|
| 310 |
+
|
| 311 |
+
[28] Joachims, T. A support vector method for multivariate performance measures. In Proceedings of the 22nd International Conference on Machine learning, pp. 377–384, 2005.
|
| 312 |
+
|
| 313 |
+
[29] Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, 2017.
|
| 314 |
+
|
| 315 |
+
[30] Lian, X., Wang, M., and Liu, J. Finite-sum composition optimization via variance reduced gradient descent. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 1159–1167, 2017.
|
| 316 |
+
|
| 317 |
+
[31] Lin, T., Fan, C., Wang, M., and Jordan, M. I. Improved oracle complexity for stochastic compositional variance reduced gradient. CoRR, abs/1806.00458, 2018.
|
| 318 |
+
[32] Lin, T.-Y., Goyal, P., Girshick, R., He, K., and Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980–2988, 2017.
|
| 319 |
+
[33] Liu, L., Liu, J., Hsieh, C., and Tao, D. Stochastically controlled stochastic gradient for the convex and non-convex composition problem. CoRR, abs/1809.02505, 2018.
|
| 320 |
+
[34] Liu, L., Liu, J., and Tao, D. Dualityfree methods for stochastic composition optimization. IEEE Transactions on Neural Networks and Learning Systems, 30(4):1205–1217, 2019.
|
| 321 |
+
[35] Liu, M., Zhang, X., Chen, Z., Wang, X., and Yang, T. Fast stochastic auc maximization with $o ( 1 / n )$ -convergence rate. In Proceedings of the 35th International Conference on Machine Learning, pp. 3189–3197. PMLR, 2018.
|
| 322 |
+
[36] Liu, M., Yuan, Z., Ying, Y., and Yang, T. Stochastic auc maximization with deep neural networks. In International Conference on Learning Representations, 2020.
|
| 323 |
+
[37] Metzler, D. and Croft, W. B. A markov random field model for term dependencies. In Proceedings of the 28th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR, 2005.
|
| 324 |
+
[38] Metzler, D. and Croft, W. B. A markov random field model for term dependencies. In Proceedings of the 28th annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 472–479, 2005.
|
| 325 |
+
[39] Mohapatra, P., Jawahar, C., and Kumar, M. P. Efficient optimization for average precision svm. In Advances in Neural Information Processing Systems, 2014.
|
| 326 |
+
[40] Mohapatra, P., Rolinek, M., Jawahar, C. V., Kolmogorov, V., and Kumar, M. Efficient optimization for rank-based loss functions. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3693–3701, 2018.
|
| 327 |
+
[41] Narasimhan, H., Cotter, A., and Gupta, M. Optimizing generalized rate metrics with three players. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/ 3ce257b311e5acf849992f5a675188e8-Paper.pdf.
|
| 328 |
+
[42] Natole, M., Ying, Y., and Lyu, S. Stochastic proximal algorithms for auc maximization. In Proceedings of the 35th International Conference on Machine Learning, pp. 3710–3719. PMLR, 2018.
|
| 329 |
+
[43] Oksuz, K., Cam, B. C., Akbas, E., and Kalkan, S. A ranking-based, balanced loss function unifying classification and localisation in object detection. In Advances in Neural Information Processing Systems, 2020.
|
| 330 |
+
[44] Qi, Q. Soap code for reproducing results. https://github.com/Optimization-AI, 2021.
|
| 331 |
+
[45] Qi, Q., Xu, Y., Jin, R., Yin, W., and Yang, T. Attentional biased stochastic gradient for imbalanced classification. arXiv preprint arXiv:2012.06951, 2020.
|
| 332 |
+
[46] Qi, Q., Guo, Z., Xu, Y., Jin, R., and Yang, T. An online method for a class of distributionally robust optimization with non-convex objectives. In Proceedings of Thirty-fifth Conference on Neural Information Processing Systems (NeurIPS), 2021.
|
| 333 |
+
[47] Qin, T., Liu, T.-Y., and Li, H. A general approximation framework for direct optimization of information retrieval measures. Technical Report MSR-TR-2008-164, November 2008.
|
| 334 |
+
[48] Rolinek, M., Musil, V., Paulus, A., Vlastelica, M., Michaelis, C., and Martius, G. Optimizing rank-based metrics with blackbox differentiation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 335 |
+
[49] Rotemberg, V., Kurtansky, N., Betz-Stablein, B., Caffery, L., Chousakos, E., Codella, N., Combalia, M., Dusza, S., Guitera, P., Gutman, D., et al. A patient-centric dataset of images and metadata for identifying melanomas using clinical context. arXiv preprint arXiv:2008.07360, 2020.
|
| 336 |
+
[50] Song, Y., Schwing, A., Richard, and Urtasun, R. Training deep neural networks via direct loss minimization. In Balcan, M. F. and Weinberger, K. Q. (eds.), Proceedings of The $3 3 r d$ International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 2169–2177, New York, New York, USA, 20–22 Jun 2016. PMLR.
|
| 337 |
+
[51] Stokes, J. M., Yang, K., Swanson, K., Jin, W., Cubillos-Ruiz, A., Donghia, N. M., MacNair, C. R., French, S., Carfrae, L. A., Bloom-Ackerman, Z., et al. A deep learning approach to antibiotic discovery. Cell, 180(4):688–702, 2020.
|
| 338 |
+
[52] Wang, M., Fang, E. X., and Liu, H. Stochastic compositional gradient descent: algorithms for minimizing compositions of expected-value functions. Mathematical Programming, 161(1-2): 419–449, 2017.
|
| 339 |
+
[53] Wang, M., Liu, J., and Fang, E. X. Accelerating stochastic composition optimization. Journal Machine Learning Research, 18:105:1–105:23, 2017.
|
| 340 |
+
[54] Wang, Z., Liu, M., Luo, Y., Xu, Z., Xie, Y., Wang, L., Cai, L., Qi, Q., Yuan, Z., Yang, T., and Ji, S. Advanced graph and sequence neural networks for molecular property prediction and drug discovery, 2021.
|
| 341 |
+
[55] Wu, Z., Ramsundar, B., Feinberg, E. N., Gomes, J., Geniesse, C., Pappu, A. S., Leswing, K., and Pande, V. MoleculeNet: a benchmark for molecular machine learning. Chemical science, 9 (2):513–530, 2018.
|
| 342 |
+
[56] Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? In 7th International Conference on Learning Representations, 2019.
|
| 343 |
+
[57] Yan, Y., Xu, Y., Lin, Q., Liu, W., and Yang, T. Optimal epoch stochastic gradient descent ascent methods for min-max optimization. In Advances in Neural Information Processing Systems 33 (NeurIPS), 2020.
|
| 344 |
+
[58] Ying, Y., Wen, L., and Lyu, S. Stochastic online auc maximization. In Advances in Neural Information Processing Systems, pp. 451–459, 2016.
|
| 345 |
+
[59] Yu, Y. and Huang, L. Fast stochastic variance reduced ADMM for stochastic composition optimization. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence (IJCAI), pp. 3364–3370, 2017.
|
| 346 |
+
[60] Yuan, Z., Yan, Y., Sonka, M., and Yang, T. Robust deep auc maximization: A new surrogate loss and empirical studies on medical image classification. arXiv preprint arXiv:2012.03173, 2020.
|
| 347 |
+
[61] Yue, Y., Finley, T., Radlinski, F., and Joachims, T. A support vector method for optimizing average precision. In Proceedings of the 30th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR ’07, pp. 271–278, New York, NY, USA, 2007. Association for Computing Machinery.
|
| 348 |
+
[62] Zhang, J. and Xiao, L. A composite randomized incremental gradient method. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning (ICML), volume 97, pp. 7454–7462, 2019.
|
| 349 |
+
[63] Zhao, P., Hoi, S. C. H., Jin, R., and Yang, T. Online auc maximization. In ICML, pp. 233–240, 2011.
|
md/train/QbVza2PKM7T/QbVza2PKM7T.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Beyond Pinball Loss: Quantile Methods for Calibrated Uncertainty Quantification
|
| 2 |
+
|
| 3 |
+
# Youngseog Chung
|
| 4 |
+
|
| 5 |
+
Machine Learning Department Carnegie Mellon University Pittsburgh, PA 15213 youngsec@cs.cmu.edu
|
| 6 |
+
|
| 7 |
+
Willie Neiswanger
|
| 8 |
+
Department of Computer Science
|
| 9 |
+
Stanford University
|
| 10 |
+
Stanford, CA 94305
|
| 11 |
+
neiswanger@cs.stanford.edu
|
| 12 |
+
|
| 13 |
+
# Ian Char
|
| 14 |
+
|
| 15 |
+
# Jeff Schneider
|
| 16 |
+
|
| 17 |
+
Machine Learning Department
|
| 18 |
+
Carnegie Mellon University Pittsburgh, PA 15213 ichar@cs.cmu.edu
|
| 19 |
+
|
| 20 |
+
Robotics Institute Carnegie Mellon University Pittsburgh, PA 15213 schneide@cs.cmu.edu
|
| 21 |
+
|
| 22 |
+
# Abstract
|
| 23 |
+
|
| 24 |
+
Among the many ways of quantifying uncertainty in a regression setting, specifying the full quantile function is attractive, as quantiles are amenable to interpretation and evaluation. A model that predicts the true conditional quantiles for each input, at all quantile levels, presents a correct and efficient representation of the underlying uncertainty. To achieve this, many current quantile-based methods focus on optimizing the pinball loss. However, this loss restricts the scope of applicable regression models, limits the ability to target many desirable properties (e.g. calibration, sharpness, centered intervals), and may produce poor conditional quantiles. In this work, we develop new quantile methods that address these shortcomings. In particular, we propose methods that can apply to any class of regression model, select an explicit balance between calibration and sharpness, optimize for calibration of centered intervals, and produce more accurate conditional quantiles. We provide a thorough experimental evaluation of our methods, which includes a high dimensional uncertainty quantification task in nuclear fusion.
|
| 25 |
+
|
| 26 |
+
# 1 Introduction
|
| 27 |
+
|
| 28 |
+
Uncertainty quantification (UQ) in machine learning typically refers to the task of quantifying the confidence of a given prediction. This measure of certainty can be crucial in a variety of downstream applications, including Bayesian optimization [36, 45, 54], model-based reinforcement learning [64, 42, 10, 18], and in high-stakes predictions where mistakes incur large costs [52, 61].
|
| 29 |
+
|
| 30 |
+
While the common goal of UQ is to describe predictive distributions over outputs for given inputs, the representation of the distributional prediction varies across methods. For example, some methods assume a parametric distribution and return parameter estimates [65, 14, 37], while others return density function estimates, as is common in Bayesian methods [41, 38, 24, 3, 33, 50]. Alternatively, many methods represent predictive uncertainty with quantile estimates [15, 53, 58, 49, 27].
|
| 31 |
+
|
| 32 |
+
Quantiles provide an attractive representation for uncertainty because they can be used to model complex distributions without parametric assumptions, are interpretable with units in the target output space, allow for easy construction of prediction intervals, and can be used to efficiently sample from the predictive distribution via inverse transform sampling [22, 32]. Learning the quantile for a single quantile level is a well studied problem in quantile regression (QR) [30, 32], which typically involves optimizing the so-called pinball loss, a tilted transformation of the absolute value function. Given a target $y$ , a prediction $\hat { y }$ , and quantile level $\tau \in ( 0 , 1 )$ , the pinball loss $\rho _ { \tau }$ is defined as
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\rho _ { \tau } ( y , \hat { y } ) = ( \hat { y } - y ) ( \mathbb { I } \{ y \leq \hat { y } \} - \tau ) .
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
By training for all quantiles simultaneously, recent works have made concrete steps in incorporating QR methods to form competitive UQ methods which output the full predictive distribution [51, 58].
|
| 39 |
+
|
| 40 |
+
In this work, we highlight some limitations of the pinball loss and propose several methods to address these shortcomings. Specifically, we explore the following:
|
| 41 |
+
|
| 42 |
+
• Model agnostic QR. Optimizing the pinball loss often restricts the choice of model family for which we can provide UQ. We propose an algorithm to learn all quantiles simultaneously by utilizing methods from conditional density estimation. This algorithm is agnostic to model class and can be applied to any regression model.
|
| 43 |
+
• Explicitly balancing calibration and sharpness. While the pinball loss, as a proper scoring rule, targets both calibration and sharpness, the balance between these two quantities is made implicitly, which may result in a poor optimization objective. We propose a tunable loss function that targets calibration and sharpness separately, and allows the end-user to set an explicit balance.
|
| 44 |
+
• Centered intervals. In practice, we often desire uncertainty predictions made with centered intervals, which are not targeted via the pinball loss. We propose an alternative loss function that is better suited for this goal.
|
| 45 |
+
• Encouraging individual calibration. Perfect quantile forecasts will satisfy individual calibration (Eq. 2), which is a much stricter condition than the more-commonly used notion of average calibration (Eq. 3). We introduce a training procedure that aims to improve quantile predictions beyond average calibration, and demonstrate its efficacy via adversarial group calibration (Eq. 4).
|
| 46 |
+
|
| 47 |
+
We proceed by first describing methods of assessing the quality of predictive UQ and the pitfalls of optimizing the pinball loss in Section 2. Drawing motivation from this, we then present our proposed methods in Section 3. In Section 4, we demonstrate our methods experimentally, where we model predictive uncertainty on benchmark datasets, and on a high-dimensional, real-world uncertainty estimation task in the area of nuclear fusion.
|
| 48 |
+
|
| 49 |
+
# 2 Preliminaries and Background
|
| 50 |
+
|
| 51 |
+
We first lay out the notation, terminology, and class of models considered in this paper. Then we provide an overview of evaluation metrics in UQ and demonstrate how the pinball loss may be inadequate both as an evaluation metric and as an optimization objective.
|
| 52 |
+
|
| 53 |
+
# 2.1 Notation
|
| 54 |
+
|
| 55 |
+
Bold upper case letters $\mathbf { X }$ , $\mathbf { Y }$ denote random variables, lower case letters $x , y$ , denote their values, and calligraphic upper case letters $\mathcal { X } , \mathcal { y }$ denote sets of possible values. We use $x \in \mathcal { X }$ to denote the input feature vector and $y \in \mathcal { V }$ to denote the corresponding target. Additionally, we consider the regression setting where $\mathcal { V } \subset \mathbb { R }$ and $\mathcal { X } \subset \mathbb { R } ^ { n }$ . We use $\mathbb { F } _ { \mathbf { X } } , \mathbb { F } _ { \mathbf { Y | } x } , \mathbb { F } _ { \mathbf { Y } }$ to denote the true cumulative distribution of the subscript random variable. For any $x \in \mathcal { X }$ , we assume there exists a true conditional distribution $\mathbb { F } _ { \mathbf { Y } \mid x }$ over $\mathcal { V }$ , and we assume $\mathbb { Q } _ { p } ( x )$ denotes the true $p ^ { \mathrm { t h } }$ quantile of this distribution, i.e. $\mathbb { F } _ { \mathbf { Y } | x } ( \mathbb { Q } _ { p } ( x ) ) = p$ . Any estimates of the true functions $\mathbb { F } , \mathbb { Q } _ { p }$ will be denoted with a hat, $\hat { \mathbb { F } } , \hat { \mathbb { Q } } _ { p }$ . We will specifically refer to any family of estimates for $\mathbb { Q } _ { p }$ , with $p \in ( 0 , 1 )$ , as a “quantile model”, denoted $\hat { \mathbb { Q } } : \mathcal { X } \times ( 0 , 1 ) \mathcal { Y }$ . Unless otherwise noted, we will always consider the conditional problem of estimating quantities in the target space $\mathcal { V }$ , conditioned on a value $x \in \mathcal { X }$ .
|
| 56 |
+
|
| 57 |
+
# 2.2 Assessing the Quality of Predictive UQ
|
| 58 |
+
|
| 59 |
+
While various metrics have been proposed to assess the quality of UQ, there has been a great deal of recent focus on the notions of calibration and sharpness [15, 13, 65, 60, 55, 35, 21, 20]. We introduce calibration here, but for a more thorough treatment, see Zhao et al. [65]. Broadly speaking, calibration in the regression setting requires that the probability of observing the target random variable below a predicted $p ^ { \mathrm { t h } }$ quantile is equal to the expected probability $p$ , for all $p \in ( 0 , 1 )$ . We refer to the former quantity as the observed probability and denote it $p ^ { \mathrm { o b s } } ( p )$ , for an expected probability $p$ , which we will write as $p ^ { \mathrm { o b s } }$ when it is clear from context. Calibration requires $p ^ { \mathrm { o b s } } ( p ) = p$ , $\forall p \in ( 0 , 1 )$ . From this generic statement, we can describe different notions of calibration based on how $p ^ { \mathrm { o b s } }$ is defined.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 1: (a) Test loss continues to decrease until the validated epoch. (b-c) At the validated epoch, $S Q R$ (optimizes pinball loss) is highly miscalibrated while sharper than the true sharpness level. Cali (optimizes proposed calibration loss) is better calibrated while less sharp than the true sharpness.
|
| 63 |
+
|
| 64 |
+
A model is individually calibrated if it outputs the true conditional quantiles, i.e. $\hat { \mathbb { Q } } _ { p } ( x ) = \mathbb { Q } _ { p } ( x )$ In this case, we define the observed probability to be
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
p _ { i n d v } ^ { \mathrm { o b s } } ( p , x ) : = \mathbb { F } _ { \mathbf { Y } | x } ( \hat { \mathbb { Q } } _ { p } ( x ) ) , \forall x \in \mathcal { X } , \forall p \in ( 0 , 1 ) .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
In words, this requires that the probability of observing $y$ below the quantile prediction is equal to $p$ , at each point $x \in \mathcal { X }$ , individually. If we can verify this property for all $x \in \mathcal { X }$ , then by definition, we will know the quantile output is correct and precisely the true conditional quantile. However, individual calibration is typically unverifiable with finite datasets in the assumption-less case [65].
|
| 71 |
+
|
| 72 |
+
A relaxed condition is average calibration. In this case, we define the observed probability to be
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
p _ { a v g } ^ { \mathrm { o b s } } ( p ) : = \mathbb { E } _ { x \sim \mathbb { F } _ { \mathbf { X } } } [ \mathbb { F } _ { \mathbf { Y } \mid x } ( \hat { \mathbb { Q } } _ { p } ( x ) ) ] , \forall p \in ( 0 , 1 ) ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
i.e. the probability of observing the target below the quantile prediction, averaged over $\mathbb { F } _ { X }$ , is equal to $D = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ $p$ . Average calibration is often referred to simply as “calibration” [13, 35]. Given a dataset , we can estimate $p _ { a v g } ^ { \mathrm { o b s } } ( p )$ with $\begin{array} { r } { \hat { p } _ { a v g } ^ { \mathrm { o b s } } ( D , p ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathbb { I } \{ y _ { i } \leq \hat { \mathbb { Q } } _ { p } ( x _ { i } ) \} } \end{array}$ . Note that if our quantile estimate achieves average calibration then $\hat { p } _ { a v g } ^ { \mathrm { o b s } } p$ as $N \infty$ , $\forall p \in ( 0 , 1 )$ The degree of error in average calibration is commonly measured by expected calibration error [60, 13, 21], $\begin{array} { r } { \mathrm { E C E } ( D , \hat { \mathbb { Q } } ) = \frac { 1 } { m } \sum _ { j = 1 } ^ { m } \left| \hat { p } _ { a v g } ^ { \mathrm { o b s } } \left( D , p _ { j } \right) - p _ { j } \right| } \end{array}$ , where $p _ { j } \sim \mathrm { U n i f } ( 0 , 1 )$ .
|
| 79 |
+
|
| 80 |
+
It may be possible to have an uninformative, yet average calibrated model. For example, quantile predictions that match the true marginal quantiles of $\mathbb { F } _ { \mathbf { Y } }$ will be average calibrated, but will hardly be useful since they do not depend on the input $x$ . Therefore, the notion of sharpness is also considered, which quantifies the concentration of distributional predictions [20]. For example, for non-parametric predictions, the width of a centered $9 5 \%$ prediction interval is often used as a measure of sharpness. There generally exists a tradeoff between average calibration and sharpness [20, 46].
|
| 81 |
+
|
| 82 |
+
Recent works have suggested a notion of calibration stronger than average calibration, called adversarial group calibration [65]. This stems from the notion of group calibration [23, 29], which prescribes measurable subsets $s _ { i } \subset \mathcal { X }$ s.t. $P _ { x \sim \mathbb { F } _ { \mathbf { X } } } ( x \in S _ { i } ) > 0$ , $i = 1 , \ldots , k$ , and requires the predictions to be average calibrated within each subset. Adversarial group calibration then requires average calibration for any subset of $\mathcal { X }$ with non-zero measure. Denote $\mathbf { X } _ { \mathcal { S } }$ as a random variable that is conditioned on being in the set $s$ . For adversarial group calibration, the observed probability is
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
p _ { a d v } ^ { \mathsf { o b s } } ( p ) : = \mathbb { E } _ { x \sim \mathbb { F } _ { \mathbf { X } _ { S } } } [ \mathbb { F } _ { \mathbf { Y } | x } ( \hat { \mathbb { Q } } _ { p } ( x ) ) ] , \forall p \in ( 0 , 1 ) , \forall S \subset \mathcal { K } \mathrm { ~ s . t . ~ } P _ { x \sim \mathbb { F } _ { \mathbf { X } } } ( x \in S ) > 0 .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
With a finite dataset, we can measure a proxy of adversarial group calibration by measuring the average calibration within all subsets of the dataset with sufficiently many points.
|
| 89 |
+
|
| 90 |
+
Intuitively, individual calibration inspects the discrepancy between $p ^ { \mathrm { o b s } }$ and $p$ for individual inputs $x \in \mathcal { X }$ , adversarial group calibration relaxes this by inspecting any subset of $\mathcal { X }$ with non-zero measure, and average calibration relaxes this further by considering the full distribution of $\mathbf { X }$ .
|
| 91 |
+
|
| 92 |
+
One alternative family of evaluation metrics is proper scoring rules [19]. Proper scoring rules are summary statistics of overall performance of a distributional prediction and consider both calibration and sharpness jointly [20]. For example, negative log-likelihood (NLL) is a proper scoring rule that is commonly used with density predictions [14, 48, 37]. For quantile predictions, one proper score is the check score, which is identical to the pinball loss. Since proper scoring rules consider both calibration and sharpness together in a single value, they can serve as optimization objectives for UQ. For example, optimizing the pinball loss is the traditional method in quantile regression [31], and many recent quantile-based UQ methods focus on optimizing this objective [51, 58, 8, 63].
|
| 93 |
+
|
| 94 |
+
In this work, however, we note that the balance between calibration and sharpness implied by the pinball loss is arbitrary and depends on the expressivity of the model class—and with highly expressive models, this balance can be heavily skewed towards sharpness. In their seminal work on probabilistic forecasts, Gneiting and Raftery [19] contend that the goal of probabilistic forecasting is to “maximize the sharpness of the predictive distribution subject to calibration”, i.e. calibration should be first achieved and then sharpness optimized. We show that common machine learning methods that use the pinball loss objective may in fact lead to an arbitrary and miscalibrated UQ.
|
| 95 |
+
|
| 96 |
+
Proposition 1. Consider a finite dataset $D$ , the pinball loss $\rho _ { \tau }$ (Eq. 1) and a quantile model $f : \mathcal { X } \times ( 0 , 1 ) \mathcal { Y }$ that is average calibrated on $D$ , i.e. $E C E ( D , f ) = 0$ . Then there always exists another quantile modlower pinball loss than $f$ $g : \mathcal { X } \times ( 0 , 1 ) \mathcal { Y }$ $D$ $\begin{array} { r } { \sum _ { i = 1 } ^ { N } \rho _ { \tau } ( y _ { i } , g _ { \tau } ( x _ { i } ) ) < \sum _ { i = 1 } ^ { N } \rho _ { \tau } ( y _ { i } , f _ { \tau } ( x _ { i } ) ) } \end{array}$ l , $\tau \in ( 0 , 1 )$ , g hasaverage calibration than $f _ { i }$ , i.e. $E C E ( D , g ) \stackrel { } { > } E \dot { C } E ( D , f )$ .
|
| 97 |
+
|
| 98 |
+
Proof: The proof is given in Appendix A.1.
|
| 99 |
+
|
| 100 |
+
This proposition essentially states how the pinball loss can become detached from calibration, and we show its practical ramifications via a synthetic example in Figure 1 (experiment details in Appendix E.1). We first note in Figure 1 (a) and (b) that even while the pinball loss decreases on the test set, test calibration worsens (while sharpness improves). Further, at the best validation epoch, optimizing the pinball loss converges to a solution that is sharper than the true noise level. Note that a UQ that is sharper than the true noise level will never be calibrated (meanwhile, a less sharp prediction can still be calibrated, e.g. the marginal distribution $\mathbb { F } _ { \mathbf { Y } }$ ). While this may seem like an issue that can simply be addressed with regularization, we demonstrate in Appendix E.2 how that is not the case. These pitfalls motivate our methods in Section 3.
|
| 101 |
+
|
| 102 |
+
# 3 Methods
|
| 103 |
+
|
| 104 |
+
We propose four methods that aim to produce an improved quantile model. The first is a modelagnostic procedure that relies on conditional density estimation (Section 3.1). To address settings where density estimation may be difficult, we then propose two loss functions to optimize with differentiable models: the combined calibration loss (Section 3.2), which directly optimizes calibration and sharpness, and the interval score (Section 3.3), which is a proper scoring rule for centered intervals. Finally, we propose a group batching method (Section 3.4) that can be applied to the batch optimization procedure for any loss function (e.g. combined calibration loss, interval score, and even pinball loss) to induce better convergence towards adversarial group calibration.
|
| 105 |
+
|
| 106 |
+
# 3.1 Utilizing Conditional Density Estimation for Model Agnostic QR
|
| 107 |
+
|
| 108 |
+
One drawback of many existing quantile-based UQ methods is that their training procedure requires differentiable models. In fact, most UQ methods require a specific class of models because of their modeling structure or their loss objective (e.g. Gaussian processes [50], dropout [17], latent variable models [33], simultaneous pinball loss [58], and NLL-based losses [37]). This model restriction can be especially unfavorable in practical settings. A domain expert with an established point prediction model and compute infrastructure may want to add UQ without much additional overhead.
|
| 109 |
+
|
| 110 |
+
To address these issues, we can consider the following model-agnostic procedure. Instead of optimizing a designated loss function, we can consider splitting the given problem into two parts: estimate conditional quantiles directly from data, then regress onto these estimates. The benefit of this method is that, granted we can estimate the conditional quantiles accurately, we can use any regression model to regress onto these quantile estimates. Further, this regression task directly targets the goal of producing the true conditional quantiles (i.e. individual calibration). This procedure, which we refer to as Model Agnostic QR (MAQR), is outlined in Algorithm 1.
|
| 111 |
+
|
| 112 |
+
# Algorithm 1 MAQR
|
| 113 |
+
|
| 114 |
+
1: Input: Train data $\{ x _ { i } , y _ { i } \} _ { i = 1 } ^ { N }$ , trained regression model $\hat { f } ( x )$
|
| 115 |
+
2: Calculate residuals $\epsilon _ { i } = y _ { i } - \hat { f } ( x _ { i } ) ,$ $i \in$ $[ N ]$ , and denote the residual dataset $R =$ $\mathbf { \bar { \{ } } x _ { i } , \epsilon _ { i } \} _ { i = 1 } ^ { N }$
|
| 116 |
+
3: Initialize $D \emptyset$
|
| 117 |
+
4: for $i = 1$ to $N$ do
|
| 118 |
+
5: $D _ { i }$ ← CONDQUANTILESESTIMATORS $( R , i )$ (Algorithm 2)
|
| 119 |
+
6: $D D \cup D _ { i }$
|
| 120 |
+
7: end for
|
| 121 |
+
8: Use $D$ to fit a regression model $\hat { g }$ $\widehat { g } : ( x , p ) \mapsto \overline { { \epsilon } }$
|
| 122 |
+
9: Output: $\hat { f } + \hat { g }$
|
| 123 |
+
|
| 124 |
+
1: Input: Dataset $\{ x _ { i } , \epsilon _ { i } \} _ { i = 1 } ^ { N }$ , point index $k \in$
|
| 125 |
+
$[ N ]$
|
| 126 |
+
2 $: \stackrel { \cdot } { E } _ { k , d _ { N } } ^ { \enspace \enspace } \gets \enspace \{ \epsilon _ { i } \enspace : \enspace \mathrm { d i s t } ( x _ { k } , x _ { i } ) \enspace \le \enspace d _ { N } , i \enspace \in$
|
| 127 |
+
3: Construct an empirical CDF with $E _ { k , d _ { N } }$ to
|
| 128 |
+
produce $\hat { \mathbb { F } } _ { \mathbf { E } | x _ { k } } : \epsilon \mapsto p \in [ 0 , 1 ]$
|
| 129 |
+
4: Initialize $D \varnothing$
|
| 130 |
+
5: for each $\epsilon _ { j }$ in $E _ { k , d _ { N } }$ do
|
| 131 |
+
6: pˆk,j ← FˆE|xk (j )
|
| 132 |
+
7: $D \gets D \cup \{ x _ { k } , \hat { p } _ { k , j } , \epsilon _ { j } \}$
|
| 133 |
+
8: end for
|
| 134 |
+
9: Output: D
|
| 135 |
+
|
| 136 |
+
MAQR is based on the key assumption that nearby points in $\mathcal { X }$ will have similar conditional distributions, i.e. if $x _ { j } \approx x _ { k }$ then $\mathbb { F } _ { \mathbf { Y } | x _ { j } } \approx \mathbb { F } _ { \mathbf { Y } | x _ { k } }$ . Given this smoothness assumption, we can group neighboring points to estimate the conditional density at each locality over $\mathcal { X }$ , with locality determined by the hyperparameter $d _ { N }$ (Algorithm 2, line 2). We then construct an empirical CDF with the group of neighboring points, and conditional quantile estimates are produced with this empirical CDF. These estimates are collected into $D$ (Algorithm 1, line 6), which is ultimately used as the training set for the quantile model $\hat { g }$ .
|
| 137 |
+
|
| 138 |
+
In practice, we perform these steps with residuals, by first estimating a mean function $\hat { f }$ (Algorithm 1, line 1). This practical choice stems from existing works in conditional density estimation, which suggests that having 0 conditional mean in the data provides benefits in terms of lower asymptotic mean squared error in the conditional density predictions [26]. Further, this demonstrates how MAQR can be readily applied in the application setting where an accurate point prediction model often already exist.
|
| 139 |
+
|
| 140 |
+
Algorithm 1 is a specific implementation of a more general model-agnostic algorithm, in which we directly estimate conditional quantiles from the data with tools from conditional density estimation. We note that using KDEs for conditional density estimation is a well studied problem with theoretical guarantees [25, 26, 57]. In the case the distance in $\mathcal { X }$ is measured using a uniform kernel with mild assumptions on the bandwidth, Algorithm 1 falls under the guarantees stated by Stute et al. [57].
|
| 141 |
+
|
| 142 |
+
Theorem 1 [57]. Assume $\mathcal { V } \subset \mathbb { R } ,$ , $\mathcal { X } \subset \mathbb { R } ^ { n }$ , $d i s t ( x _ { i } , x _ { j } ) : = | x _ { i } - x _ { j } | _ { \infty }$ , and that $\hat { \mathbb { F } } _ { \mathbf { E } | x }$ is constructed using the procedure given in line 5 of Algorithm $I$ (i.e. $x _ { i } = x$ ). Further assume that, as $N \to \infty$ , $d _ { N } 0$ and that $\begin{array} { r } { \sum _ { N \ge 1 } \exp ( - \rho N d _ { N } ^ { n } ) < \infty } \end{array}$ , $\forall \rho > 0$ . Then, as $N \infty$ , for almost all $x \in \mathcal { X }$ $\operatorname* { s u p } _ { \epsilon } [ \hat { \mathbb { F } } _ { \mathbf { E } | x } ( \epsilon ) - \mathbb { F } _ { \mathbf { E } | x } ( \epsilon ) ] 0$ with probability $^ { l }$ .
|
| 143 |
+
|
| 144 |
+
This theorem states that in the limit of data, for almost all $x \in \mathcal { X }$ , the CDF estimate $\hat { \mathbb { F } } _ { \mathbf { E } | x }$ will converge uniformly to the true CDF $\mathbb { F } _ { \mathbf { E } | x }$ with probability 1. The dataset, $D$ , will therefore be populated with good estimates of the conditional quantile and quantile level pair for $x$ . In Appendix B, we state the general form of Algorithm 1 and also demonstrate how the algorithm is model agnostic. Through our experiments in Section 4, we will show empirically that utilizing these density estimates sidesteps the issues inherent to the pinball loss and produces much higher quality quantile predictions.
|
| 145 |
+
|
| 146 |
+
# 3.2 Explicitly balancing calibration and sharpness with the combined calibration loss
|
| 147 |
+
|
| 148 |
+
While MAQR can produce strong results, its performance can suffer in high-dimensional settings, where nonparametric conditional density estimation methods falter. Neural networks (NNs) have shown good performance in high dimensional settings, given their high capacity to approximate complex functions and recent advances in fast gradient-based optimization. We therefore propose a loss-based approach to estimating conditional quantiles for NNs and other differentiable models.
|
| 149 |
+
|
| 150 |
+
Drawing motivation from the arbitrary balance between calibration and sharpness that pinball loss implicitly provides, we propose objectives separately for calibration and sharpness, Then, we combine the two objectives into a single loss function that provides an explicit balance between calibration and sharpness that can be chosen by the end user.
|
| 151 |
+
|
| 152 |
+
We first consider calibration of a quantile prediction, $\hat { \mathbb { Q } } _ { p } \in \mathcal { V }$ for quantile level $p \in ( 0 , 1 )$ . Here, we omit conditioning on $x$ for clarity. For this prediction to be average calibrated, exactly a $p$ proportion of the true density should lie below $\hat { \mathbb { Q } } _ { p }$ , i.e. $p _ { a \nu g } ^ { \mathrm { o b s } } = P ( Y \leq \hat { \mathbb { Q } } _ { p } ) = p$ . While calibration (e.g. $| p _ { a \nu g } ^ { \mathrm { o b s } } - p | )$ is a non-differentiable objective, by inducing a truncated distribution based on the currentlibration, we can construct the following calibration objective, which is minimized if and only if the prediction is average calibrated:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\begin{array} { r } { \mathcal { C } ( \hat { \mathbb { Q } } _ { p } , p ) = \mathbb { I } \{ \hat { p } _ { p } < p \} * \mathbb { E } [ Y - \hat { \mathbb { Q } } _ { p } | Y > \hat { \mathbb { Q } } _ { p } ] * P ( Y > \hat { \mathbb { Q } } _ { p } ) } \\ { + \mathbb { I } \{ \hat { p } _ { p } > p \} * \mathbb { E } [ \hat { \mathbb { Q } } _ { p } - Y | \hat { \mathbb { Q } } _ { p } > Y ] * P ( \hat { \mathbb { Q } } _ { p } > Y ) } \end{array}
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
The empirical calibration objective, $\mathcal { C } ( D , \hat { \mathbb { Q } } _ { p } , p )$ , is then defined as follows:
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\begin{array} { r l r } { { \mathcal { C } ( D , \hat { \mathbb { Q } } , p ) = \mathbb { I } \{ \hat { p } _ { a v g } ^ { \mathrm { o b s } } < p \} * \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \Big [ ( y _ { i } - \hat { \mathbb { Q } } _ { p } ( x _ { i } ) ) \mathbb { I } \{ y _ { i } > \hat { \mathbb { Q } } _ { p } ( x _ { i } ) \} \Big ] } } \\ & { } & { \quad + \mathbb { I } \{ \hat { p } _ { a v g } ^ { \mathrm { o b s } } > p \} * \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \Big [ ( \hat { \mathbb { Q } } _ { p } ( x _ { i } ) - y _ { i } ) \mathbb { I } \{ \hat { \mathbb { Q } } _ { p } ( x _ { i } ) > y _ { i } \} \Big ] . } \end{array}
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
Note $\pmb { I }$ : Intuition of the calibration objective. For any given $p$ , consider the case when the quantile estimate $\hat { \mathbb { Q } } _ { p }$ is below the true $p ^ { \mathrm { t h } }$ quantile $\mathbb { Q } _ { p }$ . Since $\hat { \mathbb { Q } } _ { p } < \mathbb { Q } _ { p } \Longrightarrow \hat { p } _ { p } < p$ , this implies that too much data density lies above $\hat { \mathbb { Q } } _ { p }$ . In this case, ${ \mathcal { C } } ( { \hat { \mathbb { Q } } } _ { p } , p )$ reduces to $\mathbb { E } [ Y - \hat { \mathbb { Q } } _ { p } | Y > \hat { \mathbb { Q } } _ { p } ] * P ( Y > \hat { \mathbb { Q } } _ { p } )$ . $\hat { \mathbb { Q } } _ { p }$ is pulled higher with the expectation of the truncated distribution that places $\hat { \mathbb { Q } } _ { p }$ at the lower bound of the support. In the opposite case, when $\hat { \mathbb { Q } } _ { p } > \mathbb { Q } _ { p }$ , $\hat { \mathbb { Q } } _ { p }$ is pulled lower by the same logic.
|
| 165 |
+
|
| 166 |
+
Note 2: Is the proposed calibration objective a proper scoring rule? Strictly speaking, the calibration objective is a non-decomposable function, hence deviates from the standard convention of proper scoring rules [19], which can be “decomposed” into scores for individual examples $( x _ { i } , y _ { i } )$ . This simply arises from the fact that measuring average calibration (i.e. $\hat { p } _ { a \nu g } ^ { \mathrm { o b s } }$ ) is non-decomposable. Proper scoring rules are defined such that an optimum of the expected score (or risk, if we consider the score as a loss function) occurs at the true distribution quantity. While an example level loss or score does not exist due to non-decomposability, we can still show the (expectation-level) score (i.e. $\mathcal { C } ( \hat { \mathbb { Q } } _ { p } , p ) )$ ) is minimized by the true distribution and hence enjoys the optimum property of proper scoring rules.
|
| 167 |
+
|
| 168 |
+
Proposition 2. For any quantile level $p \in \mathsf { \Gamma } ( 0 , 1 )$ , the true quantile function $\mathbb { Q } _ { p }$ minimizes the calibration objective, ${ \mathcal { C } } ( { \hat { \mathbb { Q } } } _ { p } , p )$ . Further, on a finite dataset $D$ , the empirical calibration objective, $\mathcal { C } ( D , \hat { \mathbb { Q } } _ { p } , p )$ , is minimized by an average calibrated solution on $D$ , i.e. when $\hat { p } _ { a \nu g } ^ { o b s } ( D , p ) = p$ .
|
| 169 |
+
|
| 170 |
+
Proof: The proof is given in Appendix A.2.
|
| 171 |
+
|
| 172 |
+
Note 3: Non-zero gradients for miscalibrated predictions $\hat { \mathbb { Q } } _ { p }$ . We can further show that for a miscalibrated quantile prediction, the gradients of $\mathcal { C }$ are always non-zero. When $\hat { p } _ { p } < p$ , $\partial \mathcal { C } ( \hat { \mathbb { Q } } _ { p } , p ) / \partial \hat { \mathbb { Q } } _ { p }$ $= - P ( Y > \hat { \mathbb { Q } } _ { p } ) < 0$ . Thus increasing $\hat { \mathbb { Q } } _ { p }$ decreases the objective $\mathcal { C }$ . Similarly, when $\hat { p } _ { p } > p$ , $\partial \mathcal { C } ( \hat { \mathbb { Q } } _ { p } , p ) / \partial \hat { \mathbb { Q } } _ { p } = P ( Y < \hat { \mathbb { Q } } _ { p } ) > 0$ , and an analogous argument follows (proof in Appendix A.3).
|
| 173 |
+
|
| 174 |
+
As discussed in Section 2.2, average calibration by itself is not a sufficient condition for meaningful UQ, hence we also desire sharp quantile models, with more-concentrated (less dispersed) distributions. We can induce this property in quantile predictions by predicting the $( 1 - p ) ^ { \mathrm { t h } }$ quantile $\hat { \mathbb { Q } } _ { 1 - p } ( x _ { i } )$ alongside each prediction $\hat { \mathbb { Q } } _ { p } ( x _ { i } )$ and penalizing the width between the quantile predictions:
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\mathcal { P } ( \hat { \mathbb { Q } } _ { p } , p ) = \mathbb { E } \left[ \left| \hat { \mathbb { Q } } _ { p } - \hat { \mathbb { Q } } _ { 1 - p } \right| \right] .
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
The empirical sharpness objective, $\mathcal { P } ( D , \hat { \mathbb { Q } } _ { p } , p )$ , is then defined as follows:
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\mathcal { P } ( D , \hat { \mathbb { Q } } , p ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left\{ \hat { \mathbb { Q } } _ { 1 - p } ( x _ { i } ) - \hat { \mathbb { Q } } _ { p } ( x _ { i } ) \ ( p \leq 0 . 5 ) \right.
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
It is important to note that the true underlying distribution will not have 0 sharpness if there is significant noise, and sharpness should be optimized subject to calibration. Therefore, we should only penalize sharpness when the data suggests our quantiles are too dispersed, i.e. when $\left| p _ { a v g } ^ { \mathrm { o b s } } ( p ) - p _ { a v g } ^ { \mathrm { o b s } } ( 1 - p ) \right|$ , the observed coverage between the pair of quantiles $\hat { \mathbb { Q } } _ { p } ( x _ { i } )$ and $\hat { \mathbb { Q } } _ { 1 - p } ( x _ { i } )$ is greater than $| 2 p - 1 |$ , the expected coverage.
|
| 187 |
+
|
| 188 |
+
Combining the calibration and sharpness terms, we have the combined calibration loss
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\mathcal { L } ( D , \hat { \mathbb { Q } } _ { p } , p ) = ( 1 - \lambda ) \mathcal { C } ( D , \hat { \mathbb { Q } } _ { p } , p ) + \lambda \mathcal { P } ( D , \hat { \mathbb { Q } } _ { p } , p ) .
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
The hyperparameter $\lambda \in [ 0 , 1 ]$ sets the explicit balance between calibration and sharpness. Note that setting $\lambda = 0$ may not always be desirable, since optimizing $\mathcal { C } ( D , \hat { \mathbb { Q } } _ { p } , p )$ alone may converge to quantiles of the marginal distribution, $\mathbb { F } _ { \mathbf { Y } }$ . Further, in certain downstream applications that utilize UQ, a sharper prediction, even at the cost of worse calibration, may result in higher utility, and $\lambda$ can be tuned according to the utility function of the application. In our experiments, we tune $\lambda$ by cross-validating with adversarial group calibration as it is the strictest notion of calibration that can be estimated with a finite dataset. Since we learn a quantile model that outputs the conditional quantile estimates for all probabilities, our training objective is $\mathbb { E } _ { p \sim \mathrm { U n i f } ( 0 , 1 ) } \mathcal { L } ( D , \hat { \mathbb { Q } } _ { p } , p )$ .
|
| 195 |
+
|
| 196 |
+
# 3.3 Encouraging calibration of centered intervals with the interval score
|
| 197 |
+
|
| 198 |
+
The combined calibration loss (Eq. 9) optimizes average calibration, which targets observed probabilities below a quantile. In many applications, however, we may desire a centered prediction interval (PI) which requires a pair of quantile predictions. A centered $9 5 \%$ PI, for example, is a pair of quantile predictions at quantile levels 0.025 and 0.975. Hence, for the average calibration of the $p ^ { \mathrm { t h } }$ centered interval, we want interval coverage $\big [ \hat { p } _ { a \nu g } ^ { \mathrm { o b s } } ( 0 . 5 + { \textstyle \frac { p } { 2 } } ) - \hat { p } _ { a \nu g } ^ { \mathrm { o b s } } ( 0 . 5 - { \textstyle \frac { p } { 2 } } ) \big ]$ (the PI’s observed probability, a.k.a. p to be equal to the expected probability diction. While $p$ we can modify the objective in Eq. 9 to adhere to this altered goal, here we propose simultaneously optimizing the interval score (or Winkler score) [19, 62] for all expected probabilities $p \in ( 0 , 1 )$ , and bring to light a proper scoring rule that has largely been neglected for the purpose of learning quantiles. While some previous works utilize the interval score to evaluate interval predictions [7, 4, 1, 40], to the best of our knowledge, no previous work has focused on simultaneously optimizing it and shown a thorough experimental evaluation as we provide in Section 4.
|
| 199 |
+
|
| 200 |
+
For a point $( x , y )$ , if we denote a $( 1 - \alpha )$ centered PI as $\hat { l } , \hat { u }$ , i.e. $\hat { l } = \hat { \mathbb { Q } } _ { \mathit { \Pi } _ { 2 } ^ { \alpha } } ( x )$ and $\hat { u } = \hat { \mathbb { Q } } _ { 1 - \frac { \alpha } { 2 } } ( x )$ , the interval score is defined as $\begin{array} { r } { S _ { \alpha } ( \widehat { l } , \widehat { u } ; y ) = ( \widehat { u } - \widehat { l } ) + \frac { 2 } { \alpha } ( \widehat { l } - y ) \mathbb { I } \{ y < \widehat { l } \} + \frac { 2 } { \alpha } ( y - \widehat { u } ) \mathbb { I } \{ y > \widehat { u } \} } \end{array}$ . We show in Appendix A.4 that the minimum of the expectation of the interval score is attained at the true conditional quantiles, $\hat { l } = \mathbb { Q } _ { \frac { \alpha } { 2 } } ( \cdot )$ , $\hat { u } = \mathbb { Q } _ { 1 - \frac { \alpha } { 2 } } ( \cdot )$ . We train our quantile model for all centered intervals (and hence all quantile levels) simultaneously by setting our loss as ${ \mathbb E } _ { \alpha \sim \mathrm { U n i f } ( 0 , 1 ) } S _ { \alpha }$ .
|
| 201 |
+
|
| 202 |
+
# 3.4 Inducing adversarial group calibration with group batching
|
| 203 |
+
|
| 204 |
+
The calibration loss (Section 3.2) and the interval score (Section 3.3) optimize for the average calibration of quantiles and centered intervals, respectively. To get closer to individual calibration, one condition we can additionally require is adversarial group calibration. Since adversarial group calibration requires average calibration over any subset of non-zero measure over the domain, this is not fully observable with finite datasets $D$ for all subset sizes. However, for any subset in $D$ with enough datapoints, we can still estimate average calibration over the subset. Hence, we can apply our optimization objectives onto appropriately large subsets to induce adversarial group calibration.
|
| 205 |
+
|
| 206 |
+
In practice, this involves constructing subsets within the domain and taking gradient steps based on the loss over each subset. In naive implementations of stochastic gradient descent, a random batch is drawn uniformly from the training dataset $D$ , and a gradient step is taken according to the loss over this batch. This is also the case in SQR [58]. The uniform draw of the batch will tend to preserve $\mathbb { F } _ { \mathbf { X } }$ (the marginal distribution of $\mathbf { X }$ ), hence optimizing average calibration over this batch will only induce average calibration of the model.
|
| 207 |
+
|
| 208 |
+
Instead, deliberately grouping the datapoints based on input features, and then batching and taking gradient steps based on these batches, induces better adversarial group calibration. We find in our experiments that adversarial group calibration improves significantly with simple implementations of group batching, and in Section 4.2, we show through an ablation study that group batching can improve average calibration and adversarial group calibration of SQR as well.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 2: UCI Experiments. (Top Table): Average calibration (measured by ECE) and sharpness in parentheses. The best mean ECE for each dataset has been bolded and the best mean sharpness has been underlined (all values multiplied by 100 for readability). (Bottom Figure): Adversarial group calibration for the first 5 UCI datasets (full set of results in Appendix D.1). Group size refers to proportion of test dataset size.
|
| 212 |
+
|
| 213 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SQR</td><td rowspan=1 colspan=1>mPAIC</td><td rowspan=1 colspan=1>Interval</td><td rowspan=1 colspan=1>Cali</td></tr><tr><td rowspan=10 colspan=1>uoisn</td><td rowspan=1 colspan=1>aminor</td><td rowspan=1 colspan=1>5.8 ± 0.9(1.6± 0.0)</td><td rowspan=1 colspan=1>13.5 ± 0.0(5.3 ± 0.0)</td><td rowspan=1 colspan=1>3.6 ±0.7(3.7± 0.1)</td><td rowspan=1 colspan=1>2.9±0.2(2.2 ± 0.0)</td></tr><tr><td rowspan=1 colspan=1>betan</td><td rowspan=1 colspan=1>3.1 ±0.4(2.8 ± 0.1)</td><td rowspan=1 colspan=1>9.2 ± 0.4(5.5 ± 0.1)</td><td rowspan=1 colspan=1>5.1 ± 0.4(5.7± 0.3)</td><td rowspan=1 colspan=1>3.4± 0.5(3.3± 0.2)</td></tr><tr><td rowspan=1 colspan=1>dssdenest</td><td rowspan=1 colspan=1>4.4± 0.5(7.2± 0.2)</td><td rowspan=1 colspan=1>8.4±0.1(13.7± 0.1)</td><td rowspan=1 colspan=1>2.9 ± 0.3(13.3± 0.4)</td><td rowspan=1 colspan=1>4.1±0.5(8.9±0.3)</td></tr><tr><td rowspan=1 colspan=1>ip</td><td rowspan=1 colspan=1>3.2 ± 0.3(2.4 ± 0.1)</td><td rowspan=1 colspan=1>13.5 ± 0.2(9.0 ± 0.2)</td><td rowspan=1 colspan=1>4.4± 0.3(5.4± 0.1)</td><td rowspan=1 colspan=1>2.3± 0.2(3.8 ± 0.1)</td></tr><tr><td rowspan=1 colspan=1>kappa</td><td rowspan=1 colspan=1>4.4± 0.6(2.5± 0.1)</td><td rowspan=1 colspan=1>14.8 ±0.5(9.0±0.4)</td><td rowspan=1 colspan=1>4.2 ±0.4(6.1 ± 0.2)</td><td rowspan=1 colspan=1>3.6±0.2(3.4± 0.1)</td></tr><tr><td rowspan=1 colspan=1>li</td><td rowspan=1 colspan=1>4.4±0.6(1.0±0.1)</td><td rowspan=1 colspan=1>12.6± 0.6(2.7±0.1)</td><td rowspan=1 colspan=1>3.7 ± 0.6(2.2 ± 0.1)</td><td rowspan=1 colspan=1>2.9 ±0.4(1.3± 0.1)</td></tr><tr><td rowspan=1 colspan=1>R0</td><td rowspan=1 colspan=1>5.3 ± 0.8(3.3 ± 0.1)</td><td rowspan=1 colspan=1>8.7±0.4(7.2±0.3)</td><td rowspan=1 colspan=1>3.4±0.2(6.2±0.1)</td><td rowspan=1 colspan=1>3.6±0.2(4.0±0.3)</td></tr><tr><td rowspan=1 colspan=1>tribot</td><td rowspan=1 colspan=1>4.6± 0.4(2.4 ± 0.1)</td><td rowspan=1 colspan=1>15.1 ± 0.7(8.8± 0.7)</td><td rowspan=1 colspan=1>3.9 ± 0.5(6.0 ±0.2)</td><td rowspan=1 colspan=1>4.6 ± 0.5(3.0 ± 0.2)</td></tr><tr><td rowspan=1 colspan=1>tritop</td><td rowspan=1 colspan=1>5.6±0.7(2.7±0.1)</td><td rowspan=1 colspan=1>12.9±0.7(7.2 ±0.7)</td><td rowspan=1 colspan=1>3.7 ± 0.8(6.5 ± 0.4)</td><td rowspan=1 colspan=1>2.5 ± 0.3(4.4 ± 0.1)</td></tr><tr><td rowspan=1 colspan=1>volume</td><td rowspan=1 colspan=1>5.8±1.2(0.9±0.0)</td><td rowspan=1 colspan=1>16.9 ± 1.1(3.9 ± 0.4)</td><td rowspan=1 colspan=1>3.6 ± 0.3(2.0± 0.1)</td><td rowspan=1 colspan=1>2.8 ±0.1(1.2 ±0.0)</td></tr></table>
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 3: Fusion Experiments. (Top Table): Average calibration (measured by ECE) and sharpness in parentheses. The best mean ECE for each dataset has been bolded and the best mean sharpness has been underlined (all values multiplied by 100 for readability). (Bottom Figure): Adversarial group calibration for the first 5 fusion datasets (full set of results in Appendix D.2). Group size refers to proportion of test dataset size.
|
| 217 |
+
|
| 218 |
+
To summarize, the main idea we introduce here with group batching is that, only taking uniform batches from the training set (thus only drawing batches which preserve $\mathbb { F } _ { \mathbf { X } }$ ) can be detrimental when optimizing for calibration. Thus, additionally drawing batches based on deliberate groupings within the training set (thus, batches which do not preserve $\mathbb { F } _ { \mathbf { X } }$ ) can help to induce a stronger notion of calibration (i.e. adversarial group calibration) in the model than average calibration. This concept is quite general and allows for variations in implementations when constructing the groups. In Appendix C.3 we provide details on how we implemented group batching for our experiments and ablation study.
|
| 219 |
+
|
| 220 |
+
# 4 Experiments
|
| 221 |
+
|
| 222 |
+
We demonstrate the performances of our proposed methods on the standard 8 UCI datasets [2], and on a real-world problem in nuclear fusion. To assess the predictions, we use all metrics from Section 2.2 that can be estimated with a finite test dataset: 1) average calibration vs sharpness, 2) adversarial group calibration, 3) centered interval calibration, 4) check score, and 5) interval score. The results for the first two of these metrics are displayed in the main body of the paper, and the results for the other three metrics are shown in Appendix D due to space restrictions. We describe how each of these evaluation metrics are calculated in Appendix C.4.
|
| 223 |
+
|
| 224 |
+
Figure 4: Group Batching Ablation: Average Calibration and Sharpness. The table shows mean ECE and sharpness (in parentheses) and their standard error with and without group batching. The best mean ECE for each dataset has been bolded and the best mean sharpness has been underlined for Cali and SQR separately. All values have been multiplied by 100 for readability.
|
| 225 |
+
|
| 226 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Cali</td><td rowspan=1 colspan=2>SQR</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>RandomBatch</td><td rowspan=1 colspan=1>Group Batch</td><td rowspan=1 colspan=1>RandomBatch</td><td rowspan=1 colspan=1>Group Batch</td></tr><tr><td rowspan=1 colspan=1>Boston</td><td rowspan=1 colspan=1>9.7 ± 1.3(10.2 ± 0.7)</td><td rowspan=1 colspan=1>8.5 ± 1.5(10.9 ± 0.6)</td><td rowspan=1 colspan=1>10.9 ± 1.0(8.8 ± 1.1)</td><td rowspan=1 colspan=1>9.8 ± 1.2(9.5 ± 0.9)</td></tr><tr><td rowspan=1 colspan=1>Concrete</td><td rowspan=1 colspan=1>6.6± 0.9(17.6 ± 2.3)</td><td rowspan=1 colspan=1>5.6 ± 0.8(17.3 ± 1.5)</td><td rowspan=1 colspan=1>9.8 ± 1.3(7.0± 0.6)</td><td rowspan=1 colspan=1>7.1 ± 0.9(8.5 ± 0.6)</td></tr><tr><td rowspan=1 colspan=1>Energy</td><td rowspan=1 colspan=1>9.2± 0.3(2.8± 0.1)</td><td rowspan=1 colspan=1>5.8± 0.4(3.6±0.3)</td><td rowspan=1 colspan=1>10.2 ± 0.8(1.8 ± 0.1)</td><td rowspan=1 colspan=1>6.9±1.1(2.4±0.2)</td></tr><tr><td rowspan=1 colspan=1>Kin8nm</td><td rowspan=1 colspan=1>3.4±0.3(13.7± 0.4)</td><td rowspan=1 colspan=1>3.5±0.3(13.7±0.7)</td><td rowspan=1 colspan=1>4.7± 0.3(11.1± 0.1)</td><td rowspan=1 colspan=1>3.9±0.4(11.3± 0.2)</td></tr><tr><td rowspan=1 colspan=1>Wine</td><td rowspan=1 colspan=1>4.4± 0.5(25.6± 0.8)</td><td rowspan=1 colspan=1>4.2 ±0.4(26.0±0.8)</td><td rowspan=1 colspan=1>4.5± 0.4(29.7 ± 0.5)</td><td rowspan=1 colspan=1>4.0± 0.4(28.5 ± 0.8)</td></tr><tr><td rowspan=1 colspan=1>Yacht</td><td rowspan=1 colspan=1>11.1 ± 1.8(1.8 ± 0.1)</td><td rowspan=1 colspan=1>8.3±0.6(2.0± 0.4)</td><td rowspan=1 colspan=1>9.0 ± 0.9(0.9 ± 0.1)</td><td rowspan=1 colspan=1>8.9±0.9(2.3 ± 0.2)</td></tr><tr><td rowspan=1 colspan=1>Power</td><td rowspan=1 colspan=1>1.7 ± 0.2(14.2 ± 0.3)</td><td rowspan=1 colspan=1>2.0± 0.1(13.1± 0.1)</td><td rowspan=1 colspan=1>2.5± 0.3(14.0± 0.5)</td><td rowspan=1 colspan=1>2.9 ± 0.5(13.6± 0.8)</td></tr><tr><td rowspan=1 colspan=1>Naval</td><td rowspan=1 colspan=1>2.8± 0.2(12.1 ± 3.1)</td><td rowspan=1 colspan=1>2.4± 0.3(50.6± 8.6)</td><td rowspan=1 colspan=1>8.6 ±1.6(3.6± 0.1)</td><td rowspan=1 colspan=1>5.3± 0.8(6.0± 0.5)</td></tr></table>
|
| 227 |
+
|
| 228 |
+
We provide comparisons against current state-of-the-art UQ methods for which computing the above metrics is tractable. SQR [58] is an NN model that optimizes the pinball loss for a batch of random quantile levels $p \sim \mathrm { U n i f } ( 0 , 1 )$ . mPAIC [65] is an extension of probabilistic neural networks [37, 47] that optimizes a combination of the standard Gaussian NLL and a loss that induces individual calibration. While additional quantile and PI based UQ methods exist, they are mostly designed to output a single quantile level or interval coverage level, which makes measuring calibration extremely expensive (training up to 100 models separately). For these methods, we provide a comparison on a simplified task of predicting the $9 5 \%$ PI in Appendix E.3. Lastly, we could also consider the recalibration algorithm of Kuleshov et al. [35], which is not a standalone UQ method, but a post-hoc refinement step that can be applied on top of other methods. We discuss recalibration results in Appendix E.4. All results report the mean and error across 5 trials. Error bars and shaded bands in plots indicate $\pm 1$ standard error.
|
| 229 |
+
|
| 230 |
+
# 4.1 UCI and Fusion Experiments
|
| 231 |
+
|
| 232 |
+
UCI datasets: We evaluate 5 methods on the 8 UCI benchmark datasets: three proposed algorithms— MAQR, Cali (combined calibration loss), and Interval (interval score)—and 2 alternative algorithms— SQR and mPAIC. Appendix C.1 includes more details on the experiment setup and hyperparameters.
|
| 233 |
+
|
| 234 |
+
Fusion datasets: We further evaluate the methods on a high-dimensional task from nuclear fusion: quantifying uncertainty in plasma dynamics. Recently, there has been increasing interest in applying machine learning to prediction and control tasks in the area of nuclear fusion [11, 9, 43]. The plasma data in this paper was recorded from the DIII-D tokamak, a nuclear fusion device operated by General Atomics [39]. Plasma dynamics during fusion reactions are highly stochastic and running live fusion experiments is costly. Hence, practitioners use this dataset to learn a dynamics model of the system for various purposes, such as controller learning to optimize reaction efficiency and stability [16, 5, 6]. There are 10 scalar target signals to model in this dataset (full list in Appendix C.2), each describing a particular aspect of the current state of plasma. For each signal, the input features are 468 dimensional. We do not apply MAQR on this dataset because of the high computational costs and statistical challenge associated with nonparametric density estimation in high dimensions. Appendix C.2 provides more details on the dataset, experiment setup, and hyperparameters.
|
| 235 |
+
|
| 236 |
+
Analysis of Results: Figure 2 displays average calibration-sharpness for all 8 UCI datasets and adversarial group calibration for the first 5 UCI datasets (alphabetical order). MAQR produces the best average calibrated models on 7 of the 8 UCI datasets, and adversarial group calibration also indicates that MAQR tends to achieve the lowest calibration error across any random subgroup of any size with more than one point (6 out of 8 datasets). Excluding MAQR, Interval and Cali achieve competitive average calibration and adversarial group calibration on 7 out of 8 UCI datasets. Notably, SQR tends to produce the sharpest predictions across all datasets (often at the cost of worse calibration), which is not surprising following the discussion in Section 2.2. Lastly, we also note that Interval and Cali tend to be less brittle compared to SQR and mPAIC, which incur major failures in some cases (e.g. mPAIC in Kin8nm, SQR in Naval).
|
| 237 |
+
|
| 238 |
+
The fusion experiment results display a similar pattern (Figure 3). Interval and Cali achieve competitive average calibration and adversarial group calibration on 9 out of 10 fusion datasets, and SQR produces the sharpest UQ at the cost worse average and adversarial group calibration (except on betan). We also observe that mPAIC performs the poorest on the fusion datasets, with least calibrated and least sharp predictions. It is generally known that plasma dynamics display complex stochasticity [16, 34], and hence we suspect mPAIC’s performance degrades significantly because it assumes a Gaussian output and is trained according to the Gaussian likelihood.
|
| 239 |
+
|
| 240 |
+
Only a subset of the plots and metrics are shown in the main paper due to space restrictions. Readers are encouraged to see the full set of results in Appendix D, but we summarize the main findings here. The check score, interval score, and centered interval calibration in the tables in Appendix D.1 also rank MAQR’s prediction as best on the UCI datasets. This is surprising since SQR and Interval train NNs of the same capacity to explicitly minimize the check and interval scores, respectively. This indicates the distribution predicted by MAQR is fundamentally different as it utilizes direct estimates of the conditional distribution, while the other methods all optimize a specific loss function. The centered interval calibration metric on the fusion datasets (Appendix D.2) indicates that Cali and Interval both produce competitive centered PI’s (9 out of 10 fusion datasets), suggesting that both methods have generally estimated the conditional quantiles better than the alternative algorithms.
|
| 241 |
+
|
| 242 |
+
# 4.2 Ablation Study: Effect of Group Batching
|
| 243 |
+
|
| 244 |
+
We provide an ablation study on the effect of group batching (experiment details in Appendix F.1). Figure 4 displays how group batching affects average calibration-sharpness of Cali and SQR on all 8 UCI datasets. Average calibration improved on 6 out of 8 datasets for Cali, and on 7 out of 8 datasets on SQR. While sharpness tends to worsen with group batching, it’s important to note that less sharp (i.e. more dispersed) predictions are desirable if there is high noise in the true data distribution. In Appendix F.2, we show that group batching also improves adversarial group calibration, suggesting that the underlying data distribution truly does have high noise. This study indicates that deliberately taking batches during training that do not follow $\mathbb { F } _ { \mathbf { X } }$ can improve UQ performance.
|
| 245 |
+
|
| 246 |
+
# 5 Discussion
|
| 247 |
+
|
| 248 |
+
In this paper, we have proposed four methods to improve quantile estimates for calibrated uncertainty quantification in regression. We assert that the pinball loss may not be an adequate objective to optimize in order to achieve calibration, and that our proposed methods provide better means of learning calibrated conditional quantiles. We have also extended the scope of regression models on which quantile-based UQ can be applied by developing a model-agnostic method. This can be of practical interest to users that have specific training infrastructure or preexisting regression procedures, since these procedures can be leveraged to quantify uncertainty without much additional overhead.
|
| 249 |
+
|
| 250 |
+
By providing an extensive evaluation with a suite of metrics, we also aim to show that there is not one single metric that captures full information about the performance of a UQ procedure. Rather, a holistic review of multiple types of metrics sheds light on different aspects of performance. This point has motivated us to additionally develop and make publicly available Uncertainty Toolbox [12], a Python library for evaluation, visualization and recalibration of predictive uncertainty, which includes the full suite of metrics discussed in this work.
|
| 251 |
+
|
| 252 |
+
In certain applications, users may also be concerned with modeling epistemic uncertainty. This is somewhat orthogonal to the goals of this paper; nevertheless, we provide a discussion on how bootstrapped ensembles of our methods can incorporate epistemic uncertainty in Appendix G.
|
| 253 |
+
|
| 254 |
+
# Acknowledgments
|
| 255 |
+
|
| 256 |
+
This work was funded in part by DOE grant number DE-SC0021414 and DE-AC02-76SF00515.
|
| 257 |
+
|
| 258 |
+
Willie Neiswanger was supported in part by NSF (#1651565), ONR (N000141912145), AFOSR (FA95501910024), ARO (W911NF-21-1-0125), DOE (DE-AC02-76SF00515) and Sloan Fellowship.
|
| 259 |
+
|
| 260 |
+
Ian Char was also supported by NSF grant DGE1745016. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
|
| 261 |
+
|
| 262 |
+
References
|
| 263 |
+
[1] Ross Askanazi, Francis X Diebold, Frank Schorfheide, and Minchul Shin. On the comparison of interval forecasts. Journal of Time Series Analysis, 39(6):953–965, 2018.
|
| 264 |
+
[2] Arthur Asuncion and David Newman. Uci machine learning repository, 2007.
|
| 265 |
+
[3] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
|
| 266 |
+
[4] VE Bowman, DS Silk, U Dalrymple, and DC Woods. Uncertainty quantification for epidemiological forecasts of covid-19 through combinations of model predictions. arXiv preprint arXiv:2006.10714, 2020.
|
| 267 |
+
[5] MD Boyer, KG Erickson, BA Grierson, DC Pace, JT Scoville, J Rauch, BJ Crowley, JR Ferron, SR Haskey, DA Humphreys, et al. Feedback control of stored energy and rotation with variable beam energy and perveance on diii-d. Nuclear Fusion, 59(7):076004, 2019.
|
| 268 |
+
[6] MD Boyer, S Kaye, and K Erickson. Real-time capable modeling of neutral beam injection on nstx-u using neural networks. Nuclear Fusion, 59(5):056008, 2019.
|
| 269 |
+
[7] Johannes Bracher, Evan L Ray, Tilmann Gneiting, and Nicholas G Reich. Evaluating epidemic forecasts in an interval format. PLoS computational biology, 17(2):e1008618, 2021.
|
| 270 |
+
[8] Alex J Cannon. Non-crossing nonlinear regression quantiles by monotone composite quantile regression neural network, with application to rainfall extremes. Stochastic environmental research and risk assessment, 32(11):3207–3225, 2018.
|
| 271 |
+
[9] Ian Char, Youngseog Chung, Willie Neiswanger, Kirthevasan Kandasamy, Andrew O Nelson, Mark Boyer, Egemen Kolemen, and Jeff Schneider. Offline contextual bayesian optimization. Advances in Neural Information Processing Systems, 32:4627–4638, 2019.
|
| 272 |
+
[10] Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Advances in Neural Information Processing Systems, pages 4754–4765, 2018.
|
| 273 |
+
[11] Youngseog Chung, Ian Char, Willie Neiswanger, Kirthevasan Kandasamy, Andrew Oakleigh Nelson, Mark D Boyer, Egemen Kolemen, and Jeff Schneider. Offline contextual bayesian optimization for nuclear fusion. arXiv preprint arXiv:2001.01793, 2020.
|
| 274 |
+
[12] Youngseog Chung, Ian Char, Han Guo, Jeff Schneider, and Willie Neiswanger. Uncertainty toolbox: an open-source library for assessing, visualizing, and improving uncertainty quantification. arXiv preprint arXiv:2109.10254, 2021.
|
| 275 |
+
[13] Peng Cui, Wenbo Hu, and Jun Zhu. Calibrated reliable regression using maximum mean discrepancy. Advances in Neural Information Processing Systems, 33, 2020.
|
| 276 |
+
[14] Nicki S Detlefsen, Martin Jørgensen, and Søren Hauberg. Reliable training and estimation of variance networks. arXiv preprint arXiv:1906.03260, 2019.
|
| 277 |
+
[15] Matteo Fasiolo, Simon N Wood, Margaux Zaffran, Raphaël Nedellec, and Yannig Goude. Fast calibrated additive quantile regression. Journal of the American Statistical Association, pages 1–11, 2020.
|
| 278 |
+
[16] Yichen Fu, David Eldon, Keith Erickson, Kornee Kleijwegt, Leonard Lupin-Jimenez, Mark D Boyer, Nick Eidietis, Nathaniel Barbour, Olivier Izacard, and Egemen Kolemen. Machine learning control for disruption and tearing mode avoidance. Physics of Plasmas, 27(2):022501, 2020.
|
| 279 |
+
[17] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pages 1050–1059, 2016.
|
| 280 |
+
[18] Javier Garcia and Fernando Fernández. Safe exploration of state and action spaces in reinforcement learning. Journal of Artificial Intelligence Research, 45:515–564, 2012.
|
| 281 |
+
|
| 282 |
+
[19] Tilmann Gneiting and Adrian E Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American statistical Association, 102(477):359–378, 2007.
|
| 283 |
+
|
| 284 |
+
[20] Tilmann Gneiting, Fadoua Balabdaoui, and Adrian E Raftery. Probabilistic forecasts, calibration and sharpness. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 69 (2):243–268, 2007.
|
| 285 |
+
|
| 286 |
+
[21] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1321–1330. JMLR. org, 2017.
|
| 287 |
+
|
| 288 |
+
[22] Lingxin Hao, Daniel Q Naiman, and Daniel Q Naiman. Quantile regression. Number 149. Sage, 2007.
|
| 289 |
+
|
| 290 |
+
[23] Ursula Hébert-Johnson, Michael P Kim, Omer Reingold, and Guy N Rothblum. Calibration for the (computationally-identifiable) masses. arXiv preprint arXiv:1711.08513, 2017.
|
| 291 |
+
|
| 292 |
+
[24] José Miguel Hernández-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learning of bayesian neural networks. In International Conference on Machine Learning, pages 1861–1869, 2015.
|
| 293 |
+
|
| 294 |
+
[25] Michael P Holmes, Alexander G Gray, and Charles Lee Isbell. Fast nonparametric conditional density estimation. arXiv preprint arXiv:1206.5278, 2012.
|
| 295 |
+
|
| 296 |
+
[26] Rob J Hyndman, David M Bashtannyk, and Gary K Grunwald. Estimating and visualizing conditional densities. Journal of Computational and Graphical Statistics, 5(4):315–336, 1996.
|
| 297 |
+
|
| 298 |
+
[27] Soyoung Jeon, Christopher J Paciorek, and Michael F Wehner. Quantile-based bias correction and uncertainty quantification of extreme event attribution statements. Weather and Climate Extremes, 12:24–32, 2016.
|
| 299 |
+
|
| 300 |
+
[28] HM Dipu Kabir, Abbas Khosravi, Mohammad Anwar Hosen, and Saeid Nahavandi. Neural network-based uncertainty quantification: A survey of methodologies and applications. IEEE access, 6:36218–36234, 2018.
|
| 301 |
+
|
| 302 |
+
[29] Jon Kleinberg, Sendhil Mullainathan, and Manish Raghavan. Inherent trade-offs in the fair determination of risk scores. arXiv preprint arXiv:1609.05807, 2016.
|
| 303 |
+
|
| 304 |
+
[30] Koenker. Quantile Regression (Econometric Society Monographs; No. 38). Cambridge university press, 2005.
|
| 305 |
+
|
| 306 |
+
[31] Roger Koenker and Gilbert Bassett Jr. Regression quantiles. Econometrica: journal of the Econometric Society, pages 33–50, 1978.
|
| 307 |
+
|
| 308 |
+
[32] Roger Koenker and Kevin F Hallock. Quantile regression. Journal of economic perspectives, 15(4):143–156, 2001.
|
| 309 |
+
|
| 310 |
+
[33] Daphne Koller and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009.
|
| 311 |
+
|
| 312 |
+
[34] Grzegorz Kowal, Diego A Falceta-Gonçalves, Alex Lazarian, and Ethan T Vishniac. Kelvin– helmholtz versus tearing instability: What drives turbulence in stochastic reconnection? The Astrophysical Journal, 892(1):50, 2020.
|
| 313 |
+
|
| 314 |
+
[35] Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. arXiv preprint arXiv:1807.00263, 2018.
|
| 315 |
+
|
| 316 |
+
[36] Harold J Kushner. A new method of locating the maximum point of an arbitrary multipeak curve in the presence of noise. 1964.
|
| 317 |
+
|
| 318 |
+
[37] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in neural information processing systems, pages 6402–6413, 2017.
|
| 319 |
+
|
| 320 |
+
[38] Jeremiah Liu, John Paisley, Marianthi-Anna Kioumourtzoglou, and Brent Coull. Accurate uncertainty estimation and decomposition in ensemble learning. In Advances in Neural Information Processing Systems, pages 8950–8961, 2019.
|
| 321 |
+
[39] James L Luxon. A design retrospective of the diii-d tokamak. Nuclear Fusion, 42(5):614, 2002.
|
| 322 |
+
[40] Katarzyna Maciejowska, Jakub Nowotarski, and Rafał Weron. Probabilistic forecasting of electricity spot prices using factor quantile regression averaging. International Journal of Forecasting, 32(3):957–965, 2016.
|
| 323 |
+
[41] Wesley J Maddox, Pavel Izmailov, Timur Garipov, Dmitry P Vetrov, and Andrew Gordon Wilson. A simple baseline for bayesian uncertainty in deep learning. In Advances in Neural Information Processing Systems, pages 13153–13164, 2019.
|
| 324 |
+
[42] Ali Malik, Volodymyr Kuleshov, Jiaming Song, Danny Nemer, Harlan Seymour, and Stefano Ermon. Calibrated model-based deep reinforcement learning. arXiv preprint arXiv:1906.08312, 2019.
|
| 325 |
+
[43] Viraj Mehta, Ian Char, Willie Neiswanger, Youngseog Chung, Andrew Oakleigh Nelson, Mark D Boyer, Egemen Kolemen, and Jeff Schneider. Neural dynamical systems: Balancing structure and flexibility in physical prediction. arXiv preprint arXiv:2006.12682, 2020.
|
| 326 |
+
[44] Nicolai Meinshausen. Quantile regression forests. Journal of Machine Learning Research, 7 (Jun):983–999, 2006.
|
| 327 |
+
[45] Jonas Mockus, Vytautas Tiesis, and Antanas Zilinskas. The application of bayesian methods for seeking the extremum. Towards global optimization, 2(117-129):2, 1978.
|
| 328 |
+
[46] Allan H Murphy. A new vector partition of the probability score. Journal of applied Meteorology, 12(4):595–600, 1973.
|
| 329 |
+
[47] David A Nix and Andreas S Weigend. Estimating the mean and variance of the target probability distribution. In Proceedings of 1994 ieee international conference on neural networks (ICNN’94), volume 1, pages 55–60. IEEE, 1994.
|
| 330 |
+
[48] Tim Pearce, Felix Leibfried, Alexandra Brintrup, Mohamed Zaki, and Andy Neely. Uncertainty in neural networks: Approximately bayesian ensembling. arXiv preprint arXiv:1810.05546, 2018.
|
| 331 |
+
[49] Tim Pearce, Mohamed Zaki, Alexandra Brintrup, and Andy Neely. High-quality prediction intervals for deep learning: A distribution-free, ensembled approach. arXiv preprint arXiv:1802.07167, 2018.
|
| 332 |
+
[50] Carl Edward Rasmussen. Gaussian processes in machine learning. In Summer School on Machine Learning, pages 63–71. Springer, 2003.
|
| 333 |
+
[51] Filipe Rodrigues and Francisco C Pereira. Beyond expectation: deep joint mean and quantile regression for spatiotemporal problems. IEEE Transactions on Neural Networks and Learning Systems, 2020.
|
| 334 |
+
[52] Cynthia Rudin. Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1(5):206–215, 2019.
|
| 335 |
+
[53] Tárik S Salem, Helge Langseth, and Heri Ramampiaro. Prediction intervals: Split normal mixture from quality-driven deep ensembles. In Conference on Uncertainty in Artificial Intelligence, pages 1179–1187. PMLR, 2020.
|
| 336 |
+
[54] Bobak Shahriari, Kevin Swersky, Ziyu Wang, Ryan P Adams, and Nando De Freitas. Taking the human out of the loop: A review of bayesian optimization. Proceedings of the IEEE, 104 (1):148–175, 2015.
|
| 337 |
+
[55] Hao Song, Tom Diethe, Meelis Kull, and Peter Flach. Distribution calibration for regression. In International Conference on Machine Learning, pages 5897–5906. PMLR, 2019.
|
| 338 |
+
[56] Ingo Steinwart and Andreas Christmann. Estimating conditional quantiles with the help of the pinball loss. Bernoulli, 17(1):211–225, 2011.
|
| 339 |
+
[57] Winfried Stute et al. On almost sure convergence of conditional empirical distribution functions. The Annals of Probability, 14(3):891–901, 1986.
|
| 340 |
+
[58] Natasa Tagasovska and David Lopez-Paz. Single-model uncertainties for deep learning. In Advances in Neural Information Processing Systems, pages 6414–6425, 2019.
|
| 341 |
+
[59] Ichiro Takeuchi, Quoc V Le, Timothy D Sears, and Alexander J Smola. Nonparametric quantile estimation. Journal of machine learning research, 7(Jul):1231–1264, 2006.
|
| 342 |
+
[60] Kevin Tran, Willie Neiswanger, Junwoong Yoon, Qingyang Zhang, Eric Xing, and Zachary W Ulissi. Methods for comparing uncertainty quantifications for material property predictions. Machine Learning: Science and Technology, 1(2):025006, 2020.
|
| 343 |
+
[61] Rebecca Wexler. When a computer program keeps you in jail: How computers are harming criminal justice. New York Times, 13, 2017.
|
| 344 |
+
[62] Robert L Winkler. A decision-theoretic approach to interval estimation. Journal of the American Statistical Association, 67(337):187–191, 1972.
|
| 345 |
+
[63] Qifa Xu, Kai Deng, Cuixia Jiang, Fang Sun, and Xue Huang. Composite quantile regression neural network with applications. Expert Systems with Applications, 76:129–139, 2017.
|
| 346 |
+
[64] Tianhe Yu, Garrett Thomas, Lantao Yu, Stefano Ermon, James Zou, Sergey Levine, Chelsea Finn, and Tengyu Ma. Mopo: Model-based offline policy optimization. arXiv preprint arXiv:2005.13239, 2020.
|
| 347 |
+
[65] Shengjia Zhao, Tengyu Ma, and Stefano Ermon. Individual calibration with randomized forecasting. arXiv preprint arXiv:2006.10288, 2020.
|
md/train/QgX15Mdi1E_/QgX15Mdi1E_.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Space-time Mixing Attention for Video Transformer
|
| 2 |
+
|
| 3 |
+
Adrian Bulat Samsung AI Cambridge adrian@adrianbulat.com
|
| 4 |
+
|
| 5 |
+
Juan-Manuel Perez-Rua Samsung AI Cambridge j.perez-rua@samsung.com
|
| 6 |
+
|
| 7 |
+
Swathikiran SudhakaranSamsung AI Cambridgeswathikir.s@samsung.com
|
| 8 |
+
|
| 9 |
+
Brais Martinez Samsung AI Cambridge brais.a@samsung.com
|
| 10 |
+
|
| 11 |
+
Georgios Tzimiropoulos Samsung AI Cambridge
|
| 12 |
+
Queen Mary University of London
|
| 13 |
+
g.tzimiropoulos@qmul.ac.uk
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
This paper is on video recognition using Transformers. Very recent attempts in this area have demonstrated promising results in terms of recognition accuracy, yet they have been also shown to induce, in many cases, significant computational overheads due to the additional modelling of the temporal information. In this work, we propose a Video Transformer model the complexity of which scales linearly with the number of frames in the video sequence and hence induces no overhead compared to an image-based Transformer model. To achieve this, our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. We also show how to integrate 2 very lightweight mechanisms for global temporal-only attention which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model produces very high recognition accuracy on the most popular video recognition datasets while at the same time being significantly more efficient than other Video Transformer models. Code for our method is made available here.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Video recognition – in analogy to image recognition – refers to the problem of recognizing events of interest in video sequences such as human activities. Following the tremendous success of Transformers in sequential data, specifically in Natural Language Processing (NLP) [39, 5], Vision Transformers were very recently shown to outperform CNNs for image recognition too [48, 13, 35], signaling a paradigm shift on how visual understanding models should be constructed. In light of this, in this paper, we propose a Video Transformer model as an appealing and promising solution for improving the accuracy of video recognition models.
|
| 22 |
+
|
| 23 |
+
A direct, natural extension of Vision Transformers to the spatio-temporal domain is to perform the self-attention jointly across all $S$ spatial locations and $T$ temporal locations. Full space-time attention though has complexity ${ \cal O } ( T ^ { 2 } S ^ { 2 } )$ making such a model computationally heavy and, hence, impractical even when compared with the 3D-based convolutional models. As such, our aim is to exploit the temporal information present in video streams while minimizing the computational burden within the Transformer framework for efficient video recognition.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Different approaches to space-time self-attention for video recognition. In all cases, the key locations that the query vector, located at the center of the grid in red, attends are shown in orange. Unlike prior work, our key vector is constructed by mixing information from tokens located at the same spatial location within a local temporal window. Our method then performs self-attention with these tokens. Note that our mechanism allows for an efficient approximation of local space-time attention at no extra cost.
|
| 27 |
+
|
| 28 |
+
A baseline solution to this problem is to consider spatial-only attention followed by temporal averaging, which has complexity ${ \cal O } ( T S ^ { 2 } )$ . Similar attempts to reduce the cost of full space-time attention have been recently proposed in [3, 1]. These methods have demonstrated promising results in terms of video recognition accuracy, yet they have been also shown to induce, in most of the cases, significant computational overheads compared to the baseline (spatial-only) method due to the additional modelling of the temporal information.
|
| 29 |
+
|
| 30 |
+
Our main contribution in this paper is a Video Transformer model that has complexity $O ( T S ^ { 2 } )$ and, hence, is as efficient as the baseline model, yet, as our results show, it outperforms recently/concurrently proposed work [3, 1] in terms of efficiency (i.e. accuracy/FLOP) by significant margins. To achieve this our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer’s depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. Fig. 1 shows the proposed approximation to space-time attention. We also show how to integrate two very lightweight mechanisms for global temporal-only attention, which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model is surprisingly effective in terms of capturing long-term dependencies and producing very high recognition accuracy on the most popular video recognition datasets, including Something-Something-v2 [17], Kinetics [4] and Epic Kitchens [9], while at the same time being significantly more efficient than other Video Transformer models.
|
| 31 |
+
|
| 32 |
+
# 2 Related work
|
| 33 |
+
|
| 34 |
+
Video recognition: Standard solutions are based on CNNs and can be broadly classified into two categories: 2D- and 3D-based approaches. 2D-based approaches process each frame independently to extract frame-based features which are then aggregated temporally with some sort of temporal modeling (e.g. temporal averaging) performed at the end of the network [42, 26, 27]. The works of [26, 27] use the “shift trick” [45] to have some temporal modeling at a layer level. 3D-based approaches [4, 16, 36] are considered the current state-of-the-art as they can typically learn stronger temporal models via 3D convolutions. However, they also incur higher computational and memory costs. To alleviate this, a large body of works attempt to improve their efficiency via spatial and/or temporal factorization [38, 37, 15].
|
| 35 |
+
|
| 36 |
+
CNN vs ViT: Historically, video recognition approaches tend to mimic the architectures used for image classification (e.g. from AlexNet [23] to [20] or from ResNet [18] and ResNeXt [47] to [16]). After revolutionizing NLP [39, 32], very recently, Transformer-based architectures showed promising results on large scale image classification too [13]. While self-attention and attention were previously used in conjunction with CNNs at a layer or block level [6, 50, 33], the Vision Transformer (ViT)
|
| 37 |
+
|
| 38 |
+
of Dosovitskiy et al. [13] is the first convolution-free, Transformer-based architecture that achieves state-of-the-art on ImageNet [11].
|
| 39 |
+
|
| 40 |
+
Video Transformer: Recently/concurrently with our work, vision transformer architectures, derived from [13], were used for video recognition [3, 1], too. Because performing full space-time attention is computationally prohibitive (i.e. $\bar { O } ( T ^ { 2 } S ^ { 2 } ) )$ , their main focus is on reducing this via temporal and spatial factorization. In TimeSformer [3], the authors propose applying spatial and temporal attention in an alternating manner reducing the complexity to $\bar { O } ( \bar { T ^ { 2 } } S + \bar { T } \bar { S ^ { 2 } } )$ . In a similar fashion, ViViT [1] explores several avenues for space-time factorization. In addition, they also proposed to adapt the patch embedding process from [13] to 3D (i.e. video) data. Our work proposes a completely different approximation to full space-time attention that is also efficient. To this end, we firstly restrict full space-time attention to a local temporal window which is reminiscent of [2] but applied here to space-time attention and video recognition 1. Secondly, we define a local joint space-time attention which we show that can be implemented efficiently via the “shift trick” [45].
|
| 41 |
+
|
| 42 |
+
# 3 Method
|
| 43 |
+
|
| 44 |
+
Video Transformer: We are given a video clip $\mathbf { X } \in \mathbb { R } ^ { T \times H \times W \times C }$ $C = 3$ ). Following ViT [13], each frame is divided into $K \times K$ non-overlapping patches which are then mapped into visual tokens using a linear embedding layer $\mathbf { E } \in \mathbb { R } ^ { 3 K ^ { 2 } \times d }$ . Since self-attention is permutation invariant, in order to preserve the information regarding the location of each patch within space and time we also learn two positional embeddings, one for space: $\mathbf { p } _ { s } \in \mathbb { R } ^ { 1 \times S \times d }$ and one for time: $\mathbf { p } _ { t } \in \mathbb { R } ^ { T \times 1 \times d }$ . These are then added to the initial visual tokens. Finally, the token sequence is processed by $L$ Transformer layers.
|
| 45 |
+
|
| 46 |
+
The visual token at layer $l$ , spatial location $s$ and temporal location $t$ is denoted as:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { r } { \mathbf { z } _ { s , t } ^ { l } \in \mathbb { R } ^ { d } , l = 0 , \ldots , L - 1 , s = 0 , \ldots , S - 1 , t = 0 , \ldots , T - 1 . } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
In addition to the $S T$ visual tokens extracted from the video, a special classification token $\mathbf { z } _ { c l s } ^ { l } \in \mathbb { R } ^ { d }$ is prepended to the token sequence [12]. The $l -$ th Transformer layer processes the visual tokens $\mathbf { Z } ^ { l ^ { - } } \in \mathsf { \bar { R } } ^ { ( S T + 1 ) \times d }$ of the previous layer using a series of Multi-head Self-Attention (MSA), Layer Normalization (LN), and MLP $\mathbb { R } ^ { d } \overset { \cdot } { \to } \mathbb { R } ^ { 4 d } \overset { \cdot } { \to } \mathbb { R } ^ { d }$ ) layers as follows:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { r c l } { { \mathbf { Y } ^ { l } } } & { { = } } & { { { \mathrm { \bf ~ M S A } } ( { \mathrm { \bf ~ L N } } ( { \mathbf { Z } } ^ { l - 1 } ) ) + { \mathbf { Z } } ^ { l - 1 } , } } \\ { { \mathbf { Z } ^ { l } } } & { { = } } & { { { \mathrm { \bf ~ M L P } } ( { \mathrm { \bf ~ L N } } ( { \mathbf { Y } } ^ { l } ) ) + { \mathbf { Y } } ^ { l } . } } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
The main computation of a single full space-time Self-Attention (SA) head boils down to calculating:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathbf { y } _ { s , t } ^ { l } = \sum _ { t ^ { \prime } = 0 } ^ { T - 1 } \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\mathbf { q } _ { s , t } ^ { l } , \mathbf { k } _ { s , t } ^ { l } , \mathbf { v } _ { s , t } ^ { l } \in \mathbb { R } ^ { d _ { h } }$ are the query, key, and value vectors computed from $\mathbf { z } _ { s , t } ^ { l }$ (after LN) using embedding matrices $\mathbf { W _ { q } } , \mathbf { W _ { k } } , \mathbf { W _ { v } } \in \mathbb { R } ^ { d \times d _ { h } }$ . Finally, the output of the $h$ heads is concatenated and projected using embedding matrix Wh ∈ Rhdh×d.
|
| 65 |
+
|
| 66 |
+
The complexity of the full model is: $O ( 3 h T S d d _ { h } )$ $( q k v$ projections) $+ O ( 2 h T ^ { 2 } S ^ { 2 } d _ { h } )$ (MSA for $h$ attention heads) $+ O ( T S ( h d _ { h } ) d )$ (multi-head projection) $+ \hat { O } ( 4 T S d ^ { 2 } )$ (MLP) 2. From these terms, our goal is to reduce the cost $\tilde { O ( 2 T ^ { 2 } S ^ { 2 } d _ { h } ) }$ (for a single attention head) of the full space-time attention which is the dominant term 3. For clarity, from now on, we will drop constant terms and $d _ { h }$ to report complexity unless necessary. Hence, the complexity of the full space-time attention is $O ( T ^ { 2 } S ^ { 2 } )$ .
|
| 67 |
+
|
| 68 |
+
Our baseline is a model that performs a simple approximation to the full space-time attention by applying, at each Transformer layer, spatial-only attention:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathbf { y } _ { s , t } ^ { l } = \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
the complexity of which is ${ \cal O } ( T S ^ { 2 } )$ . Notably, the complexity of the proposed space-time mixing attention is also ${ \cal O } ( T S ^ { 2 } )$ . Following spatial-only attention, simple temporal averaging is performed on the class tokens $\begin{array} { r } { { \bf z } _ { f i n a l } = \frac { 1 } { T } \sum _ { t } { \bf z } _ { t , c l s } ^ { L - 1 } } \end{array}$ to obtain a single feature that is fed to the linear classifier.
|
| 75 |
+
|
| 76 |
+
Recent work by [3, 1] has focused on reducing the cost ${ \cal O } ( T ^ { 2 } S ^ { 2 } )$ of the full space-time attention of Eq. 4. Bertasius et al. [3] proposed the factorised attention:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r l r } & { \tilde { \mathbf { y } } _ { s , t } ^ { l } = \displaystyle \sum _ { t ^ { \prime } = 0 } ^ { T - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s , t ^ { \prime } } ^ { l } , } & \\ & { \mathbf { y } _ { s , t } ^ { l } = \displaystyle \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ \tilde { \mathbf { q } } _ { s , t } ^ { l } \cdot \tilde { \mathbf { k } } _ { s ^ { \prime } , t } ^ { l } ) / \sqrt { d _ { h } } \} \tilde { \mathbf { v } } _ { s ^ { \prime } , t } ^ { l } , } & \end{array} \quad \begin{array} { r l } & { \left\{ s = 0 , \dots , S - 1 \right\} , } \\ & { \left\{ t = 0 , \dots , T - 1 \right\} , } \\ & \left\{ \begin{array} { r l } & { s = 0 , \dots , T - 1 \} \\ & { s ^ { \prime } = 0 } \end{array} \right\} , } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\tilde { \mathbf { q } } _ { s , t } ^ { l } , \tilde { \mathbf { k } } _ { s ^ { \prime } , t } ^ { l } \tilde { \mathbf { v } } _ { s ^ { \prime } , t } ^ { l }$ are new query, key and value vectors calculated from $\tilde { \mathbf { y } } _ { s , t } ^ { l }$ 4. The above model reduces complexity to $O ( T ^ { 2 } S + T S ^ { 2 } )$ . However, temporal attention is performed for a fixed spatial location which is ineffective when there is camera or object motion and there is spatial misalignment between frames.
|
| 83 |
+
|
| 84 |
+
The work of [1] is concurrent to ours and proposes the following approximation: $L _ { s }$ Transformer layers perform spatial-only attention as in Eq. 5 (each with complexity $O ( S ^ { 2 } ) _ { \ l }$ ). Following this, there are $L _ { t }$ Transformer layers performing temporal-only attention on the class tokens $\mathbf { z } _ { t } ^ { L _ { s } }$ . The complexity of the temporal-only attention is, in general, $\overset { \cdot } { O ( T ^ { 2 } ) }$ .
|
| 85 |
+
|
| 86 |
+
Our model aims to better approximate the full space-time self-attention (SA) of Eq. 4 while keeping complexity to ${ \cal O } ( T S ^ { 2 } )$ , i.e. inducing no further complexity to a spatial-only model.
|
| 87 |
+
|
| 88 |
+
To achieve this, we make a first approximation to perform full space-time attention but restricted to a local temporal window $[ - t _ { w } , t _ { w } ]$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbf { y } _ { s , t } ^ { l } = \sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l } \cdot \mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} \mathbf { v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } = \sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \mathbf { V } _ { t ^ { \prime } } ^ { l } \mathbf { a } _ { t ^ { \prime } } ^ { l } , \{ \mathbf { \phi } _ { t = 0 , \dots , T - 1 } ^ { s = 0 , \dots , S - 1 } \}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where ${ \bf V } _ { t ^ { \prime } } ^ { l } = [ { \bf v } _ { 0 , t ^ { \prime } } ^ { l } ; { \bf v } _ { 1 , t ^ { \prime } } ^ { l } ; \ldots ; { \bf v } _ { S - 1 , t ^ { \prime } } ^ { l } ] \in \mathbb { R } ^ { d _ { h } \times S }$ and $\mathbf { a } _ { t ^ { \prime } } ^ { l } = [ a _ { 0 , t ^ { \prime } } ^ { l } , a _ { 1 , t ^ { \prime } } ^ { l } , \ldots , a _ { S = 1 , t ^ { \prime } } ^ { l } ] \in \mathbb { R } ^ { S }$ is the vector with the corresponding attention weights. Eq. 7 shows that, for a single Transformer layer, $\mathbf { y } _ { s , t } ^ { l }$ is a spatio-temporal combination of the visual tokens in the local window $[ - t _ { w } , t _ { w } ]$ . It follows that, after k Transformer layers, yl+ks,t will be a spatio-temporal combination of the visual tokens in the local window $[ - k t _ { w } , k t _ { w } ]$ which in turn conveniently allows to perform spatio-temporal attention over the whole clip. For example, for $t _ { w } = 1$ and $k = 4$ , the local window becomes $[ - 4 , 4 ]$ which spans the whole video clip for the typical case $T = 8$ .
|
| 95 |
+
|
| 96 |
+
The complexity of the local self-attention of Eq. 7 is $O ( T ( 2 t _ { w } + 1 ) ^ { 2 } S ^ { 2 } )$ . To reduce this even further, we make a second approximation on top of the first one as follows: the attention between spatial locations $s$ and $s ^ { \prime }$ according to the model of Eq. 7 is:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\sum _ { t ^ { \prime } = t - t _ { w } } ^ { t + t _ { w } } \mathrm { S o f t m a x } \{ ( { \bf q } _ { s , t } ^ { l } \cdot { \bf k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ) / \sqrt { d _ { h } } \} { \bf v } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
i.e. it requires the calculation of $2 t _ { w } + 1$ attentions, one per temporal location over $[ - t _ { w } , t _ { w } ]$ . Instead, we propose to calculate a single attention over $[ - t _ { w } , t _ { w } ]$ which can be achieved by $\mathbf { q } _ { s , t } ^ { l }$ attending $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } \triangleq [ \mathbf { k } _ { s ^ { \prime } , t - t _ { w } } ^ { l } ; \hdots ; \mathbf { k } _ { s ^ { \prime } , t + t _ { w } } ^ { l } ] \in \mathbb { R } ^ { ( 2 t _ { w } + 1 ) d _ { h } }$ . Note that to match the dimensions of $\mathbf { q } _ { s , t } ^ { l }$ and $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ a further projection of $\mathbf { k } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ to $\mathbb { R } ^ { d _ { h } }$ is normally required which has complexity $O ( ( 2 t _ { w } + 1 ) d _ { h } ^ { 2 } )$ and hence compromises the goal of an efficient implementation. To alleviate this we use the “shift trick” [45, 26] which allows to perform both zero-cost dimensionality reduction, spacetime mixing and attention (between $\mathbf { q } _ { s , t } ^ { l }$ and $\mathbf { \Delta } \mathbf { \bar { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } )$ in $O ( d _ { h } )$ . In particular, each $t ^ { \prime } \in [ - t _ { w } , t _ { w } ]$ is assigned $d _ { h } ^ { t ^ { \prime } }$ channels from $d _ { h }$ (i.e. $\textstyle \sum _ { t ^ { \prime } } d _ { h } ^ { t ^ { \prime } } = d _ { h } )$ ). Let $\mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l } ( d _ { h } ^ { t ^ { \prime } } ) \in \mathbb { R } ^ { d _ { h } ^ { t ^ { \prime } } }$ denote the operator for indexing the $d _ { h } ^ { t ^ { \prime } }$ channels from $\mathbf { k } _ { s ^ { \prime } , t ^ { \prime } } ^ { l }$ . Then, a new key vector is constructed as:
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
|
| 106 |
+
Figure 2: Detailed self-attention computation graph for (a) full space-time attention and (b) the proposed space-time mixing approximation. Notice that in our case only S tokens participate instead of ST. The temporal information is aggregated by indexing channels from adjacent frames. Tokens of identical colors share the same temporal index.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
(b) Proposed space-time mixing attention.
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r } { \tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } \triangleq [ \mathbf { k } _ { s ^ { \prime } , t - t _ { w } } ^ { l } ( d _ { h } ^ { t - t _ { w } } ) , \hdots , \mathbf { k } _ { s ^ { \prime } , t + t _ { w } } ^ { l } ( d _ { h } ^ { t + t _ { w } } ) ] \in \mathbb { R } ^ { d _ { h } } . } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Fig. 2 shows how the key vector $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t w : t _ { w } } ^ { l }$ is constructed. In a similar way, we also construct a new value vector $\tilde { \mathbf { v } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ . Finally, the proposed approximation to the full space-time attention is given by:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathbf { y } _ { s , t } ^ { l _ { s } } = \sum _ { s ^ { \prime } = 0 } ^ { S - 1 } \mathrm { S o f t m a x } \{ ( \mathbf { q } _ { s , t } ^ { l _ { s } } \cdot \tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } / \sqrt { d _ { h } } \} \tilde { \mathbf { v } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l } , \ \left\{ \begin{array} { l l } { s = 0 , \dots , S - 1 } \\ { t = 0 , \dots , T - 1 } \end{array} \right\} .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
This has the complexity of a spatial-only attention $( O ( T S ^ { 2 } ) )$ and hence it is more efficient than previously proposed video transformers [3, 1]. Our model also provides a better approximation to the full space-time attention and as shown by our results it significantly outperforms [3, 1].
|
| 122 |
+
|
| 123 |
+
Temporal Attention aggregation: The final set of the class tokens $\mathbf { z } _ { t , c l s } ^ { L - 1 } , 0 \leq t \leq L - 1$ are used to generate the predictions. To this end, we propose to consider the following options: (a) simple temporal averaging $\begin{array} { r } { \mathbf { z } _ { f i n a l } = \frac { 1 } { T } \sum _ { t } \mathbf { z } _ { t , c l s } ^ { L - 1 } } \end{array}$ as in the case of our baseline. (b) An obvious limitation of temporal averaging is that the output is treated purely as an ensemble of per-frame features and, hence, completely ignores the temporal ordering between them. To address this, we propose to use a lightweight Temporal Attention (TA) mechanism that will attend to the $T$ classification tokens. In particular a $\mathbf { z } _ { f i n a l }$ token attends the sequence $[ \mathbf { z } _ { 0 , c l s } ^ { L - 1 } , \ldots , \mathbf { z } _ { T - 1 , c l s } ^ { L - 1 } ]$ using a temporal Transformer layer and then fed as input to the classifier. This is akin to the (concurrent) work of [1] with the difference being that in our model we found that a single TA layer suffices whereas [1] uses $L _ { t }$ . A consequence of this is that the complexity of our layer is $O ( T )$ vs $O ( 2 ( L _ { t } - 1 ) T ^ { 2 } + \bar { T } )$ of [1].
|
| 124 |
+
|
| 125 |
+
Summary token: As an alternative to TA, herein, we also propose a simple lightweight mechanism for information exchange between different frames at intermediate layers of the network. Given the set of tokens for each frame $t$ , $\mathbf { Z } _ { t } ^ { l - 1 } \in \mathbb { R } ^ { ( S + 1 ) \times d _ { h } }$ (constructed by concatenating all tokens $\mathbf { z } _ { s , t } ^ { l - 1 } , s = 0 , \ldots , S )$ , we compute a new set of $R$ tokens $\mathbf { Z } _ { r , t } ^ { l } = \phi ( \mathbf { Z } _ { \underline { { t } } } ^ { l - 1 } ) \in \mathbb { R } ^ { R \times d _ { h } }$ which summarize the frame information and hence are named “Summary” tokens. These are then, appended to the visual tokens of all frames to calculate the keys and values so that the query vectors attend the original keys plus the Summary tokens. Herein, we explore the case that $\phi ( . )$ performs simple spatial averaging $\begin{array} { r } { \mathbf { \tilde { z } } _ { 0 , t } ^ { l } = \frac { 1 } { S } \sum _ { s } \mathbf { z } _ { s , t } ^ { l } } \end{array}$ over the tokens of each frame ( $R = 1$ for this case). Note that, for $R = 1$ , the extra cost that the Summary token induces is $O ( T S )$ .
|
| 126 |
+
|
| 127 |
+
X-ViT: We call the Video Transformer based on the proposed (a) space-time mixing attention and (b) lightweight global temporal attention (or summary token) as $\mathbf { X }$ -ViT.
|
| 128 |
+
|
| 129 |
+
# 4 Results
|
| 130 |
+
|
| 131 |
+
# 4.1 Experimental setup
|
| 132 |
+
|
| 133 |
+
Datasets: We train and evaluate the proposed models on the following datasets (all datasets are publicly available for research purposes):
|
| 134 |
+
|
| 135 |
+
Kinetics-400 and 600: The Kinetics [21] dataset consists of short clips (typically 10 sec long sampled from YouTube) labeled using 400 and 600 classes, respectively. Due to the removal of some videos from YouTube, the version of the dataset used in this paper consists of approximately 261K clips for Kinetics-400. Note, that these amounts are lower than the original version of the datasets and thus might represent a negative performance bias when compared with prior works.
|
| 136 |
+
|
| 137 |
+
Something-Something- $\cdot \nu 2$ $( S S \nu 2 )$ : The SSv2 [17] dataset consists of 220,487 short videos (of duration between 2 and 6 sec) that depict humans performing pre-defined basic actions with everyday objects. Because the objects and backgrounds in the videos are consistent across different action classes, this dataset tends to require stronger temporal modeling. Due to this, we conducted most of our ablation studies on SSv2 to better analyze the importance of the proposed components.
|
| 138 |
+
|
| 139 |
+
Epic Kitchens-100 (Epic-100): is an egocentric large scale action recognition dataset consisting of more than 90,000 action segments spanning 100 hours of recordings in home environments, capturing daily activities [10]. The dataset is labeled using 97 verb classes and 300 noun classes. The evaluation results are reported using the standard action recognition protocol: the network predicts the “verb” and the “noun” using two heads. The predictions are then merged to construct an “action” which is used to report the accuracy.
|
| 140 |
+
|
| 141 |
+
Training details: All models, unless otherwise stated, were trained using the following scheduler and training procedure: specifically, our models were trained using SGD with momentum (0.9) and a cosine scheduler [28] (with linear warmup) for 35 epochs on SSv2, 50 on Epic-100 and 30 on Kinetics. The base learning rate, set at a batch size of 128, was 0.05 (0.03 for Kinetics). To prevent over-fitting we made use of the following augmentation techniques: random scaling $( 0 . 9 \times$ to $1 . 3 \times$ ) and cropping, random flipping (with probability of 0.5; not for SSv2) and autoaugment [8]. In addition, for SSv2 and Epic-100, we also applied random erasing (probability $= 0 . 5$ , min. area $_ { = 0 . 0 2 }$ , max. area $_ { = 1 / 3 }$ , min. aspec $\scriptstyle \mathrm { \ t = 0 . 3 }$ ) [52] and label smoothing $\lambda = 0 . 3 )$ ) [34] while, for Kinetics, we used mixup [51] $\langle \alpha = 0 . 4 \rangle$ ).
|
| 142 |
+
|
| 143 |
+
Table 1: Effect of local window size. To isolate its effect from that of temporal aggregation, the models were trained using temporal averaging. Note, that $( B o . )$ indicates that only features from the boundaries of the local window were used, ignoring the intermediate ones.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>tw=0</td><td>45.2</td><td>71.4</td></tr><tr><td>tw=1</td><td>62.5</td><td>87.8</td></tr><tr><td>tw=2</td><td>60.5</td><td>86.4</td></tr><tr><td>tw =2(Bo.)</td><td>60.4</td><td>86.2</td></tr></table>
|
| 146 |
+
|
| 147 |
+
The backbone models follow closely the ViT architecture of Dosovitskiy et al. [13]. Most experiments were performed using the ViT-B/16 variant $L = 1 2$ , $h = 1 2$ , $d = 7 6 8$ , $K = 1 6$ ), where $L$ represents the number of transformer layers, $h$ the number of heads, $d$ the embedding dimension and $K$ the patch size. We initialized our models from a pretrained ImageNet-21k [11] ViT model. The spatial positional encoding $\mathbf { p } _ { s }$ was initialized from the pretrained 2D model and the temporal one, $\mathbf { p } _ { t }$ , with zeros so that it does not have a great impact on the tokens early on during training. The models were trained on 8 V100 GPUs using PyTorch [30].
|
| 148 |
+
|
| 149 |
+
Testing details: Unless otherwise stated, we used ViT-B/16 and $T = 8$ frames. We mostly used Temporal Attention (TA) for temporal aggregation. We report accuracy results for $1 \times 3$ views (1 temporal clip and 3 spatial crops) departing from the common approach of using up to $1 0 \times 3$ views [26, 16]. The $1 \times 3$ views setting was also used in Bertasius et al. [3]. To measure the variation between runs, we trained one of the 8–frame models 5 times. The results varied by $\pm 0 . 4 \%$ .
|
| 150 |
+
|
| 151 |
+
# 4.2 Ablation studies
|
| 152 |
+
|
| 153 |
+
Throughout this section, we study the effect of varying certain design choices and different components of our method. Because SSv2 tends to require a more fine-grained temporal modeling, unless otherwise specified, all results reported, in this section, are on the SSv2.
|
| 154 |
+
|
| 155 |
+
Table 2: Effect of: (a) proposed SA position, (b) temporal aggregation and number of Temporal Attention (TA) layers, (c) space-time mixing qkv vectors and (d) amount of mixed channels on SSv2.
|
| 156 |
+
(a) Effect of applying the proposed SA to certain layers.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Transform. layers</td><td>Top-1 Top-5</td></tr><tr><td>1st half</td><td>61.7 86.5</td></tr><tr><td>2nd half</td><td>61.6 86.3</td></tr><tr><td>Half (odd. pos)</td><td>61.2 86.4</td></tr><tr><td>All</td><td>62.6 87.8</td></tr></table>
|
| 159 |
+
|
| 160 |
+
(c) Effect of space-time mixing. x denotes the input token before $q k v$ projection. Query produces equivalent results with key and thus omitted.
|
| 161 |
+
(d) Effect of amount of mixed channels. \* uses temp. avg. aggregation.
|
| 162 |
+
|
| 163 |
+
<table><tr><td>X</td><td>key</td><td>value</td><td>Top-1</td><td>Top-5</td></tr><tr><td>x>xxx</td><td>X</td><td>X</td><td>56.6</td><td>83.5</td></tr><tr><td></td><td>X</td><td>X</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td>√</td><td>×</td><td>63.1</td><td>88.8</td></tr><tr><td></td><td></td><td>√</td><td>62.5</td><td>88.6</td></tr><tr><td></td><td>×</td><td>√</td><td>64.4</td><td>89.3</td></tr></table>
|
| 164 |
+
|
| 165 |
+
(b) Effect of number of TA layers. 0 corresponds to temporal averaging.
|
| 166 |
+
|
| 167 |
+
<table><tr><td>#. TA layers</td><td>Top-1</td><td>Top-5</td></tr><tr><td>0 (temp. avg.)</td><td>62.4</td><td>87.8</td></tr><tr><td>1</td><td>64.4</td><td>89.3</td></tr><tr><td>2</td><td>64.5</td><td>89.3</td></tr><tr><td>3</td><td>64.5</td><td>89.3</td></tr></table>
|
| 168 |
+
|
| 169 |
+
<table><tr><td>0%*</td><td>0%</td><td>25%</td><td>50%</td><td>100%</td></tr><tr><td>45.2</td><td>56.6</td><td>64.3</td><td>64.4</td><td>62.5</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Effect of local window size: Table 1 shows the accuracy of our model by varying the local window size $[ - t _ { w } , t _ { w } ]$ used in the proposed space-time mixing attention. Firstly, we observe that the proposed model is significantly superior to our baseline ${ { t } _ { w } } = 0$ ) which uses spatial-only attention. Secondly, a window of $t _ { w } = 1$ produces the best results. This shows that more gradual increase of the effective window size that is attended is more beneficial compared to more aggressive ones, i.e. the case where $t _ { w } = 2$ . A performance degradation for the case $t _ { w } = 2$ could be attributed to boundary effects (handled by filling with zeros) which are aggravated as $t _ { w }$ increases. Based on these results, we chose to use $t _ { w } = 1$ for the models reported hereafter. For short to medium long videos, it seems that $t _ { w } = 1$ suffices as the temporal receptive field size increases as we advance in depth in the model allowing it to capture a larger effective temporal window. For the datasets used, as explained earlier, after a few transformer layers the whole clip is effectively covered. However, for significantly longer video sequences, larger window sizes may perform better.
|
| 172 |
+
|
| 173 |
+
Effect of SA position: We explored which layers should the proposed space-time mixing attention be applied to within the network. Specifically, we explored the following variants: Applying it to the first $L / 2$ layers, to the last $L / 2$ layers, to every odd indexed layer and, finally, to all layers. As the results from Table 2a show, the exact layers within the network that self-attention is applied to do not matter; what matters is the number of layers it is applied to. We attribute this result to the increased temporal receptive field and cross-frame interactions.
|
| 174 |
+
|
| 175 |
+
Effect of temporal aggregation: Herein, we compare the two methods used for temporal aggregation: simple temporal averaging [41] and the proposed Temporal Attention (TA) mechanism. Given that our model already incorporates temporal information through the proposed space-time attention, we also explored how many TA layers are needed. As shown in Table 2b, replacing temporal averaging with one TA layer improves the Top-1 accuracy from $6 2 . 5 \%$ to $6 4 . 4 \%$ . Increasing the number of layers further yields no additional benefits. In Table 2d, we also report the accuracy of spatial-only attention $0 \%$ mixing) plus TA aggregation. In the absence of the proposed space-time mixing attention, the TA layer alone is unable to compensate, scoring only $5 6 . 6 \%$ . In the same table, $4 5 . 2 \%$ is the accuracy of a model trained without the proposed local attention and TA layer (i.e. using a temporal pooling for aggregation). Overall, the results highlight the need of having both components in our final model. For the next two ablation studies, we used 1 TA layer.
|
| 176 |
+
|
| 177 |
+
Table 3: Effect of number of tokens on SSv2.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Variant</td><td>Top-1</td><td>Top-5</td></tr><tr><td>XViT-T/16</td><td>54.7</td><td>82.8</td></tr><tr><td>XViT-S/32</td><td>57.0</td><td>84.6</td></tr><tr><td>XViT-S/16</td><td>61.1</td><td>88.0</td></tr><tr><td>XViT-B/32</td><td>60.5</td><td>87.4</td></tr><tr><td>XViT-L/32</td><td>61.8</td><td>88.3</td></tr><tr><td>XViT-B/16</td><td>64.4</td><td>89.3</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Effect of space-time mixing qkv vectors: Paramount to our work is the proposed space-time mixing attention of Eq. 10 which is implemented by constructing $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ w and v˜ ls0,−tw :tw efficiently via channel indexing (see Eq. 9). Space-time mixing though can be applied in several different ways in the model. For completeness, herein, we study the effect of applying space-time mixing to various combinations for the key, value and to the input token prior to qkv projection. As shown in Table 2c, the combination corresponding to our model (i.e. space-time mixing applied to the key and value) significantly outperforms all other variants by up to $2 \%$ . This result is important as it confirms that our model, derived from the proposed approximation to the local space-time attention, gives the best results when compared to other non-well motivated variants.
|
| 182 |
+
|
| 183 |
+
Table 4: Comparison between TA and Summary token on SSv2 (left) and Kinetics-400 (right).
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>X</td><td>62.4</td><td>87.8</td></tr><tr><td>√</td><td>×</td><td>63.7</td><td>88.9</td></tr><tr><td>√</td><td></td><td>63.4</td><td>88.9</td></tr><tr><td>X</td><td>交</td><td>64.4</td><td>89.3</td></tr></table>
|
| 186 |
+
|
| 187 |
+
<table><tr><td> Summary</td><td>TA</td><td>Top-1</td><td>Top-5</td></tr><tr><td>X</td><td>×</td><td>77.8</td><td>93.7</td></tr><tr><td>√</td><td>x>></td><td>78.7</td><td>93.7</td></tr><tr><td>√</td><td></td><td>78.0</td><td>93.2</td></tr><tr><td>X</td><td></td><td>78.5</td><td>93.7</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 5: Comparison with state-of-the-art on the Kinetics-400.
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>Params</td><td>FLOPs (×109)</td></tr><tr><td>bLVNet [14]</td><td>73.5</td><td>91.2</td><td>24×2</td><td>3×3</td><td>25M</td><td>840</td></tr><tr><td>STM[19]</td><td>73.7</td><td>91.6</td><td>16</td><td>1</td><td>24M</td><td>1</td></tr><tr><td>TEA [25]</td><td>76.1</td><td>92.5</td><td>16</td><td>10×3</td><td>25.6M</td><td>2,100</td></tr><tr><td>TSM R50 [26]</td><td>74.7</td><td>=</td><td>16</td><td>10×3</td><td>25.6M</td><td>650</td></tr><tr><td>I3D NL [44]</td><td>77.7</td><td>93.3</td><td>128</td><td>10×3</td><td>1</td><td>10,800</td></tr><tr><td>CorrNet-101 [40]</td><td>79.2</td><td>-</td><td>32</td><td>10×3</td><td>=</td><td>6,700</td></tr><tr><td>ip-CSN-152[38]</td><td>79.2</td><td>93.8</td><td>8</td><td>10×3</td><td></td><td>3,270</td></tr><tr><td>LGD-3D R101 [31]</td><td>79.4</td><td>94.4</td><td>16</td><td>1</td><td>=</td><td>1</td></tr><tr><td>SlowFast 8×8 R101+NL [16]</td><td>78.7</td><td>93.5</td><td>8</td><td>10×3</td><td></td><td>3,480</td></tr><tr><td>SlowFast 16×8 R101+NL [16]</td><td>79.8</td><td>93.9</td><td>16</td><td>10×3</td><td>=</td><td>7,020</td></tr><tr><td>X3D-XXL [15]</td><td>80.4</td><td>94.6</td><td>1</td><td>10×3</td><td>20.3M</td><td>5,823</td></tr><tr><td>TimeSformer-L [3]</td><td>80.7</td><td>94.7</td><td>96</td><td>1×3</td><td>121M</td><td>7,140</td></tr><tr><td>ViViT-L/16x2[1]</td><td>80.6</td><td>94.7</td><td>32</td><td>4×3</td><td>312M</td><td>17,352</td></tr><tr><td>X-ViT (Ours)</td><td>78.5</td><td>93.7</td><td>8</td><td>1×3</td><td>92M</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>79.4</td><td>93.9</td><td>8</td><td>2×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.2</td><td>94.7</td><td>16</td><td>1×3</td><td>92M</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>80.7</td><td>94.7</td><td>16</td><td>2×3</td><td>92M</td><td>1700</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Effect of amount of space-time mixing: We definefrom the adjacent frames in the local temporal window $\rho d _ { h }$ ming when $\begin{array} { r } { - t _ { w } , t _ { w } ] \left( i . e . \sum _ { t ^ { \prime } = - t _ { w } , t \neq 0 } ^ { t _ { w } } d _ { h } ^ { t ^ { \prime } } = \rho d _ { h } \right) } \end{array}$ constructing $\tilde { \mathbf { k } } _ { s ^ { \prime } , - t _ { w } : t _ { w } } ^ { l }$ (see Section 3). Herein, we study the effect of $\rho$ on the model’s accuracy. As the results from Table 2d show, the optimal $\rho$ is between $2 5 \%$ and $50 \%$ . Increasing $\rho$ to $100 \%$ (i.e. all channels are coming from adjacent frames) unsurprisingly degrades the performance as it excludes the case $t ^ { \prime } = t$ when performing the self-attention.
|
| 194 |
+
|
| 195 |
+
Effect of Summary token: Herein, we compare Temporal Attention with Summary token on SSv2 and Kinetics-400. We used both datasets for this case as they require different type of understanding: fine-grained temporal (SSv2) and spatial content (Kinetics-400). From Table 4, we conclude that the Summary token compares favorable on Kinetics-400 but not on SSv2 showing that it is more useful in terms of capturing spatial information. Since the improvement is small, we conclude that 1 TA layer is the best global attention-based mechanism for improving the accuracy of our method adding also negligible computational cost.
|
| 196 |
+
|
| 197 |
+
Effect of number of input frames: Herein we evaluate the impact of increasing the number of input frames $T$ from 8 to 16 and 32. We note that, for our method, this change results in a linear increase in complexity. As the results from Table 7 show, increasing the number of frames from 8 to 16 offers a $1 . 8 \%$ boost in Top-1 accuracy on SSv2. Moreover, increasing the number of frames to 32 improves the performance by a further $0 . 2 \%$ , offering diminishing returns. Similar behavior can be observed on Kinetics and Epic-100 in Tables 5 and 8.
|
| 198 |
+
|
| 199 |
+
Table 6: Comparison with state-of-the-art on the Kinetics-600 dataset. $T \times$ is the number of frames used by our method.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>AttentionNAS [43]</td><td>79.8</td><td>94.4</td><td>=</td><td>1,034</td></tr><tr><td>LGD-3D R101 [31]</td><td>81.5</td><td>95.6</td><td>10×3</td><td>1</td></tr><tr><td>SlowFast R101+NL [16]</td><td>81.8</td><td>95.1</td><td>10×3</td><td>3,480</td></tr><tr><td>X3D-XL [15]</td><td>81.9</td><td>95.5</td><td>10×3</td><td>1,452</td></tr><tr><td>TimeSformer-HR [3]</td><td>82.4</td><td>96.0</td><td>1×3</td><td>5,110</td></tr><tr><td>ViViT-L/16x2[1]</td><td>82.5</td><td>95.6</td><td>4×3</td><td>17,352</td></tr><tr><td>X-ViT (8x) (Ours)</td><td>82.5</td><td>95.4</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (16×) (Ours)</td><td>84.5</td><td>96.3</td><td>1×3</td><td>850</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Effect of number of tokens and different model sizes: Herein, we vary the number of input tokens by changing the patch size $K$ . As the results from Table 3 show, even when the number of tokens decreases significantly (e.g. ViT-B/32 or ViT-S/32) our approach is still able to produce results of satisfactory accuracy. The benefit of that is having a model which is significantly more efficient. Similar concusions can be observed when the model size (in terms of parameters and FLOPs) is varied. Our approach provides consistent results in all cases, showcasing its ability to scale well from tiny (XViT-T) to large (XViT-L) models.
|
| 204 |
+
|
| 205 |
+
Latency and throughput considerations: While the channel shifting operation used by the proposed space-time mixing attention is zero-FLOP, there is still a small cost associated with memory movement operations. In order to ascertain that the induced cost does not introduce noticeable performance degradation, we benchmarked a Vit-B/16 ( $8 \times$ frames) model using spatial-only attention and the proposed space-time mixing attention on 8 V100 GPUs and a batch size of 128. A model with spatial-only attention has a throughput of 312 fps while our model has 304 fps.
|
| 206 |
+
|
| 207 |
+
Table 7: Comparison with state-of-the-art on SSv2. \* - pretrained on Kinetics 600
|
| 208 |
+
|
| 209 |
+
<table><tr><td>Method</td><td>Top-1</td><td>Top-5</td><td>#Frames</td><td>Views</td><td>FLOPs (×109)</td></tr><tr><td>TRN [53]</td><td>48.8</td><td>77.6</td><td>8</td><td></td><td></td></tr><tr><td>SlowFast+multigrid [46]</td><td>61.7</td><td>1</td><td>1</td><td>1×3</td><td></td></tr><tr><td>TimeSformer-L [3]</td><td>62.4</td><td>1</td><td>96</td><td>1×3</td><td>7,140</td></tr><tr><td>TSMR50 [26]</td><td>63.3</td><td>88.5</td><td>16</td><td>2×3</td><td>-</td></tr><tr><td>STM[19]</td><td>64.2</td><td>89.8</td><td>16</td><td>-</td><td>-</td></tr><tr><td>MSNet [24]</td><td>64.7</td><td>89.4</td><td>16</td><td>=</td><td>-</td></tr><tr><td>TEA [25]</td><td>65.1</td><td>89.9</td><td>16</td><td></td><td></td></tr><tr><td>ViViT-L/16x2 [3]</td><td>65.4</td><td>89.8</td><td>32</td><td>4×3</td><td>11,892</td></tr><tr><td>X-ViT (Ours)</td><td>64.4</td><td>89.3</td><td>8</td><td>1×3</td><td>425</td></tr><tr><td>X-ViT (Ours)</td><td>66.2</td><td>90.6</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT* (Ours)</td><td>67.2</td><td>90.8</td><td>16</td><td>1×3</td><td>850</td></tr><tr><td>X-ViT (Ours)</td><td>66.4</td><td>90.7</td><td>32</td><td>1×3</td><td>1,270</td></tr></table>
|
| 210 |
+
|
| 211 |
+
# 4.3 Comparison to state-of-the-art
|
| 212 |
+
|
| 213 |
+
Our best model uses the proposed space-time mixing attention in all the Transformer layers and performs temporal aggregation using a single lightweight temporal transformer layer as described in Section 3. Unless otherwise specified, we report the results using the $1 \times 3$ configuration for the views (1 temporal and 3 spatial) for all datasets. Regarding related work on transformer-based video recognition [1, 3], we included their very best models trained on the same data as our models. For TimeSformer, this is typically the TimeSformer-L version. For ViVit, we used the 16x2 configuration, with factorized-encoding for Epic-100 and SS-v2 (as reported in Tables 6d and 6e in [1]) and the full version for Kinetics (as reported in Table 6a in [1]).
|
| 214 |
+
|
| 215 |
+
On Kinetics-400, we match the current state-of-the-art while having significantly lower computational complexity than the next two best recently proposed methods that also use Transformer-based architectures: $2 0 \times$ fewer FLOPs than ViVit [1] and $8 \times$ fewer than TimeSformer-L [3]. Note that both models from [1, 3] and ours were initialized from a ViT model pretrained on ImageNet-21k [11] and take as input frames at a resolution of $2 2 4 \times 2 2 4 \mathrm { p x }$ . Similar conclusions can be drawn from Table 6 which reports our results on Kinetics-600.
|
| 216 |
+
|
| 217 |
+
On SSv2, we match and surpass the current state-of-the-art, especially in terms of Top-5 accuracy (ours: $9 0 . 7 \%$ vs ViViT: $8 9 . 8 \%$ [1]) using models that are $1 4 \times$ (16 frames) and $9 \times$ (32 frames) faster.
|
| 218 |
+
|
| 219 |
+
Finally, we observe similar outcomes on Epic-100 where we set a new state-of-the-art, showing large improvements especially for “Verb” accuracy, while again being more efficient.
|
| 220 |
+
|
| 221 |
+
# 5 Ethical considerations and broader impact
|
| 222 |
+
|
| 223 |
+
Current high-performing video recognition models tend to have high computational demands for both training and testing and, by extension, significant environmental costs. This is especially true for the transformer-based architectures. Our research introduces a novel approach that matches and surpasses the current state-ofthe-art while being significantly more efficient thanks to the linear scaling of the complexity with respect to the number of frames. We hope such models will offer noticeable reduction in power consumption while setting at the same time a solid base for future research. We will release code and models to facilitate this. Moreover, and similarly to most data-driven systems,
|
| 224 |
+
|
| 225 |
+
Table 8: Comparison with state-of-the-art on Epic100. $T \times$ is the #frames used by our method. Results for other methods are taken from [1].
|
| 226 |
+
|
| 227 |
+
<table><tr><td>Method</td><td>Action</td><td>Verb</td><td>Noun</td></tr><tr><td>TSN [41] TRN [53]</td><td>33.2 35.3</td><td>60.2 65.9</td><td>46.0 45.4</td></tr><tr><td>TBN [22] TSM[22] SlowFast [16]</td><td>36.7 38.3 38.5</td><td>66.0 67.9 65.6</td><td>47.2 49.0 50.0</td></tr><tr><td>ViViT-L/16x2[1] X-ViT (8×) (Ours) X-ViT(16×) (Ours)</td><td>44.0 41.5</td><td>66.4 66.7</td><td>56.8 53.3</td></tr></table>
|
| 228 |
+
|
| 229 |
+
bias from the training data can potentially affect the fairness of the model. As such, we suggest to take this aspect into consideration when deploying the models into real-world scenarios.
|
| 230 |
+
|
| 231 |
+
# 6 Conclusions
|
| 232 |
+
|
| 233 |
+
We presented a novel approximation to the full space-time attention that is amenable to an efficient implementation and applied it to video recognition. Our approximation has the same computational cost as spatial-only attention yet the resulting video Transformer model was shown to be significantly more efficient than recently proposed Video Transformers [3, 1]. By no means this paper proposes a complete solution to video recognition using video Transformers. Future efforts could include combining our approaches with other architectures than the standard ViT, removing the dependency on pre-trained models and applying the model to other video-related tasks like detection and segmentation. Finally, further research is required for deploying our models on low power/resource devices.
|
| 234 |
+
|
| 235 |
+
References
|
| 236 |
+
[1] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luciˇ c, and Cordelia Schmid. Vivit: A ´ video vision transformer. arXiv preprint arXiv:2103.15691, 2021.
|
| 237 |
+
[2] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
|
| 238 |
+
[3] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? arXiv preprint arXiv:2102.05095, 2021.
|
| 239 |
+
[4] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299–6308, 2017.
|
| 240 |
+
[5] Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Niki Parmar, Mike Schuster, Zhifeng Chen, et al. The best of both worlds: Combining recent advances in neural machine translation. arXiv preprint arXiv:1804.09849, 2018.
|
| 241 |
+
[6] Yunpeng Chen, Yannis Kalantidis, Jianshu Li, Shuicheng Yan, and Jiashi Feng. A2-nets: Double attention networks. arXiv preprint arXiv:1810.11579, 2018.
|
| 242 |
+
[7] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 243 |
+
[8] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501, 2018.
|
| 244 |
+
[9] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Sanja Fidler, Antonino Furnari, Evangelos Kazakos, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Scaling egocentric vision: The epic-kitchens dataset. In ECCV, 2018.
|
| 245 |
+
[10] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Antonino Furnari, Evangelos Kazakos, Jian Ma, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Rescaling egocentric vision. arXiv preprint arXiv:2006.13256, 2020.
|
| 246 |
+
[11] 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, pages 248–255. Ieee, 2009.
|
| 247 |
+
[12] 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.
|
| 248 |
+
[13] 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 preprint arXiv:2010.11929, 2020.
|
| 249 |
+
[14] Quanfu Fan, Chun-Fu Chen, Hilde Kuehne, Marco Pistoia, and David Cox. More is less: Learning efficient video representations by big-little network and depthwise temporal aggregation. arXiv preprint arXiv:1912.00869, 2019.
|
| 250 |
+
[15] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 203–213, 2020.
|
| 251 |
+
[16] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6202–6211, 2019.
|
| 252 |
+
[17] Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The" something something" video database for learning and evaluating visual common sense. In Proceedings of the IEEE International Conference on Computer Vision, pages 5842–5850, 2017.
|
| 253 |
+
[18] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 254 |
+
[19] Boyuan Jiang, MengMeng Wang, Weihao Gan, Wei Wu, and Junjie Yan. Stm: Spatiotemporal and motion encoding for action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2000–2009, 2019.
|
| 255 |
+
[20] Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li Fei-Fei. Large-scale video classification with convolutional neural networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1725–1732, 2014.
|
| 256 |
+
[21] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
|
| 257 |
+
[22] Evangelos Kazakos, Arsha Nagrani, Andrew Zisserman, and Dima Damen. Epic-fusion: Audio-visual temporal binding for egocentric action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5492–5501, 2019.
|
| 258 |
+
[23] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 259 |
+
[24] Heeseung Kwon, Manjin Kim, Suha Kwak, and Minsu Cho. Motionsqueeze: Neural motion feature learning for video understanding. In European Conference on Computer Vision, pages 345–362. Springer, 2020.
|
| 260 |
+
[25] Yan Li, Bin Ji, Xintian Shi, Jianguo Zhang, Bin Kang, and Limin Wang. Tea: Temporal excitation and aggregation for action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 909–918, 2020.
|
| 261 |
+
[26] Ji Lin, Chuang Gan, and Song Han. Tsm: Temporal shift module for efficient video understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7083–7093, 2019.
|
| 262 |
+
[27] Zhaoyang Liu, Limin Wang, Wayne Wu, Chen Qian, and Tong Lu. Tam: Temporal adaptive module for video recognition. arXiv preprint arXiv:2005.06803, 2020.
|
| 263 |
+
[28] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 264 |
+
[29] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
|
| 265 |
+
[30] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019.
|
| 266 |
+
[31] Zhaofan Qiu, Ting Yao, Chong-Wah Ngo, Xinmei Tian, and Tao Mei. Learning spatio-temporal representation with local and global diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12056–12065, 2019.
|
| 267 |
+
[32] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
|
| 268 |
+
[33] Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, and Ashish Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
|
| 269 |
+
[34] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 270 |
+
[35] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
|
| 271 |
+
[36] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE international conference on computer vision, pages 4489–4497, 2015.
|
| 272 |
+
[37] Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 6450–6459, 2018.
|
| 273 |
+
[38] Du Tran, Heng Wang, Lorenzo Torresani, and Matt Feiszli. Video classification with channel-separated convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5552–5561, 2019.
|
| 274 |
+
[39] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 275 |
+
[40] Heng Wang, Du Tran, Lorenzo Torresani, and Matt Feiszli. Video modeling with correlation networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 352–361, 2020.
|
| 276 |
+
[41] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In European conference on computer vision, pages 20–36. Springer, 2016.
|
| 277 |
+
[42] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks for action recognition in videos. IEEE transactions on pattern analysis and machine intelligence, 41(11):2740–2755, 2018.
|
| 278 |
+
[43] Xiaofang Wang, Xuehan Xiong, Maxim Neumann, AJ Piergiovanni, Michael S Ryoo, Anelia Angelova, Kris M Kitani, and Wei Hua. Attentionnas: Spatiotemporal attention cell search for video classification. In European Conference on Computer Vision, pages 449–465. Springer, 2020.
|
| 279 |
+
[44] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
|
| 280 |
+
[45] Bichen Wu, Alvin Wan, Xiangyu Yue, Peter Jin, Sicheng Zhao, Noah Golmant, Amir Gholaminejad, Joseph Gonzalez, and Kurt Keutzer. Shift: A zero flop, zero parameter alternative to spatial convolutions. In CVPR, 2018.
|
| 281 |
+
[46] Chao-Yuan Wu, Ross Girshick, Kaiming He, Christoph Feichtenhofer, and Philipp Krahenbuhl. A multigrid method for efficiently training video models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 153–162, 2020.
|
| 282 |
+
[47] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017.
|
| 283 |
+
[48] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
|
| 284 |
+
[49] Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. In NeurIPS, 2020.
|
| 285 |
+
[50] Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In International conference on machine learning, pages 7354–7363. PMLR, 2019.
|
| 286 |
+
[51] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 287 |
+
[52] Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13001–13008, 2020.
|
| 288 |
+
[53] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In Proceedings of the European Conference on Computer Vision (ECCV), pages 803–818, 2018.
|
| 289 |
+
|
| 290 |
+
# Checklist
|
| 291 |
+
|
| 292 |
+
1. For all authors...
|
| 293 |
+
|
| 294 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 295 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6
|
| 296 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5
|
| 297 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 298 |
+
|
| 299 |
+
2. If you are including theoretical results...
|
| 300 |
+
|
| 301 |
+
(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]
|
| 302 |
+
|
| 303 |
+
3. If you ran experiments...
|
| 304 |
+
|
| 305 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] We include however all implementation details required to reproduce our work. We will make the code and the models available. The datasets used are already publicly available.
|
| 306 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1
|
| 307 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Due to prohibitive costs, we reported the variations between multiple training runs for a single 8 frames model in Section 4.1. This should be representative for the rest of the trained models.
|
| 308 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.1
|
| 309 |
+
|
| 310 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 311 |
+
|
| 312 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 313 |
+
(b) Did you mention the license of the assets? [Yes] See Section 4.1
|
| 314 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 315 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] No data was collected, publicly available datasets were used
|
| 316 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] To our knowledge the datasets used do not contain such info
|
| 317 |
+
|
| 318 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 319 |
+
|
| 320 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 321 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 322 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/QjINdYOfq0b/QjINdYOfq0b.md
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ABS: AUTOMATIC BIT SHARING FOR MODEL COMPRESSION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present Automatic Bit Sharing (ABS) to automatically search for optimal model compression configurations (e.g., pruning ratio and bitwidth). Unlike previous works that consider model pruning and quantization separately, we seek to optimize them jointly. To deal with the resultant large designing space, we propose a novel super-bit model, a single-path method, to encode all candidate compression configurations, rather than maintaining separate paths for each configuration. Specifically, we first propose a novel decomposition of quantization that encapsulates all the candidate bitwidths in the search space. Starting from a low bitwidth, we sequentially consider higher bitwidths by recursively adding reassignment offsets. We then introduce learnable binary gates to encode the choice of bitwidth, including filter-wise 0-bit for pruning. By jointly training the binary gates in conjunction with network parameters, the compression configurations of each layer can be automatically determined. Our ABS brings two benefits for model compression: 1) It avoids the combinatorially large design space, with a reduced number of trainable parameters and search costs. 2) It also averts directly fitting an extremely low bit quantizer to the data, hence greatly reducing the optimization difficulty due to the non-differentiable quantization. Experiments on CIFAR-100 and ImageNet show that our methods achieve significant computational cost reduction while preserving promising performance.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNNs) have achieved great success in many challenging computer vision tasks, including image classification (Krizhevsky et al., 2012; He et al., 2016) and object detection (Lin et al., 2017a;b). However, a deep model usually has a large number of parameters and consumes huge amounts of computational resources, which remains great obstacles for many applications, especially on resource-limited devices with limited memory and computational resources, such as smartphones. To reduce the number of parameters and computational overhead, many methods (He et al., 2019; Zhou et al., 2016) have been proposed to conduct model compression by removing the redundancy while maintaining the performance.
|
| 12 |
+
|
| 13 |
+
In the last decades, we have witnessed a lot of model compression methods, such as network pruning (He et al., 2017; 2019) and quantization (Zhou et al., 2016; Hubara et al., 2016). Specifically, network pruning reduces the model size and computational costs by removing redundant modules while network quantization maps the full-precision values to low-precision ones. It has been shown that sequentially perform network pruning and quantization is able to get a compressed network with small model size and lower computational overhead (Han et al., 2016). However, performing pruning and quantization in a separate step may lead to sub-optimal results. For example, the best quantization strategy for the uncompressed network is not necessarily the optimal one after network pruning. Therefore, we need to consider performing pruning and quantization simultaneously.
|
| 14 |
+
|
| 15 |
+
Recently, many attempts have been made to automatically determine the compression configurations of each layer (i.e., pruning ratios, and/or bitwidths), either based on reinforcement learning (RL) (Wang et al., 2019), evolutionary search (ES) (Wang et al., 2020), Bayesian optimization (BO) (Tung & Mori, 2018) or differentiable methods (Wu et al., 2018; Dong & Yang, 2019). In particular, previous differentiable methods formulate model compression as a differentiable searching problem to explore the search space using gradient-based optimization. As shown in Figure 1(a), each candidate operation is maintained as a separate path, which leads to a huge number of trainable parameters and high computational overhead when the search space becomes combinatorially large. Moreover, due to the non-differentiable quantizer and pruning process, the optimization of heavily compressed candidate networks can be more challenging than that in the conventional search problem.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Multi-path v.s. single-path compression scheme. (a) Multi-path search scheme (Wu et al., 2018): represents each candidate configuration as a separate path and formulates the compression problem as a path selection problem, which gives rise to huge numbers of trainable parameters and high computational overhead when the search space becomes combinatorially large. Here, $z _ { k }$ is the $k$ -bit quantized version of $z$ and $\alpha _ { k } ^ { q }$ is the architecture parameters corresponding to the path of $k$ -bit quantization. (b) Single-path search scheme (Ours): represents each candidate configuration as a subset of a “super-bit” and formulates the compression problem as a subset selection problem, which greatly reduces the computational costs and optimization difficulty from the discontinuity of quantization. Here, the super-bit denotes the highest bitwidth in the search space, $g _ { k } ^ { q }$ is a binary gate that controls the decision of bitwidth, and $\epsilon _ { k }$ is the re-assignment offset (quantized residual error).
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a simple yet effective model compression method named Automatic Bit Sharing (ABS) to reduce the search cost and ease the optimization for the compressed candidates. Inspired by recent single-path neural architecture search (NAS) methods (Stamoulis et al., 2019; Guo et al., 2020), the proposed ABS introduces a novel single-path super-bit to encode all effective bitwidths in the search space instead of formulating each candidate operation as a separate path, as shown in Figure 1(b). Specifically, we build upon the observation that the quantized values of a high bitwidth can share the ones of low bitwidths under some conditions. Therefore, we are able to decompose the quantized representation into the sum of the lowest bit quantization and a series of re-assignment offsets. We then introduce learnable binary gates to encode the choice of bitwidth, including filter-wise 0-bit for pruning. By jointly training the binary gates and network parameters, the compression ratio of each layer can be automatically determined. The proposed scheme has several advantages. First, we only need to solve the search problem as finding which subset of the super-bit to use for each layer’s weights and activations rather than selecting from different paths. Second, we enforce the candidate bitwidths to share the common quantized values. Hence, we are able to optimize them jointly instead of separately, which greatly reduces the optimization difficulty from the discontinuity of discretization.
|
| 21 |
+
|
| 22 |
+
Our main contributions are summarized as follows:
|
| 23 |
+
|
| 24 |
+
• We devise a novel super-bit scheme that encapsulates multiple compression configurations in a unified single-path framework. Relying on the super-bit scheme, we further introduce learnable binary gates to determine the optimal bitwidths (including filter-wise 0-bit for
|
| 25 |
+
pruning). The proposed ABS casts the search problem as subset selection problem, hence significantly reducing the search cost.
|
| 26 |
+
• We formulate the quantized representation as a gated combination of the lowest bitwidth quantization and a series of re-assignment offsets, in which we explicitly share the quantized values between different bitwidths. In this way, we enable the candidate operations to learn jointly rather than separately, hence greatly easing the optimization, especially in the non-differentiable quantization scenario.
|
| 27 |
+
|
| 28 |
+
• We evaluate our ABS on CIFAR-100 and ImageNet over various network architectures. Extensive experiments show that the proposed method achieves the state-of-the-art performance. For example, on ImageNet, our ABS compressed MobileNetV2 achieves $2 8 . 5 \times$ Bit-Operation (BOP) reduction with only $0 . 2 \%$ performance drop on the Top-1 accuracy.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Network quantization. Network quantization represents the weights, activations and even gradients in low-precision to yield compact DNNs. With low-precision integers or power-of-two representations, the heavy matrix multiplications can be replaced by efficient bitwise operations, leading to much faster test-time inference and lower power consumption. To improve the quantization performance, current methods either focus on designing accurate quantizers by fitting the quantizer to the data (Jung et al., 2019; Zhang et al., 2018; Choi et al., 2018; Cai et al., 2017), or seek to approximate the gradients due to the non-differentiable discretization (Ding et al., 2019; Louizos et al., 2019; Zhuang et al., 2020). Moreover, most previous works assign the same bitwidth for all layers (Zhou et al., 2016; Zhuang et al., 2018a; 2019; Jung et al., 2019; Jin et al., 2019; Li et al., 2020; Esser et al., 2020). Though attractive for simplicity, setting a uniform precision places no guarantee on optimizing network performance since different layers have different redundancy and arithmetic intensity. Therefore, several studies proposed mixed-precision quantization (Wang et al., 2019; Dong et al., 2019; Wu et al., 2018; Uhlich et al., 2020) to set different bitwidths according to the redundancy of each layer. In this paper, based on the proposed quantization decomposition, we devise an approach that can effectively learn appropriate bitwidths for each layer through gradient-based optimization.
|
| 33 |
+
|
| 34 |
+
NAS and pruning. Neural architecture search (NAS) aims to automatically design efficient architectures with low model size and computational costs, either based on reinforcement learning (Pham et al., 2018; Guo et al., 2019), evolutionary search (Real et al., 2019) or gradient-based methods (Liu et al., 2019a). In particular, gradient-based NAS has gained increased popularity, where the search space can be divided into the multi-path design (Liu et al., 2019a; Cai et al., 2019) and single-path formulation (Stamoulis et al., 2019; Guo et al., 2020), depending on whether adding each operation as a separate path or not. While prevailing NAS methods optimize the network topology, the focus of this paper is to search optimal compression ratios for a given architecture. Moreover, network pruning can be treated as fine-grained NAS, which aims at removing redundant modules to accelerate the run-time inference speed, giving rise to methods based on unstructured weight pruning (Han et al., 2016; Guo et al., 2016) or structured channel pruning (He et al., 2017; Zhuang et al., 2018b; Luo et al., 2017). Based on channel pruning, our paper further takes quantization into consideration to generate more compact networks.
|
| 35 |
+
|
| 36 |
+
AutoML for model compression. Recently, much effort has been put into automatically determining either the optimal pruning rate (Tung & Mori, 2018; Dong & Yang, 2019; He et al., 2018), or the bitwidth (Lou et al., 2019; Cai & Vasconcelos, 2020) of each layer via hyper-parameter search, without relying on heuristics. In particular, HAQ (Wang et al., 2019) employs reinforcement learning to search bitwidth strategies with the hardware accelerator’s feedback. Meta-pruning (Liu et al., 2019b) uses meta-learning to generate the weight parameters of the pruned networks and then adopts an evolutionary search algorithm to find the layer-wise sparsity for channel pruning. More recently, several studies (Wu et al., 2018; Cai & Vasconcelos, 2020) have focused on using differentiable schemes via gradient-based optimization.
|
| 37 |
+
|
| 38 |
+
Closely related methods. To further improve the compression ratio, several methods propose to jointly optimize pruning and quantization strategies. In particular, some works only support weight quantization (Tung & Mori, 2018; Ye et al., 2019) or use fine-grained pruning (Yang et al., 2020). However, the resultant networks cannot be implemented efficiently on edge devices. Recently, several methods (Wu et al., 2018; Wang et al., 2020; Ying et al., 2020) have been proposed to consider filter pruning, weight quantization, and activation quantization jointly. In contrast to these methods, we carefully design the compression search space by sharing the quantized values between different candidate configurations, which significantly reduces the search cost and eases the optimization. Compared with those methods that share the similarities of using quantized residual errors (Chen et al., 2010; Gong et al., 2014; Li et al., 2017b; van Baalen et al., 2020), our proposed method recursively uses quantized residual errors to decompose a quantized representation as a set of candidate bitwidths and parameterize the selection of optimal bitwidth via binary gates.
|
| 39 |
+
|
| 40 |
+
Our proposed ABS and Bayesian Bits (van Baalen et al., 2020) are developed concurrently that share a similar idea of quantization decomposition. Critically, our ABS differs from Bayesian Bits in several aspects: 1) The quantization decomposition in our methods can be extended to non-powerof-two bit widths (i.e., $b _ { 1 }$ can be set to arbitrary appropriate integer values), which is a general case of the one in Bayesian Bits. 2) The optimization problems are different. Specifically, we formulate model compression as a single-path subset selection problem while Bayesian Bits casts the optimization of the binary gates to a variational inference problem that requires more relaxations and hyperparameters. 3) Our compressed models with less or comparable BOPs outperform those of Bayesian Bits by a large margin on ImageNet (See Table 2).
|
| 41 |
+
|
| 42 |
+
# 3 PROPOSED METHOD
|
| 43 |
+
|
| 44 |
+
# 3.1 PRELIMINARY: NORMALIZATION AND QUANTIZATION FUNCTION
|
| 45 |
+
|
| 46 |
+
Without loss of generality, given a convolutional layer, let $x$ and $w$ be the activations of the last layer and its weight parameters, respectively. First, for convenience, following (Choi et al., 2018; Bai et al., 2019), we can normalize $x$ and $w$ into scale [0, 1] by $T _ { x }$ and $T _ { w }$ , respectively:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { l } { \displaystyle { z _ { x } = T _ { x } ( x ) = \mathrm { c l i p } \left( \frac { x } { v _ { x } } , 0 , 1 \right) , } } \\ { \displaystyle { z _ { w } = T _ { w } ( w ) = \frac { 1 } { 2 } \left( \mathrm { c l i p } \left( \frac { w } { v _ { w } } , - 1 , 1 \right) + 1 \right) , } } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where the function $\mathrm { c l i p } \left( v , v _ { \mathrm { l o w } } , v _ { \mathrm { u p } } \right) = \mathrm { m i n } ( \mathrm { m a x } ( v , v _ { \mathrm { l o w } } ) , v _ { \mathrm { u p } } )$ clips any number $v$ into the range $[ v _ { \mathrm { l o w } } , v _ { \mathrm { u p } } ]$ , and $v _ { x }$ and $v _ { w }$ are trainable quantization intervals which indicate the range of weights and activations to be quantized. Then, we can apply the following function to quantize the normalized activations and parameters, namely $z _ { x } \in [ 0 , 1 ]$ and $z _ { w } \in [ 0 , 1 ]$ , to discretized ones:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
D ( z , s ) = s \cdot { \mathrm { r o u n d } } \left( { \frac { z } { s } } \right) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where round $( \cdot )$ returns the nearest integer of a given value and $s$ denotes the normalized step size. Typically, for $k$ -bit quantization, the normalized step size $s$ can be computed by
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
s = { \frac { 1 } { 2 ^ { k } - 1 } } .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
After doing the $k$ -bit quantization, we shall have $2 ^ { k } - 1$ quantized values. Specifically, we obtain the quantization $Q ( w )$ and $Q ( x )$ by
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { r l } & { Q ( w ) = { \cal T } _ { w } ^ { - 1 } ( D ( z _ { w } , s ) ) = v _ { w } \cdot ( 2 \cdot D ( z _ { w } , s ) - 1 ) , } \\ & { ~ Q ( x ) = { \cal T } _ { x } ^ { - 1 } ( D ( z _ { x } , s ) ) = v _ { x } \cdot D ( z _ { x } , s ) , } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $T _ { w } ^ { - 1 }$ and $T _ { x } ^ { - 1 }$ denote the inverse functions of $T _ { w }$ and $T _ { x }$ , respectively.
|
| 71 |
+
|
| 72 |
+
# 3.2 BIT SHARING DECOMPOSITION
|
| 73 |
+
|
| 74 |
+
Previous methods consider different compression configurations as different paths and reformulate model compression as a path selection problem, which gives rise to a huge number of trainable parameters and high computational costs. In this paper, we seek to conduct filter pruning and quantization simultaneously by solving the following problem:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \underset { \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } } { \operatorname* { m i n } } \mathcal { L } \left( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } \right) , } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\mathcal { L } ( \cdot )$ denotes some losses, and $\mathbf { W }$ is the parameters of the network. $\alpha ^ { p }$ and $\alpha ^ { q }$ are the pruning and quantization configurations, respectively. As shown in Eq. (7), we propose to encode all compression configurations in a single-path super-bit model (See Figure 1(b)). In the following, we first introduce the bit sharing decomposition and then describe how to learn for compression.
|
| 81 |
+
|
| 82 |
+
To illustrate the bit sharing decomposition, we begin with an example of 2-bit quantization for $z \in \{ z _ { x } , z _ { w } \}$ . Specifically, we consider using the following equation to quantize $z$ to 2-bit:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
z _ { 2 } = D ( z , s _ { 2 } ) , \quad s _ { 2 } = \frac { 1 } { 2 ^ { 2 } - 1 } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $z _ { 2 }$ and $s _ { 2 }$ are the quantized value and the step size of 2-bit quantization, respectively. Due to the large step size, the residual error $z - z _ { 2 } \in [ - s _ { 2 } / 2 , s _ { 2 } / 2 ]$ may be big and result in a significant performance drop. To reduce the residual error, an intuitive way is to use a smaller step size, which indicates that we quantize $z$ to a higher bitwidth. Since the step size $s _ { 4 } = 1 / ( 2 ^ { 4 } - 1 )$ in 4-bit quantization is a divisor of the step size $s _ { 2 }$ in 2-bit quantization, the quantized values of 2-bit quantization are among the ones of 4-bit quantization. In fact, based on 2-bit quantization, the 4-bit counterpart introduces additional unshared quantized values. In particular, if $z _ { 2 }$ has zero residual error, then 4-bit quantization maps $z$ to the shared quantized values (i.e., $z _ { 2 }$ ). In contrast, if $z _ { 2 }$ is with non-zero residual error, 4-bit quantization is likely to map $z$ to the unshared quantized values. In this case, 4-bit quantization can be regarded as performing quantized value re-assignment based on $z _ { 2 }$ . Such a re-assignment process can be formulated as follows:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
z _ { 4 } = z _ { 2 } + \epsilon _ { 4 } ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $z _ { 4 }$ is the 4-bit quantized value and $\epsilon _ { 4 }$ is the re-assignment offset based on $z _ { 2 }$ . To ensure that the results of re-assignment fall into the unshared quantized values, the re-assignment offset $\epsilon _ { 4 }$ must be an integer multiplying of the 4-bit step size $s _ { 4 }$ . Formally, $\epsilon _ { 4 }$ can be computed by performing 4-bit quantization on the residual error of $z _ { 2 }$ :
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\epsilon _ { 4 } = D ( z - z _ { 2 } , s _ { 4 } ) , ~ s _ { 4 } = \frac { s _ { 2 } } { 2 ^ { 2 } + 1 } = \frac { 1 } { 2 ^ { 4 } - 1 } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Therefore, according to Eq. (9), a 4-bit quantized value can be decomposed into the 2-bit representation and its re-assignment offset. Similarly, an 8-bit quantized value can also be decomposed into the 4-bit representation and its corresponding re-assignment offset. In this way, we can generalize the idea of decomposition to arbitrary effective bitwidths as follows.
|
| 101 |
+
|
| 102 |
+
Definition 1 (Quantization decomposition) Let $z \in [ 0 , 1 ]$ be a normalized full-precision input, $\big \{ b _ { 1 } , . . . , b _ { K } \big \}$ be a sequence of candidate bitwidths, and $b _ { 1 } ~ < ~ b _ { 2 } , . . . , < ~ b _ { K - 1 } < b _ { K }$ . We use the following quantized $\widehat { z }$ to approximate $z$ :
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
{ \widehat { z } } = z _ { b _ { 1 } } + \sum _ { j = 2 } ^ { K } \epsilon _ { b _ { j } } , \quad { \mathrm { w h e r e ~ } } \epsilon _ { b _ { j } } = D ( z - z _ { b _ { j - 1 } } , s _ { b _ { j } } ) , \quad s _ { b _ { j } } = { \frac { s _ { b _ { j - 1 } } } { 2 ^ { b _ { j - 1 } } + 1 } } = { \frac { 1 } { 2 ^ { b _ { j } } - 1 } } .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
In other words, the quantized approximation $\widehat { z }$ can be decomposed into the sum of the lowest bit bquantization and a series of recursive re-assignment offsets. In Definition (1), to enable quantized value re-assignment, we need to constrain that $s _ { b _ { j - 1 } }$ is divisible by $s _ { b _ { j } }$ , which requires the bitwidths $b _ { j } ( j > 1 )$ to satisfy the following relation:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
b _ { j } = 2 ^ { j - 1 } \cdot b _ { 1 } .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
In fact, the bitwidth $b _ { 1 }$ can be set to arbitrary appropriate integer values (e.g., 1, 2, 3, etc.). To get a hardware-friendly compressed network1, we set $b _ { 1 }$ to 2, which ensures that all the decomposition bitwidths are power-of-two. Moreover, since 8-bit quantization achieves lossless performance compared with the full-precision counterpart (Zhou et al., 2016), we only consider those candidate bitwidths that are not greater than 8-bit. In other words, we constrain the value of $j$ to [1, 3].
|
| 115 |
+
|
| 116 |
+
Remark 1 The proposed bit sharing decomposition has several advantages. First, the proposed method only needs to maintain a small number of trainable parameters, which greatly reduces the computational costs during search. Second, we are able to directly extract a low-precision representation from its higher precision, which allows optimizing different bitwidths jointly and ease the discontinuous optimization due to quantization.
|
| 117 |
+
|
| 118 |
+
# 3.3 LEARNING FOR COMPRESSION
|
| 119 |
+
|
| 120 |
+
Note that different layers have different levels of redundancy, which indicates that different layers may choose different subsets of the quantized values. To learn the quantized approximation for each layer, we introduce a layer-wise binary quantization gate $g _ { b _ { j } } ^ { q } \in \{ 0 , 1 \}$ on each of the re-assignment offsets in Eq. (11) to encode the choice of the quantization bitwidth, which can be formulated as
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { c } { g _ { b _ { j } } ^ { q } = \mathbb { 1 } \left( | | z - z _ { b _ { j - 1 } } | | - \alpha _ { b _ { j } } ^ { q } > 0 \right) , } \\ { \widehat { z } = z _ { b _ { 1 } } + g _ { b _ { 2 } } ^ { q } \big ( \epsilon _ { b _ { 2 } } + \cdot \cdot \cdot + g _ { b _ { K - 1 } } ^ { q } \big ( \epsilon _ { b _ { K - 1 } } + g _ { b _ { K } } ^ { q } \epsilon _ { b _ { K } } \big ) \big ) , } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\mathbb { 1 } ( \cdot )$ is the indicator function and $\alpha _ { b _ { j } } ^ { q }$ is a layer-wise threshold that controls the choice of bitwidth. Specifically, if the quantization error $\left| \left| z \textrm { -- } z _ { b _ { j - 1 } } \right| \right|$ is greater than the threshold $\alpha _ { b _ { j } } ^ { q }$ , we activate the corresponding quantization gate to increase the bitwidth so that the residual error can be reduced, and vice versa.
|
| 127 |
+
|
| 128 |
+
Note that from Eq. (13), we can consider the filter pruning as 0-bit filter-wise quantization. To avoid the prohibitively large filter-wise search space, we propose to divide the filters into groups based on indexes and consider the group-wise sparsity instead. To be specific, we introduce a binary gate $g _ { c } ^ { p }$ for each group to encode the choice of pruning, which can be formulated as follows:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { c } { g _ { c } ^ { p } = \mathbb { 1 } ( | | w _ { c } | | - \alpha ^ { p } > 0 ) , } \\ { \widehat { z } _ { c } = g _ { c } ^ { p } \cdot \big ( z _ { c , b _ { 1 } } + g _ { b _ { 2 } } ^ { q } \big ( \epsilon _ { c , b _ { 2 } } + \cdot \cdot \cdot + g _ { b _ { K - 1 } } ^ { q } ( \epsilon _ { c , b _ { K - 1 } } + g _ { b _ { K } } ^ { q } \epsilon _ { c , b _ { K } } ) \big ) \big ) , } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $\widehat { z } _ { c }$ is the $c$ -th group of quantized filters and $\epsilon _ { c , b _ { j } }$ is the corresponding re-assignment offset by bquantizing the residual error $z _ { c } - z _ { c , b _ { j - 1 } }$ . Here, $\alpha ^ { p }$ is a layer-wise threshold for filter pruning. Following PFEC (Li et al., 2017a), we use $\ell _ { 1 }$ -norm to evaluate the importance of the filter. Specifically, if a group of filters is important, the corresponding pruning gate will be activated and vice versa.
|
| 135 |
+
|
| 136 |
+
Note that both quantization and pruning have their corresponding thresholds. Instead of manually setting the thresholds, we propose to learn them via gradient descent. However, the indicator function in Eq. (13) is non-differentiable. To address this, we use straight-through estimator (STE) (Bengio et al., 2013; Zhou et al., 2016) to approximate the gradient of the indicator function $\mathbb { 1 } ( \cdot )$ using the gradient of the sigmoid function $\sigma ( \cdot )$ , which can be formulated as:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\frac { \partial g } { \partial \alpha } = \frac { \partial \mathbb { 1 } \left( A - \alpha \right) } { \partial \alpha } \approx \frac { \partial \sigma \left( A - \alpha \right) } { \partial \alpha } = - \sigma \left( A - \alpha \right) \left( 1 - \sigma ( A - \alpha ) \right) ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $g$ is the output of a binary gate, $\alpha \in \{ \alpha ^ { p } , \alpha ^ { q } \}$ is the corresponding threshold and $A$ denotes some specific metrics (i.e., $\ell _ { 1 }$ -norm of the filter or the quantization error). By jointly training the binary gates and the network parameters, the pruning ratio and bitwidth of each layer can be automatically determined. However, the gradient approximation of the binary gate inevitably introduces noisy signals, which can be even more severe when we quantize both weights and activations. Thus, we propose to train the binary gates of weights and activations in an alternative manner. Specifically, when training the binary gates of weights, we fix the binary gates of activations, and vice versa.
|
| 143 |
+
|
| 144 |
+
Search Space for Model Compression. Given an uncompressed network with $L$ layers, we use $C _ { l }$ to denote the number of filters at the $l$ -th layer. To obtain the compressed model, we first divide the filters of each layer into groups and then search for the optimal bitwidths for the considered layer. Let $B$ be the number of filters in a group. For any layer $l$ , there would be $\displaystyle \left\lfloor \frac { C _ { l } } { B } \right\rfloor$ groups in total. Since we quantize both weights and activations, given $K$ candidate bitwidths, there are $K ^ { 2 }$ different quantization configurations for each layer. Thus, for the whole network with $L$ layers, the size of the search space $\Omega$ can be computed by
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\left| \Omega \right| = \prod _ { l = 1 } ^ { L } \left( K ^ { 2 } \times \left\lfloor \frac { C _ { l } } { B } \right\rfloor \right) .
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
Eq. (16) indicates that the search space is large enough to cover the potentially good configurations.
|
| 151 |
+
|
| 152 |
+
Training Objective. To design a hardware-efficient network, the objective function in Eq. (7) should reflect both the accuracy of the compressed network and its computational costs. Following (Cai et al., 2019), we train the network and architecture by minimizing following loss function:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
{ \mathcal { L } } ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) = { \mathcal { L } } _ { c e } ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) + \lambda \log R ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
where $\mathcal { L } _ { c e } ( \cdot )$ is the cross-entropy loss, $R ( \cdot )$ is the computational costs of the network and $\lambda$ is a balancing hyper-parameter. Following single-path NAS (Stamoulis et al., 2019), we use a similar formulation of computational costs to preserve the differentiability of the objective function. The details of the differentiable computational loss can be found in Appendix B. Once the training is finished, we can obtain the compressed network by selecting those filters and bitwidths with activated binary gates. Then, we fine-tune the compressed network to compensate the accuracy loss.
|
| 159 |
+
|
| 160 |
+
Table 1: Comparisons of different methods on CIFAR-100. “W” and “A” represent the average quantization bitwidth of the weights and activations, respectively.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Network</td><td>Method</td><td>BOPs (M)</td><td>BOP comp.ratio</td><td>WIA</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td rowspan="7">ResNet-20</td><td>Full-precision</td><td>41798.6</td><td>1.0</td><td>32.0/32.0</td><td>67.5</td><td>90.8</td></tr><tr><td>4-bit precision</td><td>674.6</td><td>62.0</td><td>4.0/4.0</td><td>67.8±0.3</td><td>90.4±0.2</td></tr><tr><td>DQ</td><td>1180.0</td><td>35.4</td><td>5.3/6.1</td><td>67.7±0.6</td><td>90.4±0.5</td></tr><tr><td>HAQ</td><td>653.4</td><td>64.0</td><td>3.7/4.2</td><td>67.7±0.1</td><td>90.4±0.3</td></tr><tr><td>DNAS</td><td>660.0</td><td>62.9</td><td>4.6/3.8</td><td>67.8±0.3</td><td>90.4±0.2</td></tr><tr><td>ABS-P(Ours)</td><td>28586.5</td><td>1.5</td><td>32.0/32.0</td><td>67.9±0.1</td><td>90.7±0.2</td></tr><tr><td>ABS-Q(Ours) ABS (Ours)</td><td>649.5</td><td>64.4</td><td>4.4/4.2</td><td>68.1±0.1</td><td>90.5±0.0</td></tr><tr><td></td><td>630.6</td><td></td><td>66.3</td><td>4.4/4.2</td><td>68.1±0.3</td><td>90.6±0.2</td></tr><tr><td rowspan="7">ResNet-56</td><td>Full-precision</td><td>128771.7</td><td>1.0</td><td>32.0/32.0</td><td>71.7</td><td>92.2</td></tr><tr><td>4-bit precision</td><td>2033.6</td><td>63.3</td><td>4.0/4.0</td><td>70.9±0.3</td><td>91.2±0.4</td></tr><tr><td>DQ</td><td>2222.9</td><td>57.9</td><td>3.8 /4.6</td><td>70.7±0.2</td><td>91.4±0.4</td></tr><tr><td>HAQ</td><td>2014.9</td><td>63.9</td><td>3.3/4.9</td><td>71.2±0.1</td><td>91.1±0.2</td></tr><tr><td>DNAS</td><td>2035.7</td><td>65.3</td><td>5.3/3.2</td><td>71.2±0.2</td><td>91.3±0.3</td></tr><tr><td>ABS-P(Ours)</td><td>87021.6</td><td>1.5</td><td>32.0/32.0</td><td>71.5±0.1</td><td>91.8±0.2</td></tr><tr><td>ABS-Q(Ours)</td><td>1970.7</td><td>65.3</td><td>4.1/4.0</td><td>71.5±0.2</td><td>91.5±0.2</td></tr><tr><td></td><td>ABS (Ours)</td><td>1918.8</td><td>67.1</td><td>4.2/4.1</td><td>71.6±0.1</td><td>91.8±0.4</td></tr></table>
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 2: Results of different compressed networks with different BOPs and memory footprints. We use different methods to compress ResNet-56 and report the results on CIFAR-100.
|
| 166 |
+
|
| 167 |
+
# 4 EXPERIMENTS
|
| 168 |
+
|
| 169 |
+
Compared methods. To investigate the effectiveness of the proposed method, we consider the following methods for comparisons: ABS: our proposed method with joint pruning and quantization; ABS-Q: ABS with quantization only; ABS-P: ABS with pruning only; and several state-ofthe-art model compression methods including HAQ (Wang et al., 2019), DQ (Uhlich et al., 2020), DJPQ (Ying et al., 2020), Bayesian Bits (van Baalen et al., 2020) and DNAS (Wu et al., 2018). We measure the performance of different methods in terms of the Top-1 and Top-5 accuracy. Following (Guo et al., 2020; Ying et al., 2020), we measure the computational costs by the Bit-Operation (BOP) count. The BOP compression ratio is defined as the ratio between the total BOPs of the uncompressed and compressed models. We can also measure the computational costs with the total weights and activations memory footprints following DQ (Uhlich et al., 2020). Moreover, following (Stamoulis et al., 2019; Liu et al., 2019a), we use the search cost to measure the time of finding an optimal compressed model.
|
| 170 |
+
|
| 171 |
+
Implementation details. Following HAQ (Wang et al., 2019), we quantize all the layers, in which the first and the last layers are quantized to 8-bit. Following ThiNet (Luo et al., 2017), we only conduct filter pruning for the first layer in the residual block. For ResNet-20 and ResNet-56 on CIFAR-100 (Krizhevsky et al., 2009), we set $B$ to 4. For ResNet-18 and MobileNetV2 on ImageNet (Russakovsky et al., 2015), $B$ is set to 16 and 8, respectively. We first train the full-precision models and then use the pretrained weights to initialize the compressed models. Following (Li et al., 2020; Esser et al., 2020), we introduce weight normalization during training. We use SGD with nesterov (Nesterov, 1983) for optimization, with a momentum of 0.9. For CIFAR-100, we use the same data augmentation as in (He et al., 2016), including translation and horizontal flipping. For ImageNet, images are resized to $2 5 6 \times 2 5 6$ , and then a $2 2 4 \times 2 2 4$ patch is randomly cropped from an image or its horizontal flip for training. For testing, a $2 2 4 \times 2 2 4$ center cropped is chosen. We first train the uncompressed network for 30 epochs on CIFAR-100 and 10 epochs on ImageNet.
|
| 172 |
+
|
| 173 |
+
Table 2: Comparisons on ImageNet. “\*” denotes that we get the results from the figures in (van Baalen et al., 2020) and “–” denotes that the results are not reported. Moreover, “W” and “A” represent the average quantization bitwidth of the weights and activations, respectively.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Network</td><td>Method</td><td>BOPs (G)</td><td>BOP comp. ratio</td><td>W/A</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td rowspan="8">ResNet-18</td><td>Full-precision</td><td>1857.6</td><td>1.0</td><td>32.0/32.0</td><td>70.7</td><td>89.8</td></tr><tr><td>4-bit precision</td><td>34.7</td><td>53.5</td><td>4.0/4.0</td><td>71.0</td><td>89.8</td></tr><tr><td>DQ</td><td>40.7</td><td>40.6</td><td>1/1</td><td>68.5</td><td>1</td></tr><tr><td>DJPQ</td><td>35.5</td><td>52.3</td><td>-/1</td><td>69.1</td><td></td></tr><tr><td>HAQ</td><td>34.7</td><td>53.5</td><td>4.0/4.0</td><td>70.2</td><td>89.5</td></tr><tr><td>Bayesian Bits*</td><td>35.9</td><td>51.7</td><td>1/1</td><td>69.5</td><td></td></tr><tr><td>ABS-Q(Ours)</td><td>33.1</td><td>56.1</td><td>4.5/3.8</td><td>70.9</td><td>89.7</td></tr><tr><td>ABS (Ours)</td><td>32.3</td><td>57.5</td><td>4.6/4.2</td><td>70.8</td><td>89.6</td></tr><tr><td rowspan="6">MobileNetV2</td><td>Full-precision</td><td>308.0</td><td>1.0</td><td>32.0/32.0</td><td>71.9</td><td>90.3</td></tr><tr><td>6-bit precision</td><td>11.2</td><td>27.5</td><td>6.0/6.0</td><td>71.8</td><td>90.3</td></tr><tr><td>DQ</td><td>19.6</td><td>1.9</td><td>6.8/8.0</td><td>70.4</td><td>89.7</td></tr><tr><td>HAQ</td><td>10.8</td><td>28.5</td><td>5.61/6.27</td><td>71.2</td><td>90.0</td></tr><tr><td>Bayesian Bits *</td><td>10.8</td><td>28.5</td><td>-/1</td><td>70.9</td><td>一</td></tr><tr><td>ABS-Q(Ours)</td><td>10.9</td><td>28.3</td><td>6.8/6.8</td><td>71.8</td><td>90.4</td></tr><tr><td></td><td>ABS (Ours)</td><td>10.8</td><td>28.5</td><td>6.1/7.1</td><td>71.7</td><td>90.3</td></tr></table>
|
| 176 |
+
|
| 177 |
+
The learning rate is set to 0.001. We then fine-tune the searched compressed network to recover the performance drop. On CIFAR-100, we train the searched network for 200 epochs with a mini-batch size of 128. The learning rate is initialized to 0.1 and is divided by 10 at 80-th and 120-th epochs. Experiments on CIFAR-100 are repeated for 5 times and we report the mean and standard deviation. For ResNet-18 on ImageNet, we finetune the searched network for 90 epochs with a mini-batch size of 256. For MobileNetV2 on ImageNet, we fine-tune for 150 epochs. For all models on ImageNet, the learning rate starts at 0.01 and decays with cosine annealing (Loshchilov & Hutter, 2017).
|
| 178 |
+
|
| 179 |
+
# 4.1 MAIN RESULTS
|
| 180 |
+
|
| 181 |
+
We apply the proposed methods to compress ResNet-20, ResNet-56 on CIFAR-100 and ResNet18, MobileNetV2 on ImageNet. We compare the performance of different methods in Table 1 and Table 2. We also show the results of the compressed ResNet-56 with different BOPs and memory footprints in Figure 2. From the results, we can see that 4-bit quantized networks achieve lossless performance. Also, 6-bit MobileNetV2 only leads to a $0 . 1 \%$ performance drop on the Top-1 Accuracy. Compared with fixed-precision quantization, mixed-precision methods are able to reduce the BOPs while preserving the performance. Critically, our proposed ABS-Q outperforms the stateof-the-arts baselines with less computational costs. Specifically, ABS-Q compressed ResNet-18 outperforms the one compressed by HAQ with more BOPs reduction. More critically, our proposed ABS achieves significant improvement in terms of BOPs and memory footprints. For example, in Figure 2(a), our ABS compressed ResNet-56 model yields much fewer BOPs (395.25 vs. 536.24) but achieves comparable performance compared with the fixed-precision counterpart. Moreover, by combing pruning and quantization, ABS achieves nearly lossless performance while further reducing the computational costs of ABS-Q. For example, ABS compressed ResNet-18 reduces the BOPs by $5 7 . 5 \times$ while still outperforming the full-precision network by $0 . 1 \%$ in terms of the Top-1 accuracy on ImageNet.
|
| 182 |
+
|
| 183 |
+
# 4.2 FURTHER STUDIES
|
| 184 |
+
|
| 185 |
+
Effect of the bit-sharing scheme. To investigate the effect of the bit-sharing scheme, we apply our methods to quantize ResNet-20 and ResNet-56 with and without the bit sharing scheme on CIFAR100. We report the testing accuracy and BOPs in Table 3. We also present the search costs and consumed GPU memory measured on a GPU device (NVIDIA TITAN $\mathrm { X p }$ ). It can be seen from the results that the method with the bit sharing scheme consistently outperforms the ones without the bit sharing scheme while significantly reducing the search costs and GPU memory.
|
| 186 |
+
|
| 187 |
+
Effect of the one-stage compression. To investigate the effect of the one-stage compression scheme (perform pruning and quantization jointly), we extend ABS to two-stage optimization, where we sequentially do filter pruning and quantization, denoted as ABS- $\mathbf { \partial } \cdot \mathbf { P } { } \mathbf { A } \mathbf { B } \mathbf { S } { - } \mathbf { Q }$ . The results are shown in Table 4. Compared with the two-stage counterpart, ABS achieves better performance with less computational costs, which shows the superiority of the one-stage optimization. For example, ABS compressed ResNet-56 outperforms the counterpart by $0 . 4 \%$ on the Top-1 accuracy with less computational overhead.
|
| 188 |
+
|
| 189 |
+
Table 3: Effect of the bit-sharing scheme. We report the testing accuracy, BOPs, and search costs on CIFAR-100. The search costs are measured on a GPU device (NVIDIA TITAN Xp).
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Network</td><td>Method</td><td>Top-1 Acc.</td><td>Top-5 Acc.</td><td>BOPs (M)</td><td>Search Cost (GPU hours)</td><td>GPUMemory (GB)</td></tr><tr><td rowspan="2">ResNet-20</td><td> w/o bit sharing</td><td>67.8±0.1</td><td>90.5±0.2</td><td>664.2</td><td>2.8</td><td>4.4</td></tr><tr><td>w/bit sharing</td><td>68.1±0.1</td><td>90.5±0.0</td><td>649.5</td><td>0.8</td><td>1.5</td></tr><tr><td rowspan="2">ResNet-56</td><td>w/o bit sharing</td><td>71.3±0.3</td><td>91.4±0.4</td><td>2001.1</td><td>8.7</td><td>10.9</td></tr><tr><td>w/ bit sharing</td><td>71.5±0.2</td><td>91.5±0.2</td><td>1970.7</td><td>1.9</td><td>3.0</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Table 4: Effect of the one-stage compression. We report the results of ResNet-56 on CIFAR-100.
|
| 194 |
+
|
| 195 |
+
<table><tr><td>Network</td><td>Method</td><td>Top-1 Acc.</td><td>Top-5 Acc.</td><td>BOPs (M)</td></tr><tr><td rowspan="2">ResNet-56</td><td>ABS-P→ABS-Q</td><td>70.4±0.1</td><td>90.8±0.2</td><td>1077.7</td></tr><tr><td>ABS</td><td>70.8±0.4</td><td>91.2±0.1</td><td>1042.5</td></tr></table>
|
| 196 |
+
|
| 197 |
+
Effect of the alternative training scheme. To investigate the effect of the alternative training scheme introduced in Section 3.3, we apply our method to compress ResNet-56 using a joint training scheme and an alternative training scheme on CIFAR-100. Here, the joint training scheme denotes that we train the binary gates of weights and activations jointly. From the results of Table 5, the model trained with the alternative scheme achieves better performance than the joint one, which demonstrates the effectiveness of the alternative training scheme.
|
| 198 |
+
|
| 199 |
+
Table 5: Effect of the alternative training scheme. We report the results of ResNet-56 on CIFAR-100.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Network</td><td>Method</td><td>Top-1 Acc.</td><td>Top-5 Acc.</td><td>BOPs (M)</td></tr><tr><td rowspan="2">ResNet-56</td><td>Joint</td><td>71.3±0.2</td><td>91.6±0.3</td><td>1942.4</td></tr><tr><td>Alternative</td><td>71.6±0.1</td><td>91.8±0.4</td><td>1918.8</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Resource-constrained compression. To demonstrate the effectiveness of our ABS on hardware devices, we further apply our methods to compress MobileNetV2 under the resource constraints on the BitFusion architecture (Sharma et al., 2018). Instead of using BOPs, we use the latency and energy on a simulator of the BitFusion to measure the computational costs. We report the results in Table 6. Compared with fixed-precision quantization, ABS achieves better performance with lower latency and energy. Specifically, ABS compressed MobileNetV2 with much lower latency and energy even outperforms 6-bit MobileNetV2 by $0 . 2 \%$ in the Top-1 accuracy.
|
| 204 |
+
|
| 205 |
+
Table 6: Resource-constrained compression on BitFusion. We evaluate the proposed ABS under the latency- and energy-constrained and report the Top-1 and Top-5 accuracy on ImageNet.
|
| 206 |
+
|
| 207 |
+
<table><tr><td rowspan="2">Network</td><td rowspan="2">Method</td><td colspan="3">Latency-constrained</td><td colspan="3">Energy-constrained</td></tr><tr><td>Acc.-1 (%)</td><td>Acc.-5 (%)</td><td>Latency (ms)</td><td>Acc.-1 (%)</td><td>Acc.-5 (%)</td><td>Energy (mJ)</td></tr><tr><td rowspan="2">MobileNetV2</td><td>6-bit precision</td><td>71.8</td><td>90.3</td><td>24.9</td><td>71.8</td><td>90.3</td><td>32.8</td></tr><tr><td>ABS (Ours)</td><td>72.0</td><td>90.4</td><td>17.2</td><td>72.0</td><td>90.3</td><td>26.3</td></tr></table>
|
| 208 |
+
|
| 209 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 210 |
+
|
| 211 |
+
In this paper, we have proposed a novel model compression method called Automatically Bit Sharing (ABS). Specifically, our ABS is based on the observation that quantized values of a high bitwidth share the ones of lower bitwidths under some constraints. We therefore have proposed the decomposition of quantization that encapsulates all candidate bitwidths. Starting from a low bitwidth in the search space, we sequentially increase the effective bitwidth by recursively adding re-assignment offsets. Based on this, we have further introduced learnable binary gates to encode the choice of different compression policies. By training the binary gates, the optimal compression ratio of each layer can be automatically determined. Experiments on CIFAR-100 and ImageNet have shown that our methods are able to achieve significant cost reduction while preserving the performance. In the future, we plan to work on a joint search for architecture, pruning, and quantization to find a compact model with better performance.
|
| 212 |
+
|
| 213 |
+
# REFERENCES
|
| 214 |
+
|
| 215 |
+
Yu Bai, Yu-Xiang Wang, and Edo Liberty. Proxquant: Quantized neural networks via proximal operators. In Proc. Int. Conf. Learn. Repren., 2019.
|
| 216 |
+
|
| 217 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients ´ through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 218 |
+
|
| 219 |
+
Yash Bhalgat, Jinwon Lee, Markus Nagel, Tijmen Blankevoort, and Nojun Kwak. Lsq $^ +$ : Improving low-bit quantization through learnable offsets and better initialization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 220 |
+
|
| 221 |
+
Han Cai, Ligeng Zhu, and Song Han. ProxylessNAS: Direct neural architecture search on target task and hardware. In Proc. Int. Conf. Learn. Repren., 2019.
|
| 222 |
+
|
| 223 |
+
Zhaowei Cai and Nuno Vasconcelos. Rethinking differentiable search for mixed-precision neural networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 224 |
+
|
| 225 |
+
Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2017.
|
| 226 |
+
|
| 227 |
+
Yongjian Chen, Tao Guan, and Cheng Wang. Approximate nearest neighbor search by residual vector quantization. Sensors, 10(12):11259–11273, 2010.
|
| 228 |
+
|
| 229 |
+
Jungwook Choi, Zhuo Wang, Swagath Venkataramani, Pierce I-Jen Chuang, Vijayalakshmi Srinivasan, and Kailash Gopalakrishnan. Pact: Parameterized clipping activation for quantized neural networks. arXiv preprint arXiv:1805.06085, 2018.
|
| 230 |
+
|
| 231 |
+
Ruizhou Ding, Ting-Wu Chin, Zeye Liu, and Diana Marculescu. Regularizing activation distribution for training binarized deep networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 232 |
+
|
| 233 |
+
Xuanyi Dong and Yi Yang. Network pruning via transformable architecture search. In Proc. Adv. Neural Inf. Process. Syst., 2019.
|
| 234 |
+
|
| 235 |
+
Zhen Dong, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. Hawq: Hessian aware quantization of neural networks with mixed-precision. In Proc. IEEE Int. Conf. Comp. Vis., 2019.
|
| 236 |
+
|
| 237 |
+
Steven K. Esser, Jeffrey L. McKinstry, Deepika Bablani, Rathinakumar Appuswamy, and Dharmendra S. Modha. Learned step size quantization. In Proc. Int. Conf. Learn. Repren., 2020.
|
| 238 |
+
|
| 239 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014.
|
| 240 |
+
|
| 241 |
+
Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Proc. Adv. Neural Inf. Process. Syst., 2016.
|
| 242 |
+
|
| 243 |
+
Yong Guo, Yin Zheng, Mingkui Tan, Qi Chen, Jian Chen, Peilin Zhao, and Junzhou Huang. Nat: Neural architecture transformer for accurate and compact architectures. In Proc. Adv. Neural Inf. Process. Syst., 2019.
|
| 244 |
+
|
| 245 |
+
Zichao Guo, Xiangyu Zhang, Haoyuan Mu, Wen Heng, Zechun Liu, Yichen Wei, and Jian Sun. Single path one-shot neural architecture search with uniform sampling. In Proc. Eur. Conf. Comp. Vis., 2020.
|
| 246 |
+
|
| 247 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In Proc. Int. Conf. Learn. Repren., 2016.
|
| 248 |
+
|
| 249 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2016.
|
| 250 |
+
|
| 251 |
+
Yang He, Ping Liu, Ziwei Wang, Zhilan Hu, and Yi Yang. Filter pruning via geometric median for deep convolutional neural networks acceleration. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 252 |
+
|
| 253 |
+
Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proc. IEEE Int. Conf. Comp. Vis., 2017.
|
| 254 |
+
|
| 255 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. In Proc. Eur. Conf. Comp. Vis., 2018.
|
| 256 |
+
|
| 257 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In Proc. Adv. Neural Inf. Process. Syst., 2016.
|
| 258 |
+
|
| 259 |
+
Qing Jin, Linjie Yang, and Zhenyu Liao. Towards efficient training for neural network quantization. arXiv preprint arXiv:1912.10207, 2019.
|
| 260 |
+
|
| 261 |
+
Sangil Jung, Changyong Son, Seohyung Lee, Jinwoo Son, Jae-Joon Han, Youngjun Kwak, Sung Ju Hwang, and Changkyu Choi. Learning to quantize deep networks by optimizing quantization intervals with task loss. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 262 |
+
|
| 263 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 264 |
+
|
| 265 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Proc. Adv. Neural Inf. Process. Syst., 2012.
|
| 266 |
+
|
| 267 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. In Proc. Int. Conf. Learn. Repren., 2017a.
|
| 268 |
+
|
| 269 |
+
Yuhang Li, Xin Dong, and Wei Wang. Additive powers-of-two quantization: An efficient nonuniform discretization for neural networks. In Proc. Int. Conf. Learn. Repren., 2020.
|
| 270 |
+
|
| 271 |
+
Zefan Li, Bingbing Ni, Wenjun Zhang, Xiaokang Yang, and Wen Gao. Performance guaranteed network acceleration via high-order residual quantization. In Proc. IEEE Int. Conf. Comp. Vis., 2017b.
|
| 272 |
+
|
| 273 |
+
Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. ´ Feature pyramid networks for object detection. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2017a.
|
| 274 |
+
|
| 275 |
+
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object ´ detection. In Proc. IEEE Int. Conf. Comp. Vis., 2017b.
|
| 276 |
+
|
| 277 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In Proc. Int. Conf. Learn. Repren., 2019a.
|
| 278 |
+
|
| 279 |
+
Zechun Liu, Haoyuan Mu, Xiangyu Zhang, Zichao Guo, Xin Yang, Kwang-Ting Cheng, and Jian Sun. Metapruning: Meta learning for automatic neural network channel pruning. In Proc. IEEE Int. Conf. Comp. Vis., 2019b.
|
| 280 |
+
|
| 281 |
+
Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. In Proc. Int. Conf. Learn. Repren., 2017.
|
| 282 |
+
|
| 283 |
+
Qian Lou, Lantao Liu, Minje Kim, and Lei Jiang. Autoqb: Automl for network quantization and binarization on mobile devices. arXiv preprint arXiv:1902.05690, 2019.
|
| 284 |
+
|
| 285 |
+
Christos Louizos, Matthias Reisser, Tijmen Blankevoort, Efstratios Gavves, and Max Welling. Relaxed quantization for discretized neural networks. In Proc. Int. Conf. Learn. Repren., 2019.
|
| 286 |
+
|
| 287 |
+
Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In Proc. IEEE Int. Conf. Comp. Vis., 2017.
|
| 288 |
+
|
| 289 |
+
Yurii E Nesterov. A method for solving the convex programming problem with convergence rate o $( 1 / \mathrm { k } ^ { \cdot } 2 )$ . In Proceedings of the USSR Academy of Sciences, volume 269, pp. 543–547, 1983.
|
| 290 |
+
|
| 291 |
+
Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In Proc. Int. Conf. Mach. Learn., 2018.
|
| 292 |
+
|
| 293 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proc. AAAI Conf. on Arti. Intel., 2019.
|
| 294 |
+
|
| 295 |
+
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. Int. J. Comp. Vis., 115(3):211–252, 2015.
|
| 296 |
+
|
| 297 |
+
Hardik Sharma, Jongse Park, Naveen Suda, Liangzhen Lai, Benson Chau, Vikas Chandra, and Hadi Esmaeilzadeh. Bit fusion: Bit-level dynamically composable architecture for accelerating deep neural network. In International Symposium on Computer Architecture, pp. 764–775. IEEE, 2018.
|
| 298 |
+
|
| 299 |
+
Dimitrios Stamoulis, Ruizhou Ding, Di Wang, Dimitrios Lymberopoulos, Bodhi Priyantha, Jie Liu, and Diana Marculescu. Single-path nas: Designing hardware-efficient convnets in less than 4 hours. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 481–497, 2019.
|
| 300 |
+
|
| 301 |
+
Frederick Tung and Greg Mori. Clip-q: Deep network compression learning by in-parallel pruningquantization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pp. 7873–7882, 2018.
|
| 302 |
+
|
| 303 |
+
Stefan Uhlich, Lukas Mauch, Fabien Cardinaux, Kazuki Yoshiyama, Javier Alonso Garcia, Stephen Tiedemann, Thomas Kemp, and Akira Nakamura. Mixed precision dnns: All you need is a good parametrization. In Proc. Int. Conf. Learn. Repren., 2020.
|
| 304 |
+
|
| 305 |
+
Mart van Baalen, Christos Louizos, Markus Nagel, Rana Ali Amjad, Ying Wang, Tijmen Blankevoort, and Max Welling. Bayesian bits: Unifying quantization and pruning. In Proc. Adv. Neural Inf. Process. Syst., 2020.
|
| 306 |
+
|
| 307 |
+
Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. Haq: Hardware-aware automated quantization with mixed precision. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 308 |
+
|
| 309 |
+
Tianzhe Wang, Kuan Wang, Han Cai, Ji Lin, Zhijian Liu, Hanrui Wang, Yujun Lin, and Song Han. Apq: Joint search for network architecture, pruning and quantization policy. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 310 |
+
|
| 311 |
+
Bichen Wu, Yanghan Wang, Peizhao Zhang, Yuandong Tian, Peter Vajda, and Kurt Keutzer. Mixed precision quantization of convnets via differentiable neural architecture search. arXiv preprint arXiv:1812.00090, 2018.
|
| 312 |
+
|
| 313 |
+
Haichuan Yang, Shupeng Gui, Yuhao Zhu, and Ji Liu. Automatic neural network compression by sparsity-quantization joint learning: A constrained optimization-based approach. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 314 |
+
|
| 315 |
+
Shaokai Ye, Tianyun Zhang, Kaiqi Zhang, Jiayu Li, Jiaming Xie, Yun Liang, Sijia Liu, Xue Lin, and Yanzhi Wang. A unified framework of dnn weight pruning and weight clustering/quantization using admm. In Proc. AAAI Conf. on Arti. Intel., 2019.
|
| 316 |
+
|
| 317 |
+
Wang Ying, Lu Yadong, and Blankevoort Tijmen. Differentiable joint pruning and quantization for hardware efficiency. In Proc. Eur. Conf. Comp. Vis., 2020.
|
| 318 |
+
|
| 319 |
+
Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In Proc. Eur. Conf. Comp. Vis., 2018.
|
| 320 |
+
|
| 321 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 322 |
+
|
| 323 |
+
Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian Reid. Towards effective lowbitwidth convolutional neural networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2018a.
|
| 324 |
+
|
| 325 |
+
Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian Reid. Structured binary neural networks for accurate image classification and semantic segmentation. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 326 |
+
|
| 327 |
+
Bohan Zhuang, Lingqiao Liu, Mingkui Tan, Chunhua Shen, and Ian Reid. Training quantized neural networks with a full-precision auxiliary module. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 328 |
+
|
| 329 |
+
Zhuangwei Zhuang, Mingkui Tan, Bohan Zhuang, Jing Liu, Yong Guo, Qingyao Wu, Junzhou Huang, and Jinhui Zhu. Discrimination-aware channel pruning for deep neural networks. In Proc. Adv. Neural Inf. Process. Syst., 2018b.
|
| 330 |
+
|
| 331 |
+
# Appendix for ABS: Automatic Bit Sharing for Model Compression
|
| 332 |
+
|
| 333 |
+
A HARDWARE-FRIENDLY DECOMPOSITION
|
| 334 |
+
|
| 335 |
+
As mentioned in Sec. 3.2, $b _ { 1 }$ can be set to arbitrary appropriate integer values (e.g., 1, 2, 3, etc.). By default, we set $b _ { 1 } = 2$ for better hardware utilization. On general purpose computing devices (e.g., CPU, GPU), byte (8 bits) is the lowest data type for operations. Other data types and ALU registers are all composed with multiple bytes in width. By setting $b _ { 1 } = 2$ , 2-bit/ 4-bit/ 8-bit quantization values can be packed into byte (or short, int, long) data type without bit wasting. Otherwise, if $b _ { 1 } = 1$ or $b _ { 1 } = 3$ , it is inevitable to have wasted bits when packing mixed-precision quantized tensors on general purpose devices. For example, one 32-bit int data type can be used to store ten 3-bit quantized values with 2 bits wasted. One might argue that these 2 bits can be leveraged with the next group of 3-bit data, but it will result in irregular memory access patterns, which will degrade the hardware utilization more seriously. Moreover, 8-bit quantization has been demonstrated to own similar performance with the full precision counterparts for many networks. Therefore, there is no need to consider a bitwidth larger than 8.
|
| 336 |
+
|
| 337 |
+
# B FORMULATION OF DIFFERENTIABLE COMPUTATIONAL LOSS
|
| 338 |
+
|
| 339 |
+
In this section, we introduce the differentiable computational loss mentioned in Section 3.3. Unlike the cross-entropy loss in Eq. (17), the computational costs $R ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } )$ is non-differentiable. To solve this issue, we model the computational costs as a function of binary gates as:
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
R ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) = \sum _ { c = 1 } ^ { G } g _ { c } ^ { p } \left( R _ { x _ { c , b _ { 1 } } } + g _ { b _ { 2 } } ^ { q } \left( R _ { x _ { c , b _ { 2 } } } - R _ { x _ { c , b _ { 1 } } } + \cdot \cdot + \cdot + g _ { b _ { K } } ^ { q } \left( R _ { x _ { c , b _ { K } } } - R _ { x _ { c , b _ { K - 1 } } } \right) \right) \right) ,
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where Rxc,b is the computational cost for the $c$ -th group of filters with $b _ { j }$ -bit quantization and $G$ is the number of groups in total.
|
| 346 |
+
|
| 347 |
+
# C QUANTIZATION CONFIGURATIONS
|
| 348 |
+
|
| 349 |
+
All the methods in Tables 1 and 2 use layer-wise and symmetric quantization schemes and the compared methods strictly follow the quantization configurations in their original papers. Specifically, for DQ (Uhlich et al., 2020), we parameterize the fixed-point quantizer using case U3 with $\theta = [ d , q _ { \mathrm { m a x } } ]$ . We initialize the weights using a pre-trained model. The initial step size is set to $d = \bar { 2 } ^ { \lfloor \log _ { 2 } ( \operatorname* { m a x } ( | \mathbf { W } | ) / ( 2 ^ { b - 1 } - 1 ) \rfloor }$ for weights and $2 ^ { - 3 }$ for activations. The remaining quantization parameters are set such that the initial bitwidth is 4-bit. For HAQ (Wang et al., 2019), we first truncate the weights and activations into the range of $[ - v _ { w } , v _ { w } ]$ and $[ 0 , v _ { x } ]$ , respectively. We then perform linear quantization for both weights and activations. To find more proper $v _ { w }$ and $v _ { x }$ , we minimize the KL-divergence between the original weight distribution W and the quantized weight distribution $Q ( \mathbf { W } )$ . For DNAS (Wu et al., 2018), we follow DoReFa-Net (Zhou et al., 2016) to quantize weights and follow PACT (Choi et al., 2018) to quantize activations. We initialize the learnable upper bound to 1. For DJPQ (Ying et al., 2020) and Bayesian Bits (van Baalen et al., 2020), we directly get the results from original papers. For other methods in Tables 1 and 2, we use the quantization function introduced in Section 3.1. The trainable quantization intervals $v _ { x }$ and $v _ { w }$ are initialized to 1.
|
| 350 |
+
|
| 351 |
+
# D SEARCH COST COMPARISONS
|
| 352 |
+
|
| 353 |
+
To evaluate the efficiency of the proposed ABS, we compare the search cost of different methods and report the results in Table 7. From the results, the search costs of the proposed ABS is much smaller than the state-of-the-art methods. Moreover, compared with ABS-Q, ABS only introduces a small amount of computational overhead, which demonstrates the efficiency of the proposed methods.
|
| 354 |
+
|
| 355 |
+
Table 7: Comparisons of the search costs on CIFAR-100. The search costs are measured on a GPU device (NVIDIA TITAN Xp).
|
| 356 |
+
|
| 357 |
+
<table><tr><td>Network</td><td>Method</td><td>Search Cost (GPU hours)</td></tr><tr><td rowspan="3">ResNet-20</td><td>HAQ DQ</td><td>5.8 3.0</td></tr><tr><td>DNAS</td><td>2.8</td></tr><tr><td>ABS-Q (Ours) ABS-P (Ours) ABS (Ours)</td><td>0.8 0.2</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 8: Comparisons of different methods w.r.t. memory footprints. We compress ResNet-56 using different methods and report the results on CIFAR-100.
|
| 360 |
+
|
| 361 |
+
<table><tr><td>Method</td><td>Memory footprints(KB)</td><td>M.f. comp. ratio</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td>Full-precision</td><td>5653.4</td><td>1.0</td><td>71.7</td><td>92.2</td></tr><tr><td>4-bit precision</td><td>711.7</td><td>7.9</td><td>70.9±0.3</td><td>91.2±0.4</td></tr><tr><td>DNAS</td><td>708.9</td><td>8.0</td><td>71.5±0.2</td><td>91.3±0.1</td></tr><tr><td>HAQ</td><td>700.0</td><td>8.1</td><td>71.3±0.1</td><td>91.1±0.1</td></tr><tr><td>ABS-Q (Ours)</td><td>674.5</td><td>8.4</td><td>71.5±0.2</td><td>91.6±0.2</td></tr><tr><td>ABS (Ours)</td><td>657.3</td><td>8.6</td><td>71.6±0.1</td><td>91.8±0.4</td></tr></table>
|
| 362 |
+
|
| 363 |
+
Table 9: Comparisons of different methods with MobileNetV3 on CIFAR-100.
|
| 364 |
+
|
| 365 |
+
<table><tr><td>Method</td><td>BOPs (M)</td><td>BOP comp.ratio</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td>Full-precision</td><td>68170.1</td><td>1.0</td><td>76.1</td><td>93.9</td></tr><tr><td>6-bit precision</td><td>2412.6</td><td>28.3</td><td>76.1±0.0</td><td>93.7±0.0</td></tr><tr><td>DQ</td><td>2136.3</td><td>31.9</td><td>75.9±0.1</td><td>93.7±0.1</td></tr><tr><td>HAQ</td><td>2191.7</td><td>31.1</td><td>76.1±0.1</td><td>93.5±0.0</td></tr><tr><td>DNAS</td><td>2051.9</td><td>33.2</td><td>76.1±0.1</td><td>93.7±0.1</td></tr><tr><td>ABS-P(Ours)</td><td>59465.8</td><td>1.1</td><td>76.0±0.0</td><td>93.5±0.0</td></tr><tr><td>ABS-Q(Ours)</td><td>2021.9</td><td>33.7</td><td>76.1±0.1</td><td>93.7±0.1</td></tr><tr><td>ABS (Ours)</td><td>2006.6</td><td>34.0</td><td>76.1±0.1</td><td>93.7±0.1</td></tr></table>
|
| 366 |
+
|
| 367 |
+
# E MORE RESULTS ON MEMORY FOOTPRINTS
|
| 368 |
+
|
| 369 |
+
To further demonstrate the effectiveness of the proposed ABS, we replace BOPs with total weights and activations memory footprints (Uhlich et al., 2020). We apply different methods to compress ResNet-56 and report the results in Table 8. From the results, ABS compressed ResNet-56 outperforms other methods with fewer memory footprints. These results show the effectiveness of our proposed ABS in terms of memory footprints reduction.
|
| 370 |
+
|
| 371 |
+
# F DETAILED STRUCTURE OF THE COMPRESSED NETWORK
|
| 372 |
+
|
| 373 |
+
We illustrate the pruning rate and bitwidth of each layer’s weights and activations of the compressed ResNet-18 and MobileNetV2 in Figure 3 and Figure 4, respectively. From the results, we observe that our ABS assigns more bitwidths to the weights in the downsampling convolutional layer in ResNet-18 and depthwise convolutional layer in MobileNetV2. Intuitively, this is because the number of parameters of these layers is much smaller than other layers. Moreover, our ABS inclines to prune more filters in the shallower layers, which can significantly reduce the number of parameters and computational overhead. Finally, we also observe that the correlation between the bitwidth and pruning rate is as follows. If a layer is set to a high pruning rate, our ABS tends to select a higher bitwidth to compensate for the performance drop. In contrast, if a layer is with a low pruning rate, our ABS tends to select a lower bitwidth to reduce the model size and computational costs.
|
| 374 |
+
|
| 375 |
+
# G MORE RESULTS ON MOBILENETV3
|
| 376 |
+
|
| 377 |
+
To evaluate the proposed ABS on the lightweight model, we apply our methods to MobileNetV3 on CIFAR-100. Following $\mathrm { L S Q + }$ (Bhalgat et al., 2020), we introduce a learnable offset to handle the negative activations in hard-swish. We show the results in Table 9. From the results of MobileNetV3, our proposed ABS still outperforms the compared methods, which demonstrates its effectiveness.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
(a) Bitwidth configuration of the compressed ResNet-18.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 3: Detailed configurations of the compressed ResNet-18.
|
| 384 |
+
|
| 385 |
+
(b) Pruning rate configuration of the compressed ResNet-18. The pruning rate is defined as the ratio between #pruned weights of the compressed models and #weights of the uncompressed models.
|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
Figure 4: Detailed configurations of the compressed MobileNetV2.
|
| 389 |
+
|
| 390 |
+
(b) Pruning rate configuration of the compressed MobileNetV2. The pruning rate is defined as the ratio between #pruned weights of the compressed models and #weights of the uncompressed models.
|
md/train/QkRbdiiEjM/QkRbdiiEjM.md
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADAGCN: ADABOOSTING GRAPH CONVOLUTIONAL NETWORKS INTO DEEP MODELS
|
| 2 |
+
|
| 3 |
+
Ke Sun
|
| 4 |
+
Zhejiang Lab
|
| 5 |
+
Key Lab. of Machine Perception (MoE), School of EECS, Peking University
|
| 6 |
+
ajksunke@pku.edu.cn
|
| 7 |
+
|
| 8 |
+
Zhanxing Zhu\* Beijing Institute of Big Data Research, Beijing, China zhanxing.zhu@pku.edu.cn
|
| 9 |
+
|
| 10 |
+
Zhouchen Lin∗
|
| 11 |
+
Key Lab. of Machine Perception (MoE), School of EECS, Peking University
|
| 12 |
+
Pazhou Lab, Guangzhou, China
|
| 13 |
+
zlin@pku.edu.cn
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
The design of deep graph models still remains to be investigated and the crucial part is how to explore and exploit the knowledge from different hops of neighbors in an efficient way. In this paper, we propose a novel RNN-like deep graph neural network architecture by incorporating AdaBoost into the computation of network; and the proposed graph convolutional network called AdaGCN (Adaboosting Graph Convolutional Network) has the ability to efficiently extract knowledge from high-order neighbors of current nodes and then integrates knowledge from different hops of neighbors into the network in an Adaboost way. Different from other graph neural networks that directly stack many graph convolution layers, AdaGCN shares the same base neural network architecture among all “layers” and is recursively optimized, which is similar to an RNN. Besides, We also theoretically established the connection between AdaGCN and existing graph convolutional methods, presenting the benefits of our proposal. Finally, extensive experiments demonstrate the consistent state-of-the-art prediction performance on graphs across different label rates and the computational advantage of our approach AdaGCN 1.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Recently, research related to learning on graph structural data has gained considerable attention in machine learning community. Graph neural networks (Gori et al., 2005; Hamilton et al., 2017; Velickovi ˇ c et al., 2018), particularly graph convolutional networks (Kipf & Welling, 2017; Deffer- ´ rard et al., 2016; Bruna et al., 2014) have demonstrated their remarkable ability on node classification (Kipf & Welling, 2017), link prediction (Zhu et al., 2016) and clustering tasks (Fortunato, 2010). Despite their enormous success, almost all of these models have shallow model architectures with only two or three layers. The shallow design of GCN appears counterintuitive as deep versions of these models, in principle, have access to more information, but perform worse. Oversmoothing (Li et al., 2018) has been proposed to explain why deep GCN fails, showing that by repeatedly applying Laplacian smoothing, GCN may mix the node features from different clusters and makes them indistinguishable. This also indicates that by stacking too many graph convolutional layers, the embedding of each node in GCN is inclined to converge to certain value (Li et al., 2018), making it harder for classification. These shallow model architectures restricted by oversmoothing issue limit their ability to extract the knowledge from high-order neighbors, i.e., features from remote hops of neighbors for current nodes. Therefore, it is crucial to design deep graph models such that high-order information can be aggregated in an effective way for better predictions.
|
| 22 |
+
|
| 23 |
+
There are some works (Xu et al., 2018b; Liao et al., 2019; Klicpera et al., 2018; Li et al., 2019; Liu et al., 2020) that tried to address this issue partially, and the discussion can refer to Appendix A.1. By contrast, we argue that a key direction of constructing deep graph models lies in the efficient exploration and effective combination of information from different orders of neighbors. Due to the apparent sequential relationship between different orders of neighbors, it is a natural choice to incorporate boosting algorithm into the design of deep graph models. As an important realization of boosting theory, AdaBoost (Freund et al., 1999) is extremely easy to implement and keeps competitive in terms of both practical performance and computational cost (Hastie et al., 2009). Moreover, boosting theory has been used to analyze the success of ResNets in computer vision (Huang et al., 2018) and AdaGAN (Tolstikhin et al., 2017) has already successfully incorporated boosting algorithm into the training of GAN (Goodfellow et al., 2014).
|
| 24 |
+
|
| 25 |
+
In this work, we focus on incorporating AdaBoost into the design of deep graph convolutional networks in a non-trivial way. Firstly, in pursuit of the introduction of AdaBoost framework, we refine the type of graph convolutions and thus obtain a novel RNN-like GCN architecture called AdaGCN. Our approach can efficiently extract knowledge from different orders of neighbors and then combine these information in an AdaBoost manner with iterative updating of the node weights. Also, we compare our AdaGCN with existing methods from the perspective of both architectural difference and feature representation power to show the benefits of our method. Finally, we conduct extensive experiments to demonstrate the consistent state-of-the-art performance of our approach across different label rates and computational advantage over other alternatives.
|
| 26 |
+
|
| 27 |
+
# 2 OUR APPROACH: ADAGCN
|
| 28 |
+
|
| 29 |
+
# 2.1 ESTABLISHMENT OF ADAGCN
|
| 30 |
+
|
| 31 |
+
Consider an undirected graph $\mathcal { G } = ( \nu , \mathcal { E } )$ with $N$ nodes $v _ { i } \in \mathcal V$ , edges $( v _ { i } , v _ { j } ) \in \mathcal { E }$ . $A \in \mathbb { R } ^ { N \times N }$ is the adjacency matrix with corresponding degree matrix $\begin{array} { r } { D _ { i i } = \sum _ { j } \dot { A } _ { i j } } \end{array}$ . In the vanilla GCN model (Kipf & Welling, 2017) for semi-supervised node classification, the graph embedding of nodes with two convolutional layers is formulated as:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
Z = \hat { A } \mathrm { R e L U } ( \hat { A } X W ^ { ( 0 ) } ) W ^ { ( 1 ) }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $Z \in \mathbb { R } ^ { N \times K }$ is the final embedding matrix (output logits) of nodes before softmax and $K$ is the number of classes. $X \in \mathbb { R } ^ { N \times C }$ denotes the feature matrix where $C$ is the input dimension. $\hat { A } = \tilde { D } ^ { - \frac { 1 } { 2 } } \tilde { A } \tilde { D } ^ { - \frac { 1 } { 2 } }$ where ${ \tilde { A } } = A + I$ and $\tilde { D }$ is the degree matrix of $\tilde { A }$ . In addition, $W ^ { ( 0 ) } \in \mathbb { R } ^ { C \times H }$ is the input-to-hidden weight matrix for a hidden layer with $H$ feature maps and $W ^ { ( 1 ) } \in \mathbb { R } ^ { H \times K }$ is the hidden-to-output weight matrix.
|
| 38 |
+
|
| 39 |
+
Our key motivation of constructing deep graph models is to efficiently explore information of highorder neighbors and then combine these messages from different orders of neighbors in an AdaBoost way. Nevertheless, if we naively extract information from high-order neighbors based on GCN, we are faced with stacking $l$ layers’ parameter matrix $W ^ { ( i ) } , i = 0 , . . . , l - 1$ , which is definitely costly in computation. Besides, Multi-Scale Deep Graph Convolutional Networks (Luan et al., 2019) also theoretically demonstrated that the output can only contain the stationary information of graph structure and loses all the local information in nodes for being smoothed if we simply deepen GCN. Intuitively, the desirable representation of node features does not necessarily need too many nonlinear transformation $f$ applied on them. This is simply due to the fact that the feature of each node is normally one-dimensional sparse vector rather than multi-dimensional data structures, e.g., images, that intuitively need deep convolution network to extract high-level representation for vision tasks. This insight has been empirically demonstrated in many recent works (Wu et al., 2019; Klicpera et al., 2018; Xu et al., 2018a), showing that a two-layer fully-connected neural networks is a better choice in the implementation. Similarly, our AdaGCN also follows this direction by choosing an appropriate $f$ in each layer rather than directly deepen GCN layers.
|
| 40 |
+
|
| 41 |
+
Thus, we propose to remove ReLU to avoid the expensive joint optimization of multiple parameter matrices. Similarly, Simplified Graph Convolution (SGC) (Wu et al., 2019) also adopted this practice, arguing that nonlinearity between GCN layers is not crucial and the majority of the benefits arises from local weighting of neighboring features. Then the simplified graph convolution is:
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: The RNN-like architecture of AdaGCN with each base classifier $f _ { \theta } ^ { ( l ) }$ sharing the same neural network architecture $f _ { \theta }$ . $w ^ { l }$ and $\theta _ { l }$ denote node weights and parameters computed after the $l$ -th base classifier, respectively.
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
Z = \hat { A } ^ { l } X W ^ { ( 0 ) } W ^ { ( 1 ) } \cdots W ^ { ( l - 1 ) } = \hat { A } ^ { l } X \tilde { W } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where we collapse $W ^ { ( 0 ) } W ^ { ( 1 ) } \cdot \cdot \cdot W ^ { ( l - 1 ) }$ as $\tilde { W }$ and $\hat { A } ^ { l }$ denotes $\hat { A }$ to the $l$ -th power. In particular, one crucial impact of ReLU in GCN is to accelerate the convergence of matrix multiplication since the ReLU is a contraction mapping intuitively. Thus, the removal of ReLU operation could also alleviate the oversmoothing issue, i.e. slowering the convergence of node embedding to indistinguishable ones (Li et al., 2018). Additionally, without ReLU this simplified graph convolution is also able to avoid the aforementioned joint optimization over multiple parameter matrices, resulting in computational benefits. Nevertheless, we find that this type of stacked linear transformation from graph convolution has insufficient power in representing information of high-order neighbors, which is revealed in our experiment described in Appendix A.2. Therefore, we propose to utilize an appropriate nonlinear function $f _ { \theta }$ , e.g., a two-layer fully-connected neural network, to replace the linear transformation $\tilde { W }$ in Eq. 2 and enhance the representation ability of each base classifier in AdaGCN as follows:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
Z ^ { ( l ) } = f _ { \theta } ( \hat { A } ^ { l } X ) ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $Z ^ { ( l ) }$ represents the final embedding matrix (output logits before Softmax) after the $l$ -th base classifier in AdaGCN. This formulation also implies that the $l$ -th base classifier in AdaGCN is extracting knowledge from features of current nodes and their $l$ -th hop of neighbors. Due to the fact that the function of $l$ -th base classifier in AdaGCN is similar to that of the $l$ -th layer in other traditional GCN-based methods that directly stack many graph convolutional layers, we regard the whole part of l-th base classifier as the $l$ -th layers in AdaGCN. As for the realization of Multi-class AdaBoost, we apply SAMME (Stagewise Additive Modeling using a Multi-class Exponential loss function) algorithm (Hastie et al., 2009), a natural and clean multi-class extension of the two-class AdaBoost adaptively combining weak classifiers.
|
| 57 |
+
|
| 58 |
+
As illustrated in Figure 1, we apply base classifie r f (l) to extract knowledge from current node feature and $l$ -th hop of neighbors by minimizing current weighted loss. Then we directly compute the weighted error rate $e r r ^ { ( l ) }$ and corresponding weight $\alpha ^ { ( l ) }$ of current base classifier $f _ { \theta } ^ { ( l ) }$ as follows:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { c } { { e r r ^ { ( l ) } = \displaystyle \sum _ { i = 1 } ^ { n } w _ { i } \mathbb { I } \left( c _ { i } \neq f _ { \theta } ^ { ( l ) } \left( x _ { i } \right) \right) / \sum _ { i = 1 } ^ { n } w _ { i } } } \\ { { \displaystyle \alpha ^ { ( l ) } = \log \frac { 1 - e r r ^ { ( l ) } } { e r r ^ { ( l ) } } + \log ( K - 1 ) , } } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $w _ { i }$ denotes the weight of $i$ -th node and $c _ { i }$ represents the category of current $i$ -th node. To attain a positive $\alpha ^ { ( l ) }$ , we only need $( 1 - e r r ^ { ( l ) } ) > 1 / K$ , i.e., the accuracy of each weak classifier
|
| 65 |
+
|
| 66 |
+
should be better than random guess (Hastie et al., 2009). This can be met easily to guarantee the weights to be updated in the right direction. Then we adjust nodes’ weights by increasing weights on incorrectly classified ones:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
w _ { i } \gets w _ { i } \cdot \exp \left( \alpha ^ { ( l ) } \cdot \mathbb { I } \left( c _ { i } \neq f _ { \theta } ^ { ( l ) } \left( x _ { i } \right) \right) \right) , i = 1 , \dots , n
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
After re-normalizing the weights, we then compute $\hat { A } ^ { l + 1 } X = \hat { A } \cdot ( \hat { A } ^ { l } X )$ to sequentially extract knowledge from of AdaGCN is t $l { + } 1$ -th hop of neighbors in the following base classifier different from traditional AdaBoost, we only define $f _ { \theta } ^ { ( l + 1 ) }$ One crucial point, e.g. a two-layer $f _ { \theta }$ fully connected neural network, which in practice is recursively optimized in each base classifier just similar to a recurrent neural network. This also indicates that the parameters from last base classifier are leveraged as the initialization of next base classifier, which coincides with our intuition that $l + 1$ -th hop of neighbors are directly connected from $l$ -th hop of neighbors. The efficacy of this kind of layer-wise training has been similarly verified in (Belilovsky et al., 2018) recently. Further, we combine the predictions from different orders of neighbors in an Adaboost way to obtain the final prediction $C ( A , X )$ :
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
C ( A , X ) = \arg \operatorname* { m a x } _ { k } \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Finally, we obtain the concise form of AdaGCN in the following:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { r l } & { \hat { A } ^ { l } X = \hat { A } \cdot ( \hat { A } ^ { l - 1 } X ) } \\ & { Z ^ { ( l ) } = f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X ) } \\ & { Z = \mathrm { A d a B o o s t } ( Z ^ { ( l ) } ) } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Note that $f _ { \theta }$ is non-linear, rather than linear in SGC (Wu et al., 2019), to guarantee the representation power. As shown in Figure 1, the architecture of AdaGCN is a variant of RNN with synchronous sequence input and output. Although the same classifier architecture is adopted for $f _ { \theta } ^ { ( \bar { l } ) }$ , their parameters are different, which is different from vanilla RNN. We provide a detailed description of the our algorithm in Section 3.
|
| 85 |
+
|
| 86 |
+
# 2.2 COMPARISON WITH EXISTING METHODS
|
| 87 |
+
|
| 88 |
+
Architectural Difference. As illustrated in Figure 1 and 2, there is an apparent difference among the architectures of GCN (Kipf & Welling, 2017), SGC (Wu et al., 2019), Jumping Knowledge (JK) (Xu et al., 2018b) and AdaGCN. Compared with these existing graph convolutional approaches that sequentially convey intermediate result $Z ^ { ( l ) }$ to compute final prediction, our AdaGCN transmits weights of nodes $w ^ { i }$ , aggregated features of different hops of neighbors ${ \hat { A } } ^ { l } X$ . More importantly, in AdaGCN the embedding $Z ^ { ( l ) }$ is independent of the flow of computation in the network and the sparse adjacent matrix $\hat { A }$ is also not directly involved in the computation of individual network because we compute
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: Comparison of the graph model architectures. $f _ { a }$ in JK network denotes one aggregation layer with aggregation function such as concatenation or max pooling.
|
| 92 |
+
|
| 93 |
+
${ \hat { A } } ^ { ( l + 1 ) } X$ in advance and then feed it instead of $\hat { A }$ into the classifier $f _ { \theta } ^ { ( l + 1 ) }$ , thus yielding significant computation reduction, which will be discussed further in Section 3.
|
| 94 |
+
|
| 95 |
+
Connection with PPNP and APPNP. We also established a strong connection between AdaGCN and previous state-of-the-art Personalized Propagation of Neural Predictions (PPNP) and Approximate PPNP (APPNP) (Klicpera et al., 2018) method that leverages personalized pagerank to reconstruct graph convolutions in order to use information from a large and adjustable neighborhood. The analysis can be summarized in the following Proposition 1. Proof can refer to Appendix A.3.
|
| 96 |
+
|
| 97 |
+
Proposition 1. Suppose that $\gamma$ is the teleport factor. Let matrix sequence $\{ Z ^ { ( l ) } \}$ be from the output of each layer l in AdaGCN, then PPNP is equivalent to the Exponential Moving Average (EMA) with exponentially decreasing factor $\gamma$ on $\{ Z ^ { ( l ) } \}$ in a sharing parameters version, and its approximate version APPNP can be viewed as the approximated form of EMA with a limited number of terms.
|
| 98 |
+
|
| 99 |
+
Proposition 1 illustrates that AdaGCN can be viewed as an adaptive form of APPNP, formulated as:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
Z = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X )
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Specifically, the first discrepancy between AdaGCN and APPNP lies in the adaptive coefficient $\alpha ^ { ( l ) }$ in AdaGCN determined by the error of $l$ -th base classifier $f _ { \theta } ^ { ( l ) }$ rather than fixed exponentially decreased weights in APPNP. In addition, AdaGCN employs classifier $f _ { \theta } ^ { ( l ) }$ with different parameters to learn the embedding of different orders of neighbors, while APPNP shares these parameters in its form. We verified this benefit of our approach in our experiments shown in Section 4.2.
|
| 106 |
+
|
| 107 |
+
Comparison with MixHop MixHop (Abu-El-Haija et al., 2019) applied the similar way of graph convolution by repeatedly mixing feature representations of neighbors at various distance. Proposition 2 proves that both AdaGCN and MixHop are able to represent feature differences among neighbors while previous GCNs-based methods cannot. Proof can refer to Appendix A.4. Recap the definition of general layer-wise Neighborhood Mixing (Abu-El-Haija et al., 2019) as follows:
|
| 108 |
+
|
| 109 |
+
Definition 1. General layer-wise Neighborhood Mixing: $A$ graph convolution network has the ability to represent the layer-wise neighborhood mixing if for any $b _ { 0 } , b _ { 1 } , . . . , b _ { L } ,$ , there exists an injective mapping $f$ with a setting of its parameters, such that the output of this graph convolution network can express the following formula:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
f \left( \sum _ { l = 0 } ^ { L } b _ { l } \sigma \left( \hat { A } ^ { l } X \right) \right)
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Proposition 2. AdaGCNs defined by our proposed approach (Eq. equation 7) are capable of representing general layer-wise neighborhood mixing, i.e., can meet the Definition $^ { l }$ .
|
| 116 |
+
|
| 117 |
+
Albeit the similarity, AdaGCN distinguishes from MixHop in many aspects. Firstly, MixHop concatenates all outputs from each order of neighbors while we combines these predictions in an Adaboost way, which has theoretical generalization guarantee based on boosting theory Hastie et al. (2009). Oono & Suzuki (2020) have recently derived the optimization and generalization guarantees of multi-scale GNNs, serving as the theoretical backbone of AdaGCN. Meantime, MixHop allows full linear mixing of different orders of neighboring features, while AdaGCN utilizes different nonlinear transformation $f _ { \theta } ^ { ( l ) }$ among all layers, enjoying stronger expressive power.
|
| 118 |
+
|
| 119 |
+
# 3 ALGORITHM
|
| 120 |
+
|
| 121 |
+
In practice, we employ SAMME.R (Hastie et al., 2009), the soft version of SAMME, in AdaGCN. SAMME.R (R for Real) algorithm (Hastie et al., 2009) leverages real-valued confidence-rated predictions, i.e., weighted probability estimates, rather than predicted hard labels in SAMME, in the prediction combination, which has demonstrated a better generalization and faster convergence than SAMME. We elaborate the final version of AdaGCN in Algorithm 1. We provide the analysis on the choice of model depth $L$ in Appendix A.7, and then we elaborate the computational advantage of AdaGCN in the following.
|
| 122 |
+
|
| 123 |
+
Analysis of Computational Advantage. Due to the similarity of graph convolution in MixHop (Abu-El-Haija et al., 2019), AdaGCN also requires no additional memory or computational complexity compared with previous GCN models. Meanwhile, our approach enjoys huge computational advantage compared with GCN-based models, e.g., PPNP and APPNP, stemming from excluding the additional computation involved in sparse tensors, such as the sparse tensor multiplication between $\hat { A }$ and other dense tensors, in the forward and backward propagation of the neural network. Specifically, there are only $L$ times sparse tensor operations for an AdaGCN model with $L$ layers, i.e., $\hat { A } ^ { l } X = \overset { \cdot } { A } \cdot ( \hat { A } ^ { l - 1 } X )$ for each layer $l$ . This operation in each layer yields a dense tensor
|
| 124 |
+
|
| 125 |
+
# Algorithm 1 AdaGCN based on SAMME.R Algorithm
|
| 126 |
+
|
| 127 |
+
Input: Features Matrix $X$ , normalized adjacent matrix $\hat { A }$ , a two-layer fully connected network $f _ { \theta }$ , number of layers $L$ and number of classes $K$ .
|
| 128 |
+
|
| 129 |
+
Output: Final combined prediction $C ( A , X )$
|
| 130 |
+
|
| 131 |
+
1: Initialize the node weights $w _ { i } = 1 / n , i = 1 , 2 , . . . , n$ on training set, neighbors feature matrix ${ \hat { X } } ^ { ( 0 ) } = X$ and classifier $f _ { \theta } ^ { ( - 1 ) }$ .
|
| 132 |
+
|
| 133 |
+
2: for $l = 0$ to do
|
| 134 |
+
|
| 135 |
+
3: Fit the graph convolutional classifier f (l) on neighbor feature matrix $\hat { X } ^ { ( l ) }$ based on $f _ { \theta } ^ { ( l - 1 ) }$ by minimizing current weighted loss.
|
| 136 |
+
|
| 137 |
+
4: Obtain the weighted probability estimates $p ^ { ( l ) } ( \hat { X } ^ { ( l ) } )$ for $f _ { \theta } ^ { ( l ) }$
|
| 138 |
+
|
| 139 |
+
5: Compute the individual prediction $h _ { k } ^ { ( l ) } ( x )$ for the current graph convolutional classifier $f _ { \theta } ^ { ( l ) }$
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
h _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } ) \gets ( K - 1 ) \left( \log p _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } ) - \frac { 1 } { K } \sum _ { k ^ { \prime } } \log p _ { k ^ { \prime } } ^ { ( l ) } ( \hat { X } ^ { ( l ) } ) \right)
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $k = 1 , \ldots , K$
|
| 146 |
+
|
| 147 |
+
6: Adjust the node weights $w _ { i }$ for each node $x _ { i }$ with label $y _ { i }$ on training set:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
w _ { i } w _ { i } \cdot \exp ( - \frac { K - 1 } { K } y _ { i } ^ { \top } \log p ^ { ( l ) } ( x _ { i } ) ) , i = 1 , \ldots , n
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
7: Re-normalize all weights $w _ { i }$
|
| 154 |
+
|
| 155 |
+
8: Update $l { + } 1$ -hop neighbor feature matrix $\hat { X } ^ { ( l + 1 ) }$ :
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\hat { X } ^ { ( l + 1 ) } = \hat { A } \hat { X } ^ { ( l ) }
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
# 9: end for
|
| 162 |
+
|
| 163 |
+
10: Combine all predictions $h _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } )$ for $l = 0 , . . . , L$
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
C ( A , X ) = \arg \operatorname* { m a x } _ { k } \sum _ { l = 0 } ^ { L } h _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } )
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
11: return Final combined prediction $C ( A , X )$ .
|
| 170 |
+
|
| 171 |
+
$B ^ { l } = \hat { A } ^ { l } X$ for the $l$ -th layer, which is then fed into the computation in a two-layer fully-connected network, i.e., $f _ { \theta } ^ { ( l ) } ( B ^ { l } ) = \mathrm { \bar { R e L U } } ( B ^ { l } W ^ { ( 0 ) } ) W ^ { ( 1 ) }$ . Due to the fact that dense tensor $B ^ { l }$ has been computed in advance, there is no other computation related to sparse tensors in the multiple forward and backward propagation procedures while training the neural network. By contrast, this multiple computation involved in sparse tensors in the GCN-based models, e.g., GCN: $\hat { A } \mathrm { R e L U } ( \hat { A } X W ^ { ( 0 ) } ) W ^ { ( 1 ) }$ , is highly expensive. AdaGCN avoids these additional sparse tensor operations in the neural network and then attains huge computational efficiency. We demonstrate this viewpoint in the Section 4.3.
|
| 172 |
+
|
| 173 |
+
# 4 EXPERIMENTS
|
| 174 |
+
|
| 175 |
+
Experimental Setup. We select five commonly used graphs: CiteSeer, Cora-ML (Bojchevski & Gunnemann, 2018; McCallum et al., 2000), PubMed (Sen et al., 2008), MS-Academic (Shchur ¨ et al., 2018) and Reddit. Dateset statistics are summarized in Table 1. Recent graph neural networks suffer from overfitting to a single splitting of training, validation and test datasets (Klicpera et al., 2018). To address this problem, inspired by (Klicpera et al., 2018), we test all approaches on multiple random splits and initialization to conduct a rigorous study. Detailed dataset splittings are provided in Appendix A.6.
|
| 176 |
+
|
| 177 |
+
Table 1: Dateset statistics
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Dateset</td><td>Nodes</td><td>Edges</td><td>Classes</td><td>Features</td><td>LabelRate</td></tr><tr><td>CiteSeer</td><td>3,327</td><td>4,732</td><td>6</td><td>3,703</td><td>3.6%</td></tr><tr><td>Cora</td><td>2,708</td><td>5,429</td><td>7</td><td>1,433</td><td>5.2%</td></tr><tr><td>PubMed</td><td>19,717</td><td>44,338</td><td>3</td><td>500</td><td>0.3%</td></tr><tr><td>MS Academic</td><td>18,333</td><td>81,894</td><td>15</td><td>6,805</td><td>1.6%</td></tr><tr><td>Reddit</td><td>232,965</td><td>11,606,919</td><td>41</td><td>602</td><td>65.9%</td></tr></table>
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 3: Comparison of test accuracy of different models as the layer increases. We regard the $l$ -th base classifier as the $l$ -th layer in AdaGCN as both of them are leveraged to exploit the information from $l$ -th order of neighbors for current nodes.
|
| 183 |
+
|
| 184 |
+
Basic Setting of Baselines and AdaGCN. We compare AdaGCN with GCN (Kipf & Welling, 2017) and Simple Graph Convolution (SGC) (Wu et al., 2019) in Figure 3. In Table 2, we employ the same baselines as (Klicpera et al., 2018): V.GCN (vanilla GCN) (Kipf & Welling, 2017) and GCN with our early stopping, N-GCN (network of GCN) (Abu-El-Haija et al., 2018a), GAT (Graph Attention Networks) (Velickovi ˇ c et al., 2018), BT.FP (bootstrapped feature propagation) (Buchnik ´ & Cohen, 2018) and JK (jumping knowledge networks with concatenation) (Xu et al., 2018b). In the computation part, we additionally compare AdaGCN with FastGCN (Chen et al., 2018) and GraphSAGE (Hamilton et al., 2017). We refer to the result of baselines from (Klicpera et al., 2018) and the implementation of AdaGCN is adapted from APPNP. For AdaGCN, after the line search on hyper-parameters, we set $h = 5 0 0 0$ hidden units for the first four datasets except Ms-academic with $h = 3 0 0 0$ , and 15, 12, 20 and 5 layers respectively due to the different graph structures. In addition, we set dropout rate to 0 for Citeseer and Cora-ML datasets and 0.2 for the other datasets and $5 \times 1 0 ^ { - 3 } L _ { 2 }$ regularization on the first linear layer. We set weight decay as $1 \times 1 0 ^ { - 3 }$ for Citeseer while $1 \times 1 0 ^ { - 4 }$ for others. More detailed model parameters and analysis about our early stopping mechanism can be referred from Appendix A.6.
|
| 185 |
+
|
| 186 |
+
# 4.1 DESIGN OF DEEP GRAPH MODELS TO CIRCUMVENT OVERSMOOTHING EFFECT
|
| 187 |
+
|
| 188 |
+
It is well-known that GCN suffers from oversmoothing (Li et al., 2018) with the stacking of more graph convolutions. However, combination of knowledge from each layer to design deep graph models is a reasonable method to circumvent oversmoothing issue. In our experiment, we aim to explore the prediction performance of GCN, GCN with residual connection (Kipf & Welling, 2017), SGC and our AdaGCN with a growing number of layers.
|
| 189 |
+
|
| 190 |
+
Table 2: Average accuracy under 100 runs with uncertainties showing the $95 \%$ confidence level calculated by bootstrapping. OOM denotes “out of memory”. “(ours)” denotes the results based on our implementation, which are slight lower than numbers above from original literature (Klicpera et al., 2018). P values of paired t test between APPNP (ours) and AdaGCN are provided in the last row.
|
| 191 |
+
|
| 192 |
+
<table><tr><td>Model</td><td>Citeseer</td><td>Cora-ML</td><td>Pubmed</td><td>MSAcademic</td></tr><tr><td>V.GCN</td><td>73.51±0.48</td><td>82.30±0.34</td><td>77.65±0.40</td><td>91.65±0.09</td></tr><tr><td>GCN</td><td>75.40±0.30</td><td>83.41±0.39</td><td>78.68±0.38</td><td>92.10±0.08</td></tr><tr><td>N-GCN</td><td>74.25±0.40</td><td>82.25±0.30</td><td>77.43±0.42</td><td>92.86±0.11</td></tr><tr><td>GAT</td><td>75.39±0.27</td><td>84.37±0.24</td><td>77.76±0.44</td><td>91.22±0.07</td></tr><tr><td>JK</td><td>73.03±0.47</td><td>82.69±0.35</td><td>77.88±0.38</td><td>91.71±0.10</td></tr><tr><td>BT.FP</td><td>73.55±0.57</td><td>80.84±0.97</td><td>72.94±1.00</td><td>91.61±0.24</td></tr><tr><td>PPNP</td><td>75.83±0.27</td><td>85.29±0.25</td><td>OOM</td><td>OOM</td></tr><tr><td>APPNP</td><td>75.73±0.30</td><td>85.09±0.25</td><td>79.73±0.31</td><td>93.27±0.08</td></tr><tr><td>PPNP (ours)</td><td>75.53±0.32</td><td>84.39±0.28</td><td>OOM</td><td>OOM</td></tr><tr><td>APPNP (ours)</td><td>75.41±0.35</td><td>84.28±0.28</td><td>79.41±0.34</td><td>92.98±0.07</td></tr><tr><td>AdaGCN</td><td>76.68±0.20</td><td>85.97±0.20</td><td>79.95±0.21</td><td>93.17±0.07</td></tr><tr><td>P value</td><td>1.8×10-15</td><td>2.2×10-16</td><td>1.1×10-5</td><td>2.1×10-9</td></tr></table>
|
| 193 |
+
|
| 194 |
+
<table><tr><td></td><td>Citeseer</td><td>Cora-ML</td><td>Pubmed</td><td>MSAcademic</td></tr><tr><td>Label Rates</td><td>1.0% / 2.0%</td><td>2.0% / 4.0%</td><td>0.1% / 0.2%</td><td>0.6% / 1.2%</td></tr><tr><td>V.GCN</td><td>67.6±1.4/70.8±1.4</td><td>76.4±1.3/81.7±0.8</td><td>70.1±1.4/74.6±1.6</td><td>89.7±0.4/91.1±0.2</td></tr><tr><td>GCN</td><td>70.3±0.9/72.7±1.1</td><td>80.0±0.7/82.8±0.9</td><td>71.1±1.1/75.2±1.0</td><td>89.8±0.4/91.2±0.3</td></tr><tr><td>PPNP APPNP</td><td>72.5±0.9/74.7±0.7 72.2±1.3/74.2±1.1</td><td>80.1±0.7/83.0±0.6</td><td>OOM</td><td>OOM</td></tr><tr><td>AdaGCN</td><td></td><td>80.1±0.7/83.2±0.6</td><td>74.0±1.5/77.2±1.2</td><td>91.7±0.2/92.6±0.2</td></tr><tr><td></td><td>74.2±0.3/75.5±0.3</td><td>83.7±0.3/85.3±0.2</td><td>77.1±0.5/79.3±0.3</td><td>92.1±0.1/92.7±0.1</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Table 3: Average accuracy across different label rates with 20 splittings of datasets under 100 runs.
|
| 197 |
+
|
| 198 |
+
From Figure 3, it can be easily observed that oversmoothing leads to the rapid decreasing of accuracy for GCN (blue line) as the layer increases. In contrast, the speed of smoothing (green line) of SGC is much slower than GCN due to the lack of ReLU analyzed in Section 2.1. Similarly, GCN with residual connection (yellow line) partially mitigates the oversmoothing effect of original GCN but fails to take advantage of information from different orders of neighbors to improve the prediction performance constantly. Remarkably, AdaGCN (red line) is able to consistently enhance the performance with the increasing of layers across the three datasets. This implies that AdaGCN can efficiently incorporate knowledge from different orders of neighbors and circumvent oversmoothing of original GCN in the process of constructing deep graph models. In addition, the fluctuation of performance for AdaGCN is much lower than GCN especially when the number of layer is large.
|
| 199 |
+
|
| 200 |
+
# 4.2 PREDICTION PERFORMANCE
|
| 201 |
+
|
| 202 |
+
We conduct a rigorous study of AdaGCN on four datasets under multiple splittings of dataset. The results from Table 2 suggest the state-of-the-art performance of our approach and the improvement compared with APPNP validates the benefit of adaptive form for our AdaGCN. More rigorously, p values under paired t test demonstrate the significance of improvement for our method.
|
| 203 |
+
|
| 204 |
+
In the realistic setting, graphs usually have different labeled nodes and thus it is necessary to investigate the robust performance of methods on different number of labeled nodes. Here we utilize label rates to measure the different numbers of labeled nodes and then sample corresponding labeled nodes per class on graphs respectively. Table 3 presents the consistent state-of-the-art performance of AdaGCN under different label rates. An interesting manifestation from Table 3 is that AdaGCN yields more improvement on fewer label rates compared with APPNP, showing more efficiency on graphs with few labeled nodes. Inspired by the Layer Effect on graphs (Sun et al., 2019), we argue that the increase of layers in AdaGCN can result in more benefits on the efficient propagation of label signals especially on graphs with limited labeled nodes.
|
| 205 |
+
|
| 206 |
+
More rigorously, we additionally conduct the comparison on a larger dataset, i.e., Reddit. We choose the best layer as 4 due to the fact that AdaGCN with larger number of layers tends to suffer from overfitting on this relatively simple dataset (with high label rate $6 5 . 9 \%$ ). Table 4 suggests that AdaGCN can still outperform other typical baselines, including V.GCN, PPNP and APPNP. More experimental details can be referred from Appendix A.6.
|
| 207 |
+
|
| 208 |
+
Table 4: Average F1-scores and per-epoch training time of typical methods on Reddit dataset under 5 runs.
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Reddit</td><td>F1-Score</td><td>Per-epoch training time</td></tr><tr><td>V.GCN</td><td>94.46±0.06</td><td>5627.46ms</td></tr><tr><td>PPNP</td><td>OOM</td><td>OOM</td></tr><tr><td>APPNP</td><td>95.04±0.07</td><td>29489.81ms</td></tr><tr><td>AdaGCN</td><td>95.39±0.13</td><td>32.29ms</td></tr></table>
|
| 211 |
+
|
| 212 |
+
# 4.3 COMPUTATIONAL EFFICIENCY
|
| 213 |
+
|
| 214 |
+
Without the additional computational cost involved in sparse tensors in the propagation of the neural network, AdaGCN presents huge computational efficiency. From the left part of Figure 4, it exhibits that AdaGCN has the fastest speed of per-epoch training time in comparison with other methods except the comparative performance with FastGCN in Pubmed. In addition, there is a somewhat inconsistency in computation of FastGCN, with fastest speed in Pubmed but slower than
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 4: Left: Per-epoch training time of AdaGCN vs other methods under 5 runs on four datasets. Right: Per-epoch training time of AdaGCN compared with GCN and SGC with the increasing of layers and the digit after $\mathbf { \bar { \Sigma } } ^ { 6 } = \mathbf { \bar { \Sigma } } ^ { 5 }$ denotes the slope in a fitted linear regression.
|
| 218 |
+
|
| 219 |
+
GCN on Cora-ML and MS-Academic datasets. Furthermore, with multiple power iterations involved in sparse tensors, APPNP unfortunately has relatively expensive computation cost. It should be noted that this computational advantage of AdaGCN is more significant when it comes to large datasets, e.g., Reddit. Table 4 demonstrates AdaGCN has the potential to perform much faster on larger datasets.
|
| 220 |
+
|
| 221 |
+
Besides, we explore the computational cost of ReLU and sparse adjacency tensor with respect to the number of layers in the right part of Figure 4. We focus on comparing AdaGCN with SGC and GCN as other GCN-based methods, such as GraphSAGE and APPNP, behave similarly with GCN. Particularly, we can easily observe that both SGC (green line) and GCN (red line) show a linear increasing tendency and GCN yields a larger slope arises from ReLU and more parameters. For SGC, stacking more layers directly is undesirable regarding the computation. Thus, a limited number of SGC layers is preferable with more advanced optimization techniques Wu et al. (2019). It also shows that the computational cost involved sparse matrices in neural networks plays a dominant role in all the cost especially when the layer is large enough. In contrast, our AdaGCN (pink line) displays an almost constant trend as the layer increases simply because it excludes the extra computation involved in sparse tensors $\hat { A }$ , such as $\cdot \cdot \cdot \hat { A } \mathrm { ~ R e L U } ( \hat { A } X W ^ { ( 0 ) } ) W ^ { ( 1 ) } \cdot \cdot \cdot ,$ , in the process of training neural networks. AdaGCN maintains the updating of parameters in the $f _ { \theta } ^ { ( l ) }$ with a fixed architecture in each layer while the layer-wise optimization, therefore displaying a nearly constant computation cost within each epoch although more epochs are normally needed in the entire layer-wise training. We leave the analysis of exact time and memory complexity of AdaGCN as future works, but boosting-based algorithms including AdaGCN is memory-efficient (Oono & Suzuki, 2020).
|
| 222 |
+
|
| 223 |
+
# 5 DISCUSSIONS AND CONCLUSION
|
| 224 |
+
|
| 225 |
+
One potential concern is that AdaBoost (Hastie et al., 2009; Freund et al., 1999) is established on i.i.d. hypothesis while graphs have inherent data-dependent property. Fortunately, the statistical convergence and consistency of boosting (Lugosi & Vayatis, 2001; Mannor et al., 2003) can still be preserved when the samples are weakly dependent (Lozano et al., 2013). More discussion can refer to Appendix A.5. In this paper, we propose a novel RNN-like deep graph neural network architecture called AdaGCNs. With the delicate architecture design, our approach AdaGCN can effectively explore and exploit knowledge from different orders of neighbors in an Adaboost way. Our work paves a way towards better combining different-order neighbors to design deep graph models rather than only stacking on specific type of graph convolution.
|
| 226 |
+
|
| 227 |
+
# ACKNOWLEDGMENTS
|
| 228 |
+
|
| 229 |
+
Z. Lin is supported by NSF China (grant no.s 61625301 and 61731018), Major Scientific Research Project of Zhejiang Lab (grant no.s 2019KB0AC01 and 2019KB0AB02), Beijing Academy of Artificial Intelligence, and Qualcomm.
|
| 230 |
+
|
| 231 |
+
# REFERENCES
|
| 232 |
+
|
| 233 |
+
Sami Abu-El-Haija, Amol Kapoor, Bryan Perozzi, and Joonseok Lee. N-gcn: Multi-scale graph convolution for semi-supervised node classification. International Workshop on Mining and Learning with Graphs (MLG), 2018a.
|
| 234 |
+
|
| 235 |
+
Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Hrayr Harutyunyan, Nazanin Alipourfard, Kristina Lerman, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolution architectures via sparsified neighborhood mixing. International Conference on Machine Learning (ICML), 2019.
|
| 236 |
+
|
| 237 |
+
Eugene Belilovsky, Michael Eickenberg, and Edouard Oyallon. Greedy layerwise learning can scale to imagenet. International Conference on Machine Learning (ICML), 2018.
|
| 238 |
+
|
| 239 |
+
Aleksandar Bojchevski and Stephan Gunnemann. Deep gaussian embedding of graphs: Unsu- ¨ pervised inductive learning via ranking. International Conference on Learning Representations (ICLR), 2018.
|
| 240 |
+
|
| 241 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. International Conference on Learning Representations (ICLR), 2014.
|
| 242 |
+
|
| 243 |
+
Eliav Buchnik and Edith Cohen. Bootstrapped graph diffusions: Exposing the power of nonlinearity. In Abstracts of the 2018 ACM International Conference on Measurement and Modeling of Computer Systems, pp. 8–10. ACM, 2018.
|
| 244 |
+
|
| 245 |
+
Peter Buhlmann and Bin Yu. Boosting with the l 2 loss: regression and classification. ¨ Journal of the American Statistical Association, 98(462):324–339, 2003.
|
| 246 |
+
|
| 247 |
+
Jie Chen, Tengfei Ma, and Cao Xiao. Fastgcn: fast learning with graph convolutional networks via importance sampling. International Conference on Learning Representations (ICLR), 2018.
|
| 248 |
+
|
| 249 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks ¨ on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3844–3852, 2016.
|
| 250 |
+
|
| 251 |
+
Santo Fortunato. Community detection in graphs. Physics reports, 486(3-5):75–174, 2010.
|
| 252 |
+
|
| 253 |
+
Yoav Freund, Robert Schapire, and Naoki Abe. A short introduction to boosting. Journal-Japanese Society For Artificial Intelligence, 14(771-780):1612, 1999.
|
| 254 |
+
|
| 255 |
+
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 (NeurIPS), pp. 2672–2680, 2014.
|
| 256 |
+
|
| 257 |
+
Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In Proceedings. 2005 IEEE International Joint Conference on Neural Networks, 2005., volume 2, pp. 729–734. IEEE, 2005.
|
| 258 |
+
|
| 259 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1024–1034, 2017.
|
| 260 |
+
|
| 261 |
+
Trevor Hastie, Saharon Rosset, Ji Zhu, and Hui Zou. Multi-class adaboost. Statistics and Its Interface, 2(3):349–360, 2009.
|
| 262 |
+
|
| 263 |
+
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.
|
| 264 |
+
|
| 265 |
+
Furong Huang, Jordan Ash, John Langford, and Robert Schapire. Learning deep resnet blocks sequentially using boosting theory. International Conference on Machine Learning (ICML), 2018.
|
| 266 |
+
|
| 267 |
+
Wenxin Jiang et al. Process consistency for adaboost. The Annals of Statistics, 32(1):13–29, 2004.
|
| 268 |
+
|
| 269 |
+
Ming Jin, Heng Chang, Wenwu Zhu, and Somayeh Sojoudi. Power up! robust graph convolutional network against evasion attacks based on graph powering. arXiv preprint arXiv:1905.10029, 2019.
|
| 270 |
+
|
| 271 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017.
|
| 272 |
+
|
| 273 |
+
Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: ¨ Graph neural networks meet personalized pagerank. International Conference on Learning Representations (ICLR), 2018.
|
| 274 |
+
|
| 275 |
+
Guohao Li, Matthias Muller, Ali Thabet, and Bernard Ghanem. Can gcns go as deep as cnns? ¨ ICCV, 2019.
|
| 276 |
+
|
| 277 |
+
Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. Association for the Advancement of Artificial Intelligence (AAAI), 2018.
|
| 278 |
+
|
| 279 |
+
Renjie Liao, Zhizhen Zhao, Raquel Urtasun, and Richard S Zemel. Lanczosnet: Multi-scale deep graph convolutional networks. International Conference on Learning Representations (ICLR), 2019.
|
| 280 |
+
|
| 281 |
+
Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 338–348, 2020.
|
| 282 |
+
|
| 283 |
+
Aurelie C Lozano, Sanjeev R Kulkarni, and Robert E Schapire. Convergence and consistency of regularized boosting with weakly dependent observations. IEEE Transactions on Information Theory, 60(1):651–660, 2013.
|
| 284 |
+
|
| 285 |
+
Sitao Luan, Mingde Zhao, Xiao-Wen Chang, and Doina Precup. Break the ceiling: Stronger multiscale deep graph convolutional networks. Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 286 |
+
|
| 287 |
+
Gabor Lugosi and Nicolas Vayatis. On the bayes-risk consistency of boosting methods. 2001. ´
|
| 288 |
+
|
| 289 |
+
Shie Mannor, Ron Meir, and Tong Zhang. Greedy algorithms for classification–consistency, convergence rates, and adaptivity. Journal of Machine Learning Research, 4(Oct):713–742, 2003.
|
| 290 |
+
|
| 291 |
+
Andrew Kachites McCallum, Kamal Nigam, Jason Rennie, and Kristie Seymore. Automating the construction of internet portals with machine learning. Information Retrieval, 3(2):127–163, 2000.
|
| 292 |
+
|
| 293 |
+
Kenta Oono and Taiji Suzuki. Optimization and generalization analysis of transduction through gradient boosting and application to multi-scale graph neural networks. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 294 |
+
|
| 295 |
+
Omri Puny, Heli Ben-Hamu, and Yaron Lipman. From graph low-rank global attention to 2-fwl approximation. ICML Workshop Graph Representation Learning and Beyond, 2020.
|
| 296 |
+
|
| 297 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93, 2008.
|
| 298 |
+
|
| 299 |
+
Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. In Relational Representation Learning Workshop (R2L 2018), NeurIPS, 2018.
|
| 300 |
+
|
| 301 |
+
Ke Sun, Zhanxing Zhu, and Zhouchen Lin. Multi-stage self-supervised learning for graph convolutional networks. Association for the Advancement of Artificial Intelligence (AAAI), 2019.
|
| 302 |
+
|
| 303 |
+
Ilya O Tolstikhin, Sylvain Gelly, Olivier Bousquet, Carl-Johann Simon-Gabriel, and Bernhard Scholkopf. Adagan: Boosting generative models. In ¨ Advances in Neural Information Processing Systems (NeurIPS), pp. 5424–5433, 2017.
|
| 304 |
+
|
| 305 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. International Conference on Learning Representations (ICLR), 2018.
|
| 306 |
+
|
| 307 |
+
Felix Wu, Tianyi Zhang, Amauri Holanda de Souza Jr, Christopher Fifty, Tao Yu, and Kilian Q Weinberger. Simplifying graph convolutional networks. International Conference on Machine Learning (ICML), 2019.
|
| 308 |
+
|
| 309 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? International Conference on Learning Representations (ICLR), 2018a.
|
| 310 |
+
|
| 311 |
+
Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. International Conference on Machine Learning (ICML), 2018b.
|
| 312 |
+
|
| 313 |
+
Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Graphsaint: Graph sampling based inductive learning method. International Conference on Learning Representations (ICLR), 2019.
|
| 314 |
+
|
| 315 |
+
Tong Zhang, Bin Yu, et al. Boosting with early stopping: Convergence and consistency. The Annals of Statistics, 33(4):1538–1579, 2005.
|
| 316 |
+
|
| 317 |
+
Jun Zhu, Jiaming Song, and Bei Chen. Max-margin nonparametric latent feature models for link prediction. arXiv preprint arXiv:1602.07428, 2016.
|
| 318 |
+
|
| 319 |
+
# A APPENDIX
|
| 320 |
+
|
| 321 |
+
# A.1 RELATED WORKS ON DEEP GRAPH MODELS
|
| 322 |
+
|
| 323 |
+
A straightforward solution (Kipf & Welling, 2017; Xu et al., 2018b) inspired by ResNets (He et al., 2016) was by adding residual connections, but this practice was unsatisfactory both in prediction performance and computational efficiency towards building deep graph models, as shown in our experiments in Section 4.1 and 4.3. More recently, JK (Jumping Knowledge Networks (Xu et al., 2018b)) introduced jumping connections into final aggregation mechanism in order to extract knowledge from different layers of graph convolutions. However, this straightforward change of GCN architecture exhibited inconsistent empirical performance for different aggregation operators, which cannot demonstrate the successful construction of deep layers. In addition, Graph powering-based method (Jin et al., 2019) implicitly leveraged more spatial information by extending classical spectral graph theory to robust graph theory, but they concentrated on defending adversarial attacks rather than model depth. LanczosNet (Liao et al., 2019) utilized Lanczos algorithm to construct low rank approximations of the graph Laplacian and then can exploit multi-scale information. Moreover, APPNP (Approximate Personalized Propagation of Neural Predictions, (Klicpera et al., 2018)) leveraged the relationship between GCN and personalized PageRank to derive an improved global propagation scheme. Beyond these, DeepGCNs (Li et al., 2019) directly adapted residual, dense connection and dilated convolutions to GCN architecture, but it mainly focused on the task of point cloud semantic segmentation and has not demonstrated its effectiveness in typical graph tasks. Similar to our work, Deep Adaptive Graph Neural Network (DAGNN) (Liu et al., 2020) also focused on incorporating information from large receptive fields through the entanglement of representation transformation and propagation, while our work efficiently ensembles knowledge from large receptive fields in an Adaboost manner. Other related works based on global attention models (Puny et al., 2020) and sample-based methods (Zeng et al., 2019) are also helpful to construct deep graph models.
|
| 324 |
+
|
| 325 |
+
# A.2 INSUFFICIENT REPRESENTATION POWER OF ADASGC
|
| 326 |
+
|
| 327 |
+
As illustrated in Figure 5, with the increasing of layers, AdaSGC with only linear transformation has insufficient representation power both in extracting knowledge from high-order neighbors and combining information from different orders of neighbors while AdaGCN exhibits a consistent improvement of performance as the layer increases.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 5: AdaSGC vs AdaGCN.
|
| 331 |
+
|
| 332 |
+
# A.3 PROOF OF PROPOSITION 1
|
| 333 |
+
|
| 334 |
+
Firstly, we further elaborate the Proposition 1 as follows, then we provide the proof.
|
| 335 |
+
|
| 336 |
+
Suppose that $\gamma$ is the teleport factor. Consider the output $Z _ { \mathrm { P P N P } } = \gamma ( \mathbb { I } - ( 1 - \gamma ) \hat { A } ) ^ { - 1 } f _ { \theta } ( X )$ in PPNP and $Z _ { \mathrm { A P P N P } }$ from its approxminated version APPNP. Let matrix sequence $\{ Z ^ { ( l ) } \}$ be from the output of each layer $l$ in AdaGCN, then PPNP is equivalent to the Exponential Moving Average (EMA) with exponentially decreasing factor In add $\gamma$ , a first-order infinite impulse response filter, on ion, APPNP, which we reformulate in Eq. 10, c $\{ Z ^ { ( l ) } \}$ in a sharing parameters version, i.e., iewed as the approximated form of E $f _ { \theta } ^ { ( l ) } \equiv f _ { \theta }$
|
| 337 |
+
|
| 338 |
+
limited number of terms.
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
Z _ { \mathrm { A P P N P } } = ( \gamma \sum _ { l = 0 } ^ { L - 1 } ( 1 - \gamma ) ^ { l } \hat { A } ^ { l } + ( 1 - \gamma ) ^ { L } \hat { A } ^ { L } ) f _ { \theta } ( X )
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Proof. According to Neumann Theorem, $Z _ { \mathrm { P P N P } }$ can be expanded as a Neumann series:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\begin{array} { r l } { { Z _ { \mathrm { P P N P } } = \gamma ( \mathbb { I } - ( 1 - \gamma ) \hat { A } ) ^ { - 1 } f _ { \theta } ( X ) } } \\ & { = \gamma \sum _ { l = 0 } ^ { \infty } ( 1 - \gamma ) ^ { l } \hat { A } ^ { l } f _ { \theta } ( X ) , } \end{array}
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
where feature embedding matrix sequence $\{ Z ^ { ( l ) } \}$ for each order of neighbors share the same parameters $f _ { \theta }$ . If we relax this sharing nature to the adaptive form with respect to the layer and put $\hat { A } ^ { l }$ into $f _ { \theta }$ , then the output $Z$ can be approximately formulated as:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
Z _ { \mathrm { P P N P } } \approx \gamma \sum _ { l = 0 } ^ { \infty } ( 1 - \gamma ) ^ { l } f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X )
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
This relaxed version from PPNP is the Exponential Moving Average form of matrix sequence $\{ Z ^ { ( l ) } \}$ with exponential decreasing factor $\gamma$ . Moreover, if we approximate the EMA by truncating it after $L - 1$ items, then the weight omitted by stopping after $L - 1$ items is $( 1 - \gamma ) ^ { L }$ . Thus, the approximated EMA is exactly the APPNP form:
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
Z _ { \mathrm { A P P N P } } = ( \gamma \sum _ { l = 0 } ^ { L - 1 } ( 1 - \gamma ) ^ { l } \hat { A } ^ { l } + ( 1 - \gamma ) ^ { L } \hat { A } ^ { L } ) f _ { \theta } ( X )
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
# A.4 PROOF OF PROPOSITION 2
|
| 363 |
+
|
| 364 |
+
Proof. We consider a two layers fully-connected neural network as $f$ in Eq. 8, then the output of AdaGCN can be formulated as:
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
Z = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } \sigma ( \hat { A } ^ { l } X W ^ { ( 0 ) } ) W ^ { ( 1 ) }
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
Particularly, we set W (0) $\begin{array} { r } { W ^ { ( 0 ) } = \frac { b _ { l } } { \mathrm { s i g n } ( b _ { l } ) \alpha ^ { ( l ) } } \mathbb { I } } \end{array}$ blsign(b )α(l) I and W (1) = sign(bl)I where sign(bl) is the signed incidence scalar w.r.t $b _ { l }$ . Then the output of AdaGCN can be presented as:
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\begin{array} { l } { { \displaystyle Z = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } \sigma ( \hat { A } ^ { l } X \frac { b _ { l } } { \mathrm { s i g n } ( b _ { l } ) \alpha ^ { ( l ) } } \mathbb { I } ) \mathrm { s i g n } ( b _ { l } ) \mathbb { I } } } \\ { ~ } \\ { { \displaystyle ~ = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } \sigma ( \hat { A } ^ { l } X ) \frac { b _ { l } } { \mathrm { s i g n } ( b _ { l } ) \alpha ^ { ( l ) } } \mathrm { s i g n } ( b _ { l } ) } } \\ { { \displaystyle ~ = \sum _ { l = 0 } ^ { L } b _ { l } \sigma \left( \hat { A } ^ { l } X \right) } } \end{array}
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
The proof that GCNs-based methods are not capable of representing general layer-wise neighborhood mixing has been demonstrated in MixHop (Abu-El-Haija et al., 2019). Proposition 2 proved. □
|
| 377 |
+
|
| 378 |
+
# A.5 EXPLANATION ABOUT CONSISTENCY OF BOOSTING ON DEPENDENT DATA
|
| 379 |
+
|
| 380 |
+
Definition 2. ( $\beta$ -mixing sequences.) Let $\sigma _ { i } ^ { j } = \sigma ( W ) = \sigma ( W _ { i } , W _ { i + 1 } , . . . , W _ { j } )$ be the $\sigma$ -field generated by $a$ strictly stationary sequence of random variables $W = ( W _ { i } , W _ { i + 1 } , . . . , W _ { j } )$ . The $\beta$ -mixing coefficient is defined by:
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
\beta _ { W } ( n ) = \operatorname* { s u p } _ { k } \mathbb { E } \operatorname* { s u p } \left\{ \left| \mathbb { P } \left( A | \sigma _ { 1 } ^ { k } \right) - \mathbb { P } ( A ) \right| : A \in \sigma _ { k + n } ^ { \infty } \right\}
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
Then a sequence $W$ is called $\beta$ -mixing if $l i m _ { n \infty } \beta _ { W } ( n ) = 0 .$ . Further, $i t$ is algebraically $\beta$ -mixing if there is a positive constant $r _ { \beta }$ such that $\beta _ { W } ( n ) = \mathcal { O } ( n ^ { - r _ { \beta } } )$ .
|
| 387 |
+
|
| 388 |
+
Definition 3. (Consistency) $A$ classification rule is consistent for a certain distribution $P$ if $E ( L ( h _ { n } ) ) =$ $P \{ h _ { n } ( X ) ~ = ~ Y \} ~ \to ~ a$ as $n \infty$ where $a$ is a constant. It is strongly Bayes-risk consistent $i f$ $l i m _ { n \infty } L ( h _ { n } ) = a$ almost surely.
|
| 389 |
+
|
| 390 |
+
Under these definitions, the convergence and consistence of regularized boosting method on stationary $\beta$ - mixing sequences can be proved under mild assumptions. More details can be referred from (Lozano et al., 2013).
|
| 391 |
+
|
| 392 |
+
# A.6 EXPERIMENTAL DETAILS
|
| 393 |
+
|
| 394 |
+
Early Stopping on AdaGCN. We apply the same early stopping mechanism across all the methods as (Klicpera et al., 2018) for fair comparison. Furthermore, boosting theory also has the capacity to perfectly incorporate early stopping and it has been shown that for several boosting algorithms including AdaBoost, this regularization via early stopping can provide guarantees of consistency (Zhang et al., 2005; Jiang et al., 2004; Buhlmann ¨ & Yu, 2003).
|
| 395 |
+
|
| 396 |
+
Dataset Splitting. We choose a training set of a fixed nodes per class, an early stopping set of 500 nodes and test set of remained nodes. Each experiment is run with 5 random initialization on each data split, leading to a total of 100 runs per experiment. On a standard setting, we randomly select 20 nodes per class. For the two different label rates on each graph, we select 6, 11 nodes per class on citeseer, 8, 16 nodes per class on Cora-ML, 7, 14 nodes per class on Pubmed and 8, 15 nodes per class on MS-Academic dataset.
|
| 397 |
+
|
| 398 |
+
Model parameters. For all GCN-based approaches, we use the same hyper-parameters in the original paper: learning rate of 0.01, 0.5 dropout rate, $5 \times \mathrm { \dot { 1 } 0 ^ { - 4 } ~ } L _ { 2 }$ regularization weight, and 16 hidden units. For FastGCN, we adopt the officially released code to conduct our experiments. PPNP and APPNP are adapted with best setting: $K = 1 0$ power iteration steps for APPNP, teleport probability $\gamma = 0 . 1$ on Cora-ML, Citeseer and Pubmed, $\gamma = 0 . 2$ on Ms-Academic. In addition, we use two layers with $h = 6 4$ hidden units and apply L2 regularization with $\lambda = 5 \times 1 0 ^ { - 3 }$ on the weights of the first layer and use dropout with dropout rate $d = 0 . 5$ on both layers and the adjacency matrix. The early stopping criterion uses a patience of $p = 1 0 0$ and an (unreachably high) maximum of $n = 1 0 0 0 0$ epochs.The implementation of AdaGCN is adapted from PPNP and APPNP. Corresponding patience $p = 3 0 0$ and $n = 5 0 0$ in the early stopping of AdaGCN. Moreover, SGC is re-implemented in a straightforward way without incorporating advanced optimization for better illustration and comparison. Other baselines are adopted the same parameters described in PPNP and APPNP.
|
| 399 |
+
|
| 400 |
+
Settings on Reddit dataset. By repeatedly tuning the parameters of these typical methods on Reddit, we finally choose weight decay rate as $1 \dot { 0 } ^ { - 4 }$ , hidden layer size 100 and epoch 20000 for AdaGCN. For APPNP, we opt weight decay rate as $1 0 ^ { - 5 }$ , dropout rate as 0 and epoch 500. V.GCN applies the same parameters in (Kipf & Welling, 2017) and we choose epoch as 500. All approaches have not deployed early stopping due to the expensive computational cost on the large Reddit dataset, which is also a fair comparison.
|
| 401 |
+
|
| 402 |
+
# A.7 CHOICE OF THE NUMBER OF LAYERS
|
| 403 |
+
|
| 404 |
+
Different from the “forcible” behaviors in CNNs that directly stack many convolution layers, in our AdaGCN there is a theoretical guidance on the choice of model depth $L$ , i.e., the number of base classifiers or layers, derived from boosting theory. Specifically, according to the boosting theory, the increasing of $L$ can exponentially decreases the empirical loss, however, from the perspective of VC-dimension, an overly large $L$ can yield overfitting of AdaGCN. It should be noted that the deeper graph convolution layers in AdaGCN are not always better, which indeed heavily depends on the the complexity of data. In practice, $L$ can be determined via cross-validation. Specifically, we start a VC-dimension-based analysis to illustrate that too large $L$ can yield overfitting of AdaGCN. For $L$ layers of AdaGCN, its hypothesis set is
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\mathcal { F } _ { L } = \left\{ \underset { k } { \arg \operatorname* { m a x } } \left( \sum _ { l = 1 } ^ { L } \alpha ^ { ( l ) } f _ { \theta } ^ { ( l ) } \right) : \alpha ^ { ( l ) } \in \mathbb { R } , l \in [ 1 , L ] \right\}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Then the VC-dimension of ${ \mathcal { F } } _ { T }$ can be bounded as follows in terms of the VC-dimension $d$ of the family of base hypothesis:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\begin{array} { r } { \mathrm { V C d i m } \left( \mathcal { F } _ { L } \right) \leq 2 ( d + 1 ) ( L + 1 ) \log _ { 2 } ( ( L + 1 ) e ) , } \end{array}
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
where $e$ is a constant and the upper bounds grows as $L$ increases. Combined with VC-dimension generalization bounds, these results imply that larger values of $L$ can lead to overfitting of AdaBoost. This situation also happens in AdaGCN, which inspires us that there is no need to stack too many layers on AdaGCN in order to avoid overfitting. In practice, $L$ is typically determined via cross-validation.
|
md/train/QkVi6KogNbu/QkVi6KogNbu.md
ADDED
|
@@ -0,0 +1,536 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Stochastic Approximation of Gaussian Free Energy for Risk-Sensitive Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 We introduce a stochastic approximation rule for estimating the free energy from
|
| 11 |
+
2 i.i.d. samples generated by a Gaussian distribution with unknown mean and vari
|
| 12 |
+
3 ance. The rule is a simple modification of the Rescorla-Wagner rule, where the
|
| 13 |
+
4 (sigmoidal) stimulus is taken to be either the event of over- or underestimating a
|
| 14 |
+
5 target value. Since the Gaussian free energy is known to be a certainty-equivalent
|
| 15 |
+
6 sensitive to the mean and the variance, the learning rule has applications in risk
|
| 16 |
+
7 sensitive decision-making. In particular, we show how to use the rule in combina
|
| 17 |
+
8 tion with the temporal-difference error in order to obtain risk-sensitive, model-free
|
| 18 |
+
9 reinforcement learning algorithms.
|
| 19 |
+
|
| 20 |
+
# 10 1 Introduction
|
| 21 |
+
|
| 22 |
+
11 Main contribution. Let $\begin{array} { r } { N ( x ; \mu , \rho ) = \sqrt { \frac { \rho } { 2 \pi } } \exp \{ - \frac { \rho } { 2 } ( x - \mu ) ^ { 2 } \} } \end{array}$ be the Gaussian pdf with mean $\mu$
|
| 23 |
+
12 and precision $\rho$ . Given a sequence $x _ { 1 } , x _ { 2 } , \dotsc$ of i.i.d. samples drawn from $N ( x ; \mu , \rho )$ with unknown
|
| 24 |
+
13 $\mu$ and $\rho$ , consider the problem of estimating the free energy $\mathbf { F } _ { \beta }$ for a given inverse temperature $\beta \in \mathbb { R }$ ,
|
| 25 |
+
14 that is
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\mathbf { F } _ { \beta } = { \frac { 1 } { \beta } } \log \int _ { \mathbb { R } } N ( x ; \mu , \rho ) \exp \{ \beta x \} d x = \mu + { \frac { \beta } { 2 \rho } } .
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
15 This paper shows that (1) can be estimated using a surprisingly simple stochastic approximation rule.
|
| 32 |
+
16 If $v \in \mathbb { R }$ is the current estimate and a new sample $x$ arrives, update $v$ according to
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
v v + 2 \alpha \cdot \sigma _ { \beta } ( x - v ) \cdot ( x - v ) ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
17 where $\alpha > 0$ is a learning rate and $\sigma _ { \beta } ( z )$ is the scaled logistic sigmoid
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\sigma _ { \beta } ( z ) = \frac { 1 } { 1 + \exp \{ - \beta z \} } .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
18 The unique and stable fixed point of the learning rule (2) is equal to the desired free energy value
|
| 45 |
+
19 $\begin{array} { r } { v ^ { * } = \mu + \frac { \beta } { 2 \rho } } \end{array}$ .
|
| 46 |
+
20 Motivation. Risk-sensitivity, the susceptibility to the higher-order moments of the return, is neces
|
| 47 |
+
21 sary for the real-world deployment of AI agents. Wrong assumptions, lack of data, misspecification,
|
| 48 |
+
22 limited computation, and adversarial attacks are just a handful of the countless sources of unforeseen
|
| 49 |
+
23 perturbations that could be present at deployment time. Such perturbations can easily destabilize
|
| 50 |
+
24 risk-neutral policies, because they only focus on maximizing expected return while entirely neglecting
|
| 51 |
+
25 the variance. This poses serious safety concerns (Russell et al., 2015; Amodei et al., 2016; Leike
|
| 52 |
+
26 et al., 2017).
|
| 53 |
+
|
| 54 |
+
Submitted to 35th Conference on Neural Information Processing Systems (NeurIPS 2021). Do not distribute.
|
| 55 |
+
|
| 56 |
+
27 Risk-sensitive control has a long history in control theory (Coraluppi, 1997) and is an active area
|
| 57 |
+
28 of research within reinforcement learning (RL). There are multiple different approaches to risk
|
| 58 |
+
29 sensitivity in RL: for instance in Minimax RL, inspired by classical robust control theory, one derives
|
| 59 |
+
30 a conservative worst-case policy over MDP parameter intervals (Nilim and El Ghaoui, 2005; Tamar
|
| 60 |
+
31 et al., 2014); and the more recent CVaR approach relies on using the conditional-value-at-risk as a
|
| 61 |
+
32 robust performance measure (Galichet et al., 2013; Cassel et al., 2018). We refer the reader to García
|
| 62 |
+
33 and Fernández (2015) for a comprehensive overview. Here we focus on one of the earliest and most
|
| 63 |
+
34 popular approaches (see references), consisting of the use of exponentially-transformed values, or
|
| 64 |
+
35 equivalently, the free energy as the risk-sensitive certainty-equivalent (Bellman, 1957; Howard and
|
| 65 |
+
36 Matheson, 1972).
|
| 66 |
+
37 The certainty-equivalent of a stochastic value $X \in \mathbb { R }$ is defined as the representative deterministic
|
| 67 |
+
38 value $v \in \mathbb { R }$ that a decision-maker uses as a summary of $X$ for valuation purposes. To illustrate,
|
| 68 |
+
39 consider a first-order Markov chain over discrete states $s$ with transition kernel $P ( s ^ { \prime } | s )$ , state-emitted
|
| 69 |
+
40 rewards $R ( s ) \in \mathbb { R } .$ , and discount factor $\gamma \in [ 0 , 1 )$ . Typically RL methods use the expectation as the
|
| 70 |
+
41 certainty-equivalent of stochastic transitions (Bertsekas and Tsitsiklis, 1995; Sutton and Barto, 2018).
|
| 71 |
+
42 Therefore they compute the value $V ( s )$ of the current state $s \in S$ by (recursively) aggregating the
|
| 72 |
+
43 future values through their expectation, e.g.
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
V ( s ) = \int P ( s ^ { \prime } | s ) \{ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) \} d s ^ { \prime } .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
44 Instead, Howard and Matheson (1972) proposed using the free energy as the certainty-equivalent,
|
| 79 |
+
45 that is,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
V ( s ) = F _ { \beta } ( s ) = \frac { 1 } { \beta } \log \int P ( s ^ { \prime } | s ) \exp \bigl \{ \beta [ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) ] \bigr \} d s ^ { \prime } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
46 where $\beta \in \mathbb { R }$ is the inverse temperature parameter which determines whether the aggregation is
|
| 86 |
+
47 risk-averse $( \beta < 0 )$ ), risk-seeking $( \beta > 0 )$ ), or even risk-neutral as a special case $\beta = 0$ ). Indeed, if
|
| 87 |
+
48 the future values are bounded, then $F _ { \beta } ( s )$ is sigmoidal in shape as a function of $\beta$ , with three special
|
| 88 |
+
49 values given by
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\operatorname* { l i m } _ { \beta } F _ { \beta } ( s ) = \left\{ \begin{array} { l l } { \operatorname* { m i n } _ { s ^ { \prime } } \{ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) \} } & { \mathrm { i f ~ } \beta \to - \infty ; } \\ { \mathbf E [ R ( S ^ { \prime } ) + \gamma V ( S ^ { \prime } ) | S = s ] } & { \mathrm { i f ~ } \beta \to ~ 0 ; } \\ { \operatorname* { m a x } _ { s ^ { \prime } } \{ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) \} } & { \mathrm { i f ~ } \beta \to + \infty . } \end{array} \right.
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
50 These limit values highlight the sensitivity to the higher-order moments of the return. Because of this
|
| 95 |
+
51 property, the free energy has been used as the certainty-equivalent for assessing the value of both
|
| 96 |
+
52 actions and observations under limited control and model uncertainty respectively, each effect having
|
| 97 |
+
53 their own inverse temperature. The work by Grau-Moya et al. (2016) is a demonstration of how to
|
| 98 |
+
54 incorporate multiple types of effects in MDPs.
|
| 99 |
+
55 The present work addresses a longstanding problem pointed out by Mihatsch and Neuneier (2002).
|
| 100 |
+
56 An advantage of using expectations is that certainty-equivalents such as (4) are easily estimated
|
| 101 |
+
57 using stochastic approximation schemes. For instance, consider the classical Robbins-Monro update
|
| 102 |
+
58 (Robbins and Monro, 1951)
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
v v + \alpha \cdot ( x - v )
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
59 where $x \sim P ( x )$ is a stochastic target value, $\alpha$ is a learning rate, and $v$ is the estimate of $\mathbf { E } [ X ]$ .
|
| 109 |
+
60 Substituting $x = \ ' { R } ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } )$ and $v = V ( s )$ leads to the popular TD(0) update (Sutton and Barto,
|
| 110 |
+
61 1990):
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
V ( s ) V ( s ) + \alpha ( R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) - V ( s ) ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
62 However, there is no model-free counterpart for estimating free energies (5) under general unknown
|
| 117 |
+
63 distributions. The difficulty lies in that model-free updates rely on single (Monte-Carlo) unbiased
|
| 118 |
+
64 samples, but these are not available in the case of the free energy due to the log-term on the r.h.s.
|
| 119 |
+
65 of (5). This shortcoming led Mihatsch and Neuneier (2002) to propose the alternative risk-sensitive
|
| 120 |
+
66 learning rule
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
v v + \alpha \cdot u \cdot ( x - v ) , \qquad { \mathrm { w h e r e ~ } } u = { \{ \begin{array} { l l } { ( 1 - \kappa ) } & { { \mathrm { i f ~ } } ( x - v ) \geq 0 } \\ { ( 1 + \kappa ) } & { { \mathrm { i f ~ } } ( x - v ) < 0 } \end{array} }
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
67 and where $\kappa \in [ - 1 ; 1 ]$ is a risk-sensitivity parameter. While the heuristic (9) does produce risk
|
| 127 |
+
68 sensitive policies, these have no formal correspondence to free energies.
|
| 128 |
+
69 As anticipated, our work contributes a simple model-free rule for estimating the free energy in the
|
| 129 |
+
70 special case of Gaussian distributions. Starting from the Rescorla-Wagner rule
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 1: Update rule and its error function. a) shows the update $f ( x )$ to the estimate $v$ caused by the arrival of a sample $x$ , weighted by its probability density. The expected update is determined by comparing the integrals of the positive and negative lobes. b) Illustration of weighted update functions $f ( x )$ for different values of the current estimate $v$ . The positive lobes are either larger, equal, or smaller than the negative lobes for a $v$ that is either smaller, equal, or larger than the free energy respectively. c) Error function implied by the update rule. For a risk-neutral $\beta = 0$ ) estimator the error function is equal to the quadratic error $\begin{array} { r } { e ( \delta , \dot { 0 } ) = \frac { 1 } { 2 } \delta ^ { 2 } } \end{array}$ . For a risk-averse estimator $\beta < 0 )$ ), the error function is lopsided, penalizing under-estimates stronger than over-estimates. Furthermore, $e ( \delta , \beta )$ is an even function in $\beta$ .
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
v v + \alpha \cdot u \cdot ( x - v ) ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
71 where $u \in \{ 0 , 1 \}$ is an indicator function marking the presence of a stimulus (Rescorla, 1972), we
|
| 139 |
+
72 substitute $u$ by twice the soft-indicator function $\sigma _ { \beta } ( x - v )$ of (3), which activates whenever $v$ either
|
| 140 |
+
73 over- or underestimates the target value $x$ , depending on the sign of the risk-sensitivity parameter $\beta$ .
|
| 141 |
+
74 Using the substitutions appropriate for RL, we obtain the risk-sensitive $\mathrm { T D } ( 0 )$ -rule
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
V ( s ) V ( s ) + 2 \alpha \cdot \sigma _ { \beta } ( \delta ) \cdot \delta ,
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
75 where $\delta = R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) - V ( s )$ is the standard temporal-difference error. The learning rule is
|
| 148 |
+
76 trivial to implement, works as stated for tabular RL, and is easily adapted to the objective functions
|
| 149 |
+
77 of deep RL methods (Mnih et al., 2015). Finally, the learning rule is also consistent with findings in
|
| 150 |
+
78 computational neuroscience (Niv et al., 2012), e.g. predicting asymmetric updates that are stronger
|
| 151 |
+
79 for negative prediction errors in the risk-averse case (Gershman, 2015).
|
| 152 |
+
|
| 153 |
+
# 80 2 Analysis of the Learning Rule
|
| 154 |
+
|
| 155 |
+
Our central result is the following lemma, which implies that the unique and stable fixed point of the expected learning dynamics of (2) is given by the desired free energy.
|
| 156 |
+
|
| 157 |
+
83 Lemma 1. If $x _ { 1 } , x _ { 2 } , \dotsc$ are i.i.d. samples from $P ( X ) = N ( x ; \mu , \rho )$ , then the expected update $J ( v )$
|
| 158 |
+
84 of the learning rule (2) is twice differentiable and such that
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
J ( v ) = 2 \mathbf { E } \big [ \sigma _ { \beta } ( X - v ) \cdot ( X - v ) \big ] \left\{ { \begin{array} { l l } { < 0 , } & { i f v > \mathbf { F } _ { \beta } ; } \\ { = 0 , } & { i f v = \mathbf { F } _ { \beta } ; } \\ { > 0 , } & { i f v < \mathbf { F } _ { \beta } . } \end{array} } \right.
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
85 Proof. The expected update of $v$ is
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
J ( v ) : = 2 \int N ( x ; \mu , \rho ) \sigma ( x - v ) ( x - v ) d x ,
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
86 where we have dropped the subscript $\beta$ from $\sigma _ { \beta }$ for simplicity. Using the Leibnitz integral rule it
|
| 171 |
+
87 is easily seen that this function is twice differentiable w.r.t. $v$ , because the integrand is a product of
|
| 172 |
+
88 twice differentiable functions.
|
| 173 |
+
89 The resulting update direction will be positive if the integral over the positive contributions outweight
|
| 174 |
+
90 the negative contributions and vice versa. The integrand of (12) has a symmetry property: splitting
|
| 175 |
+
91 the domain of integration $\mathbb { R }$ into $\left( - \infty ; v \right]$ and $( v ; + \infty )$ , using the change of variable $\delta = x - v$ , and
|
| 176 |
+
92 recombining the two integrals into one gives
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
J ( v ) : = 2 \int _ { 0 } ^ { \infty } \Bigl \{ N ( v + \delta ; \mu , \rho ) \sigma ( \delta ) - N ( v - \delta ; \mu , \rho ) \sigma ( - \delta ) \Bigr \} \delta d \delta .
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
93 We will show that the integrand of (13) is either negative, zero, or positive, depending on the value
|
| 183 |
+
94 of $v$ . Define the weighted update $f ( x )$ as
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
f ( x ) = f ( v + \delta ) : = N ( v + \delta ; \mu , \rho ) \sigma ( \delta ) \delta .
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
95 This function is illustrated in Figure 1a. We are interested in the ratio
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\frac { f ( v + \delta ) } { f ( v - \delta ) } = \frac { N ( v + \delta ; \mu , \rho ) } { N ( v - \delta ; \mu , \rho ) } \frac { \sigma ( \delta ) } { \sigma ( - \delta ) } ,
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
96 which compares the positive against the negative contributions to the integrand in (13). The first
|
| 196 |
+
97 fraction of the r.h.s. of (14) is equal to
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\frac { N ( v + \delta ; \mu , \delta ) } { N ( v - \delta ; \mu , \rho ) } = \exp \Bigl \{ - \frac { \rho } { 2 } ( v + \delta - \mu ) ^ { 2 } + \frac { \rho } { 2 } ( v - \delta - \mu ) ^ { 2 } \Bigr \} = \exp \{ - 2 \rho \delta ( v - \mu ) \} .
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
98 Using the symmetry property $\sigma ( \delta ) = 1 - \sigma ( - \delta )$ of the logistic sigmoid function, the second fraction
|
| 203 |
+
99 can be shown to be equal to
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
{ \frac { \sigma ( \delta ) } { \sigma ( - \delta ) } } = { \frac { \sigma ( \delta ) } { 1 - \sigma ( \delta ) } } = \exp \{ \beta \delta \} .
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
100 Substituting the above back into (14) results in
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\frac { f ( v + \delta ) } { f ( v - \delta ) } = \exp \{ - 2 \rho \delta ( v - \mu ) + \beta \delta \} \left\{ \begin{array} { l l } { > 1 } & { \mathrm { f o r } v < \mu + \frac { \beta } { 2 \rho } , } \\ { = 1 } & { \mathrm { f o r } v = \mu + \frac { \beta } { 2 \rho } , } \\ { < 1 } & { \mathrm { f o r } v > \mu + \frac { \beta } { 2 \rho } , } \end{array} \right.
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
also illustrated in Figure 1b. Therefore, the integrand in (13) is either positive101 $\begin{array} { r } { ( v < \mu + \frac { 2 } { 2 \rho } ) } \end{array}$ , zero 102 $\begin{array} { r } { ( v = \mu + \frac { \beta } { 2 \rho } ) } \end{array}$ , or negative $\begin{array} { r } { ( v > \mu + \frac { \beta } { 2 \rho } ) } \end{array}$ , allowing to conclude the claim of the lemma. □
|
| 216 |
+
|
| 217 |
+
# 3 Additional Properties
|
| 218 |
+
|
| 219 |
+
We discuss additional properties in order to strengthen the intuition and to clarify the significance of the learning rule; some practical implementation advice is given at the end.
|
| 220 |
+
|
| 221 |
+
106 Associated free energy functional. The Gaussian free energy $\mathbf { F } _ { \beta }$ in (1) is formally related to the
|
| 222 |
+
107 valuation of risk-sensitive portfolios used in finance (Markowitz, 1952). It is well-known that the free
|
| 223 |
+
108 energy is the extremum of the free energy functional, defined as the Kullback-Leibler-regularized
|
| 224 |
+
109 expectation of $X$ :
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
F _ { \beta } \big [ p ( x ) \big ] : = \mathbf { E } _ { p } [ X ] - \frac { 1 } { \beta } \mathbf { K L } \big ( p ( x ) \big | \big | N ( x ; \mu , \rho ) \big ) .
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
110 This functional is convex in $p$ for $\beta < 0$ and concave for $\beta > 0$ . Taking either the minimum (for
|
| 231 |
+
111 $\beta < 0$ ) or maximum (for $\beta > 0$ ) w.r.t. $p ( x )$ yields
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\mathbf { F } _ { \beta } = \operatorname { e x t r } F _ { \beta } \left[ p ( x ) \right] = \left[ \mu + { \frac { \beta } { \rho } } \right] - { \frac { 1 } { \beta } } \left[ { \frac { \beta ^ { 2 } } { 2 \rho } } \right] = \mu + { \frac { \beta } { 2 \rho } } = \mathbf { E } [ X ] + { \frac { \beta } { 2 } } \mathbf { V a r } [ X ] ,
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
112 that is, the Gaussian free energy is a linear function of $\beta$ , where the intercept and the slope are equal to the expectation and half of the variance of 113 $X$ respectively. The extremizer $p ^ { * } ( x )$ is the Gaussian
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\begin{array} { r } { p ^ { * } ( x ) = \arg \underset { p ( x ) } { \mathrm { e x t r } } F _ { \beta } \big [ p ( x ) \big ] = N ( x ; \mu + \frac { \beta } { \rho } , \rho ) . } \end{array}
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
114 The above gives a precise meaning to the free energy as a certainty-equivalent. The choice of a
|
| 244 |
+
115 non-zero inverse temperature $\beta$ reflects a distrust in the reference probability density $N ( x ; \mu , \rho )$ as a
|
| 245 |
+
116 reliable model for $X$ . Specifically, the magnitude of $\beta$ quantifies the degree of distrust and the sign of
|
| 246 |
+
117 $\beta$ indicates whether it is an under- or overestimation. This distrust results in using the extremizer (17)
|
| 247 |
+
118 as a robust substitute for the original reference model for $X$ .
|
| 248 |
+
119 Game-theoretic interpretation. In addition to the above, previous work (Ortega and Lee, 2014;
|
| 249 |
+
120 Eysenbach and Levine, 2019; Husain et al., 2021) has shown that the free energy functional has an
|
| 250 |
+
121 interpretation as a two-player game which characterizes its robustness properties. Following Ortega
|
| 251 |
+
122 and Lee (2014), computing the Legendre-Fenchel dual of the KL regularizer yields an equivalent
|
| 252 |
+
123 adversarial re-statement of the free energy functional (15), which for $\beta > 0$ is given by
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
\operatorname* { m a x } _ { p ( x ) } \operatorname* { m i n } _ { c ( x ) } \Bigl \{ \int p ( x ) [ x - c ( x ) ] d x + \int N ( x ; \mu , \rho ) \exp \{ \beta c ( x ) \} d x , \Bigr \} ,
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
124 where the perturbations $c ( x ) \in \mathbb { R }$ are chosen by an adversary (Note: for the case $\beta < 0$ one obtains a
|
| 259 |
+
125 Minimax problem over $p ( x )$ and $c ( x )$ rather than a Maximin). From this dual interpretation, one sees
|
| 260 |
+
126 that the distribution $p ( x )$ is chosen as if it were maximizing the expected value of $x ^ { \prime } = x - c ( x )$ ,
|
| 261 |
+
127 the adversarially perturbed version of $x$ . In turn, the adversary attempts to minimize $x ^ { \prime }$ , but at the
|
| 262 |
+
128 cost of an exponential penalty for $c ( x )$ . More precisely, given the distribution $p ( x )$ , the adversarial
|
| 263 |
+
129 best-response (ignoring constants) is
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
c ^ { * } ( x ) \overset { ( \cong ) } { = } \frac { 1 } { \beta } \log \frac { p ( x ) } { N ( x ; \mu , \rho ) } \overset { ( \ u ) } { = } \frac { 1 } { 2 \beta } \bigg \{ \rho ( x - \mu ) ^ { 2 } - \bar { \rho } ( x - \bar { \mu } ) ^ { 2 } + \log \frac { \bar { \rho } } { \rho } \bigg \} \overset { ( \circ ) } { = } x - \mathbf { F } _ { \beta } ,
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
130 where the equality (a) is true for any choice of $p ( x )$ ; (b) holds if $p ( x ) = N ( x ; \bar { \mu } , \bar { \rho } )$ for some mean $\bar { \mu }$
|
| 270 |
+
131 and precision $\bar { \rho }$ ; and where (c) holds if $p ( x )$ is the extremizer (17). Here we see that the adversarial
|
| 271 |
+
132 perturbations can be arbitrarily bad if $p ( x )$ is not chosen cautiously: for instance, for the (Gaussian)
|
| 272 |
+
133 Dirac delta
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
p ( x ) = N ( x ; \mu , { \bar { \rho } } ) { \xrightarrow { \bar { \rho } \to \infty } } \delta ( x = \mu ) \quad { \mathrm { w e ~ g e t } } \quad c ^ { * } ( x ) = { \mathcal { O } } \left( \log { \frac { \bar { \rho } } { \rho } } \right) { \xrightarrow { \bar { \rho } \to \infty } } + \infty .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
134 Error function. Let $\delta = x - v$ be the instantaneous difference between the sample and the estimate.
|
| 279 |
+
135 If the update rule (2) corresponds to a stochastic gradient descent step, then what is the error function?
|
| 280 |
+
136 That is, if
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
v v - \alpha \cdot \nabla _ { \delta } e ( \delta , \beta ) = v + 2 \alpha \cdot \sigma _ { \beta } ( \delta ) \cdot \delta ,
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
137 then what is $e ( \delta , \beta ) ?$ Integrating the gradient $\nabla _ { \delta } e ( \delta , \beta )$ with respect to $\delta$ gives
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
e ( \delta , \beta ) = 2 \int \sigma ( \delta ) \delta d \delta = \frac { 2 \delta } { \beta } \log ( 1 + \exp \{ \beta \delta \} ) + \frac { 2 } { \beta ^ { 2 } } \mathrm { l i } _ { 2 } ( - \exp \{ \beta \delta \} ) + \frac { \pi ^ { 2 } } { 6 \beta ^ { 2 } } ,
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
138 where $\log ( 1 + \exp ( z ) )$ is the softplus function (Dugas et al., 2001) and $\operatorname { l i } _ { 2 } ( z )$ is Spence’s function
|
| 293 |
+
139 (or dilogarithm) defined as
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\operatorname { l i } _ { 2 } ( z ) = - \int _ { 0 } ^ { z } { \frac { \log ( 1 - z ) } { z } } d z ,
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
and where the constant of integration 140 $\frac { \pi ^ { 2 } } { 6 \beta ^ { 2 } }$ was chosen so that $\begin{array} { r } { \operatorname* { l i m } _ { \delta \to 0 } e ( \delta , \beta ) = 0 } \end{array}$ for all $\beta \in \mathbb { R }$ . This 141 error function is illustrated in Figure 1c for a handful of values of $\beta$ . In the limit $\beta 0$ , the error 142 function becomes:
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\operatorname* { l i m } _ { \beta \to 0 } e ( \delta , \beta ) = \frac { 1 } { 2 } \delta ^ { 2 } ,
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
thus establishing a connection between the quadratic error and the proposed learning rule.
|
| 306 |
+
|
| 307 |
+
144 Practical considerations. The free energy learning rule (2) can be implemented as stated, for 145 instance either using constant learning rate $\alpha > 0$ or using an adaptive learning rate $\alpha _ { t } > 0$ fulfilling the Robbins-Monro conditions 146 $\textstyle \sum _ { t } \alpha _ { t } > 0$ and $\textstyle \sum _ { t } \alpha _ { t } ^ { 2 } < \infty$ .
|
| 308 |
+
|
| 309 |
+
147 A problem arises when most of the data falls within the near-zero saturated region of the sigmoid,
|
| 310 |
+
148 which can occur due to an unfortunate initialization of the estimate $v$ . Since then $\sigma _ { \beta } ( x - v ) \approx 0$ for
|
| 311 |
+
149 most $x$ , learning can be very slow. This problem can be mitigated using an affine transformation of
|
| 312 |
+
150 the sigmoid that gaurantees a minimal rate $\eta > 0$ , such as
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\tilde { \sigma } _ { \beta } ( z ) = \eta + ( 1 - 2 \eta ) \sigma _ { \beta } ( z ) ,
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
1 which re-scales the sigmoid within the interval $[ \eta , 1 - \eta ]$ . We have found this adjustment to work
|
| 319 |
+
52 well for $| \beta | \approx 0$ , especially when it is only used during the first few iterations.
|
| 320 |
+
153 If one wishes to use the learning rule in combination with gradient-based optimization (as is typical
|
| 321 |
+
154 in a deep learning architecture), we do not recommend using the error function (21) directly. Rather,
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 2: Estimation of the free energy from Gaussian (left panel) and uniform samples (right panel). Each plot shows 10 estimation processes (9 in pink, 1 in red) per choice of the inverse temperature, where $\beta \in \{ - 4 , - 2 , 0 , 2 , 4 \}$ . The true free energies are shown in black. The estimation of the free energy is accurate for Gaussian data but biased for uniform data.
|
| 325 |
+
|
| 326 |
+
155 we suggest absorbing the factor $2 \tilde { \sigma } _ { \beta } ( \delta )$ directly into the learning rate (where as before, $\delta = x - v )$
|
| 327 |
+
|
| 328 |
+
56 A simple way to achieve this consists in scaling the estimation error $E ( \delta )$ by said factor using a
|
| 329 |
+
57 stop-gradient, that is,
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\tilde { E } ( \delta ) : = \mathrm { S t o p G r a d } ( 2 \tilde { \sigma } _ { \beta } ( \delta ) ) \cdot E ( \delta ) ,
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
158 since then the error gradient with respect to the model parameters $\theta$ will be
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\nabla _ { \boldsymbol { \theta } } \tilde { E } ( \boldsymbol { \delta } ) = - 2 \tilde { \sigma } _ { \beta } ( \boldsymbol { \delta } ) \cdot \frac { \partial E } { \partial \boldsymbol { \delta } } \frac { \partial v } { \partial \boldsymbol { \theta } } .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
159 Finally, a large $| \beta |$ chooses a target free energy within a tail of the distribution, leading to slower
|
| 342 |
+
160 convergence. If one wishes to approximate a free energy that sits at $n$ standard deviations from the
|
| 343 |
+
161 mean, then $\beta$ should be chosen as
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\beta ( n ) = 2 n \sqrt { \rho } .
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
2 However, since $\beta ( n )$ is not scale invariant and the scale $\rho$ is unknown, a good choice of $\beta$ must be
|
| 350 |
+
3 determined empirically.
|
| 351 |
+
|
| 352 |
+
# 164 4 Experiments
|
| 353 |
+
|
| 354 |
+
165 Estimation. Our first experiment is a simple sanity check. We estimated the free energy in an
|
| 355 |
+
166 online manner using the learning rule (2) from data generated by two i.i.d. sources: a standard
|
| 356 |
+
167 Gaussian, and uniform distribution over the interval $[ - 2 , 2 ]$ . Five different inverse temperatures
|
| 357 |
+
168 were used $( \beta \in \{ - 4 , - 2 , 0 , 2 , 4 \} )$ . For each condition, we ran ten estimation processes from 4000
|
| 358 |
+
169 random samples using the same starting point $\mathit { v } = 1 . 5$ ). The learning rate was constant and equal to
|
| 359 |
+
170 $\alpha = 0 . 0 2$ .
|
| 360 |
+
171 The results are shown in figure 2. In the Gaussian case, the estimation processes successfully stabilize
|
| 361 |
+
172 around the true free energies, with processes having larger $| \beta |$ converging slower, but fluctuating
|
| 362 |
+
173 less. In the uniform case, the estimation processes do not settle around the correct free energy values
|
| 363 |
+
174 for $\beta \neq 0$ ; however, the found solutions increase monotonically with $\beta$ . These results validate the
|
| 364 |
+
175 estimation method only for Gaussian data, as expected.
|
| 365 |
+
176 Reinforcement learning. Next we applied the risk-sensitive learning rule to RL in a simple grid
|
| 366 |
+
177 world. The goal was to qualitatively investigate the types of policies that result from different
|
| 367 |
+
178 risk-sensitivities. Shown in Figure 3a, the objective of the agent is to navigate to a terminal state
|
| 368 |
+
179 containing a reward pill within no more than 25 time steps while avoiding the water. The reward pill
|
| 369 |
+
180 delivers one reward point upon collection, whereas standing in the water penalizes the agent with
|
| 370 |
+
181 minus one reward point per time step. In addition, there is a very strong wind: with $50 \%$ chance in
|
| 371 |
+
182 each step, the wind pushes the agent one block in a randomly chosen cardinal direction.
|
| 372 |
+
183 We trained R2D2 (Kapturowski et al., 2018) agents with the risk-sensitive cost function (23) using
|
| 373 |
+
184 five uniformly spaced inverse temperatures $\beta$ ranging from $- 0 . 8$ to 0.8. The architecture of our
|
| 374 |
+
185 agents consisted of a first convolutional layer with 3-by-3-kernels and 128 channels, a dense layer
|
| 375 |
+
186 with 128 units, and a logit layer for the four possible actions (i.e. walking directions). The discount
|
| 376 |
+
187 factor was set to $\gamma = 0 . 9 5$ . Each agent was trained for 500K iterations with a batch size of 64, using
|
| 377 |
+
188 the Adam optimizer with learning rate $1 0 ^ { - 4 }$ (Kingma and Ba, 2014). The target network was updated
|
| 378 |
+
189 every 400 steps. The inputs to the network were observation tensors of binary features representing
|
| 379 |
+
190 the 2D board. Note these agents didn’t use any recurrent cells and therefore no backpropagation
|
| 380 |
+
191 through time was used. To train all the agents in this experiment we used 154 CPU core hours at 2.4
|
| 381 |
+
192 GHz and 22.5 GPU hours.
|
| 382 |
+
193 To analyze the resulting policies, we computed the episodic returns and the percentage of time the
|
| 383 |
+
194 agents spent in the water (i.e. the “violations”) from 1000 roll-outs. The results, shown in Figure 3b,
|
| 384 |
+
195 reveal that the risk-neutral policy $\beta = 0$ ) has the highest average return. However, the percentage of
|
| 385 |
+
196 violations increases monotonically with $\beta$ . Figure 3c shows the state-visitation probabilities estimated
|
| 386 |
+
197 from the same roll-outs. There are essentially three types of policies: risk-averse, taking the longest
|
| 387 |
+
198 path away from the water; risk-neutral, taking middle path; and risk-seeking, taking the shortest
|
| 388 |
+
199 route right next to the water. These are even more crisply revealed when the wind is de-activated.
|
| 389 |
+
200 Interestingly, the risk-averse policy $\beta = - 0 . 8 )$ does not always reach the goal, which explains why
|
| 390 |
+
201 its return is slightly lower in spite of committing fewer violations.
|
| 391 |
+
202 Bandits. In the last experiment we wanted to observe the premiums that risk-sensitive agents are
|
| 392 |
+
203 willing to pay when confronted with a choice between a certain and a risky option. To do so, we
|
| 393 |
+
204 used a two-arm bandit setup, where one arm (“certain”) delivered a fixed reward and the other arm
|
| 394 |
+
205 (“risky”) a stochastic one—more precisely, drawn from a Gaussian distribution with mean $\mu$ and
|
| 395 |
+
206 precision $\rho = 2$ . Both the fixed payoff and the mean $\mu$ of the risky arm were drawn from a standard
|
| 396 |
+
207 Gaussian distribution at the beginning of an episode, which lasted twenty rounds. To build agents
|
| 397 |
+
208 that can trade off exploration versus exploitation, we used memory-based meta-learning (Wang et al.,
|
| 398 |
+
209 2016; Santoro et al., 2016), which is known to produce near-optimal bandit players (Ortega et al.,
|
| 399 |
+
210 2019; Mikulik et al., 2020).
|
| 400 |
+
211 We meta-trained five R2D2 agents using risk-sensitives $\beta \in \{ - 1 . 0 , - 0 . 5 , 0 , 0 . 5 , 1 . 0 \}$ on the two
|
| 401 |
+
212 armed bandit task distribution (also randomizing the certain/risky arm positions) with discount factor
|
| 402 |
+
213 $\gamma = 0 . 9 5$ . The network architecture and training parameters were as in the previous RL experiment,
|
| 403 |
+
214 with the difference that the initial convolutional layer was replaced with a dense layer and an LSTM
|
| 404 |
+
215 layer having 128 memory cells (Hochreiter and Schmidhuber, 1997). We used backpropagation
|
| 405 |
+
216 through time for computing the episode gradients. The input to the network consisted of the action
|
| 406 |
+
217 taken and reward obtained in the previous step. This setup allows agents to adapt their choices to past
|
| 407 |
+
218 interactions throughout an episode. To train all the agents in this experiment we used 88 CPU core
|
| 408 |
+
219 hours at $2 . 4 \ : \mathrm { G H z }$ and 10 GPU hours.
|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
Figure 3: Comparison of risk-sensitive RL agents. a) The task consists in picking up a reward located at the terminal state while avoiding stepping into water. A strong wind pushes the agent into a random direction $50 \%$ of the time. b) Bar plots showing the average return (blue) and the percentage of violations (red) for each policy, ordered from lowest to highest $\beta$ . c) State visitation frequencies for each policy, plus the optimal (deterministic) policy when there is no wind (black paths).
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
Figure 4: Two-armed bandit policy profiles with different risk-sensitivities $\beta$ . The certain arm 1 pays a deterministic reward, while the risky arm 2 pays a stochastic reward drawn from $N ( r ; \mu , \rho )$ with precision $\rho = 2$ . The agents were meta-trained on bandits where the payoffs (i.e. arm 1’s payoff and arm 2’s mean) were drawn from a standard Gaussian distribution. The plots show the marginal probability of choosing the certain arm (blue) over the risky arm (red) after twenty interactions for every payoff combination. Each point in the uniform grid was estimated from 30 seeds. Note the deviations from the true risk-neutral indifference curve (black diagonal).
|
| 415 |
+
|
| 416 |
+
Figure 4 shows the agents’ choice profile in the last $( \mathrm { 2 0 ^ { t h } } )$ time step. A true risk-neutral agent does not distinguish between a certain and risky option that have the same expected payoff (black diagonal). The main finding is that the indifference region (i.e. close to a $50 \%$ choice in white color) evolves significantly with increasing $\beta$ , implying that the agents with different risk attitudes are indeed willing to pay different risk premia (measured as the vertical distance of the indifference region from the diagonal). We observe two effects. The most salient effect is that the indifference region mostly 6 moves from being beneath (risk-averse) to above (risk-seeking) the true risk-neutral indifference curve as $\beta$ increases. The second effect is that risk-averse policies $\beta = - 1$ and $- 0 . 5 )$ contain a 8 large region of a stochastic choice profile that appears to depend only on the risky arm’s parameter. 9 We do not have a clear explanation for this effect. Our hypothesis is that risk-averse policies assume adversarial environments, which require playing mixed strategies with precise probabilities. Finally, the risk-neutral agent $\beta = 0$ ) appears to be slightly risk-averse. We believe that this effect arises due 2 to the noisy exploration policy employed during training.
|
| 417 |
+
|
| 418 |
+
# 233 5 Discussion
|
| 419 |
+
|
| 420 |
+
Summary of contributions. In this work we have introduced a learning rule for the online estimation of the Gaussian free energy with unknown mean and precision/variance. The learning rule (2) is obtained by reinterpreting the stimulus-presence indicator component of the Rescorla-Wagner rule (Rescorla, 1972) as a (soft) indicator function for the event of either over- or underestimating the target value. In Lemma 1 we have shown that the free energy is the unique and stable fixed point of the expected learning dynamics. This is the main contribution.
|
| 421 |
+
|
| 422 |
+
240 Furthermore, we have shown how to use the learning rule for risk-sensitive RL. Since the free
|
| 423 |
+
241 energy implements certainty-equivalents that range from risk-averse to risk-seeking, we were able
|
| 424 |
+
242 to formulate a risk-sensitive, model-free update in the spirit of TD(0) (Sutton and Barto, 1990),
|
| 425 |
+
243 thereby addressing a longstanding problem (Mihatsch and Neuneier, 2002) for the special case of
|
| 426 |
+
244 the Gaussian distribution. Due to its simplicity, the rule is easy to incorporate into existing deep RL
|
| 427 |
+
245 algorithms, for instance by modifying the error using a stop-gradient as shown in (23). In Section 3
|
| 428 |
+
246 we also elaborated on the role of the free energy within decision-making, pointing out its robustness
|
| 429 |
+
247 properties and adversarial interpretation.
|
| 430 |
+
248 We also demonstrated the learning rule in experiments. Firstly, we empirically confirmed that
|
| 431 |
+
249 the online estimates stabilize around the correct Gaussian free energies (Section 4–Estimation).
|
| 432 |
+
250 Secondly, we showed how incorporating risk-attitudes into deep RL can lead to agents implementing
|
| 433 |
+
251 qualitatively different policies which intuitively make sense (Section 4–RL). Lastly, we inspected the
|
| 434 |
+
252 premia risk-sensitive agents are willing to pay for choosing a risky over a certain option, finding that
|
| 435 |
+
253 agents have choice patterns that are more complex than we had anticipated (Section 4–Bandits).
|
| 436 |
+
|
| 437 |
+
Limitations. As shown empirically in Section 4–Estimation, an important limitation of the learning rule is that its fixed point is only equal to the free energy when the samples are Gaussian (or approximately Gaussian, as justified by the CLT). Nevertheless, agents using the risk-sensitive TD(0) update (11) still display risk attitudes monotonic in $\beta$ , with $\beta = 0$ reducing to the familiar risk-neutral case.
|
| 438 |
+
|
| 439 |
+
59 While Lemma 1 establishes the stable equilibrium of the expected update, it only guarantees convergence in continuous-time updates. To show convergence using discrete-time point samples, a stronger result is required. In particular, we conjecture that
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\left| J ( v ) \right| = 2 \Biggr | \int N ( x ; \mu , \rho ) \sigma _ { \beta } ( x - v ) ( x - v ) d x \Biggr | \leq 2 \bigl | { \bf F } _ { \beta } - v \bigr |
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
If (26) is true, meaning that $J ( v )$ is 2-Lipschitz, then this could be combined with a result in stochastic approximation theory akin to Theorem 1 in Jaakkola et al. (1994) to prove convergence.
|
| 446 |
+
|
| 447 |
+
A shortcoming of our experiments using R2D2 agents is that they deterministically pick actions that maximize the Q-value. However, risk-averse agents see their environments as being adversarial, and these in turn require stochastic policies in order to achieve optimal performance.
|
| 448 |
+
|
| 449 |
+
Conclusions. Because it is impossible to anticipate the many ways in which a dynamically-changing environment will violate prior assumptions, requiring the robustness of ML algorithms is of vital importance for their deployment in real-world applications. Unforeseen events can render their decisions unreliable—and in some cases even unsafe.
|
| 450 |
+
|
| 451 |
+
Our work makes a small but nonetheless significant contribution to risk-sensitivity in ML. In essence, it suggests a minor modification to existing algorithms, biasing valuation estimates in a risk-sensitive manner. In particular, we expect the risk-sensitive TD(0)-learning rule to become an integral part of future deep RL algorithms.
|
| 452 |
+
|
| 453 |
+
# References
|
| 454 |
+
|
| 455 |
+
Amodei, D., Olah, C., Steinhardt, J., Christiano, P., Schulman, J., and Mané, D. (2016). Concrete problems in AI safety. arXiv preprint arXiv:1606.06565.
|
| 456 |
+
|
| 457 |
+
Bellman, R. (1957). Dynamic Programming. Princeton University Press.
|
| 458 |
+
|
| 459 |
+
Bertsekas, D. P. and Tsitsiklis, J. N. (1995). Neuro-dynamic programming: an overview. In Proceedings of 1995 34th IEEE conference on decision and control, volume 1, pages 560–564. IEEE.
|
| 460 |
+
|
| 461 |
+
Cassel, A., Mannor, S., and Zeevi, A. (2018). A general approach to multi-armed bandits under risk criteria. In Conference On Learning Theory, pages 1295–1306. PMLR.
|
| 462 |
+
|
| 463 |
+
Coraluppi, S. P. (1997). Optimal control of Markov decision processes for performance and robustness. University of Maryland, College Park.
|
| 464 |
+
|
| 465 |
+
Dugas, C., Bengio, Y., Bélisle, F., Nadeau, C., and Garcia, R. (2001). Incorporating second-order functional knowledge for better option pricing. In Advances in Neural Information Processing Systems, volume 13. MIT Press.
|
| 466 |
+
|
| 467 |
+
Eysenbach, B. and Levine, S. (2019). If MaxEnt RL is the answer, what is the question?
|
| 468 |
+
|
| 469 |
+
Galichet, N., Sebag, M., and Teytaud, O. (2013). Exploration vs exploitation vs safety: Risk-aware multi-armed bandits. In Asian Conference on Machine Learning, pages 245–260. PMLR.
|
| 470 |
+
|
| 471 |
+
García, J. and Fernández, F. (2015). A comprehensive survey on safe reinforcement learning. Journal of Machine Learning Research, 16(1):1437–1480.
|
| 472 |
+
|
| 473 |
+
Gershman, S. J. (2015). Do learning rates adapt to the distribution of rewards? Psychonomic Bulletin & Review, 22(5):1320–1327.
|
| 474 |
+
|
| 475 |
+
Grau-Moya, J., Leibfried, F., Genewein, T., and Braun, D. A. (2016). Planning with informationprocessing constraints and model uncertainty in Markov decision processes. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 475–491. Springer.
|
| 476 |
+
|
| 477 |
+
299 Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735– 1780.
|
| 478 |
+
301 Howard, R. A. and Matheson, J. E. (1972). Risk-sensitive Markov decision processes. Management science, 18(7):356–369.
|
| 479 |
+
303 Husain, H., Ciosek, K., and Tomioka, R. (2021). Regularized policies are reward robust. In International Conference on Artificial Intelligence and Statistics, pages 64–72. PMLR.
|
| 480 |
+
305 Jaakkola, T., Jordan, M. I., and Singh, S. P. (1994). On the convergence of stochastic iterative dynamic programming algorithms. Neural computation, 6(6):1185–1201.
|
| 481 |
+
307 Kappen, H. J. (2005). Path integrals and symmetry breaking for optimal control theory. Journal of statistical mechanics: theory and experiment, 2005(11):P11011. Kappen, H. J., Gómez, V., and Opper, M. (2012). Optimal control as a graphical model inference problem. Machine learning, 87(2):159–182. Kapturowski, S., Ostrovski, G., Quan, J., Munos, R., and Dabney, W. (2018). Recurrent experience replay in distributed reinforcement learning. In International conference on learning representations.
|
| 482 |
+
314 Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv e-prints, pages arXiv–1412.
|
| 483 |
+
316 Leike, J., Martic, M., Krakovna, V., Ortega, P. A., Everitt, T., Lefrancq, A., Orseau, L., and Legg, S. (2017). AI safety gridworlds. arXiv preprint arXiv:1711.09883.
|
| 484 |
+
318 Markowitz, H. (1952). Portfolio selection. Journal of Finance, 1(7).
|
| 485 |
+
319 Mihatsch, O. and Neuneier, R. (2002). Risk-sensitive reinforcement learning. Machine learning, 49(2):267–290.
|
| 486 |
+
321 Mikulik, V., Delétang, G., McGrath, T., Genewein, T., Martic, M., Legg, S., and Ortega, P. A. (2020). Meta-trained agents implement bayes-optimal agents. arXiv preprint arXiv:2010.11223.
|
| 487 |
+
323 Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., et al. (2015). Human-level control through deep reinforcement learning. nature, 518(7540):529–533.
|
| 488 |
+
326 Nilim, A. and El Ghaoui, L. (2005). Robust control of Markov decision processes with uncertain transition matrices. Operations Research, 53(5):780–798. Niv, Y., Edlund, J. A., Dayan, P., and O’Doherty, J. P. (2012). Neural prediction errors reveal a risk-sensitive reinforcement-learning process in the human brain. Journal of Neuroscience, 32(2):551–562. Ortega, D. A. and Braun, P. A. (2011). Information, utility and bounded rationality. In International Conference on Artificial General Intelligence, pages 269–274. Springer. Ortega, P. A. and Braun, D. A. (2013). Thermodynamics as a theory of decision-making with information-processing costs. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 469(2153):20120683.
|
| 489 |
+
336 Ortega, P. A. and Lee, D. (2014). An adversarial interpretation of information-theoretic bounded rationality. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 28.
|
| 490 |
+
338 Ortega, P. A., Wang, J. X., Rowland, M., Genewein, T., Kurth-Nelson, Z., Pascanu, R., Heess, N., Veness, J., Pritzel, A., Sprechmann, P., et al. (2019). Meta-learning of sequential strategies. arXiv preprint arXiv:1905.03030.
|
| 491 |
+
341 Rescorla, R. A. (1972). A theory of Pavlovian conditioning: Variations in the effectiveness of reinforcement and nonreinforcement. Current research and theory, pages 64–99.
|
| 492 |
+
Robbins, H. and Monro, S. (1951). A stochastic approximation method. The annals of mathematical statistics, pages 400–407.
|
| 493 |
+
Russell, S., Dewey, D., and Tegmark, M. (2015). Research priorities for robust and beneficial artificial intelligence. Ai Magazine, 36(4):105–114.
|
| 494 |
+
Santoro, A., Bartunov, S., Botvinick, M., Wierstra, D., and Lillicrap, T. (2016). Meta-learning with memory-augmented neural networks. In International conference on machine learning, pages 1842–1850. PMLR.
|
| 495 |
+
Sutton, R. S. and Barto, A. G. (1990). Time-derivative models of Pavlovian reinforcement. In Learning and Computational Neuroscience: Foundations of Adaptive Networks, pages 497–537. MIT Press.
|
| 496 |
+
Sutton, R. S. and Barto, A. G. (2018). Reinforcement learning: An introduction. MIT Press.
|
| 497 |
+
Tamar, A., Mannor, S., and Xu, H. (2014). Scaling up robust MDPs using function approximation. In International Conference on Machine Learning, pages 181–189. PMLR.
|
| 498 |
+
Theodorou, E., Buchli, J., and Schaal, S. (2010). A generalized path integral control approach to reinforcement learning. The Journal of Machine Learning Research, 11:3137–3181.
|
| 499 |
+
Tishby, N. and Polani, D. (2011). Information theory of decisions and actions. In Perception-action cycle, pages 601–636. Springer.
|
| 500 |
+
Todorov, E. (2007). Linearly-solvable Markov decision problems. In Advances in neural information processing systems, pages 1369–1376.
|
| 501 |
+
Toussaint, M. (2009). Robot trajectory optimization using approximate inference. In Proceedings of the 26th annual international conference on machine learning, pages 1049–1056.
|
| 502 |
+
Wang, J. X., Kurth-Nelson, Z., Tirumala, D., Soyer, H., Leibo, J. Z., Munos, R., Blundell, C., Kumaran, D., and Botvinick, M. (2016). Learning to reinforcement learn. arXiv preprint arXiv:1611.05763.
|
| 503 |
+
Ziebart, B. D., Maas, A. L., Bagnell, J. A., and Dey, A. K. (2008). Maximum entropy inverse reinforcement learning. In AAAI.
|
| 504 |
+
|
| 505 |
+
1. For all authors...
|
| 506 |
+
|
| 507 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 508 |
+
(b) Did you describe the limitations of your work? [Yes] see Section 5
|
| 509 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] see Section 5
|
| 510 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 511 |
+
|
| 512 |
+
2. If you are including theoretical results...
|
| 513 |
+
|
| 514 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] in Section 2.
|
| 515 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] in Section 2.
|
| 516 |
+
|
| 517 |
+
3. If you ran experiments...
|
| 518 |
+
|
| 519 |
+
(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.
|
| 520 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] see Section 4.
|
| 521 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] see Section 4.
|
| 522 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] see Section 4.
|
| 523 |
+
|
| 524 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 525 |
+
|
| 526 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 527 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 528 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 529 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 530 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 531 |
+
|
| 532 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 533 |
+
|
| 534 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 535 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 536 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/QkljT4mrfs/QkljT4mrfs.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Partial success in closing the gap between human and machine vision
|
| 2 |
+
|
| 3 |
+
Robert Geirhos1-2§ Kantharaju Narayanappa1 Benjamin Mitzkus1
|
| 4 |
+
|
| 5 |
+
Tizian Thieringer1 Matthias Bethge1∗ Felix A. Wichmann1∗ Wieland Brendel1∗
|
| 6 |
+
|
| 7 |
+
1University of Tübingen 2International Max Planck Research School for Intelligent Systems ∗Joint senior authors §To whom correspondence should be addressed: robert.geirhos@uni-tuebingen.de
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
A few years ago, the first CNN surpassed human performance on ImageNet. However, it soon became clear that machines lack robustness on more challenging test cases, a major obstacle towards deploying machines “in the wild” and towards obtaining better computational models of human visual perception. Here we ask: Are we making progress in closing the gap between human and machine vision? To answer this question, we tested human observers on a broad range of out-ofdistribution (OOD) datasets, recording 85,120 psychophysical trials across 90 participants. We then investigated a range of promising machine learning developments that crucially deviate from standard supervised CNNs along three axes: objective function (self-supervised, adversarially trained, CLIP language-image training), architecture (e.g. vision transformers), and dataset size (ranging from 1M to 1B).
|
| 12 |
+
|
| 13 |
+
Our findings are threefold. (1.) The longstanding distortion robustness gap between humans and CNNs is closing, with the best models now exceeding human feedforward performance on most of the investigated OOD datasets. (2.) There is still a substantial image-level consistency gap, meaning that humans make different errors than models. In contrast, most models systematically agree in their categorisation errors, even substantially different ones like contrastive self-supervised vs. standard supervised models. (3.) In many cases, human-to-model consistency improves when training dataset size is increased by one to three orders of magnitude. Our results give reason for cautious optimism: While there is still much room for improvement, the behavioural difference between human and machine vision is narrowing. In order to measure future progress, 17 OOD datasets with image-level human behavioural data and evaluation code are provided as a toolbox and benchmark at https://github.com/bethgelab/model-vs-human/.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Looking back at the last decade, deep learning has made tremendous leaps of progress by any standard. What started in 2012 with AlexNet [1] as the surprise winner of the ImageNet Large-Scale Visual Recognition Challenge quickly became the birth of a new AI “summer”, a summer lasting much longer than just a season. With it, just like with any summer, came great expectations: the hope that the deep learning revolution will see widespread applications in industry, that it will propel breakthroughs in the sciences, and that it will ultimately close the gap between human and machine perception. We have now reached the point where deep learning has indeed become a significant driver of progress in industry [e.g. 2, 3], and where many disciplines are employing deep learning for scientific discoveries [4–9]—but are we making progress in closing the gap between human and machine vision?
|
| 18 |
+
|
| 19 |
+
IID vs. OOD benchmarking. For a long time, the gap between human and machine vision was mainly approximated by comparing benchmark accuracies on IID (independent and identically distributed) test data: as long as models are far from reaching human-level performance on challenging datasets like ImageNet, this approach is adequate [10]. Currently, models are routinely matching and in many cases even outperforming humans on IID data. At the same time, it is becoming increasingly clear that models systematically exploit shortcuts shared between training and test data [11–14]. Therefore we are witnessing a major shift towards measuring model performance on out-of-distribution (OOD) data rather than IID data alone, which aims at testing models on more challenging test cases where there is still a ground truth category, but certain image statistics differ from the training distribution. Many OOD generalisation tests have been proposed: ImageNet-C [15] for corrupted imaes, ImageNet-Sketch [16] for sketches, Stylized-ImageNet [17] for image style changes, [18] for unfamiliar object poses, and many more [19–29]. While it is great to have many viable and valuable options to measure generalisation, most of these datasets unfortunately lack human comparison data. This is less than ideal, since we can no longer assume that humans reach near-ceiling accuracies on these challenging test cases as they do on standard noise-free IID object recognition datasets. In order to address this issue, we carefully tested human observers in the Wichmannlab’s vision laboratory on a broad range of OOD datasets, providing some 85K psychophysical trials across 90 participants. Crucially, we showed exactly the same images to multiple observers, which means that we are able to compare human and machine vision on the fine-grained level of individual images [30–32]). The focus of our datasets is measuring distortion robustness: we tested 17 variations that include changes to image style, texture, and various forms of synthetic additive noise.
|
| 20 |
+
|
| 21 |
+
Contributions & outlook. The resulting 17 OOD datasets with large-scale human comparion data enable us to investigate recent exciting machine learning developments that crucially deviate from “vanilla” CNNs along three axes: objective function (supervised vs. self-supervised, adversarially trained, and CLIP’s joint language-image training), architecture (convolutional vs. vision transformer) and training dataset size (ranging from 1M to 1B images). Taken together, these are some of the most promising directions our field has developed to date—but this field would not be machine learning if new breakthroughs weren’t within reach in the next few weeks, months and years. Therefore, we open-sourced modelvshuman, a Python toolbox that enables testing both PyTorch and TensorFlow models on our comprehensive benchmark suite of OOD generalisation data in order to measure future progress. Even today, our results give cause for (cautious) optimism. After a method overview (Section 2), we are able to report that the human-machine distortion robustness gap is closing: the best models now match or in many cases even exceed human feedforward performance on most of the investigated OOD datasets (Section 3). While there is still a substantial image-level consistency gap between humans and machines, this gap is narrowing on some—but not all—datasets when the size of the training dataset is increased (Section 4).
|
| 22 |
+
|
| 23 |
+
# 2 Methods: datasets, psychophysical experiments, models, metrics, toolbox
|
| 24 |
+
|
| 25 |
+
OOD datasets with consistency-grade human data. We collected human data for 17 generalisation datasets (visualized in Figures 7 and 8 in the Appendix, which also state the number of subjects and trials per experiment) on a carefully calibrated screen in a dedicated psychophysical laboratory (a total of 85,120 trials across 90 observers). Five datasets each correspond to a single manipulation (sketches, edge-filtered images, silhouettes, images with a texture-shape cue conflict, and stylized images where the original image texture is replaced by the style of a painting); the remaining twelve datasets correspond to parametric image degradations (e.g. different levels of noise or blur). Those OOD datasets have in common that they are designed to test ImageNet-trained models. OOD images were obtained from different sources: sketches from ImageNet-Sketch [16], stylized images from
|
| 26 |
+
|
| 27 |
+
Stylized-ImageNet [17], edge-filtered images, silhouettes and cue conflict images from $[ 1 7 ] ^ { 1 }$ , and the remaining twelve parametric datasets were adapted from [33]. For these parametric datasets, [33] collected human accuracies but unfortunately, they showed different images to different observers implying that we cannot use their human data to assess image-level consistency between humans and machines. Thus we collected psychophysical data for those images ourselves by showing exactly the same images to multiple observers for each of those twelve datasets. Additionally, we cropped the images from [33] to $2 2 4 \times 2 2 4$ pixels to allow for a fair comparison to ImageNet models (all models included in our comparison receive $2 2 4 \times 2 2 4$ input images; [33] showed $2 5 6 \times 2 5 6$ images to human observers in many cases).
|
| 28 |
+
|
| 29 |
+
Psychophysical experiments. 90 observers were tested in a darkened chamber. Stimuli were presented at the center of a $2 2 '$ monitor with $1 9 2 0 \times 1 2 0 0$ pixels resolution (refresh rate: $1 2 0 \mathrm { H z } ,$ ). Viewing distance was $1 0 7 \mathrm { c m }$ and target images subtended $3 \times 3$ degrees of visual angle. Human observers were presented with an image and asked to select the correct category out of 16 basic categories (such as chair, dog, airplane, etc.). Stimuli were balanced w.r.t. classes and presented in random order. For ImageNet-trained models, in order to obtain a choice from the same 16 categories, the 1,000 class decision vector was mapped to those 16 classes using the WordNet hierarchy [34]. In Appendix I, we explain why this mapping is optimal. We closely followed the experimental protocol defined by [33], who presented images for $2 0 0 ~ \mathrm { { m s } }$ followed by a $1 / f$ backward mask to limit the influence of recurrent processing (otherwise comparing to feedforward models would be difficult). Further experimental details are provided in Appendix C.
|
| 30 |
+
|
| 31 |
+
Why not use crowdsourcing instead? Our approach of investigating few observers in a highquality laboratory setting performing many trials is known as the so-called “small-N design”, the bread-and-butter approach in high-quality psychophysics—see, e.g., the review “Small is beautiful: In defense of the small-N design” [35]. This is in contrast to the “crowdsourcing approach” (many observers in a noisy setting performing fewer trials each). The highly controlled conditions of the Wichmannlab’s psychophysical laboratory come with many advantages over crowdsourced data collection: precise timing control (down to the millisecond), carefully calibrated monitors (especially important for e.g. low-contrast stimuli), controlled viewing distance (important for foveal presentation), full visual acuity (we performed an acuity test with every observer prior to the experiment), observer attention (e.g. no multitasking or children running around during an experiment, which may happen in a crowdsourcing study), just to name a few [36]. Jointly, these factors contribute to high data quality.
|
| 32 |
+
|
| 33 |
+
Models. In order to disentangle the influence of objective function, architecture and training dataset size, we tested a total of 52 models: 24 standard ImageNet-trained CNNs [37], 8 selfsupervised models [38–43], $^ 2 6$ Big Transfer models [45], 5 adversarially trained models [46], 5 vision transformers [47, 48], two semi-weakly supervised models [49] as well as Noisy Student [50] and CLIP [51]. Technical details for all models are provided in the Appendix.
|
| 34 |
+
|
| 35 |
+
Metrics. In addition to $o o D$ accuracy (averaged across conditions and datasets), the following three metrics quantify how closely machines are aligned with the decision behaviour of humans.
|
| 36 |
+
|
| 37 |
+
Accuracy difference $A ( m )$ is a simple aggregate measure that compares the accuracy of a machine $m$ to the accuracy of human observers in different out-of-distribution tests,
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
A ( m ) : \mathbb { R } \to [ 0 , 1 ] , m \mapsto { \frac { 1 } { | D | } } \sum _ { d \in D } { \frac { 1 } { | H _ { d } | } } \sum _ { h \in H _ { d } } { \frac { 1 } { | C _ { d } | } } \sum _ { c \in C _ { d } } ( \operatorname { a c c } _ { d , c } ( h ) - \operatorname { a c c } _ { d , c } ( m ) ) ^ { 2 }
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\operatorname { a c c } _ { d , c } ( \cdot )$ is the accuracy of the model or the human on dataset $d \in D$ and condition $c \in C _ { d }$ (e.g. a particular noise level), and $h \in H _ { D }$ denotes a human observer tested on dataset $d$ . Analogously, one can compute the average accuracy difference between a human observer $h _ { 1 }$ and all other human observers by substituting $h _ { 1 }$ for $m$ and $h \in H _ { D } \setminus \{ h _ { 1 } \}$ for $h \in H _ { D }$ (which can also be applied for the two metrics defined below).
|
| 44 |
+
|
| 45 |
+
Aggregated metrics like $A ( m )$ ignore individual image-level decisions. Two models with vastly different image-level decision behaviour might still end up with the same accuracies on each dataset and condition. Hence, we include two additional metrics in our benchmark that are sensitive to decisions on individual images.
|
| 46 |
+
|
| 47 |
+
Observed consistency $O ( m )$ [32] measures the fraction of samples for which humans and a model $m$ get the same sample either both right or both wrong. More precisely, let $b _ { h , m } ( s )$ be one if both a human observer $h$ and $m$ decide either correctly or incorrectly on a given sample $s$ , and zero otherwise. We calculate the average observed consistency as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
O ( m ) : \mathbb { R } \to [ 0 , 1 ] , m \mapsto \frac { 1 } { | D | } \sum _ { d \in D } \frac { 1 } { | H _ { d } | } \sum _ { h \in H _ { d } } \frac { 1 } { | C _ { d } | } \sum _ { c \in C _ { d } } \frac { 1 } { | S _ { d , c } | } \sum _ { s \in S _ { d , c } } b _ { h , m } ( s )
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $s \in S _ { d , c }$ denotes a sample $s$ (in our case, an image) of condition $c$ from dataset $d$ . Note that this measure can only be zero if the accuracy of $h$ and $m$ are exactly the same in each dataset and condition.
|
| 54 |
+
|
| 55 |
+
Error consistency $E ( m )$ [32] tracks whether there is above-chance consistency. This is an important distinction, since e.g. two decision makers with $9 5 \%$ accuracy each will have at least $90 \%$ observed consistency, even if their $5 \%$ errors occur on non-overlapping subsets of the test data (intuitively, they both get most images correct and thus observed overlap is high). To this end, error consistency (a.k.a. Cohen’s kappa, cf. [52]) indicates whether the observed consistency is larger than what could have been expected given two independent binomial decision makers with matched accuracy, which we denote as $\hat { o } _ { h , m }$ . This can easily be computed analytically [e.g. 32, equation 1]. Then, the average error consistency is given by
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
E ( m ) : \mathbb { R } \to [ - 1 , 1 ] , m \mapsto \frac { 1 } { | D | } \sum _ { d \in D } \frac { 1 } { | H _ { d } | } \sum _ { h \in H _ { d } } \frac { 1 } { | C _ { d } | } \sum _ { c \in C _ { d } } \frac { \big ( \frac { 1 } { | S _ { d , c } | } \sum _ { s \in S _ { d , c } } b _ { h , m } ( s ) \big ) - \hat { o } _ { h , m } ( S _ { d , c } ) } { 1 - \hat { o } _ { h , m } ( S _ { d , c } ) }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Benchmark $\pmb { \& }$ toolbox. $A ( m ) , O ( m )$ and $E ( m )$ each quantify a certain aspect of the humanmachine gap. We use the mean rank order across these metrics to determine an overall model ranking (Table 2 in the Appendix). However, we would like to emphasise that the primary purpose of this benchmark is to generate insights, not winners. Since insights are best gained from detailed plots and analyses, we open-source modelvshuman, a Python project to benchmark models against human data.3 The current model zoo already includes $5 0 +$ models, and an option to add new ones (both PyTorch and TensorFlow). Evaluating a model produces a $1 5 +$ page report on model behaviour. All plots in this paper can be generated for future models—to track whether they narrow the gap towards human vision, or to determine whether an algorithmic modification to a baseline model (e.g., an architectural improvement) changes model behaviour.
|
| 62 |
+
|
| 63 |
+
# 3 Robustness across models: the OOD distortion robustness gap between human and machine vision is closing
|
| 64 |
+
|
| 65 |
+
We are interested in measuring whether we are making progress in closing the gap between human and machine vision. For a long time, CNNs were unable to match human robustness in terms of generalisation beyond the training distribution—a large OOD distortion robustness gap [14, 33, 53– 55]. Having tested human observers on 17 OOD datasets, we are now able to compare the latest developments in machine vision to human perception. Our core results are shown in Figure 1: the OOD distortion robustness gap between human and machine vision is closing (1a, 1b), especially for models trained on large-scale datasets. On the individual image level, a human-machine consistency gap remains (especially 1d), which will be discussed later.
|
| 66 |
+
|
| 67 |
+
Self-supervised models “If intelligence is a cake, the bulk of the cake is unsupervised learning, the icing on the cake is supervised learning and the cherry on the cake is reinforcement learning”,
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 1: Core results, aggregated over 17 out-of-distribution (OOD) datasets: The OOD robustness gap between human and machine vision is closing (top), but an image-level consistency gap remains (bottom). Results compare humans, standard supervised CNNs, self-supervised models, adversarially trained models, vision transformers, noisy student, BiT, SWSL and CLIP. For convenience, $\downarrow$ marks models that are trained on large-scale datasets. Metrics defined in Section 2. Best viewed on screen.
|
| 71 |
+
|
| 72 |
+
Yann LeCun said in 2016 [56]. A few years later, the entire cake is finally on the table—the representations learned via self-supervised learning4 now compete with supervised methods on ImageNet [43] and outperform supervised pre-training for object detection [41]. But how do recent self-supervised models differ from their supervised counterparts in terms of their behaviour? Do they bring machine vision closer to human vision? Humans, too, rapidly learn to recognise new objects without requiring hundreds of labels per instance; additionally a number of studies reported increased similarities between self-supervised models and human perception [57–61]. Figure 2 compares the generalisation behaviour of eight self-supervised models in orange (PIRL, MoCo, MoCoV2, InfoMin, InsDis, SimCLR-x1, SimCLR-x2, SimCLR-x4)—with 24 standard supervised models (grey). We find only marginal differences between self-supervised and supervised models: Across distortion types, self-supervised networks are well within the range of their poorly generalising supervised counterparts. However, there is one exception: the three SimCLR variants show strong generalisation improvements on uniform noise, low contrast, and high-pass images, where they are the three topperforming self-supervised networks—quite remarkable given that SimCLR models were trained on a different set of augmentations (random crop with flip and resize, colour distortion, and Gaussian blur). Curious by the outstanding performance of SimCLR, we asked whether the self-supervised objective function or the choice of training data augmentations was the defining factor. When comparing self-supervised SimCLR models with augmentation-matched baseline models trained in the standard supervised fashion (Figure 15 in the Appendix), we find that the augmentation scheme (rather than the self-supervised objective) indeed made the crucial difference: supervised baselines show just the same generalisation behaviour, a finding that fits well with [62], who observed that the influence of training data augmentations is stronger than the role of architecture or training objective. In conclusion, our analyses indicate that the “cake” of contrastive self-supervised learning currently (and disappointingly) tastes much like the “icing”.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 2: The OOD distortion robustness gap between human and machine vision is closing. Robustness towards parametric distortions for humans, standard supervised CNNs, self-supervised models, adversarially trained models, vision transformers, noisy student, BiT, SWSL, CLIP. Symbols indicate architecture type ( $\bigcirc$ convolutional, $\bigtriangledown$ vision transformer, $\diamondsuit$ human); best viewed on screen.
|
| 76 |
+
|
| 77 |
+
Adversarially trained models The vulnerability of CNNs to adversarial input perturbations is, arguably, one of the most striking shortcomings of this model class compared to robust human perception. A successful method to increase adversarial robustness is adversarial training [e.g. 63, 64]. The resulting models were found to transfer better, have meaningful gradients [65], and enable interpolating between two input images [66]: “robust optimization can actually be viewed as inducing a human prior over the features that models are able to learn” [67, p. 10]. Therefore, we include five models with a ResNet-50 architecture and different accuracy-robustness tradeoffs, adversarially trained on ImageNet with Microsoft-scale resources by [46] to test whether models with “perceptually-aligned representations” also show human-aligned OOD generalisation behaviour—as we would hope. This is not the case: the stronger the model is trained adversarially (darker shades of blue in Figure 2), the more susceptible it becomes to (random) image degradations. Most strikingly, a simple rotation by 90 degrees leads to a $50 \%$ drop in classification accuracy. Adversarial robustness seems to come at the cost of increased vulnerability to large-scale perturbations.5 On the other hand, there is a silver lining: when testing whether models are biased towards texture or shape by testing them on cue conflict images (Figure 3), in accordance with [69, 70] we observe a perfect relationship between shape bias and the degree of adversarial training, a big step in the direction of human shape bias (and a stronger shape bias than nearly all other models).
|
| 78 |
+
|
| 79 |
+
Vision transformers In computer vision, convolutional networks have become by far the dominating model class over the last decade. Vision transformers [47] break with the long tradition of using convolutions and are rapidly gaining traction [71]. We find that the best vision transformer (ViT-L trained on 14M images) even exceeds human OOD accuracy (Figure 1a shows the average across 17 datasets). There appears to be an additive effect of architecture and data: vision transformers trained on 1M images (light green) are already better than standard convolutional models; training on 14M images (dark green) gives another performance boost. In line with [72, 73], we observe a higher shape bias compared to most standard CNNs.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 3: Shape vs. texture biases of different models. While human shape bias is not yet matched, several approaches improve over vanilla CNNs. Box plots show category-dependent distribution of shape / texture biases (shape bias: high values, texture bias: low values).
|
| 83 |
+
|
| 84 |
+
Standard models trained on more data: BiT-M, SWSL, Noisy Student Interestingly, the biggest effect on OOD robustness we find simply comes from training on larger datasets, not from advanced architectures. When standard models are combined with large-scale training (14M images for BiT-M, 300M for Noisy Student and a remarkable 940M for SWSL), OOD accuracies reach levels not known from standard ImageNet-trained models; these models even outperform a more powerful architecture (vision transformer ViT-S) trained on less data (1M) as shown in Figure 1a. Simply training on (substantially) more data substantially narrows the gap to human OOD accuracies (1b), a finding that we quantified in Appendix H by means of a regression model. (The regression model also revealed a significant interaction between dataset size and objective function, as well as a significant main effect for transformers over CNNs.) Noisy Student in particular outperforms humans by a large margin overall (Figure 1a)—the beginning of a new human-machine gap, this time in favour of machines?
|
| 85 |
+
|
| 86 |
+
CLIP CLIP is special: trained on 400M images6 (more data) with joint language-image supervision (novel objective) and a vision transformer backbone (non-standard architecture), it scores close to humans across all of our metrics presented in Figure 1; most strikingly in terms of error consistency (which will be discussed in the next section). We tested a number of hypotheses to disentangle why CLIP appears “special”. H1: because CLIP is trained on a lot of data? Presumably no: Noisy Student—a model trained on a comparably large dataset of 300M images—performs very well on OOD accuracy, but poorly on error consistency. A caveat in this comparison is the quality of the labels: while Noisy Student uses pseudolabeling, CLIP receives web-based labels for all images. H2: because CLIP receives higher-quality labels? About $6 \%$ of ImageNet labels are plainly wrong [74]. Could it be the case that CLIP simply performs better since it doesn’t suffer from this issue? In order to test this, we used CLIP to generate new labels for all 1.3M ImageNet images: (a) hard labels, i.e. the top-1 class predicted by CLIP; and (b) soft labels, i.e. using CLIP’s full posterior distribution as a target. We then trained ResNet-50 from scratch on CLIP hard and soft labels (for details see Appendix E). However, this does not show any robustness improvements over a vanilla ImageNet-trained ResNet-50, thus different/better labels are not a likely root cause. H3: because CLIP has a special image+text loss? Yes and no: CLIP training on ResNet-50 leads to astonishingly poor OOD results, so training a standard model with CLIP loss alone is insufficient. However, while neither architecture nor loss alone sufficiently explain why CLIP is special, we find a clear interaction between architecture and loss (described in more detail in the Appendix along with the other “CLIP ablation” experiments mentioned above).
|
| 87 |
+
|
| 88 |
+
# 4 Consistency between models: data-rich models narrow the substantial image-level consistency gap between human and machine vision
|
| 89 |
+
|
| 90 |
+
In the previous section we have seen that while self-supervised and adversarially trained models lack OOD distortion robustness, models based on vision transformers and/or trained on large-scale datasets now match or exceed human feedforward performance on most datasets. Behaviourally, a natural follow-up question is to ask not just how many, but which errors models make—i.e., do they make errors on the same individual images as humans on OOD data (an important characteristic of a “human-like” model, cf. [32, 75])? This is quantified via error consistency (defined in Section 2); which additionally allows us to compare models with each other, asking e.g. which model classes make similar errors. In Figure 4, we compare all models with each other and with humans, asking whether they make errors on the same images. On this particular dataset (sketch images), we can see one big model cluster. Irrespective of whether one takes a standard supervised model, a selfsupervised model, an adversarially trained model or a vision transformer, all those models make highly systematic errors (which extends the results of [32, 76] who found similarities between standard vanilla CNNs). Humans, on the other hand, show a very different pattern of errors. Interestingly, the boundary between humans and some data-rich models at the bottom of the figure—especially CLIP (400M images) and SWSL (940M)—is blurry: some (but not all) data-rich models much more closely mirror the patterns of errors that humans make, and we identified the first models to achieve higher error consistency with humans than with other (standard) models. Are these promising results shared across datasets, beyond the sketch images? In Figures 1c and 1d, aggregated results over 17 datasets are presented. Here, we can see that data-rich models approach human-to-human observed consistency, but not error consistency. Taken in isolation, observed consistency is not a good measure of image-level consistency since it does not take consistency by chance into account; error consistency tracks whether there is consistency beyond chance; here we see that there is still a substantial image-level consistency gap between human and machine vision. However, several models improve over vanilla CNNs, especially BiT-M (trained on 14M images) and CLIP (400M images). This progress is non-trivial; at the same time, there is ample room for future improvement.
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 4: Data-rich models narrow the substantial image-level consistency gap between humans and machines. Error consistency analysis on a single dataset (sketch images; for other datasets see Appendix, Figures 9, 11, 12, 13, 14) shows that most models cluster (dark red $=$ highly consistent errors) irrespective of their architecture and objective function; humans cluster differently (high human-to-human consistency, low human-to-model consistency); but some data-rich models including CLIP and SWSL blur the boundary, making more human-like errors than standard models.
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 5: Partial failure, partial success: Error consistency with humans aggregated over multiple datasets. Left: 12 datasets where model accuracies exceed human accuracies; here, there is still a substantial image-level consistency gap to humans. Right: 5 datasets (sketch, silhouette, edge, cue conflict, low-pass) where humans are more robust. Here, OOD accuracy is a near-perfect predictor of image-level consistency; especially data-rich models (e.g. CLIP, SWSL, BiT) narrow the consistency gap to humans. Symbols indicate architecture type $\bigcirc$ convolutional, $\bigtriangledown$ vision transformer, $\diamondsuit$ human).
|
| 97 |
+
|
| 98 |
+
How do the findings from Figure 4 (showing nearly human-level error consistency for sketch images) and from Figure 1d (showing a substantial consistency gap when aggregating over 17 datasets) fit together? Upon closer inspection, we discovered that there are two distinct cases. On 12 datasets (stylized, colour/greyscale, contrast, high-pass, phase-scrambling, power-equalisation, false colour, rotation, eidolonI, -II and -III as well as uniform noise), the human-machine gap is large; here, more robust models do not show improved error consistency (as can be see in Figure 5a). On the other hand, for five datasets (sketch, silhouette, edge, cue conflict, low-pass filtering), there is a completely different result pattern: Here, OOD accuracy is a near-perfect predictor of error consistency, which means that improved generalisation robustness leads to more human-like errors (Figure 5b). Furthermore, training on large-scale datasets leads to considerable improvements along both axes for standard CNNs. Within models trained on larger datasets, CLIP scores best; but models with a standard architecture (SWSL: based on ResNet-50 and ResNeXt-101) closely follow suit.
|
| 99 |
+
|
| 100 |
+
It remains an open question why the training dataset appears to have the most important impact on a model’s decision boundary as measured by error consistency (as opposed to other aspects of a model’s inductive bias). Datasets contain various shortcut opportunities [14], and if two different models are trained on similar data, they might converge to a similar solution simply by exploiting the same shortcuts—which would also fit well to the finding that adversarial examples typically transfer very well between different models [77, 78]. Making models more flexible (such as transformers, a generalisation of CNNs) wouldn’t change much in this regard, since flexible models can still exploit the same shortcuts. Two predictions immediately follow from this hypothesis: (1.) error consistency between two identical models trained on very different datasets, such as ImageNet vs. Stylized-ImageNet, is much lower than error consistency between very different models (ResNet-50 vs. VGG-16) trained on the same dataset. (2.) error consistency between ResNet-50 and a highly flexible model (e.g., a vision transformer) is much higher than error consistency between ResNet-50 and a highly constrained model like BagNet-9 [79]. We provide evidence for both predictions in Appendix B, which makes the shortcut hypothesis of model similarity a potential starting point for future analyses. Looking forward, it may be worth exploring the links between shortcut learning and image difficulty, such as understanding whether many “trivially easy” images in common datasets like ImageNet causes models to expoit the same characteristics irrespective of their architecture [80].
|
| 101 |
+
|
| 102 |
+
# 5 Discussion
|
| 103 |
+
|
| 104 |
+
Summary We set out to answer the question: Are we making progress in closing the gap between human and machine vision? In order to quantify progress, we performed large-scale psychophysical experiments on 17 out-of-distribution distortion datasets (open-sourced along with evaluation code as a benchmark to track future progress). We then investigated models that push the boundaries of traditional deep learning (different objective functions, architectures, and dataset sizes ranging from 1M to 1B), asking how they perform relative to human visual perception. We found that the OOD distortion robustness gap between human and machine vision is closing, as the best models now match or exceed human accuracies. At the same time, an image-level consistency gap remains; however, this gap that is at least in some cases narrowing for models trained on large-scale datasets.
|
| 105 |
+
|
| 106 |
+
Limitations Model robustness is studied from many different viewpoints, including adversarial robustness [77], theoretical robustness guarantees [e.g. 81], or label noise robustness [e.g. 82]. The focus of our study is robustness towards non-adversarial out-of-distribution data, which is particularly well-suited for comparisons with humans. Since we aimed at a maximally fair comparison between feedforward models and human perception, presentation times for human observers were limited to $2 0 0 \mathrm { { m s } }$ in order to limit the influence of recurrent processing. Therefore, human ceiling performance might be higher still (given more time); investigating this would mean going beyond “core object recognition”, which happens within less than $2 0 0 ~ \mathrm { { m s } }$ during a single fixation [83]. Furthermore, human and machine vision can be compared in many different ways. This includes comparing against neural data [84, 85], contrasting Gestalt effects [e.g. 86], object similarity judgments [87], or mid-level properties [61] and is of course not limited to studying object recognition. By no means do we mean to imply that our behavioural comparison is the only feasible option—on the contrary, we believe it will be all the more exciting to investigate whether our behavioural findings have implications for other means of comparison!
|
| 107 |
+
|
| 108 |
+
Discussion We have to admit that we view our results concerning the benefits of increasing dataset size by one-to-three orders of magnitude with mixed feelings. On the one hand, “simply” training standard models on (a lot) more data certainly has an intellectually disappointing element—particularly given many rich ideas in the cognitive science and neuroscience literature on which architectural changes might be required to bring machine vision closer to human vision [88–93]. Additionally, large-scale training comes with infrastructure demands that are hard to meet for many academic researchers. On the other hand, we find it truly exciting to see that machine models are closing not just the OOD distortion robustness gap to humans, but that also, at least for some datasets, those models are actually making more human-like decisions on an individual image level; image-level response consistency is a much stricter behavioural requirement than just e.g. matching overall accuracies. Taken together, our results give reason to celebrate partial success in closing the gap between human and machine vision. In those cases where there is still ample room for improvement, our psychophysical benchmark datasets and toolbox may prove useful in quantifying future progress.
|
| 109 |
+
|
| 110 |
+
# Acknowledgments and disclosure of funding
|
| 111 |
+
|
| 112 |
+
We thank Andreas Geiger, Simon Kornblith, Kristof Meding, Claudio Michaelis and Ludwig Schmidt for helpful discussions regarding different aspects of this work; Lukas Huber, Maximus Mutschler, David-Elias Künstle for feedback on the manuscript; Ken Kahn for pointing out typos; Santiago Cadena for sharing a PyTorch implementation of SimCLR; Katherine Hermann and her collaborators for providing supervised SimCLR baselines; Uli Wannek and Silke Gramer for infrastructure/administrative support; the many authors who made their models publicly available; and our anonymous reviewers for many valuable suggestions.
|
| 113 |
+
|
| 114 |
+
Furthermore, we are grateful to the International Max Planck Research School for Intelligent Systems (IMPRSIS) for supporting R.G.; the Collaborative Research Center (Projektnummer 276693517—SFB 1233: Robust Vision) for supporting M.B. and F.A.W. This work was supported by the German Federal Ministry of Education and Research (BMBF): Tübingen AI Center, FKZ: 01IS18039A (W.B. and M.B.). F.A.W. is a member of the Machine Learning Cluster of Excellence, EXC number 2064/1—Project number 390727645. M.B. and W.B. acknowledge funding from the MICrONS program of the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/Interior Business Center (DoI/IBC) contract number D16PC00003. W.B. acknowledges financial support via the Emmy Noether Research Group on The Role of Strong Response Consistency for Robust and Explainable Machine Vision funded by the German Research Foundation (DFG) under grant no. BR 6382/1-1.
|
| 115 |
+
|
| 116 |
+
# Author contributions
|
| 117 |
+
|
| 118 |
+
Project idea: R.G. and W.B.; project lead: R.G.; coding toolbox and model evaluation pipeline: R.G., K.N. and B.M. based on a prototype by R.G.; training models: K.N. with input from R.G., W.B. and M.B.; data visualisation: R.G., B.M. and K.N. with input from M.B., F.A.W. and W.B.; psychophysical data collection: T.T. (12 datasets) and B.M. (2 datasets) under the guidance of R.G. and F.A.W.; curating stimuli: R.G.; interpreting analyses and findings: R.G., M.B., F.A.W. and W.B.; guidance, feedback, infrastructure & funding acquisition: M.B., F.A.W. and W.B.; paper writing: R.G. with help from F.A.W. and W.B. and input from all other authors.
|
| 119 |
+
|
| 120 |
+
# References
|
| 121 |
+
|
| 122 |
+
[1] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012.
|
| 123 |
+
[2] Jinjiang Wang, Yulin Ma, Laibin Zhang, Robert X Gao, and Dazhong Wu. Deep learning for smart manufacturing: Methods and applications. Journal of Manufacturing Systems, 48:144–156, 2018.
|
| 124 |
+
[3] Javier Villalba-Diez, Daniel Schmidt, Roman Gevers, Joaquín Ordieres-Meré, Martin Buchwitz, and Wanja Wellbrock. Deep learning for industrial computer vision quality control in the printing industry 4.0. Sensors, 19(18):3987, 2019.
|
| 125 |
+
[4] Christof Angermueller, Tanel Pärnamaa, Leopold Parts, and Oliver Stegle. Deep learning for computational biology. Molecular Systems Biology, 12(7):878, 2016.
|
| 126 |
+
[5] Adam H Marblestone, Greg Wayne, and Konrad P Kording. Toward an integration of deep learning and neuroscience. Frontiers in Computational Neuroscience, 10:94, 2016.
|
| 127 |
+
[6] Garrett B Goh, Nathan O Hodas, and Abhinav Vishnu. Deep learning for computational chemistry. Journal of Computational Chemistry, 38(16):1291–1307, 2017.
|
| 128 |
+
[7] Travers Ching, Daniel S Himmelstein, Brett K Beaulieu-Jones, Alexandr A Kalinin, Brian T Do, Gregory P Way, Enrico Ferrero, Paul-Michael Agapow, Michael Zietz, Michael M Hoffman, et al. Opportunities and obstacles for deep learning in biology and medicine. Journal of The Royal Society Interface, 15(141): 20170387, 2018.
|
| 129 |
+
[8] Dan Guest, Kyle Cranmer, and Daniel Whiteson. Deep learning and its application to LHC physics. Annual Review of Nuclear and Particle Science, 68:161–181, 2018.
|
| 130 |
+
[9] Andrew W Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Žídek, Alexander WR Nelson, Alex Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792):706–710, 2020.
|
| 131 |
+
[10] 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.
|
| 132 |
+
[11] Jason Jo and Yoshua Bengio. Measuring the tendency of cnns to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017.
|
| 133 |
+
[12] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision, pages 456–473, 2018.
|
| 134 |
+
[13] Timothy Niven and Hung-Yu Kao. Probing neural network comprehension of natural language arguments. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4658–4664, 2019.
|
| 135 |
+
[14] Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2:665–673, 2020.
|
| 136 |
+
[15] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019.
|
| 137 |
+
[16] Haohan Wang, Songwei Ge, Eric P Xing, and Zachary C Lipton. Learning robust global representations by penalizing local predictive power. arXiv preprint arXiv:1905.13549, 2019.
|
| 138 |
+
[17] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019.
|
| 139 |
+
[18] Michael A Alcorn, Qi Li, Zhitao Gong, Chengfei Wang, Long Mai, Wei-Shinn Ku, and Anh Nguyen. Strike (with) a pose: Neural networks are easily fooled by strange poses of familiar objects. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 140 |
+
[19] Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
|
| 141 |
+
[20] Andrei Barbu, David Mayo, Julian Alverio, William Luo, Christopher Wang, Dan Gutfreund, Josh Tenenbaum, and Boris Katz. ObjectNet: a large-scale bias-controlled dataset for pushing the limits of object recognition models. In Advances in Neural Information Processing Systems, pages 9448–9458, 2019.
|
| 142 |
+
[21] Claudio Michaelis, Benjamin Mitzkus, Robert Geirhos, Evgenia Rusak, Oliver Bringmann, Alexander S Ecker, Matthias Bethge, and Wieland Brendel. Benchmarking robustness in object detection: Autonomous driving when winter is coming. arXiv:1907.07484, 2019.
|
| 143 |
+
[22] Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. Measuring robustness to natural distribution shifts in image classification. In Advances in Neural Information Processing Systems, 2020.
|
| 144 |
+
[23] Josip Djolonga, Jessica Yung, Michael Tschannen, Rob Romijnders, Lucas Beyer, Alexander Kolesnikov, Joan Puigcerver, Matthias Minderer, Alexander D’Amour, Dan Moldovan, et al. On robustness and transferability of convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 16458–16468, 2021.
|
| 145 |
+
[24] Isaac Dunn, Hadrien Pouget, Daniel Kroening, and Tom Melham. Exposing previously undetectable faults in deep neural networks. arXiv preprint arXiv:2106.00576, 2021.
|
| 146 |
+
[25] Yue He, Zheyan Shen, and Peng Cui. Towards non-iid image classification: A dataset and baselines. Pattern Recognition, 110:107383, 2021.
|
| 147 |
+
[26] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8340–8349, 2021.
|
| 148 |
+
[27] Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 15262–15271, 2021.
|
| 149 |
+
[28] Spandan Madan, Tomotake Sasaki, Tzu-Mao Li, Xavier Boix, and Hanspeter Pfister. Small in-distribution changes in 3D perspective and lighting fool both CNNs and transformers. arXiv preprint arXiv:2106.16198, 2021.
|
| 150 |
+
[29] Vaishaal Shankar, Achal Dave, Rebecca Roelofs, Deva Ramanan, Benjamin Recht, and Ludwig Schmidt. Do image classifiers generalize across time? In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9661–9669, 2021.
|
| 151 |
+
[30] David M. Green. Consistency of auditory detection judgments. Psychological Review, 71(5):392–407, 1964.
|
| 152 |
+
[31] Kristof Meding, Dominik Janzing, Bernhard Schölkopf, and Felix A. Wichmann. Perceiving the arrow of time in autoregressive motion. Advances in Neural Information Processing Systems (NeurIPS), 32: 2303–2314, 2019.
|
| 153 |
+
[32] Robert Geirhos, Kristof Meding, and Felix A Wichmann. Beyond accuracy: quantifying trial-by-trial behaviour of CNNs and humans by measuring error consistency. Advances in Neural Information Processing Systems, 33, 2020.
|
| 154 |
+
[33] Robert Geirhos, Carlos RM Temme, Jonas Rauber, Heiko H Schütt, Matthias Bethge, and Felix A Wichmann. Generalisation in humans and deep neural networks. In Advances in Neural Information Processing Systems, 2018.
|
| 155 |
+
[34] George A Miller. WordNet: a lexical database for English. Communications of the ACM, 38(11):39–41, 1995.
|
| 156 |
+
[35] Philip L Smith and Daniel R Little. Small is beautiful: In defense of the small-N design. Psychonomic Bulletin & Review, 25(6):2083–2101, 2018.
|
| 157 |
+
[36] Siavash Haghiri, Patricia Rubisch, Robert Geirhos, Felix Wichmann, and Ulrike von Luxburg. Comparisonbased framework for psychophysics: lab versus crowdsourcing. arXiv preprint arXiv:1905.07234, 2019.
|
| 158 |
+
[37] Sébastien Marcel and Yann Rodriguez. Torchvision the machine-vision package of torch. In Proceedings of the 18th ACM International Conference on Multimedia, pages 1485–1488, 2010.
|
| 159 |
+
[38] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3733–3742, 2018.
|
| 160 |
+
[39] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9729–9738, 2020.
|
| 161 |
+
[40] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020.
|
| 162 |
+
[41] Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6707–6717, 2020.
|
| 163 |
+
[42] Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020.
|
| 164 |
+
[43] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020.
|
| 165 |
+
[44] Robert Geirhos, Kantharaju Narayanappa, Benjamin Mitzkus, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. On the surprising similarities between supervised and self-supervised models. arXiv preprint arXiv:2010.08377, 2020.
|
| 166 |
+
[45] Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (BiT): General visual representation learning. arXiv preprint arXiv:1912.11370, 6 (2):8, 2019.
|
| 167 |
+
[46] Hadi Salman, Andrew Ilyas, Logan Engstrom, Ashish Kapoor, and Aleksander Madry. Do adversarially robust ImageNet models transfer better? arXiv preprint arXiv:2007.08489, 2020.
|
| 168 |
+
[47] 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 preprint arXiv:2010.11929, 2020.
|
| 169 |
+
[48] Ross Wightman. PyTorch image models. https://github.com/rwightman/ pytorch-image-models, 2019.
|
| 170 |
+
[49] I Zeki Yalniz, Hervé Jégou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi-supervised learning for image classification. arXiv preprint arXiv:1905.00546, 2019.
|
| 171 |
+
[50] Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves ImageNet classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10687–10698, 2020.
|
| 172 |
+
[51] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
|
| 173 |
+
[52] Jacob Cohen. A coefficient of agreement for nominal scales. Educational and Psychological Measurement, 20(1):37–46, 1960.
|
| 174 |
+
[53] Samuel Dodge and Lina Karam. A study and comparison of human and deep learning recognition performance under visual distortions. In 26th International Conference on Computer Communication and Networks, pages 1–7. IEEE, 2017.
|
| 175 |
+
[54] Felix A Wichmann, David HJ Janssen, Robert Geirhos, Guillermo Aguilar, Heiko H Schütt, Marianne Maertens, and Matthias Bethge. Methods and measurements to compare men against machines. Electronic Imaging, Human Vision and Electronic Imaging, 2017(14):36–45, 2017.
|
| 176 |
+
[55] Thomas Serre. Deep learning: the good, the bad, and the ugly. Annual Review of Vision Science, 5:399–426, 2019.
|
| 177 |
+
[56] Yann LeCun. Predictive learning, 2016. URL https://www.youtube.com/watch?v=Ount2Y4qxQo.
|
| 178 |
+
[57] William Lotter, Gabriel Kreiman, and David Cox. A neural network trained for prediction mimics diverse features of biological neurons and perception. Nature Machine Intelligence, 2(4):210–219, 2020.
|
| 179 |
+
[58] A Emin Orhan, Vaibhav V Gupta, and Brenden M Lake. Self-supervised learning through the eyes of a child. arXiv preprint arXiv:2007.16189, 2020.
|
| 180 |
+
[59] Talia Konkle and George A Alvarez. Instance-level contrastive learning yields human brain-like representation without category-supervision. bioRxiv, 2020.
|
| 181 |
+
[60] Chengxu Zhuang, Siming Yan, Aran Nayebi, Martin Schrimpf, Michael Frank, James DiCarlo, and Daniel Yamins. Unsupervised neural network models of the ventral visual stream. bioRxiv, 2020.
|
| 182 |
+
[61] Katherine R Storrs, Barton L Anderson, and Roland W Fleming. Unsupervised learning predicts human perception and misperception of gloss. Nature Human Behaviour, pages 1–16, 2021.
|
| 183 |
+
[62] Katherine Hermann, Ting Chen, and Simon Kornblith. The origins and prevalence of texture bias in convolutional neural networks. Advances in Neural Information Processing Systems, 33, 2020.
|
| 184 |
+
[63] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 185 |
+
[64] Ruitong Huang, Bing Xu, Dale Schuurmans, and Csaba Szepesvári. Learning with a strong adversary. arXiv preprint arXiv:1511.03034, 2015.
|
| 186 |
+
[65] Simran Kaur, Jeremy Cohen, and Zachary C Lipton. Are perceptually-aligned gradients a general property of robust classifiers? arXiv preprint arXiv:1910.08640, 2019.
|
| 187 |
+
[66] Shibani Santurkar, Dimitris Tsipras, Brandon Tran, Andrew Ilyas, Logan Engstrom, and Aleksander Madry. Image synthesis with a single (robust) classifier. arXiv:1906.09453, 2019.
|
| 188 |
+
[67] Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Brandon Tran, and Aleksander Madry. Adversarial robustness as a prior for learned representations. arXiv preprint arXiv:1906.00945, 2019.
|
| 189 |
+
[68] Florian Tramèr, Jens Behrmann, Nicholas Carlini, Nicolas Papernot, and Jörn-Henrik Jacobsen. Fundamental tradeoffs between invariance and sensitivity to adversarial perturbations. In International Conference on Machine Learning, pages 9561–9571. PMLR, 2020.
|
| 190 |
+
[69] Tianyuan Zhang and Zhanxing Zhu. Interpreting adversarially trained convolutional neural networks. In International Conference on Machine Learning, pages 7502–7511. PMLR, 2019.
|
| 191 |
+
[70] Peijie Chen, Chirag Agarwal, and Anh Nguyen. The shape and simplicity biases of adversarially robust ImageNet-trained CNNs. arXiv preprint arXiv:2006.09373, 2020.
|
| 192 |
+
[71] Kai Han, Yunhe Wang, Hanting Chen, Xinghao Chen, Jianyuan Guo, Zhenhua Liu, Yehui Tang, An Xiao, Chunjing Xu, Yixing Xu, et al. A survey on visual transformer. arXiv preprint arXiv:2012.12556, 2020.
|
| 193 |
+
[72] Muzammal Naseer, Kanchana Ranasinghe, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Ming-Hsuan Yang. Intriguing properties of vision transformers. arXiv preprint arXiv:2105.10497, 2021.
|
| 194 |
+
[73] Shikhar Tuli, Ishita Dasgupta, Erin Grant, and Thomas L Griffiths. Are convolutional neural networks or transformers more like human vision? arXiv preprint arXiv:2105.07197, 2021.
|
| 195 |
+
[74] Curtis G Northcutt, Anish Athalye, and Jonas Mueller. Pervasive label errors in test sets destabilize machine learning benchmarks. arXiv preprint arXiv:2103.14749, 2021.
|
| 196 |
+
[75] Rishi Rajalingham, Elias B Issa, Pouya Bashivan, Kohitij Kar, Kailyn Schmidt, and James J DiCarlo. Large-scale, high-resolution comparison of the core visual object recognition behavior of humans, monkeys, and state-of-the-art deep artificial neural networks. Journal of Neuroscience, 38(33):7255–7269, 2018.
|
| 197 |
+
[76] Horia Mania, John Miller, Ludwig Schmidt, Moritz Hardt, and Benjamin Recht. Model similarity mitigates test set overuse. Advances in Neural Information Processing Systems, 2019.
|
| 198 |
+
[77] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv:1312.6199, 2013.
|
| 199 |
+
[78] Florian Tramèr, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space of transferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017.
|
| 200 |
+
[79] Wieland Brendel and Matthias Bethge. Approximating CNNs with bag-of-local-features models works surprisingly well on ImageNet. In International Conference on Learning Representations, 2019.
|
| 201 |
+
[80] Kristof Meding, Luca M Schulze Buschoff, Robert Geirhos, and Felix A Wichmann. Trivial or impossible–dichotomous data difficulty masks model differences (on ImageNet and beyond). arXiv preprint arXiv:2110.05922, 2021.
|
| 202 |
+
[81] Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. arXiv preprint arXiv:1705.08475, 2017.
|
| 203 |
+
[82] Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. arXiv preprint arXiv:1706.00038, 2017.
|
| 204 |
+
[83] James J DiCarlo, Davide Zoccolan, and Nicole C Rust. How does the brain solve visual object recognition? Neuron, 73(3):415–434, 2012.
|
| 205 |
+
[84] Daniel LK Yamins, Ha Hong, Charles F Cadieu, Ethan A Solomon, Darren Seibert, and James J DiCarlo. Performance-optimized hierarchical models predict neural responses in higher visual cortex. Proceedings of the National Academy of Sciences, 111(23):8619–8624, 2014.
|
| 206 |
+
[85] Jonas Kubilius, Martin Schrimpf, Kohitij Kar, Rishi Rajalingham, Ha Hong, Najib Majaj, Elias Issa, Pouya Bashivan, Jonathan Prescott-Roy, Kailyn Schmidt, et al. Brain-like object recognition with high-performing shallow recurrent ANNs. Advances in Neural Information Processing Systems, 32:12805–12816, 2019.
|
| 207 |
+
[86] Been Kim, Emily Reif, Martin Wattenberg, Samy Bengio, and Michael C Mozer. Neural networks trained on natural scenes exhibit Gestalt closure. Computational Brain & Behavior, pages 1–13, 2021.
|
| 208 |
+
[87] Martin N Hebart, Charles Y Zheng, Francisco Pereira, and Chris I Baker. Revealing the multidimensional mental representations of natural objects underlying human similarity judgements. Nature Human Behaviour, 4(11):1173–1185, 2020.
|
| 209 |
+
[88] Nikolaus Kriegeskorte. Deep neural networks: a new framework for modeling biological vision and brain information processing. Annual Review of Vision Science, 1:417–446, 2015.
|
| 210 |
+
[89] Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. Behavioral and Brain Sciences, 40, 2017.
|
| 211 |
+
[90] Amirhossein Tavanaei, Masoud Ghodrati, Saeed Reza Kheradpisheh, Timothée Masquelier, and Anthony Maida. Deep learning in spiking neural networks. Neural Networks, 111:47–63, 2019.
|
| 212 |
+
[91] Fabian H Sinz, Xaq Pitkow, Jacob Reimer, Matthias Bethge, and Andreas S Tolias. Engineering a less artificial intelligence. Neuron, 103(6):967–979, 2019.
|
| 213 |
+
[92] Joel Dapello, Tiago Marques, Martin Schrimpf, Franziska Geiger, David D Cox, and James J DiCarlo. Simulating a primary visual cortex at the front of CNNs improves robustness to image perturbations. bioRxiv, 2020.
|
| 214 |
+
[93] Benjamin D Evans, Gaurav Malhotra, and Jeffrey S Bowers. Biological convolutions improve dnn robustness to noise and generalisation. bioRxiv, 2021.
|
| 215 |
+
[94] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, pages 8026–8037, 2019.
|
| 216 |
+
[95] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv:1807.03748, 2018.
|
| 217 |
+
[96] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: a large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255, 2009.
|
| 218 |
+
[97] Evgenia Rusak, Steffen Schneider, Peter Gehler, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Adapting ImageNet-scale models to complex distribution shifts with self-learning. arXiv preprint arXiv:2104.12928, 2021.
|
| 219 |
+
[98] Eleanor Rosch. Principles of categorization. In E. Margolis and S. Laurence, editors, Concepts: core readings, pages 189–206. 1999.
|
md/train/QmxFsofRvW9/QmxFsofRvW9.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Unsupervised Speech Recognition
|
| 2 |
+
|
| 3 |
+
Alexei Baevski4 Wei-Ning Hsu4 Alexis Conneau∗ Michael Auli4
|
| 4 |
+
|
| 5 |
+
4 Facebook AI Google AI
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Despite rapid progress in the recent past, current speech recognition systems still require labeled training data which limits this technology to a small fraction of the languages spoken around the globe. This paper describes wav2vec-U, short for wav2vec Unsupervised, a method to train speech recognition models without any labeled data. We leverage self-supervised speech representations to segment unlabeled audio and learn a mapping from these representations to phonemes via adversarial training. The right representations are key to the success of our method. Compared to the best previous unsupervised work, wav2vec-U reduces the phone error rate on the TIMIT benchmark from 26.1 to 11.3. On the larger English Librispeech benchmark, wav2vec-U achieves a word error rate of 5.9 on test-other, rivaling some of the best published systems trained on 960 hours of labeled data from only two years ago. We also experiment on nine other languages, including low-resource languages such as Kyrgyz, Swahili and Tatar. The code is available at https://github.com/pytorch/fairseq/tree/ master/examples/wav2vec/unsupervised
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Speech recognition performance on the much studied English Librispeech benchmark [Panayotov et al., 2015] has seen rapid improvement over the last few years due to advances in model architectures [Dong et al., 2018, Synnaeve et al., 2020, Gulati et al., 2020], semi-supervised learning [Xu et al., 2020b, Park et al., 2020] and self-supervised learning [van den Oord et al., 2018, Chung and Glass, 2018, Chung et al., 2019b, Baevski et al., 2020c]. However, all of these techniques require transcribed speech data which is not available for the vast majority of the nearly 7,000 languages of the world [Lewis et al., 2016]. As a result, speech recognition technology is only available for about 125 different languages [Google, 2021]. On the other hand, humans learn a lot about speech simply by listening to others around them and without explicit supervision [Werker and Tees, 1984, Hirsh-Pasek et al., 1987, Polka and Werker, 1994, Jusczyk et al., 1999, Johnson and Jusczyk, 2001].
|
| 14 |
+
|
| 15 |
+
Unsupervised learning has been very successful in machine translation resulting in systems that obtain remarkable accuracy given no labeled training data at all [Conneau et al., 2018, Lample et al., 2018, Artetxe et al., 2018]. Inspired by this, there has been some work on unsupervised speech recognition based on learning to align unlabeled text and audio [Yeh et al., 2019] or adversarial learning [Liu et al., 2018, Chen et al., 2019]. These approaches showed promising initial results but their error rates are still high, with evaluation being limited to the small-scale and clean TIMIT benchmark.
|
| 16 |
+
|
| 17 |
+
In this work, we introduce a framework for unsupervised learning of speech recognition models. Wav2vec-U, or wav2vec Unsupervised, leverages self-supervised representations from wav2vec 2.0 [Baevski et al., 2020c] to embed the speech audio and to segment the audio into units with a simple $\mathrm { k }$ -means clustering method (see Figure 1 for an illustration of our approach). We find that the quality of the audio representations is key to the success of unsupervised speech recognition. Similar to Liu et al. [2018] and Chen et al. [2019], we learn a mapping between segments and phonemes using adversarial training but different to their work, we also enable the algorithm to label segments as silences. We also introduce an unsupervised cross-validation metric to enable model development without labeled development data. Our unsupervised speech recognition model, the generator, is very lightweight: it consists of a single temporal convolution comprising only about 90k parameters to which we input frozen wav2vec 2.0 representations.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Illustration of wav2vec Unsupervised: we learn self-supervised representations with wav2vec 2.0 on unlabeled speech audio (Step 1), identify clusters in the representations with $\mathbf { k }$ -means (Step 2) to segment the audio (Step 3). Next, we build segment representations by mean pooling the wav2vec 2.0 representations, performing PCA and a second mean pooling step between adjacent segments (Step 4). This is input to the generator which outputs a phoneme sequence (Step 5) fed to the discriminator, similar to phonemized unlabeled text (Step 6), for adversarial training (Step 7).
|
| 21 |
+
|
| 22 |
+
Experimental results demonstrate the viability of the framework for a variety of settings and languages. wav2vec-U improves the phone error rate (PER) on the small-scale TIMIT benchmark from 26.1 to 11.3 compared to the next best known unsupervised approach. To get a better sense of the performance compared to the best supervised methods, we measure performance on the larger Librispeech benchmark where our method achieves word error rate (WER) 5.9 on test-other. We also evaluate on six other European languages of the multilingual Librispeech benchmark [Pratap et al., 2020] and on three non-European low-resource languages.
|
| 23 |
+
|
| 24 |
+
# 2 Speech and Text Representations
|
| 25 |
+
|
| 26 |
+
Next, we describe how we build suitable speech and text representations for unsupervised learning.
|
| 27 |
+
Good representations are essential to learning a mapping from speech to text without supervision.
|
| 28 |
+
|
| 29 |
+
# 2.1 Self-supervised Learning of Speech Audio Representations
|
| 30 |
+
|
| 31 |
+
In the first step, we learn representations of the speech audio signal using self-supervised learning. There has been a lot of recent work in this direction which has shown strong performance in extremely low-labeled data setups across a range of languages [Conneau et al., 2020] and tasks [Fan et al., 2021, Pepino et al., 2021, Wang et al., 2021].
|
| 32 |
+
|
| 33 |
+
Wav2vec 2.0 consists of a convolutional feature encoder $f : \mathcal X \mapsto \mathcal Z$ that maps a raw audio sequence $X$ to latent speech representations $z _ { 1 } , \dots , z _ { T }$ , which a Transformer $g : { \mathcal { Z } } \mapsto { \mathcal { C } }$ then turns into context representations $c _ { 1 } , \ldots , c _ { T }$ [Baevski et al., 2020b,a]. Each $z _ { t }$ represents about $2 5 \mathrm { m s }$ of audio strided by $2 0 \mathrm { m s }$ and the Transformer architecture follows BERT [Vaswani et al., 2017, Devlin et al., 2019]. During training, latent representations are discretized to $q _ { 1 } , \ldots , q _ { T }$ with a quantization module ${ \mathcal { Z } } \mapsto { \mathcal { Q } }$ to represent the targets in the objective. Quantization uses a Gumbel softmax to choose entries from two codebooks [Jegou et al., 2011, Jang et al., 2016, Baevski et al., 2020b].
|
| 34 |
+
|
| 35 |
+
In our experiments, we use the publicly available English model pre-trained on $5 3 \mathrm { k }$ hours of LibriLight [Kahn et al., 2020b] as well as XLSR-53 which was pre-trained on nearly 60k hours of speech audio in 53 languages [Conneau et al., 2020].
|
| 36 |
+
|
| 37 |
+
# 2.2 Pre-processing and Embedding the Audio Data
|
| 38 |
+
|
| 39 |
+
Removing Silences. Most datasets we use for our experiments have audio data with silences. However, these parts of the audio do not correspond to any transcription and we therefore remove silences as much as possible. We apply rVAD, an unsupervised voice activity detection (VAD) model which determines the segments in the audio data corresponding to silences, and we remove these sections [Tan et al., 2020]. We ablate this choice in Appendix C.
|
| 40 |
+
|
| 41 |
+
Speech Audio Representations. After silence removal, we embed the unlabeled speech audio with wav2vec 2.0 to obtain speech representations. Specifically, we use the representations of the context Transformer network $c _ { 1 } , \ldots , c _ { T }$ $( \ S 2 . 1 )$ . The context network contains 24 Transformer blocks and we denote the output of block $l$ at time-step $t$ as $c _ { t } ^ { l }$ . Our goal is to learn a model which can map from audio representations $c _ { t } ^ { l }$ to phonemes using no supervision. However, the representations of the uppermost block of wav2vec 2.0 may not be well suited for this task. These features are trained to directly predict masked latent representations spanning $2 5 \mathrm { m s }$ of speech audio which is much shorter than the typical duration of a phoneme.
|
| 42 |
+
|
| 43 |
+
To get a better sense of this, we train supervised phoneme recognizers with a CTC loss [Graves et al., 2006] on top of the frozen representations of each of the 24 blocks of the English wav2vec 2.0 LARGE model pre-trained on Libri-Light. We then evaluate phone error rate (PER) with respect to the phonemized transcriptions of Librispeech dev-other. The classifier takes as input $c _ { t } ^ { l }$ and contains a single softmax-normalized linear layer mapping to the phoneme inventory. Figure 2 shows that most of the first ten blocks as well as the final blocks provide very poor performance, while blocks 15-19 provide error rates below $9 \%$ PER. Block 15 achieves the best error rate of $7 . 5 \%$ PER. A similar insight has been used in the concurrent work of Hsu et al. [2021b]. Appendix A shows that this choice generalizes to other languages. For brevity we drop the superscript $l$ and refer to block 15 representations simply as $c _ { 1 } , \ldots , c _ { T }$ .
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 2: Supervised phoneme recognition using representations from different wav2vec 2.0 blocks on dev-other of English Librispeech. Low and high blocks do not provide good features, while as blocks 14-19 do. Block 15 performs best.
|
| 47 |
+
|
| 48 |
+
# 2.3 Segmenting the Audio Signal
|
| 49 |
+
|
| 50 |
+
Once the speech signal is embedded, we identify segments corresponding to meaningful units that can be mapped to phonemes. Segmentation has been shown to be crucial in prior work [Chung et al., 2018] since the right boundaries in the input representations make it more aligned to phonetic sequences. There has been a lot of prior work in unsupervised speech segmentation [Kamper et al., 2017a,b, Rasanen et al., 2015, Kreuk et al., 2020] but here we simply use a method based on clustering the wav2vec 2.0 speech representations $c _ { 1 } , \ldots , c _ { T }$ . In a first step, we collect all the speech representations for the unlabeled speech data and perform k-means clustering to identify $K = 1 2 8$ clusters. We use the FAISS library to do fast clustering on GPUs [Johnson et al., 2019]. Next, each $c _ { t }$ is labeled with the corresponding cluster ID $i _ { t } \in \{ 1 , \ldots , K \}$ and we introduce speech segment boundaries whenever the cluster ID changes.
|
| 51 |
+
|
| 52 |
+
Once the speech audio representations are segmented, we compute a 512-dimensional PCA over all speech representations output by wav2vec 2.0 for the training set. Next, we mean-pool the PCA representations for a particular segment to obtain an average representation of the segment. The PCA retains only the most important features and we found this to be effective. Segment boundaries are noisy due to the lack of supervision and we therefore found it useful to also mean-pool pairs of adjacent segment representations to increase robustness. This results in sequences of speech segment representation $S = s _ { 1 } , \ldots , s _ { T } , S \sim { \mathcal { S } }$ for a given utterance. Appendix B shows an illustration of the segmentation strategy on an actual example as well as a quantitative evaluation of the strategy compared to human segmented data.
|
| 53 |
+
|
| 54 |
+
# 2.4 Pre-processing the Text Data
|
| 55 |
+
|
| 56 |
+
Similar to how we segment the unlabeled speech audio data into suitable units for unsupervised learning, we do the same for the unlabeled text data. We apply two pre-processing steps to the text data: phonemization and silence token insertion.
|
| 57 |
+
|
| 58 |
+
Phonemes characterize the different sounds which distinguish words from each other, e.g., for the word cat there are three phonemes corresponding to the three distinct sounds in the pronunciation of the word: /K/, /AE/, $/ \mathrm { T } / .$ . We phonemize the text data because we found it easier to learn a mapping between speech audio and the different sounds of a word rather than between audio and words or letters. Phonemization converts a sequence of words $Y$ into a sequence of phonemes $P = [ p _ { 1 } , \cdots , p _ { M } ]$ , where $p _ { m } \in O$ and $O$ is the phoneme inventory. We use off-the-shelf tools for this step which we detail in Appendix $\ S \operatorname { E } . 2$ .
|
| 59 |
+
|
| 60 |
+
The unlabeled speech audio data is pre-processed by applying unsupervised silence removal. However, this process is not always accurate and many silences in the speech audio remain. To deal with this, we enable the unsupervised model to label some segments with a phonemic silence token (SIL; $\ S \ 3 . 1 \AA .$ ). However, the phonemized unlabeled text data does not contain any silence tokens and this may pose difficulties for adversarial learning $( \ S 3 )$ . We remedy this by inserting silence markers at the beginning and end of the phonemized unlabeled text data; we also randomly insert SIL between words, or groups of phonemes corresponding to words at a rate of $2 5 \%$ . Appendix C evaluates these choices.
|
| 61 |
+
|
| 62 |
+
# 3 Unsupervised Learning
|
| 63 |
+
|
| 64 |
+
We use adversarial training to train an unsupervised speech recognition model using the representations of the unlabeled speech audio data and the unlabeled phonemized text data [Liu et al., 2018, Chen et al., 2019]. In the following, we detail the model architecture, the training objective as well as the unsupervised cross-validation metric we developed.
|
| 65 |
+
|
| 66 |
+
# 3.1 Model Architecture
|
| 67 |
+
|
| 68 |
+
Generative adversarial networks (GAN; Goodfellow et al. 2014) train a generator network $\mathcal { G }$ and a discriminator/critic network $\mathcal { C }$ where the generator produces samples which are then judged by the discriminator. The discriminator is trained to classify whether samples are from the generator or from the real data distribution. The objective of the generator is to produce samples that are indistinguishable by the discriminator.
|
| 69 |
+
|
| 70 |
+
Concretely, $\mathcal { G }$ takes as input a sequence of $T$ segment representations $S = [ s _ { 1 } , \dotsc , s _ { T } ]$ (§ 2.3) which are then mapped to a sequence of $M$ phonemes $\mathcal { G } ( S ) \bar { = } [ p _ { 1 } , \dotsc , p _ { M } ]$ . The generator predicts a distribution over the phoneme set $O$ for each segment and outputs the phoneme with the highest probability. If the argmax prediction of consecutive segments result in the same phoneme, then we sample one of these segments, therefore $M \leq T$ .
|
| 71 |
+
|
| 72 |
+
The phoneme set $O$ includes a silence label SIL to enable labeling silences in the speech audio as such. Without a silence label, we noticed that the model was repurposing a particular phoneme to label silences which resulted in much lower performance since it interfered with subsequent language model (LM) decoding. In the backward pass, we back-propagate through segments sampled at the generator output. We do not modify the segment representations $S$ during unsupervised training. The generator is parameterized as a single layer convolutional neural network (CNN).
|
| 73 |
+
|
| 74 |
+
The discriminator takes as input either a sequence $P ^ { r } \sim \mathcal { P } ^ { r }$ of one-hot vectors denoting phonemized text from the real data distribution ${ \mathcal { P } } ^ { r }$ or a sequence of output distributions from the generator $\mathcal { G } ( S )$ . Each input vector has $| O |$ dimensions to represent the distribution over phonemes for each segment. The discriminator is also a CNN which outputs a probability indicating how likely the sample is to be from the data distribution.
|
| 75 |
+
|
| 76 |
+
# 3.2 Objective
|
| 77 |
+
|
| 78 |
+
In our setup we use the original GAN objective with a gradient penalty [Goodfellow et al., 2014, Arjovsky et al., 2017], a segment smoothness penalty and a phoneme diversity penalty:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\operatorname* { m i n } _ { \mathcal { G } } \operatorname* { m a x } _ { \mathcal { C } } \quad \mathbb { E } _ { \mathcal { P } ^ { r } \sim \mathcal { P } ^ { r } } \left[ \log \mathcal { C } ( \boldsymbol { P } ^ { r } ) \right] - \underset { S \sim \mathcal { S } } { \mathbb { E } } \left[ \log \left( 1 - \mathcal { C } ( \mathcal { G } ( S ) ) \right) \right] - \lambda \mathcal { L } _ { g p } + \gamma \mathcal { L } _ { s p } + \eta \mathcal { L } _ { p d }
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $P ^ { r } \sim \mathcal { P } ^ { r }$ is phonemized unlabeled text, $\mathcal { G } ( S )$ is the transcription output by the generator of input segment representations $S$ for some unlabeled speech audio. The first term trains the discriminator to assign high probability to real transcriptions, the second term encourages the discriminator to assign low probability to generator outputs, $\mathcal { L } _ { g p }$ is a gradient penalty, $\mathcal { L } _ { s p }$ is a smoothness penalty and $\mathcal { L } _ { p d }$ is a phoneme diversity loss which we detail next. During training we alternate updates for the discriminator and the generator. We also alternate batches of predicted transcriptions from the generator and phonemized unlabeled text.
|
| 85 |
+
|
| 86 |
+
Gradient penalty. To stabilize training, we penalize the gradient norm of the discriminator with respect to the input [Gulrajani et al., 2017]. The penalty is computed for random samples $\tilde { P } \sim \tilde { \mathcal { P } }$ which are a linear combination of the activations of pairs of real and fake samples.2
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { L } _ { g p } = \underset { \tilde { P } \sim \tilde { \mathcal { P } } } { \mathbb { E } } \left[ \left( \| \nabla \mathcal { C } ( \tilde { P } ) \| - 1 \right) ^ { 2 } \right]
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Segment smoothness penalty. The $\mathbf { k }$ -means segmentation of the speech audio is more granular than a typical phonemized transcription and neighboring representations are highly correlated. We therefore found it useful to add a penalty which encourages the generator to produce similar outputs for adjacent segments where $p _ { t } \in \mathbb { R } ^ { | O | }$ :
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathcal { L } _ { s p } = \sum _ { ( p _ { t } , p _ { t + 1 } ) \in \mathcal { G } ( S ) } \| p _ { t } - p _ { t + 1 } \| ^ { 2 }
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Phoneme diversity loss. We also found it helpful to penalize low usage of the phoneme vocabulary by the generator on the batch level. In particular, we maximize the entropy of the averaged softmax distribution $H _ { \mathcal { G } } ( \mathcal { G } ( S ) )$ of the generator over the phoneme vocabulary across a batch $B$ of utterances:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\mathcal { L } _ { p d } = \frac { 1 } { | B | } \sum _ { S \in B } - H _ { \mathcal { G } } ( \mathcal { G } ( S ) )
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
# 3.3 Unsupervised Cross-Validation Metric
|
| 105 |
+
|
| 106 |
+
Our goal is to build speech recognition models without any supervision. To this end, we developed a cross-validation metric which does not require labeled data. We use the metric for early stopping, selecting a random seed, and hyper-parameter selection $( \lambda , \gamma , \eta )$ .
|
| 107 |
+
|
| 108 |
+
We consider two quantities in our metric: LM negative log-likelihood (NLL) and vocabulary usage. LM-NLL serves as an indicator of fluency for a given transcription and it is measured with a language model $p _ { L M }$ trained on phonemized text data $( \ S ~ 2 . 4 )$ . Vocabulary usage is the proportion of the phoneme vocabulary being output by the model via Viterbi decoding. Measuring vocabulary usage identifies degenerate models which output fluent but trivial transcriptions.
|
| 109 |
+
|
| 110 |
+
We deaudio rbias criptions for a given generator configuration . LM-NLL is measured in the standard way o $\mathcal { G }$ and unlabeled speechr the phonemized tran$\{ X _ { j } \} _ { j = 1 } ^ { N _ { s } }$ $\mathbf { \bar { \mathcal { P } } } = \{ P _ { j } \} _ { j = 1 } ^ { N _ { s } }$ scriptions: $\begin{array} { r } { N L L _ { L M } ( \mathcal { P } ) = \frac { 1 } { N _ { s } } \sum _ { j = 1 } ^ { N _ { s } } N L L _ { L M } ( P _ { j } ) } \end{array}$ where $\begin{array} { r } { N L L _ { L M } ( P ) = - \frac { 1 } { M } \sum _ { t = 1 } ^ { M } \log p _ { L M } ( p _ { t } ) } \end{array}$ using $p _ { L M } ( p _ { t } )$ as shorthand for $p _ { L M } ( p _ { t } | p _ { t - 1 } , . . . , p _ { 1 } )$ .3 On the other hand, we use $U ( { \mathcal { P } } ) =$ $\begin{array} { r } { \frac { 1 } { | O | } \bar { \sum _ { o \in O } } [ o \in \mathcal { P } ] \in [ 0 , 1 ] } \end{array}$ to denote the vocabulary usage of $\mathcal { P }$ .
|
| 111 |
+
|
| 112 |
+
In a first step, we generate phoneme transcriptions for different training checkpoints or hyperparameter settings and denote the transcriptions of the configuration with the lowest vocabulary-usage adjusted NLL as $\begin{array} { r } { \hat { \mathcal { P } } = \arg \operatorname* { m i n } _ { \mathcal { P } } N L L _ { L M } ( \mathcal { P } ) - \log U ( \mathcal { P } ) } \end{array}$ .4 Next, we discard model configurations which do not satisfy the following using $\hat { \mathcal { P } }$ as the anchor:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
N L L _ { L M } ( \mathcal { P } ) < N L L _ { L M } ( \hat { \mathcal { P } } ) + \log \left( \frac { U ( \mathcal { P } ) } { U ( \hat { \mathcal { P } } ) } \right) + \log 1 . 2
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
The second term on the right hand side introduces a margin over the NLL of the anchor transcription $N L L _ { L M } ( \hat { \mathcal { P } } )$ based on the vocabulary usage of $\mathcal { P }$ and $\hat { \mathcal { P } }$ : If $U ( \hat { \mathcal { P } } )$ is much lower compared to $U ( \mathcal { P } )$ , then we allow model configurations which produce transcriptions with higher NLL compared to $\hat { \mathcal { P } }$ . However, if $U ( \hat { \mathcal { P } } )$ is a lot higher than $U ( \mathcal { P } )$ , then the model configuration will not satisfy the constraint. The $\log 1 . 2$ factor serves as another margin allowing checkpoints with slightly worse vocabulary-usage adjusted NLL to be included.
|
| 119 |
+
|
| 120 |
+
In a final step, we take into account the length of the transcriptions: out of the configurations ${ \mathcal { P } } ^ { \prime }$ which satisfy the above constraint, we select the one which has the highest sum of log probability without normalizing the length:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\mathcal { P } ^ { * } = \arg \operatorname* { m a x } _ { \mathcal { P } ^ { \prime } } \sum _ { j = 1 } ^ { N _ { s } } \sum _ { t = 1 } ^ { M } \log p _ { L M } ( p _ { t } ^ { j } ) , M = | P ^ { j } | , P ^ { j } = [ p _ { 1 } ^ { j } , \dots , p _ { M } ^ { j } ]
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
This selects model configurations which produce phoneme sequences that score high under the language model but are not too long. Appendix D compares accuracy when developing with this metric compared to a labeled development set.
|
| 127 |
+
|
| 128 |
+
# 4 Results
|
| 129 |
+
|
| 130 |
+
# 4.1 Comparison to Supervised Speech Recognition on Librispeech
|
| 131 |
+
|
| 132 |
+
We first test our approach on Librispeech to get a sense of how unsupervised speech recognition compares to the best supervised systems trained on a large amount of labeled data. Librispeech is a standard benchmark in the speech recognition community which provides about 960 hours of transcribed read audiobooks. We use the language modeling data of Librispeech as unlabeled text data for unsupervised training. In Appendix G we show that far less unlabeled text and speech audio are sufficient to reach a similar level of performance. We experiment with the frozen representations of a wav2vec 2.0 LARGE model trained on the $5 3 . 2 \mathrm { k }$ hours of Libri-Light (LL-60k) which we denote as wav2vec-U LARGE. We also consider self-training over three iterations by first training an HMM on the labels generated by the GANm then fine-tuning the original wav2vec 2.0 model on the labels of the HMM for Librispeech followed by then fine-tuning on Libri-Light; Appendix F investigates alternatives.
|
| 133 |
+
|
| 134 |
+
wav2vec-U LARGE with self-training (wav2vec- $\mathbf { \partial } . \mathbf { U } + \mathbf { S } \mathbf { T } ,$ ) and a Transformer language model achieves WER 5.9 on test-other, the noisy test set. This shows that unsupervised speech recognition can perform remarkably well compared to the best supervised systems of the recent past on this much studied benchmark. Also, self-training is effective even when the teacher model is unsupervised as per the improvement over GAN training (wav2vec-U). Interestingly, self-training on just Librispeech, or 960 hours of unlabeled speech audio, achieves already very good performance of WER 6.4 on dev-other compared to self-training on all of Libri-Light (53.2k hours) which compares at 6.0 WER. We note that the number of parameters trained during adversarial training is very small: the generator contains only about 90k parameters for a single temporal convolution mapping to the phoneme set from frozen wav2vec 2.0 representations.
|
| 135 |
+
|
| 136 |
+
Table 1: WER on Librispeech dev/test sets when using 960 hours of unlabeled audio from Librispeech (LS-960) or $5 3 . 2 \mathrm { k }$ hours from Libri-Light (LL-60k) using representations from wav2vec 2.0 LARGE. Librispeech provides clean dev/test sets which are less challenging than the other sets. We report results for GAN training only (wav2vec-U) and with subsequent self-training (wav2vec- $\mathbf { \partial } . \mathbf { U } + \mathbf { S } \mathbf { T } ,$ .
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Unlabeled data</td><td rowspan="2">LM</td><td colspan="2">dev</td><td colspan="2">test</td></tr><tr><td>clean</td><td>other</td><td>clean</td><td>other</td></tr><tr><td>960h - Supervised learning</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>DeepSpeech 2 [Amodei et al.,2016]</td><td></td><td>5-gram</td><td></td><td></td><td>5.33</td><td>13.25</td></tr><tr><td>Fully Conv [Zeghidour et al., 2018]</td><td></td><td>ConvLM</td><td>3.08</td><td>9.94</td><td>3.26</td><td>10.47</td></tr><tr><td>TDNN+Kaldi [Xu et al., 2018]</td><td></td><td>4-gram</td><td>2.71</td><td>7.37</td><td>3.12</td><td>7.63</td></tr><tr><td>SpecAugment [Park et al., 2019]</td><td></td><td>RNN</td><td>1</td><td>-</td><td>2.5</td><td>5.8</td></tr><tr><td>ContextNet [Han et al.,2020]</td><td></td><td>LSTM</td><td>1.9</td><td>3.9</td><td>1.9</td><td>4.1</td></tr><tr><td>Conformer [Gulati et al.,2020]</td><td></td><td>LSTM</td><td>2.1</td><td>4.3</td><td>1.9</td><td>3.9</td></tr><tr><td>960h - Self and semi-supervised learning</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Transf.+ PL [Synnaeve et al.,2020]</td><td>LL-60k</td><td>CLM+Transf.</td><td>2.00</td><td>3.65</td><td>2.09</td><td>4.11</td></tr><tr><td>IPL [Xu et al., 2020b]</td><td>LL-60k</td><td>4-gram+Transf.</td><td>1.85</td><td>3.26</td><td>2.10</td><td>4.01</td></tr><tr><td>NST [Park et al., 2020]</td><td>LL-60k</td><td>LSTM</td><td>1.6</td><td>3.4</td><td>1.7</td><td>3.4</td></tr><tr><td>wav2vec 2.0 [Baevski et al.,2020c]</td><td>LL-60k</td><td>Transf.</td><td>1.6</td><td>3.0</td><td>1.8</td><td>3.3</td></tr><tr><td>wav2vec 2.0 + NST [Zhang et al.,2020b]</td><td>LL-60k</td><td>LSTM</td><td>1.3</td><td>2.6</td><td>1.4</td><td>2.6</td></tr><tr><td>Unsupervised learning</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>wav2vec-ULARGE</td><td>LL-60k</td><td>4-gram</td><td>13.3</td><td>15.1</td><td>13.8</td><td>18.0</td></tr><tr><td>wav2vec-ULARGE+ ST</td><td>LL-60k</td><td>4-gram</td><td>3.4</td><td>6.0</td><td>3.8</td><td>6.5</td></tr><tr><td></td><td>LL-60k</td><td>Transf.</td><td>3.2</td><td>5.5</td><td>3.4</td><td>5.9</td></tr></table>
|
| 139 |
+
|
| 140 |
+
# 4.2 Comparison to Prior Unsupervised Work
|
| 141 |
+
|
| 142 |
+
Prior work on unsupervised speech recognition focused on the TIMIT benchmark. In order to perform a direct comparison to these approaches, we report results on this benchmark as well. We consider two setups to compare to previous work: in the matched setting, the unlabeled text data is simply the transcriptions of the unlabeled audio data but unpaired. In the unmatched setup, the unlabeled text data does not contain the transcriptions for the audio data which is a more realistic setting.
|
| 143 |
+
|
| 144 |
+
We measure performance on the standard Kaldi dev and test sets (core-dev/core-test) as well as a slightly larger version of the test set (all-test) to be able to compare to Liu et al. [2018] and Chen et al. [2019]. Further details of the two setups can be found in Appendix $\ S \operatorname { E } . 1$ . We report performance for wav2vec-U with a 4-gram language model trained on the language modeling data of TIMIT and we also consider self-training (wav2vec- $\mathbf { \partial } . \mathbf { U } + \mathbf { S } \mathbf { T }$ ).
|
| 145 |
+
|
| 146 |
+
Table 2 shows that wav2vec-U outperforms prior unsupervised work in both the matched and unmatched settings, reducing PER on all-test in the matched setup by $57 \%$ relative compared to Chen et al. [2019]. Our method has lower performance than the best supervised methods but it performs still very well at PER 12 on core-test in the matched setup compared to PER 8.3 for the state of the art [Baevski et al., 2020c].
|
| 147 |
+
|
| 148 |
+
# 4.3 Performance on non-English languages
|
| 149 |
+
|
| 150 |
+
To get a sense of how well the method works on non-English data, we experiment on six languages of the multilingual Librispeech corpus (MLS; Pratap et al. 2020). As baseline we consider the supervised systems of Pratap et al. [2020] trained on between $2 \mathrm { k }$ and 161 hours of labeled data, depending on the language. For adversarial learning we use 100 hours of unlabeled audio data from MLS for every language as well as the MLS language modeling data. As input to wav2vec-U we use the representations from XLSR-53 [Conneau et al., 2020], a wav2vec 2.0 model pre-trained on 53 languages. Table 3 shows that wav2vec-U generalizes across a range of languages. Performance is lower than supervised systems but it shows the viability for other languages.
|
| 151 |
+
|
| 152 |
+
Next, we turn to three low-resource languages, Swahili, Kyrgyz, and Tatar. Swahili is an African language, Kyrgyz and Tatar are Turkic languages with only about $4 . 3 \mathrm { m }$ and $5 . 2 \mathrm { m }$ speakers, respectively.5 We use between 1.8 hours (Kyrgyz) and 9.2 hours of unlabeled audio (Swahili), see Appendix $\ S \operatorname { E } . 1$ .
|
| 153 |
+
|
| 154 |
+
Table 2: TIMIT Phoneme Error Rate (PER) in comparison to previous work for the matched and unmatched training data setups (Appendix $\ S \operatorname { E . 1 }$ ). PER is measured on the Kaldi dev and test sets (core-dev/core-test) as well as a slightly larger version of the test set (all-test) as used by some of the prior work. $( ^ { * } )$ indicates experiments that do not use the standard split excluding SA utterances.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Model</td><td>LM</td><td>core-dev</td><td>core-test</td><td>all-test</td></tr><tr><td colspan="5">Supervised learning</td></tr><tr><td>LiGRU [Ravanelli et al., 2018]</td><td></td><td></td><td>14.9</td><td></td></tr><tr><td>LiGRU [Ravanelli et al., 2019]</td><td></td><td></td><td>14.2</td><td></td></tr><tr><td colspan="5">Self and semi-supervised learning</td></tr><tr><td>vq-wav2vec [Baevski et al.,2020b]</td><td></td><td>9.6</td><td>11.6</td><td></td></tr><tr><td>wav2vec 2.0 [Baevski et al.,2020c]</td><td></td><td>7.4</td><td>8.3</td><td></td></tr><tr><td colspan="5">Unsupervised learning - matched setup</td></tr><tr><td>EODM[Yeh et al.,2019]</td><td>5-gram</td><td></td><td>36.5</td><td>=</td></tr><tr><td>GAN*[Chen et al., 2019]</td><td>9-gram</td><td></td><td>=</td><td>48.6</td></tr><tr><td>GAN + HMM* [Chen et al.,2019]</td><td>9-gram</td><td>■</td><td>-</td><td>26.1</td></tr><tr><td>wav2vec-U</td><td>4-gram</td><td>17.0</td><td>17.8</td><td>16.6</td></tr><tr><td>wav2vec-U + ST</td><td>4-gram</td><td>11.3</td><td>12.0</td><td>11.3</td></tr><tr><td colspan="5">Unsupervised learning - unmatched setup</td></tr><tr><td>EODM[Yeh et al., 2019]</td><td>5-gram</td><td></td><td>41.6</td><td>■</td></tr><tr><td>GAN* [Chen et al.,2019]</td><td>9-gram</td><td></td><td>=</td><td>50.0</td></tr><tr><td>GAN + HMM* [Chen et al., 2019]</td><td>9-gram</td><td>=</td><td>-</td><td>33.1</td></tr><tr><td>wav2vec-U*</td><td>4-gram</td><td>21.3</td><td>22.3</td><td>24.4</td></tr><tr><td>wav2vec-U + ST*</td><td>4-gram</td><td>13.8</td><td>15.0</td><td>18.6</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Table 3: WER on the Multilingual Librispeech (MLS) dataset using representations from the wav2vec 2.0 XLSR-53 model. We consider German (de), Dutch (nl), French (fr), Spanish (es), Italian (it), Portuguese (pt).
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Model</td><td>Labeled data used</td><td>LM</td><td>de</td><td>nl</td><td>fr</td><td>es</td><td>it</td><td>pt</td><td>Avg</td></tr><tr><td>Labeled training hours (full)</td><td></td><td></td><td>2k</td><td>1.6k</td><td>1.1k</td><td>918</td><td>247</td><td>161</td><td></td></tr><tr><td>Supervised learning</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Pratap et al. [2020]</td><td>full</td><td> 5-gram</td><td>6.49</td><td>12.02</td><td>5.58</td><td>6.07</td><td>10.54</td><td>19.49</td><td>10.0</td></tr><tr><td>Unsupervised learning</td><td>0h</td><td></td><td></td><td></td><td></td><td>33.3</td><td></td><td></td><td></td></tr><tr><td>wav2vec-U</td><td></td><td> 4-gram</td><td>32.5</td><td>40.2</td><td>39.8</td><td></td><td>58.1</td><td>59.8</td><td>43.9</td></tr><tr><td>wav2vec-U + ST</td><td>0h</td><td>4-gram</td><td>11.8</td><td>21.4</td><td>14.7</td><td>11.3</td><td>26.3</td><td>26.3</td><td>18.6</td></tr></table>
|
| 161 |
+
|
| 162 |
+
To compare to prior work, we measure WER for Swahili and PER for Kyrgyz and Tatar. For Tatar and Kyrgyz we opted to use a reduced self-training regime for faster experimental turn-around where we only perform HMM self-training and we expect better performance with the full self-training setup (Appendix F). Table 4 and Table 5 show that wav2vec-U achieves good performance on these low-resource languages compared to previous work that utilized labeled data. We note that for Tatar and Kyrgyz we use a much smaller amount of speech audio than prior work: compared to XLSR-53 we use $1 . 8 \mathrm { h }$ unlabeled data vs 17h of labeled data for Kyrgyz and 4.6h vs. 17h for Tatar.
|
| 163 |
+
|
| 164 |
+
# 5 Related Work
|
| 165 |
+
|
| 166 |
+
This paper builds on a large body of prior work which includes semi-supervised speech recognition such as self-training [Kahn et al., 2020a, Xu et al., 2020b, Park et al., 2020]. Some of the earliest work in self-supervised learning of speech representations was was done by van den Oord et al. [2018] for phoneme recognition which was simplified in Schneider et al. [2019] who applied it to full speech recognition. Other work includes language model-style pre-training [Chung et al., 2019a] and learning fixed size representations of audio segments [Chung and Glass, 2018]. There is also work on quantization of the continuous speech data [Baevski et al., 2020b,a, Liu et al., 2019, van Niekerk et al., 2020, Baevski et al., 2020c, Hsu et al., 2021b] and on robustness to domain shift [Hsu et al., 2021a], multilingual pre-training [Kawakami et al., 2020, Conneau et al., 2020] as well as combining speech and vision [Harwath et al., 2020].
|
| 167 |
+
|
| 168 |
+
Table 4: PER for low-resource languages, Tatar (tt) and Kyrgyz (ky).
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Model</td><td>tt</td><td>ky</td></tr><tr><td colspan="3">Supervised learning</td></tr><tr><td>Fer et al. [2017]</td><td>42.5</td><td>38.7</td></tr><tr><td>m-CPC [Riviere et al., 2020]</td><td>42.0</td><td>41.2</td></tr><tr><td>XLSR-53 [Conneau et al.,2020]</td><td>5.1</td><td>6.1</td></tr><tr><td colspan="3">Unsupervised learning</td></tr><tr><td>wav2vec-U</td><td>25.7</td><td>24.1</td></tr><tr><td>wav2vec-U + HMM</td><td>13.7</td><td>14.9</td></tr></table>
|
| 171 |
+
|
| 172 |
+
Table 5: WER for Swahili from the ALFFA corpus. We compare to the supervised baseline of the ALFFA project.
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Model</td><td>sw</td></tr><tr><td>Supervised learning</td><td></td></tr><tr><td>Besacier et al. [2015]</td><td>27.36</td></tr><tr><td>Unsupervised learning</td><td></td></tr><tr><td>wav2vec-U</td><td>52.6</td></tr><tr><td>wav2vec-U + ST</td><td>32.2</td></tr></table>
|
| 175 |
+
|
| 176 |
+
Learning to map speech to phonemes without supervision using adversarial learning has been explored by Liu et al. [2018] who learn a mapping matrix between segment identifiers and phonemes. However, their work still relied on data segmented into phonemes by human annotators. This has been later extended to use an automatic segmentation [Chen et al., 2019] which is iteratively refined with HMMs. However, cross validation is still performed using labeled data (personal communication with authors). We also explored HMMs to refine segmentation boundaries (Table A2) but did not find it as effective as self-training. Our work is in part inspired by aligning word embedding spaces of different languages [Mikolov et al., 2013, Artetxe et al., 2017, Conneau et al., 2018] and full unsupervised machine translation [Lample et al., 2018, Artetxe et al., 2018, Conneau and Lample, 2019].
|
| 177 |
+
|
| 178 |
+
# 6 Conclusion and Future Work
|
| 179 |
+
|
| 180 |
+
wav2vec-U is a framework which enables building speech recognition models without labeled data. It embeds and segments the speech audio with self-supervised representations from wav2vec 2.0, learns a mapping to phonemes with adversarial learning, and cross-validates hyper-parameter choices as well as early stopping with an unsupervised metric. Experiments on the standard Librispeech benchmark show performance close to the state of the art models from only a few years ago, even though these models relied on nearly 1,000 hours of labeled data.
|
| 181 |
+
|
| 182 |
+
Compared to the previous best unsupervised speech recognition approach, wav2vec-U reduces TIMIT phone error rate from 26.1 to 11.3. We also demonstrate the viability of our approach on several languages other than English, some of which are low-resource. The ability to build speech recognition models solely from unlabeled speech audio and unlabeled text drastically lowers the effort to build speech technology for many more languages of the world.
|
| 183 |
+
|
| 184 |
+
Our approach requires phonemization of the text for the language of interest. Moreover, phonemizers are not available for all languages and this presents a bottleneck. To address this, future work may develop phonemizers for more languages, explore phonemization approaches that generalize across languages, or unsupervised training with graphemic text units such as letters.
|
| 185 |
+
|
| 186 |
+
We explored a simple segmentation technique based on self-supervised representations, however, there is a large body of research on segmentation and some of these techniques may lead to improvements over our simple approach [Varadarajan et al., 2008, Zhang and Glass, 2009, Gish et al., 2009, Lee and Glass, 2012, Lee et al., 2015, Ondel et al., 2016, Kamper et al., 2017a,b, Kreuk et al., 2020]. Also, wav2vec 2.0 learns representations for fixed size units with a fixed stride, however, phonemic units are of variable size. Another direction is to learn variable sized representations during pre-training.
|
| 187 |
+
|
| 188 |
+
# Acknowledgments and Disclosure of Funding
|
| 189 |
+
|
| 190 |
+
We thank Zhouhan Lin for helping with initial explorations in this project, Tatiana Likhomanenko for helpful discussions about self-training, Da-Rong Liu for sharing details to reproduce the setup of Chen et al. [2019], Marc’Aurelio Ranzato for general helpful discussions, and Ruth Kipng’eno, Ruth Ndila Ndeto as well as Mark Mutitu for error analysis of our Swahili model.
|
| 191 |
+
|
| 192 |
+
# References
|
| 193 |
+
|
| 194 |
+
S. T. Abate, W. Menzel, and B. Tafila. An amharic speech corpus for large vocabulary continuous speech recognition. In Proc. of Interspeech, 2005.
|
| 195 |
+
D. Amodei, S. Ananthanarayanan, R. Anubhai, J. Bai, E. Battenberg, C. Case, J. Casper, B. Catanzaro, Q. Cheng, G. Chen, et al. Deep speech 2: End-to-end speech recognition in english and mandarin. In Proc. of ICML, 2016.
|
| 196 |
+
R. Ardila, M. Branson, K. Davis, M. Henretty, M. Kohler, J. Meyer, R. Morais, L. Saunders, F. M. Tyers, and G. Weber. Common voice: A massively-multilingual speech corpus. Proc. of LREC, 2020.
|
| 197 |
+
M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein gan. Proc. of ICML, 2017.
|
| 198 |
+
M. Artetxe, G. Labaka, and E. Agirre. Learning bilingual word embeddings with (almost) no bilingual data. In Proc. of ACL, 2017.
|
| 199 |
+
M. Artetxe, G. Labaka, E. Agirre, and K. Cho. Unsupervised neural machine translation. Proc. of ICLR, 2018.
|
| 200 |
+
A. Baevski and M. Auli. Adaptive input representations for neural language modeling. In Proc. of ICLR, 2018.
|
| 201 |
+
A. Baevski, M. Auli, and A. Mohamed. Effectiveness of self-supervised pre-training for speech recognition. Proc. of ICASSP, 2020a.
|
| 202 |
+
A. Baevski, S. Schneider, and M. Auli. vq-wav2vec: Self-supervised learning of discrete speech representations. In Proc. of ICLR, 2020b.
|
| 203 |
+
A. Baevski, Y. Zhou, A. Mohamed, and M. Auli. wav2vec 2.0: A framework for self-supervised learning of speech representations. In Proc. of NeurIPS, 2020c.
|
| 204 |
+
L. Besacier, E. Gauthier, M. Mangeot, P. Bretier, P. Bagshaw, O. Rosec, T. Moudenc, F. Pellegrino, S. Voisin, E. Marsico, and P. Nocera. Speech technologies for african languages: example of a multilingual calculator for education. In Proc. of Interspeech, 2015.
|
| 205 |
+
D. Can, V. R. Martinez, P. Papadopoulos, and S. S. Narayanan. Pykaldi: A python wrapper for kaldi. In Proc. of ICASSP, 2018.
|
| 206 |
+
K.-Y. Chen, C.-P. Tsai, D.-R. Liu, H.-Y. Lee, and L. shan Lee. Completely unsupervised speech recognition by a generative adversarial network harmonized with iteratively refined hidden markov models. In Proc. of Interspeech, 2019.
|
| 207 |
+
Y. Chung, W. Weng, S. Tong, and J. R. Glass. Unsupervised cross-modal alignment of speech and text embedding spaces. Proc. of NIPS, 2018.
|
| 208 |
+
Y. Chung, W. Hsu, H. Tang, and J. R. Glass. An unsupervised autoregressive model for speech representation learning. Proc. of Interspeech, 2019a.
|
| 209 |
+
Y.-A. Chung and J. Glass. Speech2vec: A sequence-to-sequence framework for learning word embeddings from speech. Proc. of Interspeech, 2018.
|
| 210 |
+
Y.-A. Chung, W.-N. Hsu, H. Tang, and J. Glass. An unsupervised autoregressive model for speech representation learning. Proc. of Interspeech, 2019b.
|
| 211 |
+
A. Conneau and G. Lample. Cross-lingual language model pretraining. Proc. of NeurIPS, 2019.
|
| 212 |
+
A. Conneau, G. Lample, M. Ranzato, L. Denoyer, and H. Jégou. Word translation without parallel data. Proc. of ICLR, 2018.
|
| 213 |
+
A. Conneau, A. Baevski, R. Collobert, A. Mohamed, and M. Auli. Unsupervised cross-lingual representation learning for speech recognition. arXiv, abs/2006.13979, 2020.
|
| 214 |
+
J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. Proc. of NAACL, 2019.
|
| 215 |
+
L. Dong, S. Xu, and B. Xu. Speech-transformer: A no-recurrence sequence-to-sequence model for speech recognition. In Proc. of ICASSP, 2018.
|
| 216 |
+
Z. Fan, M. Li, S. Zhou, and B. Xu. Exploring wav2vec 2.0 on speaker verification and language identification. arXiv, 2021.
|
| 217 |
+
R. Fer, P. Matejka, F. Grézl, O. Plchot, K. Vesel ˇ y, and J. H. \` Cernock ˇ y. Multilingually trained \` bottleneck features in spoken language recognition. Computer Speech & Language, 46, 2017.
|
| 218 |
+
J. S. Garofolo, L. F. Lamel, W. M. Fisher, J. G. Fiscus, D. S. Pallett, and N. L. Dahlgren. The DARPA TIMIT Acoustic-Phonetic Continuous Speech Corpus CDROM. Linguistic Data Consortium, 1993.
|
| 219 |
+
H. Gelas, L. Besacier, and F. Pellegrino. Developments of Swahili resources for an automatic speech recognition system. In Proc. of SLTU, 2012.
|
| 220 |
+
H. Gish, M. Siu, A. Chan, and W. Belfield. Unsupervised training of an hmm-based speech recognizer for topic classification. In Proc. of Interspeech, 2009.
|
| 221 |
+
I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. Proc. of NIPS, 2014.
|
| 222 |
+
Google. Google cloud: Speech-to-text. https://cloud.google.com/speech-to-text, 2021. Accessed: 2021-05-13.
|
| 223 |
+
A. Graves, S. Fernández, and F. Gomez. Connectionist temporal classification: Labelling unsegmented sequence data with recurrent neural networks. In Proc. of ICML, 2006.
|
| 224 |
+
A. Gulati, J. Qin, C.-C. Chiu, N. Parmar, Y. Zhang, J. Yu, W. Han, S. Wang, Z. Zhang, Y. Wu, and R. Pang. Conformer: Convolution-augmented transformer for speech recognition. Proc. of Interspeech, 2020.
|
| 225 |
+
I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. Courville. Improved training of wasserstein gans. Proc. of NIPS, 2017.
|
| 226 |
+
W. Han, Z. Zhang, Y. Zhang, J. Yu, C.-C. Chiu, J. Qin, A. Gulati, R. Pang, and Y. Wu. Contextnet: Improving convolutional neural networks for automatic speech recognition with global context. Proc. of Interspeech, 2020.
|
| 227 |
+
D. Harwath and J. Glass. Towards visually grounded sub-word speech unit discovery. In Proc. of ICASSP, pages 3017–3021. IEEE, 2019.
|
| 228 |
+
D. Harwath, W.-N. Hsu, and J. Glass. Learning hierarchical discrete linguistic units from visuallygrounded speech. In Proc. of ICLR, 2020.
|
| 229 |
+
K. Heafield. KenLM: Faster and smaller language model queries. In Proceedings of the Sixth Workshop on Statistical Machine Translation, pages 187–197, Edinburgh, Scotland, July 2011. Association for Computational Linguistics.
|
| 230 |
+
K. Hirsh-Pasek, D. G. Kemler Nelson, P. W. Jusczyk, K. W. Cassidy, B. Druss, and L. Kennedy. Clauses are perceptual units for young infants. Cognition, 26(3):269–286, 1987.
|
| 231 |
+
W.-N. Hsu, A. Sriram, A. Baevski, T. Likhomanenko, Q. Xu, V. Pratap, J. Kahn, A. Lee, R. Collobert, G. Synnaeve, et al. Robust wav2vec 2.0: Analyzing domain shift in self-supervised pre-training. arXiv preprint arXiv:2104.01027, 2021a.
|
| 232 |
+
W.-N. Hsu, Y.-H. H. Tsai, B. Bolte, R. Salakhutdinov, and A. Mohamed. Hubert: How much can a bad teacher benefit ASR pre-training? In Proc. of ICASSP, 2021b.
|
| 233 |
+
E. Jang, S. Gu, and B. Poole. Categorical reparameterization with gumbel-softmax. Proc. of ICLR, 2016.
|
| 234 |
+
H. Jegou, M. Douze, and C. Schmid. Product quantization for nearest neighbor search. IEEE Trans. Pattern Anal. Mach. Intell., 33(1):117–128, Jan. 2011.
|
| 235 |
+
E. K. Johnson and P. W. Jusczyk. Word segmentation by 8-month-olds: When speech cues count more than statistics. Journal of Memory and Language, 44(4):548–567, 2001.
|
| 236 |
+
J. Johnson, M. Douze, and H. Jégou. Billion-scale similarity search with gpus. IEEE Transactions on Big Data, 2019.
|
| 237 |
+
P. W. Jusczyk, D. M. Houston, and M. Newsome. The beginnings of word segmentation in englishlearning infants. Cognitive Psychology, 39(3):159–207, 1999.
|
| 238 |
+
J. Kahn, A. Lee, and A. Hannun. Self-training for end-to-end speech recognition. In Proc. of ICASSP, 2020a.
|
| 239 |
+
J. Kahn et al. Libri-light: A benchmark for asr with limited or no supervision. In Proc. of ICASSP, 2020b.
|
| 240 |
+
H. Kamper, A. Jansen, and S. Goldwater. A segmental framework for fully-unsupervised largevocabulary speech recognition. Comput. Speech Lang., 46(C), Nov. 2017a.
|
| 241 |
+
H. Kamper, K. Livescu, and S. Goldwater. An embedded segmental k-means model for unsupervised segmentation and clustering of speech. Proc. of ASRU, 2017b.
|
| 242 |
+
K. Kawakami, L. Wang, C. Dyer, P. Blunsom, and A. van den Oord. Learning robust and multilingual speech representations. Proc. of EMNLP, 2020.
|
| 243 |
+
D. P. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. In Proc. of ICLR, 2015.
|
| 244 |
+
F. Kreuk, J. Keshet, and Y. Adi. Self-supervised contrastive learning for unsupervised phoneme segmentation. Proc. of Interspeech, 2020.
|
| 245 |
+
G. Lample, L. Denoyer, and M. Ranzato. Unsupervised machine translation using monolingual corpora only. In Proc. of ICLR, 2018.
|
| 246 |
+
C. Lee and J. R. Glass. A nonparametric bayesian approach to acoustic model discovery. In Proc. of ACL, 2012.
|
| 247 |
+
C. Lee, T. J. O’Donnell, and J. R. Glass. Unsupervised lexicon discovery from acoustic input. TACL, 2015.
|
| 248 |
+
M. P. Lewis, G. F. Simon, and C. D. Fennig. Ethnologue: Languages of the world, nineteenth edition. Online version: http://www.ethnologue.com, 2016.
|
| 249 |
+
T. Likhomanenko, Q. Xu, J. Kahn, G. Synnaeve, and R. Collobert. slimipl: Language-model-free iterative pseudo-labeling. arXiv, 2021.
|
| 250 |
+
A. H. Liu, T. Tu, H. yi Lee, and L. shan Lee. Towards unsupervised speech recognition and synthesis with quantized speech representation learning. Proc. of ICASSP, 2019.
|
| 251 |
+
D.-R. Liu, K.-Y. Chen, H.-Y. Lee, and L. shan Lee. Completely unsupervised phoneme recognition by adversarially learning mapping relationships from audio embeddings. Proc. of Interspeech, 2018.
|
| 252 |
+
T. Mikolov, Q. V. Le, and I. Sutskever. Exploiting similarities among languages for machine translation. arXiv preprint arXiv:1309.4168, 2013.
|
| 253 |
+
M. Mohri, F. Pereira, and M. Riley. Weighted finite-state transducers in speech recognition. Computer Speech & Language, 16(1):69–88, 2002.
|
| 254 |
+
L. Ondel, L. Burget, and J. Cernocký. Variational inference for acoustic unit discovery. In Proc. of SLTU, 2016.
|
| 255 |
+
M. Ott, S. Edunov, A. Baevski, A. Fan, S. Gross, N. Ng, D. Grangier, and M. Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proc. of NAACL System Demonstrations, 2019.
|
| 256 |
+
V. Panayotov, G. Chen, D. Povey, and S. Khudanpur. Librispeech: an asr corpus based on public domain audio books. In Proc. of ICASSP, pages 5206–5210. IEEE, 2015.
|
| 257 |
+
D. S. Park, W. Chan, Y. Zhang, C.-C. Chiu, B. Zoph, E. D. Cubuk, and Q. V. Le. Specaugment: A simple data augmentation method for automatic speech recognition. In Proc. of Interspeech, 2019.
|
| 258 |
+
D. S. Park, Y. Zhang, Y. Jia, W. Han, C.-C. Chiu, B. Li, Y. Wu, and Q. V. Le. Improved noisy student training for automatic speech recognition. Proc. of Interspeech, 2020.
|
| 259 |
+
K. Park and J. Kim. g2pe. https://github.com/Kyubyong/g2p, 2019.
|
| 260 |
+
L. Pepino, P. Riera, and L. Ferrer. Emotion recognition from speech using wav2vec 2.0 embeddings. arXiv, 2021.
|
| 261 |
+
L. Polka and J. F. Werker. Developmental changes in perception of nonnative vowel contrasts. Journal of Experimental Psychology: Human perception and performance, 20(2):421, 1994.
|
| 262 |
+
D. Povey, A. Ghoshal, G. Boulianne, L. Burget, O. Glembek, N. Goel, M. Hannemann, P. Motlicek, Y. Qian, P. Schwarz, J. Silovsky, G. Stemmer, and K. Vesely. The kaldi speech recognition toolkit. In Proc. of ASRU, 2011.
|
| 263 |
+
V. Pratap, A. Hannun, Q. Xu, J. Cai, J. Kahn, G. Synnaeve, V. Liptchinsky, and R. Collobert. Wav2letter++: A fast open-source speech recognition system. In Proc. of ICASSP, 2019.
|
| 264 |
+
V. Pratap, Q. Xu, A. Sriram, G. Synnaeve, and R. Collobert. Mls: A large-scale multilingual dataset for speech research. In Proc. of Interspeech, 2020.
|
| 265 |
+
O. Rasanen, G. Doyle, and M. C. Frank. Unsupervised word discovery from speech using automatic segmentation into syllable-like units. In Proc. of Interspeech, 2015.
|
| 266 |
+
M. Ravanelli, P. Brakel, M. Omologo, and Y. Bengio. Light gated recurrent units for speech recognition. IEEE Trans. on Emerging Topics in Comp. Intel., 2, 2018.
|
| 267 |
+
M. Ravanelli, T. Parcollet, and Y. Bengio. The pytorch-kaldi speech recognition toolkit. Proc. of ICASSP, 2019.
|
| 268 |
+
M. Rivière, A. Joulin, P.-E. Mazaré, and E. Dupoux. Unsupervised pretraining transfers well across languages. In Proc. of ICASSP, 2020.
|
| 269 |
+
S. Schneider, A. Baevski, R. Collobert, and M. Auli. wav2vec: Unsupervised pre-training for speech recognition. In Proc. of Interspeech, 2019.
|
| 270 |
+
N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 2014.
|
| 271 |
+
G. Synnaeve, Q. Xu, J. Kahn, T. Likhomanenko, E. Grave, V. Pratap, A. Sriram, V. Liptchinsky, and R. Collobert. End-to-end ASR: from Supervised to Semi-Supervised Learning with Modern Architectures. Proc. of ICML workshop on Self-supervision in Audio and Speech (SAS), 2020.
|
| 272 |
+
M. Tachbelie, S. T. Abate, and L. Besacier. Using different acoustic, lexical and language modeling units for asr of an under-resourced language - amharic. Speech Communication, 56, 2014.
|
| 273 |
+
Z. Tan, A. K. Sarkar, and N. Dehak. rvad: An unsupervised segment-based robust voice activity detection method. Computer speech & language, 59:1–21, 2020.
|
| 274 |
+
A. van den Oord, Y. Li, and O. Vinyals. Representation learning with contrastive predictive coding. Proc. of NIPS, 2018.
|
| 275 |
+
B. van Niekerk, L. Nortje, and H. Kamper. Vector-quantized neural networks for acoustic unit discovery in the zerospeech 2020 challenge. Proc. of Interspeech, 2020.
|
| 276 |
+
B. Varadarajan, S. Khudanpur, and E. Dupoux. Unsupervised learning of acoustic sub-word units. In Proc. of ACL, 2008.
|
| 277 |
+
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Proc. of NIPS, 2017.
|
| 278 |
+
C. Wang, A. Wu, J. Pino, A. Baevski, M. Auli, and A. Conneau. Large-scale self- and semi-supervised learning for speech translation. arXiv, 2021.
|
| 279 |
+
J. F. Werker and R. C. Tees. Cross-language speech perception: Evidence for perceptual reorganization during the first year of life. Infant behavior and development, 7(1):49–63, 1984.
|
| 280 |
+
H. Xu, K. Li, Y. Wang, J. Wang, S. Kang, X. Chen, D. Povey, and S. Khudanpur. Neural network language modeling with letter-based features and importance sampling. In Proc. of ICASSP, 2018.
|
| 281 |
+
Q. Xu, A. Baevski, T. Likhomanenko, P. Tomasello, A. Conneau, R. Collobert, G. Synnaeve, and M. Auli. Self-training and pre-training are complementary for speech recognition. In Proc. of ICASSP, 2020a.
|
| 282 |
+
Q. Xu, T. Likhomanenko, J. Kahn, A. Hannun, G. Synnaeve, and R. Collobert. Iterative pseudolabeling for speech recognition. Proc. of Interspeech, 2020b.
|
| 283 |
+
C.-K. Yeh, J. Chen, C. Yu, and D. Yu. Unsupervised speech recognition via segmental empirical output distribution matching. In Proc. of ICLR, 2019.
|
| 284 |
+
N. Zeghidour, Q. Xu, V. Liptchinsky, N. Usunier, G. Synnaeve, and R. Collobert. Fully convolutional speech recognition. arXiv, abs/1812.06864, 2018.
|
| 285 |
+
F. Zhang, Y. Wang, X. Zhang, C. Liu, Y. Saraf, and G. Zweig. Faster, simpler and more accurate hybrid asr systems using wordpieces. Proc. of Interspeech, 2020a.
|
| 286 |
+
Y. Zhang and J. R. Glass. Unsupervised spoken keyword spotting via segmental dtw on gaussian posteriorgrams. IEEE Workshop on Automatic Speech Recognition & Understanding, 2009.
|
| 287 |
+
Y. Zhang, J. Qin, D. S. Park, W. Han, C.-C. Chiu, R. Pang, Q. V. Le, and Y. Wu. Pushing the limits of semi-supervised learning for automatic speech recognition. Proc. of NeurIPS SAS Workshop, 2020b.
|
md/train/QpNz8r_Ri2Y/QpNz8r_Ri2Y.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/QpT9Q_NNfQL/QpT9Q_NNfQL.md
ADDED
|
@@ -0,0 +1,454 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEURWIN: NEURAL WHITTLE INDEX NETWORK FOR RESTLESS BANDITS VIA DEEP RL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Whittle index policy is a powerful tool to obtain asymptotically optimal solutions for the notoriously intractable problem of restless bandits. However, finding the Whittle indices remains a difficult problem for many practical restless bandits with convoluted transition kernels. This paper proposes NeurWIN, a neural Whittle index network that seeks to learn the Whittle indices for any restless bandits by leveraging mathematical properties of the Whittle indices. We show that a neural network that produces the Whittle index is also one that produces the optimal control for a set of Markov decision problems. This property motivates using deep reinforcement learning for the training of NeurWIN. We demonstrate the utility of NeurWIN by evaluating its performance for three recently studied restless bandit problems. Our experiment results show that the performance of NeurWIN is either better than, or as good as, state-of-the-art policies for all three problems.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many sequential decision problems can be modeled as multi-armed bandit problems. A bandit problem models each potential decision as an arm. In each round, we play $M$ arms out of a total of $N$ arms by choosing the corresponding decisions. We then receive a reward from the played arms. The goal is to maximize the long-term total discounted reward. Consider, for example, displaying advertisements on an online platform with the goal to maximize the long-term discounted clickthrough rates. This can be modeled as a bandit problem where each arm is a piece of advertisement and we choose which advertisements to be displayed every time a particular user visits the platform. It should be noted that the reward, i.e., click-through rate, of an arm is not stationary, but depends on our actions in the past. For example, a user that just clicked on a particular advertisement may be much less likely to click on the same advertisement in the near future. Such a problem is a classic case of the restless bandit problem, where the reward distribution of an arm depends on its state, which changes over time based on our past actions.
|
| 12 |
+
|
| 13 |
+
The restless bandit problem is notoriously intractable (Papadimitriou & Tsitsiklis, 1999). Most recent efforts, such as recovering bandits (Pike-Burke & Grunewalder, 2019), rotting bandits (Seznec et al., 2020), and Brownian bandits (Slivkins & Upfal, 2008), only study some special instances of the restless bandit problem. The fundamental challenge of the restless bandit problem lies in the explosion of state space, as the state of the entire system is the Cartesian product of the states of individual arms. A powerful tool to address the explosion of state space is the Whittle index policy (Whittle, 1988). In a nutshell, the Whittle index policy calculates a Whittle index for each arm based on the arm’s current state, where the index loosely corresponds to the amount of cost that we are willing to pay to play the arm, and then plays the arm with the highest index. It has been shown that the Whittle index policy is either optimal or asymptotically optimal in many settings.
|
| 14 |
+
|
| 15 |
+
In this paper, we present Neural Whittle Index Network (NeurWIN), a principled machine learning approach that finds the Whittle indices for virtually all restless bandit problems. We note that the Whittle index is an artificial construct that cannot be directly measured. Finding the Whittle index is typically intractable. As a result, the Whittle indices of many practical problems remain unknown except for a few special cases.
|
| 16 |
+
|
| 17 |
+
We are able to circumvent the challenges of finding the Whittle indices by leveraging an important mathematical property of the Whittle index: Consider an alternative problem where there is only one arm and we decide whether to play the arm in each time instance. In this problem, we need to pay a constant cost of $\lambda$ every time we play the arm. The goal is to maximize the long-term discounted net reward, defined as the difference between the rewards we obtain from the arm and the costs we pay to play it. Then, the optimal policy is to play the arm whenever the Whittle index becomes larger than $\lambda$ . Based on this property, a neural network that produces the Whittle index can be viewed as one that finds the optimal policy for the alternative problem for any $\lambda$ .
|
| 18 |
+
|
| 19 |
+
Using this observation, we propose a deep reinforcement learning method to train NeurWIN. To demonstrate the power of NeurWIN, we employ NeurWIN for three recently studied restless bandit problems, namely, recovering bandit (Pike-Burke & Grunewalder, 2019), wireless scheduling (Aalto et al., 2015), and stochastic deadline scheduling (Yu et al., 2018). There is no known Whittle index for the first problem, and there is only an approximation of the Whittle index under some relaxations for the second problem. Only the third problem has a precise characterization of the Whittle index. For the first two problems, the index policy using our NeurWIN achieves better performance than existing studies. For the third problem, the index policy using our NeurWIN has virtually the same performance as the Whittle index policy.
|
| 20 |
+
|
| 21 |
+
The rest of the paper is organized as follows: Section 2 reviews related literature. Section 3 provides formal definitions of the Whittle index and our problem statement. Section 4 introduces our training algorithm for NeurWIN. Section 5 demonstrates the utility of NeurWIN by evaluating its performance under three recently studied restless bandit problems. Finally, Section 6 concludes the paper.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Restless bandit problems were first introduced in (Whittle, 1988). They are known to be intractable, and are in general PSPACE hard (Papadimitriou & Tsitsiklis, 1999). As a result, many studies focus on finding the Whittle index policy for restless bandit problems, such as in (Le Ny et al., 2008; Meshram et al., 2018; Tripathi & Modiano, 2019; Dance & Silander, 2015). However, these studies are only able to find the Whittle indices under various specific assumptions about the bandit problems.
|
| 26 |
+
|
| 27 |
+
There has been a lot of studies on applying RL methods for bandit problems. (Dann et al., 2017) proposed a tool called Uniform-PAC for contextual bandits. (Zanette & Brunskill, 2018) described a framework-agnostic approach towards guaranteeing RL algorithms’ performance. (Jiang et al., 2017) introduced contextual decision processes (CDPs) that encompass contextual bandits for RL exploration with function approximation. (Riquelme et al., 2018) compared deep neural networks with Bayesian linear regression against other posterior sampling methods. However, none of these studies are applicable to restless bandits, where the state of an arm can change over time.
|
| 28 |
+
|
| 29 |
+
Deep RL algorithms have been utilized in problems that resemble restless bandit problems, including HVAC control (Wei et al., 2017), cyber-physical systems (Leong et al., 2020), and dynamic multichannel access (Wang et al., 2018). In all these cases, a major limitation for deep RL is scalability. As the state spaces grows exponentially with the number of arms, these studies can only be applied to small-scale systems, and their evaluations are limited to cases when there are at most 5 zones, 6 sensors, and 8 channels, respectively.
|
| 30 |
+
|
| 31 |
+
An emerging research direction is applying machine learning algorithms to learn Whittle indices. (Borkar & Chadha, 2018) proposed employing the LSPE(0) algorithm (Yu & Bertsekas, 2009) coupled with a polynomial function approximator. The approach was applied in (Avrachenkov & Borkar, 2019) for scheduling web crawlers. However, this work can only be applied to restless bandits whose states can be represented by a single number, and it only uses a polynomial function approximator, which may have low representational power (Sutton & Barto, 2018). (Fu et al., 2019) proposed a Q-learning based heuristic to find Whittle indices. However, as shown in its experiment results, the heuristic may not produce Whittle indices even when the training converges.
|
| 32 |
+
|
| 33 |
+
# 3 PROBLEM SETTING
|
| 34 |
+
|
| 35 |
+
In this section, we provide a brief overview of restless bandit problems and the Whittle index. We then formally define the problem statement.
|
| 36 |
+
|
| 37 |
+
# 3.1 RESTLESS BANDIT PROBLEMS
|
| 38 |
+
|
| 39 |
+
A restless bandit problem consists of $N$ restless arms. In each round $t$ , a control policy observes the state of each arm $i$ , denoted by $s _ { i } [ t ]$ , and selects $M$ arms to activate. We call the selected arms as active and the others as passive. We use $a _ { i } [ t ]$ to denote the policy’s decision on each arm $i$ , where $a _ { i } [ t ] = 1$ if the arm is active and $a _ { i } [ t ] = 0$ if it is passive at round $t$ . Each arm $i$ generates a stochastic reward $r _ { i } [ t ]$ with distribution $R _ { i , a c t } ( s _ { i } [ t ] )$ if it is active, and with distribution $R _ { i , p a s s } ( s _ { i } [ t ] )$ if it is passive. The state of each arm $i$ in the next round evolves by the transition kernel of either $\bar { P _ { i , a c t } } ( s _ { i } [ t ] )$ or $P _ { i , p a s s } ( s _ { i } [ t ] )$ , depending on whether the arm is active. The goal of the control policy is to maximize the total discounted reward, which can be expressed as $\begin{array} { r } { \sum _ { t = 1 } ^ { \infty } \sum _ { i = 1 } ^ { N } \beta ^ { t } r _ { i } [ t ] } \end{array}$ with $\beta$
|
| 40 |
+
|
| 41 |
+
A control policy is effectively a function that takes the vector $( s _ { 1 } [ t ] , s _ { 2 } [ t ] , \ldots , s _ { N } [ t ] )$ as the input and produces the vector $( a _ { 1 } [ t ] , a _ { 2 } [ t ] , \dotsc , a _ { N } [ t ] )$ as the output. It should be noted that the space of input is exponential in $N$ . If each arm can be in one of $K$ possible states, then the number of possible inputs is $\bar { K } ^ { N }$ . This feature, which is usually referred to as the curse of dimensionality, makes finding the optimal control policy intractable.
|
| 42 |
+
|
| 43 |
+
# 3.2 THE WHITTLE INDEX
|
| 44 |
+
|
| 45 |
+
An index policy seeks to address the curse of dimensionality through decomposition. In each round, it calculates an index, denoted by $W _ { i } ( s _ { i } [ t ] )$ , for each arm $i$ based on its current state. The index policy then selects the $M$ arms with the highest indices to activate. It should be noted that the index of an arm $i$ is independent from the states of any other arms.
|
| 46 |
+
|
| 47 |
+
Obviously, the performance of an index policy depends on the design of the index function $W _ { i } ( \cdot )$ . A popular index with solid theoretical foundation is the Whittle index, which is defined below. Since we only consider one arm at a time, we drop the subscript $i$ for the rest of the paper.
|
| 48 |
+
|
| 49 |
+
Consider a system with only one arm, and a control policy that determines whether to activate the arm in each round $t$ . Suppose that the policy needs to pay an activation cost of $\lambda$ every time it chooses to activate the arm. The goal of the control policy is to maximize the total discounted net reward, $\begin{array} { r } { \sum _ { t = 1 } ^ { \infty } \beta ^ { t } ( \boldsymbol { r } [ t ] - \lambda a [ t ] ) } \end{array}$ . The optimal control policy can be expressed by the set of states in which it would activate this arm for a particular $\lambda$ , and we denote this set by $\boldsymbol { \mathcal { A } } ( \boldsymbol { \lambda } )$ . Intuitively, the higher the cost, the less likely the optimal control policy would activate the arm in a given state, and hence the set $\boldsymbol { \mathcal { A } } ( \boldsymbol { \lambda } )$ should decrease monotonically. When an arm satisfies this intuition, we say that the arm is indexable.
|
| 50 |
+
|
| 51 |
+
Definition 1 (Indexability). An arm is said to be indexable if $\boldsymbol { \mathcal { A } } ( \lambda )$ decreases monotonically from the set of all states to the empty set as $\lambda$ increases from $- \infty$ to $\infty$ . A restless bandit problem is said to be indexable if all arms are indexable.
|
| 52 |
+
|
| 53 |
+
Definition 2 (The Whittle Index). If an arm is indexable, then its Whittle index of each state s is defined as $W ( s ) : = \operatorname* { s u p } _ { \lambda } \{ \lambda : s \in { \dot { A } } ( \lambda ) \}$ .
|
| 54 |
+
|
| 55 |
+
Even when an arm is indexable, finding its Whittle index can still be intractable, especially when the transition kernel of the arm is convoluted1. Our NeurWIN finds the Whittle index by leveraging the following property of the Whittle index: Consider the single-armed bandit problem. Suppose the initial state of an indexable arm is $s$ at round one. Consider two possibilities: The first is that the control policy activates the arm at round one, and then uses the optimal policy starting from round two; and the second is that the control policy does not activate the arm at round one, and then uses the optimal policy starting from round two. Let $Q _ { \lambda , a c t } ( s )$ and $Q _ { \lambda , p a s s } ( s )$ be the expected discounted net reward for these two possibilities, respectively, and let $D _ { s } ( \lambda ) : = \left( Q _ { \lambda , a c t } ( s ) - Q _ { \lambda , p a s s } ( s ) \right)$ be their difference. Clearly, the optimal policy should activate an arm under state $s$ and activation cost $\lambda$ if $D _ { s } ( \lambda ) \geq 0$ . We then have the following:
|
| 56 |
+
|
| 57 |
+
Theorem 1. (Zhao, 2019, Thm 3.14) If an arm is indexable, then, for every state $s _ { : }$ , $D _ { s } ( \lambda ) \geq 0 i f$ and only if $\lambda \leq W ( s )$ .
|
| 58 |
+
|
| 59 |
+
Our NeurWIN uses Thm. 1 to train neural networks that predict the Whittle index for any indexable arms. From Def. 1, a sufficient condition for indexability is when $D _ { s } ( \lambda )$ is a decreasing function. Thus, we define the concept of strong indexability as follows:
|
| 60 |
+
|
| 61 |
+
Definition 3 (Strong Indexability). An arm is said to be strongly indexable if $D _ { s } ( \lambda )$ is strictly decreasing in λ for every state s.
|
| 62 |
+
|
| 63 |
+
# 3.3 PROBLEM STATEMENT
|
| 64 |
+
|
| 65 |
+
We now formally describe the objective of this paper. We assume that we are given a simulator of one single restless arm as a black box. The simulator provides two functionalities: First, it allows us to set the initial state of the arm to any arbitrary state $s$ . Second, in each round $t$ , the simulator takes $a [ t ]$ , the indicator function that the arm is activated, as the input and produces the next state $s [ t + 1 ]$ and the reward $r [ t ]$ as the outputs.
|
| 66 |
+
|
| 67 |
+
Our goal is to derive low-complexity index algorithms for restless bandit problems by training a neural network that approximates the Whittle index of each restless arm using its simulator. A neural network takes the state $s$ as the input and produces a real number $f _ { \theta } ( s )$ as the output, where $\theta$ is the vector containing all weights and biases of the neural network. Recall that $W ( s )$ is the Whittle index of the arm. We aim to find appropriate $\theta$ that makes $| f _ { \theta } ( s ) - W ( s ) |$ small for all $s$ . Such a neural network is said to be Whittle-accurate.
|
| 68 |
+
|
| 69 |
+
Definition 4 (Whittle-accurate). A neural network with parameters $\theta$ is said to be $\gamma$ -Whittleaccurate $i f \vert f _ { \theta } ( s ) - W ( s ) \vert \leq \gamma ,$ , for all $s$ .
|
| 70 |
+
|
| 71 |
+
# 4 NEURWIN ALGORITHM: NEURAL WHITTLE INDEX NETWORK
|
| 72 |
+
|
| 73 |
+
In this section, we present NeurWIN, a deep-RL algorithms that trains neural networks to predict the Whittle indices. Since the Whittle index of an arm is independent from other arms, NeurWIN trains one neural network for each arm independently. In this section, we discuss how NeurWIN trains the Whittle index for one single arm.
|
| 74 |
+
|
| 75 |
+
# 4.1 CONDITIONS FOR WHITTLE-ACCURATE
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 1: An illustrative motivation of NeurWIN.
|
| 79 |
+
|
| 80 |
+
Before presenting NeurWIN, we first discuss the conditions for a neural network to be $\gamma \cdot$ -Whittleaccurate.
|
| 81 |
+
|
| 82 |
+
Suppose we are given a simulator of an arm and a neural network with parameters $\theta$ . We can then construct an environment of the arm along with an activation cost $\lambda$ as shown in Fig. 1. In each round $t$ , the environment takes the real number $f _ { \theta } ( s [ t ] )$ as the input. The input is first fed into a step function to produce $a [ t ] = 1 \bigl ( f _ { \theta } ( s [ t ] ) \geq \lambda \bigr )$ , where $1 ( \cdot )$ is the indicator function. Then, $a ( t )$ is fed into the simulator of the arm to produce $r [ t ]$ and $s [ t + 1 ]$ . Finally, the environment outputs the net reward $r [ t ] - \lambda a [ t ]$ and the next state $s [ t + 1 ]$ . We call this environment $E n v ( \lambda )$ . Thus, the neural network can be viewed as a controller for $E n v ( \lambda )$ . The following corollary is a direct result from Thm. 1.
|
| 83 |
+
|
| 84 |
+
Corollary 1. If $f _ { \boldsymbol { \theta } } ( s ) = W ( s ) , \forall s$ , then the neural network with parameters $\theta$ is the optimal controller for $E n v ( \lambda )$ , for any $\lambda$ and initial state $s [ 1 ]$ . Moreover, given $\lambda$ and $s [ 1 ]$ , the optimal discounted net reward is $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s [ 1 ] ) , Q _ { \lambda , p a s s } ( \bar { s } [ 1 ] ) \}$ .
|
| 85 |
+
|
| 86 |
+
Corollary 1 can be viewed as a necessary condition for a neural network to be 0-Whittle-accurate.
|
| 87 |
+
Below, we establish a sufficient condition for $\gamma$ -Whittle-accuracy.
|
| 88 |
+
|
| 89 |
+
Theorem 2. If the arm is strongly indexable, then for any $\gamma > 0$ and an arbitrarily small positive constant $\delta$ , there exists a positive such that the following statement holds: $H ,$ for any states $s _ { 0 } , s _ { 1 }$ and any activation cost $\bar { \lambda ^ { \prime } } \in [ f _ { \theta } ( s _ { 0 } ) - \delta , f _ { \theta } ( s _ { 0 } ) + \delta ]$ , the discounted net reward of applying a neural network to $E n v ( \lambda )$ with initial state $s _ { 1 }$ is at least $\dot { \operatorname* { m a x } } \{ Q _ { \lambda , a c t } ( s _ { 1 } ) , Q _ { \lambda , p a s s } ( s _ { 1 } ) \} - \epsilon _ { \ i }$ , then the neural network is $\gamma$ -Whittle-accurate.
|
| 90 |
+
|
| 91 |
+
Proof. For a given $\gamma$ , let $\epsilon = \operatorname * { m i n } _ { s } \lbrace \operatorname * { m i n } \lbrace Q _ { W ( s ) + \gamma , p a s s } ( s ) - Q _ { W ( s ) + \gamma , a c t } ( s ) , Q _ { W ( s ) - \gamma , a c t } ( s ) -$ $Q _ { W ( s ) - \gamma , p a s s } ( s ) \} \} / 2$ . Since the arm is strongly indexable and $W ( s )$ is its Whittle index, we have $\epsilon > 0$ .
|
| 92 |
+
|
| 93 |
+
We prove the theorem by establishing the following equivalent statement: If the neural network is not $\gamma$ -Whittle-accurate, then there exists states $s _ { 0 } , s _ { 1 }$ , activation cost $\lambda \in [ f _ { \theta } ( s _ { 0 } ) - \delta , f _ { \theta } ( s _ { 0 } ) + \delta ]$ , such that the discounted net reward of applying a neural network to $E n v ( \lambda )$ with initial state $s _ { 1 }$ is strictly less than $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s _ { 1 } ) , Q _ { \lambda , p a s s } ( s _ { 1 } ) \} - \epsilon$ .
|
| 94 |
+
|
| 95 |
+
Suppose the neural network is not $\gamma$ -Whittle-accurate, then there exists a state $s ^ { \prime }$ such that $\left| f _ { \theta } ( s ^ { \prime } ) - \right.$ $W ( s ^ { \prime } ) | > \gamma$ . We set $s _ { 0 } = s _ { 1 } = s ^ { \prime }$ . For the case $f _ { \theta } ( s ^ { \prime } ) > W ( s ^ { \prime } ) + \gamma$ , we set $\lambda = f _ { \boldsymbol { \theta } } ( s ^ { \prime } ) + \delta$ . Since $\lambda > W ( s ^ { \prime } ) + \gamma$ , we have $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s ^ { \prime } ) , Q _ { \lambda , p a s s } ( s ^ { \prime } ) \} = Q _ { \lambda , p a s s } ( s ^ { \prime } )$ and $Q _ { \lambda , p a s s } ( s ^ { \prime } ) \_$ $Q _ { \lambda , a c t } ( s ^ { \prime } ) \geq 2 \epsilon$ . On the other hand, since $f _ { \theta } ( s ^ { \prime } ) > \lambda$ , the neural network would activate the arm in the first round and its discounted reward is at most
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
Q _ { \lambda , a c t } ( s ^ { \prime } ) < Q _ { \lambda , p a s s } ( s ^ { \prime } ) - 2 \epsilon < \operatorname * { m a x } \{ Q _ { \lambda , a c t } ( s ^ { \prime } ) , Q _ { \lambda , p a s s } ( s ^ { \prime } ) \} - \epsilon .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
For the case $f _ { \theta } ( s ^ { \prime } ) < W ( s ^ { \prime } ) - \gamma$ , a similar argument shows that the discounted reward for the neural network when $\lambda = f _ { \boldsymbol { \theta } } \big ( \boldsymbol { s } ^ { \prime } \big ) - \delta$ is smaller than $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s ^ { \prime } ) , Q _ { \lambda , p a s s } ( s ^ { \prime } ) \} - \epsilon$ . This completes the proof. □
|
| 102 |
+
|
| 103 |
+
# 4.2 TRAINING PROCEDURES FOR NEURWIN
|
| 104 |
+
|
| 105 |
+
Thm. 2 states that a neural network that yields near-optimal net reward for any environments $E n v ( \lambda )$ is also Whittle-accurate. This observation motivates the usage of deep reinforcement learning to find Whittle-accurate neural networks. To make the output of the environments differentiable with respect to the input $f _ { \theta } ( s [ t ] )$ , we replace the step function in Fig. 1 with a sigmoid function $\sigma _ { m } ( f _ { \theta } ( s [ t ] ) - \lambda ) : = \left( 1 + e x p ( - m ( f _ { \theta } ( s [ t ] ) - \lambda ) ) \right) ^ { - 1 }$ , where $m$ is a sensitivity parameter. The environment then chooses $a [ t ] = 1$ with probability $\sigma _ { m } ( f _ { \theta } ( s [ t ] ) - \lambda )$ , and $a [ t ] = 0$ with probability $1 - \sigma _ { m } ( f _ { \theta } ( s [ t ] ) - \lambda )$ . We call this differentiable environment $E n v ^ { * } ( \lambda )$ .
|
| 106 |
+
|
| 107 |
+
Our training procedure consists of multiple mini-batches, where each mini-batch is composed of a fixed number of episodes. At the beginning of each mini-batch, we randomly select two states $s _ { 0 }$ and $s _ { 1 }$ . Motivated by the condition in Thm. 2, we consider the environment $\Dot { E n } v ^ { * } ( f _ { \theta } ( s _ { 0 } ) )$ with initial state $s _ { 1 }$ and aim to improve the empirical discounted net reward of applying the neural network to such an environment.
|
| 108 |
+
|
| 109 |
+
Our approach is based on the REINFORCE algorithm (Williams, 1992). In each episode $e$ , we set $\lambda = f _ { \theta } ( s _ { 0 } )$ and initial state to be $s _ { 1 }$ . We then apply the neural network with parameters $\theta$ to $E n v ^ { * } ( \lambda )$ and observe the sequences of actions $( a [ 1 ] , a [ 2 ] , \dots )$ and states $( s [ 1 ] , s [ 2 ] , \dots )$ . We can use these sequences to calculate their gradients with respect to $\theta$ through backward propagation, which we denote by $h _ { e }$ . We also observe the discounted net reward and denote it by $G _ { e }$ . After all episodes in the mini-batch finish, we calculate the average of all $G _ { e }$ as a bootstrapped baseline and denote it by $\bar { G } _ { b }$ . Finally, we do a weighted gradient ascent with the weight for episode $e$ being its offset net reward, $G _ { e } - \bar { G } _ { b }$ . When the step size is chosen appropriately, the neural network will be more likely to follow the sequences of actions of episodes with larger $G _ { e }$ after the weighted gradient ascent, and thus will have a better empirical discounted net reward. The complete algorithm is described in Alg. 1.
|
| 110 |
+
|
| 111 |
+
Obviously, the choice of $s _ { 0 }$ and $s _ { 1 }$ can have significant impact on the convergence speed of Alg. 1. In our implementation, we choose $s _ { 0 }$ uniformly at random in each mini-batch. The choice of $s _ { 1 }$ depends on the bandit problems. Some bandit problems naturally visit certain states far less frequently than other states. For such problems, we choose $s _ { 1 }$ to be those less-frequently-visited states with higher probabilities, so as to ensure that Alg. 1 is able to learn the optimal control for these states. For other problems, we simply choose $s _ { 1 } = s _ { 0 }$ .
|
| 112 |
+
|
| 113 |
+
# Algorithm 1: NeurWIN Training
|
| 114 |
+
|
| 115 |
+
<table><tr><td>Input: Parameters 0,discount factor β ∈ (O,1),learning rate L,sigmoid parameter m Output: Trained neural network parameters 0+ foreachmini-batchbdo Randomly choose so and s1,and set X ← fe(so) ; foreach episode ein themini-batch do Set the arm to state s1,and set he ←O ; foreach round t in the episode do Choose a[t] =1 w.p.δm(fe(s[t])-λ),and a[t]=O w.p.1-δm(fe(s[t])-λ); if a[t]=1then he←he+Vθln(om(fe(s[t])-λ));</td></tr><tr><td>else end Ge ← empirical discounted net reward in episode e;</td></tr><tr><td>end</td></tr><tr><td>he←he+Vθln(1-δm(fe(s[t])-λ)) ;</td></tr></table>
|
| 116 |
+
|
| 117 |
+
# 5 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
# 5.1 OVERVIEW
|
| 120 |
+
|
| 121 |
+
In this section, we demonstrate NeurWIN’s utility by evaluating it under three recently studied applications of restless bandit problems. In each application, we consider that there are $N$ arms and a controller can play $M$ of them in each round. We evaluate three different pairs of $( N , M )$ : $( 4 , 1 )$ , (100, 10), and (100, 25), and average the results of 200 independent runs when the problems are stochastic. Some applications consider that different arms can have different behaviors. For such scenarios, we consider that there are multiple types of arms and train a separate NeurWIN for each type. During testing, the controller calculates the index of each arm based on the arm’s state and schedules the $M$ arms with the highest indices.
|
| 122 |
+
|
| 123 |
+
The performance of NeurWIN is compared against the proposed policies in the respective recent studies. In addition, we also implement and evaluate the REINFORCE algorithm (Williams, 1992) and the QWIC algorithm $\mathrm { F u }$ et al., 2019). The REINFORCE algorithm aims to find the optimal control by viewing a restless bandit problem as a Markov decision problem. Under this view, the number of states is exponential in $N$ and the number of possible actions is $\textstyle { \binom { N } { M } }$ . Thus, we are only able to evaluate REINFORCE for the case $N = 4$ and $M = 1$ . The QWIC algorithm aims to find the Whittle index through Q-learning. It is a tabular method and does not scale well as the state space increases. Thus, we only evaluate QWIC when the size of the state space is small.
|
| 124 |
+
|
| 125 |
+
We use the same neural network architecture for NeurWIN in all three applications. The neural network is a fully connected one that consists of one input layer, one output layer, and two hidden layers. There are 16 and 32 neurons in the two hidden layers. The output layer has one neuron, and the input layer size is the same as the dimension of the state of one single arm. As for the REINFORCE algorithm, we choose the neural network architecture so that the total number of parameters is slightly more than $N$ times as the number of parameters in NeurWIN to make a fair comparison. ReLU activation function is used for the two hidden layers. An initial learning rate $L = 0 . 0 0 1$ is set for all cases, with the Adam optimizer (Kingma & Ba, 2015) employed for the gradient ascent step. The discount factor is $\beta = 0 . 9 9 9$ and each mini-batch consists of five episodes.
|
| 126 |
+
|
| 127 |
+
For all cases, we implement the NeurWIN algorithm using PyTorch (Paszke et al., 2019), and train the agent on a single arm modelled after OpenAI’s Gym API (Brockman et al., 2016). We provide a brief overview of each application and the experiment setting in the following sections. We refer readers to the appendices for detailed discussions on experiment settings.
|
| 128 |
+
|
| 129 |
+
# 5.2 RECOVERING BANDITS
|
| 130 |
+
|
| 131 |
+
The recovering bandits (Pike-Burke & Grunewalder, 2019) aim to model the time-varying behaviors of consumers. In particular, it considers that a consumer who has just bought a certain product, say, a television, would be much less interested in advertisements of the same product in the near future. However, the consumer’s interest in these advertisements may recover over time. Thus, the recovering bandit models the reward of playing an arm, i.e., displaying an advertisement, by a function $f ( \operatorname* { m i n } \{ z , z _ { m a x } \} )$ , where $z$ is the time since the arm was last played and $z _ { m a x }$ is a constant specified by the arm. There is no known Whittle index or optimal control policy for this problem.
|
| 132 |
+
|
| 133 |
+
The recent study (Pike-Burke & Grunewalder, 2019) on recovering bandit focuses on learning the function $f ( \cdot )$ for each arm. Once it obtains an estimate of $f ( \cdot )$ , it uses a heuristic called $d$ -lookahead to determine which arms to play. The $d$ -lookahead policy enumerates all possible actions in the next $d$ rounds, and then pick the sequence of actions that yield that highest reward. Since the controller can choose $M$ arms out of $N$ arms to activate, with $\mathbf { \bar { \rho } } _ { ( \mathcal { M } ) }$ different possibilities, in each round, the complexity of the heuristic is $O ( { \bigl ( } _ { M } ^ { N } ) ^ { d } )$ when $d > 1$ . Thus, we are only able to evaluate 1-lookahead when $N = 1 0 0$ . When $N = 4$ and $M = 1$ , we evaluate 1-lookahead and 3-lookahead.
|
| 134 |
+
|
| 135 |
+
In our experiment, we consider that there are four types of arms and there are $\textstyle { \frac { N } { 4 } }$ arms for each type. Different types of arms have different functions $f ( \cdot )$ . The state of each arm is its value of $\operatorname* { m i n } \{ z , z _ { m a x } \}$ and we set $z _ { m a x } = 2 0$ for all arms.
|
| 136 |
+
|
| 137 |
+
Experiment results are shown in Fig. 2. It can be observed that NeurWIN is able to outperform 1-lookahead in all settings with just a few thousands of training episodes. In contrast, for the case $N = 4$ and $M = 1$ , REINFORCE only sees slight performance improvement over 50,000 training episodes and remains far worse than NeurWIN. This may be due to the explosion of state space. Even though $N$ is only 4, the total number of possible states is $2 0 ^ { 4 } = 1 6 0 , \bar { 0 } 0 0$ , making it difficult for REINFORCE to learn the optimal control in just 50, 000 episodes. In contrast, since NeurWIN learns the Whittle index of each arm separately, its size of state space is only 20. QWIC performs poorly. This suggests that it does not learn a good approximation to the Whittle index.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 2: Experiment results for the recovering bandits.
|
| 141 |
+
|
| 142 |
+
# 5.3 WIRELESS SCHEDULING
|
| 143 |
+
|
| 144 |
+
A recent paper (Aalto et al., 2015) studies the problem of wireless scheduling over fading channels. In this problem, each arm corresponds to a wireless client. Each wireless client has some data to be transmitted and it suffers from a holding cost of 1 unit per round until it has finished transmitting all its data. The channel quality of a wireless client, which determines the amount of data can be transmitted if the wireless client is scheduled, changes over time. The goal is to minimize the sum of holding costs of all wireless clients. Equivalently, we view the reward of the system as the negative of the total holding cost.
|
| 145 |
+
|
| 146 |
+
Finding the Whittle index through theoretical analysis is difficult. Even for the simplified case when the channel quality is i.i.d. over time and can only be in one of two possible states, the recent paper (Aalto et al., 2015) can only derive the Whittle index under some approximations. It then proposes a size-aware index policy using its approximated index.
|
| 147 |
+
|
| 148 |
+
In the experiment, we adopt the settings of channel qualities of the recent paper. The channel of a wireless client can be in either a good state or a bad state. The amount of data that can be transmitted in a round is $3 3 . 6 \mathrm { k b }$ in a good state, and $8 . 4 \mathrm { k b }$ in a bad state. Initially, the amount of load is uniformly between 0 and 1Mb. The state of each arm is its channel state and the amount of remaining load. The size of state space is $2 \times 1 0 ^ { 6 }$ for each arm. We consider that there are two types of arms, and different types of arms have different probabilities of being in the good state. We train a NeurWIN for each type. During testing, there are $\begin{array} { l } { { \frac { N } { 2 } } } \end{array}$ arms of each type.
|
| 149 |
+
|
| 150 |
+
Experiment results are shown in Fig. 3. It can be observed that NeurWIN is able to outperform the size-aware index policy with about 100, 000 training episodes. This result is significant when one considers the fact that the size-aware index is itself an approximation to the Whittle index. The experiment results thus suggest that NeurWIN is able to find a more accurate approximation to the Whittle index than the best known theoretical result. It can also be observed that REINFORCE performs poorly.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 3: Average rewards and confidence bounds of different policies for wireless scheduling.
|
| 154 |
+
|
| 155 |
+
# 5.4 DEADLINE SCHEDULING
|
| 156 |
+
|
| 157 |
+
A recent study (Yu et al., 2018) proposes a deadline scheduling problem for the scheduling of electrical vehicle charging stations. In this problem, a charging station has $N$ charging spots and enough power to charge $M$ vehicles in each round. When a charging spot is available, a new vehicle may join the system and occupy the spot. Upon occupying the spot, the vehicle announces the time that it will leave the station and the amount of electricity that it needs to be charged. The charging station obtains a reward for each unit of electricity that it provides to a vehicle. However, if the station cannot fully charge the vehicle by the time it leaves, then the station needs to pay a penalty. The goal of the station is to maximize its net reward, defined as the difference between the amount of reward and the amount of penalty. Under an i.i.d. arrival assumption, the recent study has derived the precise characterization of the Whittle index, which we refer to as the deadline Whittle index. We further prove that this problem is strongly indexable in the appendix.
|
| 158 |
+
|
| 159 |
+
We use exactly the same setting as in the recent study (Yu et al., 2018) for our experiment. In this problem, the state of an arm is denoted by a pair of integers $( D , B )$ , where $B$ is the amount of electricity that the vehicle still needs and $D$ is the time until the vehicle leaves the station. When a charging spot is available, its state is $( 0 , 0 )$ . $B$ is upper-bounded by 9 and $D$ is upper-bounded by 12. Hence, the size of state space is 109 for each arm.
|
| 160 |
+
|
| 161 |
+
The experiment results are shown in Fig. 4. It can be observed that the performance of NeurWIN converges to that of the deadline Whittle index in less than 500 training episodes.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: Average rewards and confidence bounds of different policies for deadline scheduling.
|
| 165 |
+
|
| 166 |
+
# 5.5 EXPERIMENT RESULTS WITH NOISY SIMULATORS
|
| 167 |
+
|
| 168 |
+
The training of NeurWIN requires a simulator for each arm. In this section, we evaluate the performance of NeurWIN when the simulator is not perfectly precise. In particular, let $R _ { a c t } ( s )$ and $R _ { p a s s } ( s )$ be the rewards of an arm in state $s$ when it is activated and not activated, respectively. Then, the simulator estimates that the rewards are $R _ { a c t } ^ { \prime } ( s ) = ( 1 + G _ { a c t , s } ) R _ { a c t } ( s )$ and $R _ { p a s s } ^ { \prime } ( s ) = ( 1 + G _ { p a s s , s } ) R _ { i , p a s s } ( s )$ , respectively, where $G _ { a c t , s }$ and $G _ { p a s s , s }$ are independent Gaussian random variables with mean 0 and variance 0.05. In other words, the simulator has an average $5 \%$ error in its reward estimation.
|
| 169 |
+
|
| 170 |
+
We train NeurWIN using the noisy simulators for the recovering bandits problem and the deadline scheduling problem. For each problem, we compare the performance of NeurWIN against the respective baseline policies. Unlike NeurWIN, the baseline policies make decisions based on the true reward functions rather than the estimated ones. The results for the case $N = 1 0 0$ and $M = 2 5$ are shown in Fig. 5. It can be observed that NeurWIN is still able to achieve superior performance.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 5: Experiment results for NeurWIN with noisy simulators.
|
| 174 |
+
|
| 175 |
+
# 6 CONCLUSION
|
| 176 |
+
|
| 177 |
+
This paper introduced NeurWIN: a deep RL method for estimating the Whittle index for restless bandit problems. The performance of NeurWIN is evaluated by three different restless bandit problems. In each of them, NeurWIN significantly outperforms state-of-the-art control policies in terms of the total discounted reward.
|
| 178 |
+
|
| 179 |
+
NeurWIN can have important implications for restless bandit problems. There are many problems where the environments are well-defined, but the optimal control is not known. NeurWIN can obviously be used for such problems. For problems where the environments are not known a priori, NeurWIN nicely compliments existing studies that aim to learn the environments through online learning but fail to find the optimal control policy.
|
| 180 |
+
|
| 181 |
+
# REFERENCES
|
| 182 |
+
|
| 183 |
+
Samuli Aalto, Pasi Lassila, and Prajwal Osti. Whittle index approach to size-aware scheduling with time-varying channels. In Proceedings of the 2015 ACM SIGMETRICS International Conference on Measurement and Modeling of Computer Systems, pp. 57–69, 2015.
|
| 184 |
+
|
| 185 |
+
K. Avrachenkov and V. S. Borkar. A learning algorithm for the whittle index policy for scheduling web crawlers. In 2019 57th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 1001–1006, 2019.
|
| 186 |
+
|
| 187 |
+
V. S. Borkar and K. Chadha. A reinforcement learning algorithm for restless bandits. In 2018 Indian Control Conference (ICC), pp. 89–94, 2018.
|
| 188 |
+
|
| 189 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 190 |
+
|
| 191 |
+
Christopher R Dance and Tomi Silander. When are kalman-filter restless bandits indexable? In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 1711–1719. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/5922-when-are-kalman-filterrestless-bandits-indexable.pdf.
|
| 192 |
+
|
| 193 |
+
Christoph Dann, Tor Lattimore, and Emma Brunskill. Unifying pac and regret: Uniform pac bounds for episodic reinforcement learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, pp. 5717–5727, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964.
|
| 194 |
+
|
| 195 |
+
J. Fu, Y. Nazarathy, S. Moka, and P. G. Taylor. Towards q-learning the whittle index for restless bandits. In 2019 Australian New Zealand Control Conference (ANZCC), pp. 249–254, 2019.
|
| 196 |
+
|
| 197 |
+
Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E. Schapire. Contextual decision processes with low Bellman rank are PAC-learnable. volume 70 of Proceedings of Machine Learning Research, pp. 1704–1713, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/ jiang17c.html.
|
| 198 |
+
|
| 199 |
+
Diederick P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 200 |
+
|
| 201 |
+
J. Le Ny, M. Dahleh, and E. Feron. Multi-uav dynamic routing with partial observations using restless bandit allocation indices. In 2008 American Control Conference, pp. 4220–4225, 2008.
|
| 202 |
+
|
| 203 |
+
Alex S. Leong, Arunselvan Ramaswamy, Daniel E. Quevedo, Holger Karl, and Ling Shi. Deep reinforcement learning for wireless sensor scheduling in cyber–physical systems. Automatica, 113:108759, 2020. ISSN 0005-1098. doi: https://doi.org/ 10.1016/j.automatica.2019.108759. URL http://www.sciencedirect.com/science/ article/pii/S0005109819306223.
|
| 204 |
+
|
| 205 |
+
R. Meshram, D. Manjunath, and A. Gopalan. On the whittle index for restless multiarmed hidden markov bandits. IEEE Transactions on Automatic Control, 63(9):3046–3053, 2018.
|
| 206 |
+
|
| 207 |
+
Jose Ni ´ no-Mora. Dynamic priority allocation via restless bandit marginal productivity indices. ˜ Top, 15(2):161–198, 2007.
|
| 208 |
+
|
| 209 |
+
Christos H. Papadimitriou and John N. Tsitsiklis. The complexity of optimal queuing network control. Mathematics of Operations Research, 24(2):293–305, 1999. ISSN 0364765X, 15265471. URL http://www.jstor.org/stable/3690486.
|
| 210 |
+
|
| 211 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alche-Buc, E. Fox, ´ and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 8026–8037. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/9015-pytorchan-imperative-style-high-performance-deep-learning-library.pdf.
|
| 212 |
+
|
| 213 |
+
Ciara Pike-Burke and Steffen Grunewalder. Recovering bandits. In Advances in Neural Information Processing Systems, pp. 14122–14131, 2019.
|
| 214 |
+
|
| 215 |
+
Carlos Riquelme, George Tucker, and Jasper Snoek. Deep bayesian bandits showdown: An empirical comparison of bayesian deep networks for thompson sampling. In International Conference on Learning Representations (ICLR), 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SyYe6k-CW.
|
| 216 |
+
|
| 217 |
+
Julien Seznec, Pierre Menard, Alessandro Lazaric, and Michal Valko. A single algorithm for both restless and rested rotting bandits. In International Conference on Artificial Intelligence and Statistics, pp. 3784–3794, 2020.
|
| 218 |
+
|
| 219 |
+
Aleksandrs Slivkins and Eli Upfal. Adapting to a changing environment: the brownian restless bandits. In COLT, pp. 343–354, 2008.
|
| 220 |
+
|
| 221 |
+
Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. The MIT Press, second edition, 2018. URL http://incompleteideas.net/book/the-book2nd.html.
|
| 222 |
+
|
| 223 |
+
V. Tripathi and E. Modiano. A whittle index approach to minimizing functions of age of information. In 2019 57th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 1160–1167, 2019.
|
| 224 |
+
|
| 225 |
+
S. Wang, H. Liu, P. H. Gomes, and B. Krishnamachari. Deep reinforcement learning for dynamic multichannel access in wireless networks. IEEE Transactions on Cognitive Communications and Networking, 4(2):257–265, 2018.
|
| 226 |
+
|
| 227 |
+
T. Wei, Yanzhi Wang, and Q. Zhu. Deep reinforcement learning for building hvac control. In 2017 54th ACM/EDAC/IEEE Design Automation Conference (DAC), pp. 1–6, 2017.
|
| 228 |
+
|
| 229 |
+
Peter Whittle. Restless bandits: Activity allocation in a changing world. Journal of applied probability, pp. 287–298, 1988.
|
| 230 |
+
|
| 231 |
+
Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn., 8(3–4):229–256, May 1992. ISSN 0885-6125. doi: 10.1007/ BF00992696. URL https://doi.org/10.1007/BF00992696.
|
| 232 |
+
|
| 233 |
+
Huizhen Yu and Dimitri P Bertsekas. Convergence results for some temporal difference methods based on least squares. IEEE Transactions on Automatic Control, 54(7):1515–1531, 2009.
|
| 234 |
+
|
| 235 |
+
Z. Yu, Y. Xu, and L. Tong. Deadline scheduling as restless bandits. IEEE Transactions on Automatic Control, 63(8):2343–2358, 2018.
|
| 236 |
+
|
| 237 |
+
Andrea Zanette and Emma Brunskill. Problem dependent reinforcement learning bounds which can identify bandit structure in MDPs. volume 80 of Proceedings of Machine Learning Research, pp. 5747–5755, Stockholmsmassan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL ¨ http: //proceedings.mlr.press/v80/zanette18a.html.
|
| 238 |
+
|
| 239 |
+
Qing Zhao. Multi-armed bandits: Theory and applications to online learning in networks. Synthesis Lectures on Communication Networks, 12(1):1–165, 2019.
|
| 240 |
+
|
| 241 |
+
# A RECOVERING BANDITS’ TRAINING AND INFERENCE DETAILS
|
| 242 |
+
|
| 243 |
+
A.1 FORMULATED RESTLESS BANDIT FOR THE RECOVERING BANDITS’ CASE
|
| 244 |
+
|
| 245 |
+
We list here the terms that describes one restless arm in the recovering bandits’ case:
|
| 246 |
+
|
| 247 |
+
State $s [ t ]$ : The state is a single value $s [ t ] = z [ t ]$ called the waiting time. The waiting time $z [ t ]$ indicates the time since the arm was last played. The arm state space is determined by the maximum allowed waiting time $z _ { m a x }$ , giving a state space $\begin{array} { r } { \boldsymbol { S } : = [ 1 , \boldsymbol { z } _ { m a x } ] } \end{array}$ .
|
| 248 |
+
|
| 249 |
+
Action $a [ t ]$ : As with all other considered cases, the agent can either activate the arm $a [ t ] = 1$ , or not select it $a [ t ] = 0$ . The action space is then $\mathcal { A } : = \{ 0 , \bar { 1 } \}$ .
|
| 250 |
+
|
| 251 |
+
Reward $r [ t ]$ : The reward is provided by the recovering function $f ( z [ t ] )$ , where $z [ t ]$ is the time since the arm was last played at time $t$ . If the arm is activated, the function value at $z [ t ]$ is the earned reward. A reward of zero if given if the arm is left passive $a [ t ] = 0$ . Figure 6 shows the four recovering functions used in this work. The recovering functions are generated from,
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
f ( z [ t ] ) = \theta _ { 0 } ( 1 - e ^ { - \theta _ { 1 } \cdot z [ t ] } )
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
Where the $\Theta = [ \theta _ { 0 } , \theta _ { 1 } ]$ values specify the recovering function. The $\Theta$ values for each class are given in table 1.
|
| 258 |
+
|
| 259 |
+
Table 1: $\Theta$ values used in the recovering bandits’ case
|
| 260 |
+
|
| 261 |
+
<table><tr><td>Class</td><td>00Value</td><td>01 Value</td></tr><tr><td></td><td></td><td>0.2</td></tr><tr><td>A B</td><td>10</td><td>0.4</td></tr><tr><td>C</td><td>8.5</td><td></td></tr><tr><td></td><td>7</td><td>0.6</td></tr><tr><td>D</td><td>5.5</td><td>0.8</td></tr></table>
|
| 262 |
+
|
| 263 |
+
Next state $s [ t + 1 ]$ : The state evolves based on the selected action. If $a [ t ] = 1$ , the state is reset to $s [ t + 1 ] = 1$ , meaning that bandit’s reward decayed to the initial waiting time $z [ t + 1 ] = 1$ . If the arm is left passive $a [ t ] = 0$ , the next state becomes $s [ t + 1 ] = \operatorname* { m i n } \{ z [ t ] \stackrel { . } { + } 1 , z _ { m a x } \stackrel { . } { } \}$ .
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 6: The selected recovering functions for the recovering bandits’ case. For testing, we set each quarter of the instantiated $N$ arms to one of the shown $f ( z )$ functions.
|
| 267 |
+
|
| 268 |
+
# A.2 TRAINING SETTING
|
| 269 |
+
|
| 270 |
+
The general training procedure for the NeurWIN algorithm is outlined in its pseudo code in section 4. Here we discuss the parameter selection and details specific to the recovering bandits’ case. We train the neural network using NeurWIN for 50, 000 episode, and save the trained parameters at an episode interval of 100 episodes. The purpose of saving the parameters is to infer their control policies, and compare it with the 1-lookahead policy. In total, for 50, 000 training episodes, we end up with 500 models for inference. The selected neural network has 609 trainable parameters given as $\{ 1 , 1 6 , 3 2 , 1 \}$ layer neurons.
|
| 271 |
+
|
| 272 |
+
For training parameters, we select the sigmoid value $m = 5$ , the episode’s time horizon $T = 1 0 0$ timesteps, the mini-batch size to 5 episodes, and the discount factor $\beta = 0 . 9 9 9$ . As with all other cases, each mini-batch of episodes has the same initial state $s [ t = 1 ]$ which is provided by the arm. To ensure the agent experiences as many states in $[ 1 , z _ { m a x } ]$ as possible, we set an initial state sampling distribution given as P r{s[t = 1] = z} = 2z21+22+...+2zmax . H ence, the probability of selecting the initial state to be $s [ t = 1 ] = z _ { m a x }$ is 0.5. This initialization distribution allows the agent to experience the recovery function’s awards at higher $z$ values.
|
| 273 |
+
|
| 274 |
+
At the agent side, we set the activation cost $\lambda$ at the beginning of each mini-batch. $\lambda$ is chosen to be the estimate index value $f _ { \theta } ( s ^ { ' } )$ of a randomly selected state in $s ^ { ' } \in [ 1 , z _ { m a x } ]$ . The training continues as described in NeurWIN’s pseudo code: the agent receives the state, and selects an action $a [ t ]$ . If the agent activates the arm $a [ t ] = 1$ , it receives a reward equal to the recovery function’s value at $z$ , and subtracts $\lambda$ from it. Otherwise, the reward $r [ t ]$ is kept the same for $a [ t ] = 0$ . We note that no noise was added with the clean simulator, and the agent discounts the original reward value $\beta ^ { t } r [ t ] = \beta ^ { t } f ( z [ t ] )$ . The process continues for all timesteps in the episode up to $T = 1 0 0$ , and for remaining mini-batch episodes. A gradient ascent step is taken on the bootstrapped mini-batch return as described in section 4.
|
| 275 |
+
|
| 276 |
+
# A.3 INFERENCE SETTING
|
| 277 |
+
|
| 278 |
+
The inference setup measures NeurWIN’s control policy for several $\binom { N } { M }$ settings. We test, for a single run, the control policies of NeurWIN and 1-lookahead over a time horizon $T \ : = \ : 3 0 0 0$ timesteps. We set $N$ arms such that a quarter have one recovering function class from table 1. For example, when $N = 1 0 0$ , 25 arms would have recovering function A that generates their rewards.
|
| 279 |
+
|
| 280 |
+
At each timestep, the 1-lookahead policy ranks the recovering functions reward values, and selects the $M$ arms with the highest reward values for activation. The incurred discounted reward at time $t$ is the discounted sum of all activated arms’ rewards. The total discounted reward is then the discounted rewards over time horizon $T = 3 0 0 0$ . For inferring NeurWIN’s control policy, we record the total discounted reward for each of the 500 models. An example testing procedure is as follows: we instantiate $N$ arms each having a neural network trained to 10, 000 episodes. At each timestep $t$ , the neural networks provide the estimated index $f _ { i , \theta } ( s _ { i } [ t ] )$ for $i = 1 , 2 , \dots , N$ . The control policy activates the $M$ arms with the highest index values. The incurred discounted reward at time $t$ is the discounted sum of all activated arm’s rewards $\begin{array} { r } { \beta ^ { t } R [ t ] = \beta ^ { t } \sum _ { j = 1 } ^ { M } f _ { j } ( z [ t ] ) } \end{array}$ . The same process continues for all timesteps in the horizon $T = 3 0 0 0$ . We then load the model parameters trained on 10, 100 episodes, and repeat the aforementioned testing process using the same seed values.
|
| 281 |
+
|
| 282 |
+
# A.4 REINFORCE TRAINING AND INFERENCE SETTING ON RECOVERING BANDITS
|
| 283 |
+
|
| 284 |
+
The REINFORCE algorithm was applied only the $\textstyle { \binom { N } { M } }$ case where $N \ = \ 4$ , and $M \ = \ 1$ . For training, REINFORCE had four arms each with one of the recovery functions detailed in table 1. The training parameters are: initial learning rate $L = 0 . 0 0 1$ , mini-batch size is 5 episodes, and a training episode time horizon $T = 1 0 0$ timesteps. Training was done up to 50, 000 episodes, where the trained parameters were saved at an interval of 100 episodes. The selected neural network had 2504 trainable parameters. This neural network size is larger than $6 0 9 \times 4 = 2 4 3 6$ parameters of four NeurWIN neural networks.
|
| 285 |
+
|
| 286 |
+
For testing, the same procedure is followed as in A.3. The trained REINFORCE models were loaded, and each tested on the same arms as NeurWIN and deadline Whittle index policies. The testing was made for all 500 trained model (each being trained up to a different episode count). The final control policy result was plotted along with NeurWIN and the 1-lookahead policies for $\binom { 4 } { 1 }$ arms.
|
| 287 |
+
|
| 288 |
+
# A.5 QWIC TRAINING AND INFERENCE SETTING ON RECOVERING BANDITS
|
| 289 |
+
|
| 290 |
+
The Q-learning Whittle Index Controller (was trained in an offline setting using fixed WIC) pserestless a deth given in activatio $\mathrm { F u }$ et a(i.e. . $N$ $M$ ${ \binom { 4 } { 1 } } \ { \binom { 1 0 0 } { 1 0 } } \ { \binom { \bar { 1 } 0 0 } { 2 5 } } \ )$ $\lambda \in \Lambda$ as index for each state. The algorithm
|
| 291 |
+
learns $\mathrm { Q }$ function $Q \in \mathbb { R } ^ { \Lambda \times S \times \{ 0 , 1 \} }$ . The estimated index $\tilde { \lambda } [ s ]$ per state $s$ is determined during
|
| 292 |
+
training as,
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\tilde { \lambda } [ s ] = \operatorname * { a r g m i n } _ { \lambda \in \Lambda } \vert Q ( \lambda , s , 1 ) - Q ( \lambda , s , 0 ) \vert
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Hence, the converged index values and control performance depends on the initial set of candidate values $\Lambda$ . We select $\Lambda$ to be 100 values evenly spaced in the interval [0, 10]. We note the set selection was based on NeurWIN’s learned index values, which provides an advantage to QWIC training.
|
| 299 |
+
|
| 300 |
+
The exploration-exploitation trade-off is steered by parameter $\epsilon$ . $\epsilon$ is initialized to $\epsilon _ { m a x } = 1$ , and decays with factor $\alpha = 0 . 0 1$ to $\epsilon _ { m i n } = 0 . 0 1$ . $\epsilon$ is updated at each timestep during training until it settles at $\epsilon _ { m i n }$ .
|
| 301 |
+
|
| 302 |
+
Other training parameters were selected as: initial learning rate $L = 0 . 0 0 1$ , training episode time horizon of $T = 1 0 0$ timesteps, discount factor $\beta ~ = ~ 0 . 9 9 9$ , . Training was done up to 50, 000 episodes, where the Q-learned indices $\bar { \Lambda }$ were saved at an interval of 100 episodes.
|
| 303 |
+
|
| 304 |
+
For testing, we use the same testing setting as in NeurWIN and REINFORCE. The learned indices are loaded for each training interval. In total, 500 estimated index mappings were tested for 200 independent runs, each trained up to a certain episode limit.
|
| 305 |
+
|
| 306 |
+
# B WIRELESS SCHEDULING TRAINING AND INFERENCE DETAILS
|
| 307 |
+
|
| 308 |
+
B.1 RESTLESS ARM DEFINITION FOR THE WIRELESS SCHEDULING CASE
|
| 309 |
+
|
| 310 |
+
As with the recovering bandits’ case, we first list the state $s [ t ]$ , action $a [ t ]$ , reward $r [ t ]$ , and next state $s [ t + 1 ]$ that forms one restless arm:
|
| 311 |
+
|
| 312 |
+
State $s [ t ]$ : The state is a vector $( y [ t ] , v [ t ] )$ , where $y [ t ]$ is the arm’s remaining load in bits, and $v [ t ]$ is the wireless channel’s state indicator. $v [ t ] = 1$ means a good channel state and a higher transmission rate $r _ { 2 }$ , while $v [ t ] = 0$ is a bad channel state with a lower transmission rate $r _ { 1 }$ .
|
| 313 |
+
|
| 314 |
+
Action $a [ t ]$ : The agent either activates the arm $a [ t ] = 1$ , or keeps it passive $a [ t ] = 0$ . The reward and next state depend on the chosen action.
|
| 315 |
+
|
| 316 |
+
Reward $r [ t ]$ : The arm’s reward is the negative of holding cost $\psi$ , which is a cost incurred at each timestep for not completing the job. If the selected action $a [ t ] = 1$ , then the reward at time $t$ is $r [ t ] = \bar { - } \psi - \lambda$ . Otherwise, reward is just $r [ t ] = - \psi$ .
|
| 317 |
+
|
| 318 |
+
Next state $s [ t + 1 ]$ : The next state evolves differently as given below,
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
s [ t + 1 ] = \left\{ { \begin{array} { l l } { ( y [ t ] - r _ { 2 } , 1 ) \qquad } & { { \mathrm { i f ~ } } q ( v [ t ] ) = 1 , a [ t ] = 1 } \\ { \qquad } \\ { ( y [ t ] - r _ { 1 } , 0 ) \qquad } & { { \mathrm { i f ~ } } q ( v [ t ] ) = 0 , a [ t ] = 1 } \\ { \qquad } \\ { ( y [ t ] , q ( v [ t ] ) ) \qquad } & { { \mathrm { o t h e r w i s e } } } \end{array} } \right.
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
Where $q ( v [ t ] )$ is the probability of a good channel state.
|
| 325 |
+
|
| 326 |
+
# B.2 TRAINING SETTING
|
| 327 |
+
|
| 328 |
+
We again emphasize that NeurWIN training happens only on one restless arm. The general training procedure was described in NeurWIN’s pseudo code. This discussion pertains only to the wireless scheduling case.
|
| 329 |
+
|
| 330 |
+
The neural network has 625 trainable parameters given as $\{ 2 , 1 6 , 3 2 , 1 \}$ neuron layers. The training happens for 1, 000, 000 episodes, and we save the model parameters at each 1000 episodes. Hence, the training results in 1000 models trained up to different episode limit.
|
| 331 |
+
|
| 332 |
+
For the wireless scheduling case, we set the sigmoid value $m = 0 . 0 1$ , mini-batch size to 5 episodes, and the discount factor to $\beta = 0 . 9 9 9$ . Episode time horizon is dependent on the remaining job size $y [ t ]$ . The episode terminates either if $y [ t ] = 0$ or $t = 3 0 0 0$ . The holding cost is set to $c = 1$ , which is incurred for each timestep the job is not completed. We also set the good transmission rate $r _ { 2 } = 3 3 . 6 \mathrm { k b }$ , and the bad channel transmission rate $r _ { 1 } = 8 . 4 \mathrm { k b }$ . During training, the good channel probability is $q ( v [ t ] ) = 0 . 5$ .
|
| 333 |
+
|
| 334 |
+
The episode defines one job size sampled uniformly from the range $y [ t = 1 ] \sim ( 0 , 1 \mathrm { M b } ]$ . All episodes in one mini-batch have the same initial state, as well as the same sequence of good channel states $[ v [ t = 1 ] , v [ t = 2 ] , \ldots , v [ t = T ] ]$ .
|
| 335 |
+
|
| 336 |
+
At the agent side, NeurWIN receives the initial state $s [ t = 1 ]$ , and sets the activation cost $\lambda =$ $f _ { \theta } ( s [ t = 1 ] )$ for all timesteps of all mini-batch episodes. As mentioned before, we save the trained model at an interval of 1000 episodes. For $1 , 0 0 0 , 0 0 0$ episodes, this results in 1000 models trained up to their respective episode limit.
|
| 337 |
+
|
| 338 |
+
# B.3 INFERENCE SETTING
|
| 339 |
+
|
| 340 |
+
For testing, the aim is to measure the trained models’ control performance against the size-aware index. We instantiate $N$ arms and activate $M$ arms at each timestep $t$ until all users’ jobs terminate. We average the total discounted reward for all control policies over 200 independent inference runs. Half of the arms have a good channel probability $q ( v [ \bar { t } ] ) = 0 . 7 5$ . The other half has a good channel probability $q ( v [ t ] ) = 0 . 1$ .
|
| 341 |
+
|
| 342 |
+
We compare NeurWIN’s control policy at different training episodes’ limits with the size-aware index policy. The size-aware index is defined as follows: at each timestep, the policy prioritizes arms in the good channel state, and calculates their secondary index. The secondary index $\hat { v } _ { i }$ of arm $i$ state $( y _ { i } [ t ] , v _ { i } [ t ] )$ is defined as,
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\hat { v } _ { i } ( y _ { i } [ t ] , v _ { i } [ t ] ) = \frac { c _ { i } r _ { i , 2 } } { y _ { i } [ t ] }
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
The size-aware policy then activates the highest $M$ indexed arms. In case the number of good channel arms is below $M$ , the policy also calculate the primary index of all remaining arms. The primary index $v _ { i }$ of arm $i$ state $( y _ { i } [ t ] , v _ { i } [ t ] )$ is defined as,
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
v _ { i } ( y _ { i } [ t ] , v _ { i } [ t ] ) = \frac { c _ { i } } { q _ { i } [ t ] ( r _ { i , 2 } / r _ { i , 1 } ) - 1 }
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
Rewards received from all arms are summed, and discounted using $\beta = 0 . 9 9 9$ . The inference phase proceeds until all jobs have been completed.
|
| 355 |
+
|
| 356 |
+
For NeurWIN’s control policy, we record the total discounted reward for the offline-trained models. For example, we set $N$ arms each coupled with a model trained on $1 0 , 0 0 0$ episodes. The models output their arms’ indices, and the top $M$ indexed arms are activated. In case the remaining arms are less than the sum $M$ , we activate all remaining arms at timestep ll arms’ rewards. Once testing for the curre $t$ . timestep reward t model is finishe $\begin{array} { r } { \beta ^ { t } R [ t ] = \beta ^ { t } \sum _ { i = 1 } ^ { N } r [ t ] } \end{array}$ isel 11, 000 for each arm, and repeat the process. We note that the arms’ initial loads are the same across runs, and that the sequence of good channel states is random.
|
| 357 |
+
|
| 358 |
+
# B.4 REINFORCE TRAINING AND INFERENCE SETTING ON WIRELESS SCHEDULING
|
| 359 |
+
|
| 360 |
+
The REINFORCE algorithm was applied only the $\binom { 4 } { 1 }$ case. The four arms have the same training setting as described in section B.2. The training parameters are: initial learning rate $L = 0 . 0 0 1$ mini-batch size is 5 episodes, and good channel probability for all four arms $q ( v [ t ] ) = 0 . 5$ . The episode time horizon has a hard limit of $\bar { T } = \dot { 3 0 0 0 }$ timesteps. However, an episode can terminate if all arms’ loads were fully processed (i.e. episodes, where the trained parameters were sav $\begin{array} { r } { \sum _ { i = 1 } ^ { 4 } y _ { i } [ t ] = 0 } \end{array}$ ). Training was done up to 100, 000of 1000 episodes. The selected neural network had 2532 trainable parameters so to have slightly more parameters than four NeurWIN neural networks.
|
| 361 |
+
|
| 362 |
+
For testing, the same procedure is followed as in B.3. The trained REINFORCE models were loaded, and each tested on the same arms as NeurWIN and size-aware index. The final control policy result was plotted along with NeurWIN and Whittle index policy for the $\binom { 4 } { 1 }$ testing setup.
|
| 363 |
+
|
| 364 |
+
# C DEADLINE SCHEDULING TRAINING AND INFERENCE DETAILS
|
| 365 |
+
|
| 366 |
+
C.1 FORMULATED RESTLESS BANDIT FOR THE DEADLINE SCHEDULING CASE
|
| 367 |
+
|
| 368 |
+
The state $s [ t ]$ , action $a [ t ]$ , reward $r [ t ]$ , and next state $s [ t + 1 ]$ of one arm are listed below:
|
| 369 |
+
|
| 370 |
+
State $s [ t ]$ : The state is a vector $( D , B )$ . $B$ denotes the job size (i.e. amount of electricity needed for an electric vehicle), and $D$ is the job’s time until the hard drop deadline $d$ is reached (i.e. time until an electric vehicle leaves).
|
| 371 |
+
|
| 372 |
+
Action $a [ t ]$ : The agent can either activate the arm $a [ t ] = 1$ , or leave it passive $a [ t ] = 0$ . The next state changes based on two different transition kernels depending on the selected action. The reward is also dependent on the action at time $t$ .
|
| 373 |
+
|
| 374 |
+
Reward $r [ t ]$ : The agent, at time $t$ , receives a reward $r [ t ]$ from the arm,
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
r [ t ] = \left\{ \begin{array} { l l } { ( 1 - c ) a [ t ] } & { \mathrm { ~ i f ~ } B [ t ] > 0 , D [ t ] > 1 } \\ { \qquad } \\ { ( 1 - c ) a [ t ] - F ( B [ t ] - a [ t ] ) } & { \mathrm { ~ i f ~ } B [ t ] > 0 , D [ t ] = 1 } \\ { \qquad } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
Where $c$ is a constant processing cost incurred when activating the arm, $F ( B [ t ] - a [ t ] )$ is the penalty function for failing to complete the job before $D = 1$ . The penalty function was chosen to be $F ( B [ t ] - a [ t ] ) = \bar { 0 } . 2 ( B [ t ] - a [ t ] ) ^ { 2 }$ .
|
| 381 |
+
|
| 382 |
+
Next state $s [ t + 1 ]$ : The next state $D [ t + 1 ]$ decreases by one, while the job size $B$ depends on the selected action as,
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
s [ t + 1 ] = \left\{ \begin{array} { l l } { ( D [ t ] - 1 , B [ t ] - a [ t ] ) \qquad } & { \mathrm { ~ i f ~ } D [ t ] > 1 } \\ { \qquad } \\ { ( D , B ) \mathrm { ~ w i t h ~ p r o b . ~ } Q ( D , B ) \qquad } & { \mathrm { ~ i f ~ } D [ t ] \leq 1 } \end{array} \right.
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
Where $Q ( D , B )$ is the arrival probability of a new job (i.e. a new electric vehicle arriving at a charging station) if the position is empty. For training and inference, we set $Q ( D , B ) = 0 . 7$ .
|
| 389 |
+
|
| 390 |
+
C.2 STRONG INDEXABILITY PROOF FOR THE DEADLINE SCHEDULING CASE
|
| 391 |
+
|
| 392 |
+
It has been shown that the Whittle index for this problem is,
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
v ( D , B ) : = \left\{ \begin{array} { l l } { 0 \qquad } & { \mathrm { i f } \ B = 0 } \\ { \qquad } \\ { 1 - c \qquad } & { \mathrm { i f } \ 1 \leq B \leq D - 1 } \\ { \qquad } \\ { \beta ^ { D - 1 } F ( B - D + 1 ) \qquad } \\ { - \beta ^ { D - 1 } F ( B - D ) + 1 - c \qquad } & { \mathrm { i f } \ D \leq B } \end{array} \right.
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
We further demonstrate that this problem is strongly indexable.
|
| 399 |
+
|
| 400 |
+
Theorem 3. The restless bandit for the deadline scheduling problem is strongly indexable.
|
| 401 |
+
|
| 402 |
+
Proof. Fix a state $s = ( D , B )$ , the function $D _ { s } ( \lambda ) : = ( Q _ { \lambda , a c t } ( s ) - Q _ { \lambda , p a s s } ( s ) )$ is a continuous and piece-wise linear function since the number of states is finite. Thus, it is sufficient to prove that $D _ { s } ( \lambda )$ is strictly decreasing at all points of $\lambda$ where $D _ { s } ( \lambda )$ is differentiable. Let $L _ { \lambda , a c t } ( s )$ be the sequence of actions taken by a policy that activates the arm at round 1, and then uses the optimal policy starting from round 2. Let $L _ { \lambda , p a s s } ( s )$ be the sequence of actions taken by a policy that does not activate the arm at round 1, and then uses the optimal policy starting from round 2. We prove this theorem by comparing $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ on every sample path. We consider the following two scenarios:
|
| 403 |
+
|
| 404 |
+
In the first scenario, $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ are the same starting from round 2. Let $b$ be the remaining job size when the current deadline expires under $L _ { \lambda , a c t } ( s )$ . Since $L _ { \lambda , p a s s } ( s )$ is the same as $L _ { \lambda , a c t } ( s )$ starting from round 2, its remaining job size when the current deadline expires is $b + 1$ . Thus, $D _ { s } ( \lambda ) = 1 - c - \lambda + \beta ^ { D - 1 } ( F ( b + 1 ) - F ( b ) )$ , which is strictly decreasing in $\lambda$ whenever $D _ { s } ( \lambda )$ is differentiable.
|
| 405 |
+
|
| 406 |
+
In the second scenario, $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ are not the same after round 2. Let $\tau$ be the first time after round 2 that they are different. Since they are the same between round 2 and round $\tau$ , the remaining job size under $L _ { \lambda , a c t } ( s )$ is no larger than that under $L _ { \lambda , p a s s } ( s )$ . Moreover, the Whittle index is increasing in job size. Hence, we can conclude that, on round $\tau$ , $L _ { \lambda , p a s s } ( s )$ activates the arm and $L _ { \lambda , a c t } ( s )$ does not activate the arm. After round $\tau$ , $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ are in the same state and will choose the same actions for all following rounds. Thus, the two sequences only see different rewards on round 1 and round $\tau$ , and we have $D _ { s } ( \lambda ) = ( 1 - c - \lambda ) ( 1 - \bar { \beta } ^ { \tau - 1 } )$ , which is strictly decreasing in $\lambda$ whenever $D _ { s } ( \lambda )$ is differentiable.
|
| 407 |
+
|
| 408 |
+
Combining the two scenarios, the proof is complete.
|
| 409 |
+
|
| 410 |
+
# C.3 TRAINING SETTING
|
| 411 |
+
|
| 412 |
+
NeurWIN training is made for 1000 episodes on the deadline scheduling case. We save the trained model parameters at an interval of 5 episodes for inferring the control policy after training. Hence, the training produces 200 different set of parameters that output the estimated index given their respective training limit. The neural network had 625 trainable parameters given as $\{ 2 , 1 6 , 3 2 , 1 \}$ , where the input layer matches the state size.
|
| 413 |
+
|
| 414 |
+
For the deadline scheduling training, we set the sigmoid value $m = 1$ , episode’s time horizon $T =$ 3000 timesteps, mini-batch size to 5 episodes, and the discount factor $\beta = 0 . 9 9 9$ . The processing cost $c = 0 . 5$ , with the job arrival rate $Q ( D , B ) = 0 . 7 $ . Training procedure follows section 4.2 from the main text. The arm randomly picks an initial state $s [ t = 1 ] = ( D , B )$ , with a maximum $\bar { D } = 1 2$ , and maximum $\bar { B } = 9$ . The arm fixes the initial states across episodes in the same minibatch for proper return comparison. The sequence of job arrivals in an episode’s horizon is also fixed across a mini-batch. For example, one episode in mini-batch 1 would have the sequence $[ ( 1 1 , 5 ) , ( 6 , 2 ) , ( 8 , 4 ) , \dots , ( 3 , 5 ) ]$ , then all other episodes in the same mini-batch would pass the same sequence. This way, the actions taken by the agent would be the critical factor in comparing a mini-batch return, and ultimately in tuning the estimated index value $f _ { \theta } ( \cdot )$ .
|
| 415 |
+
|
| 416 |
+
At the agent side, NeurWIN receives the initial state $s [ t = 1 ]$ , sets the activation cost $\begin{array} { r } { \lambda = f _ { \theta } ( s [ t = } \end{array}$ 1]). This activation cost $\lambda$ selection method hence depends on the current network parameters $\theta$ , which are modified after every gradient ascent step. Training follows as described in NeurWIN’s pseudo code.
|
| 417 |
+
|
| 418 |
+
In figure 7, we plot the trained NeurWIN index for all possible state enumerations of $\bar { B } = 9$ and $D \in \{ 1 , 2 , 3 \}$ . The output index from the untrained neural network is also plotted for convergence comparison.
|
| 419 |
+
|
| 420 |
+
In figure 8, the trained restless bandit indices for noisy reward function is given. All possible states in $\bar { B } = 9$ for $D \in \{ 1 , 2 , 3 \}$ . For $\mathcal { N } ( 0 , 0 . 0 5 )$ added noise per timestep, the learned indices still match the state ordering found when trained with the true reward function.
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
Figure 7: Trained indices using the true reward function.
|
| 424 |
+
|
| 425 |
+

|
| 426 |
+
Figure 8: Trained indices using the noisy reward function.
|
| 427 |
+
|
| 428 |
+
# C.4 INFERENCE SETTING
|
| 429 |
+
|
| 430 |
+
In order to infer the resultant control policy, we are required to test the performance on models saved at different episodes’ intervals. In other words, the trained models’ parameters are tested at an interval of episodes, and their discounted rewards are plotted for comparison.
|
| 431 |
+
|
| 432 |
+
From the trained models described in C.3, we instantiate $N$ arms, and activate $M$ arms at each timestep. The inference step compares the resultant control policy with the deadline Whittle index $v ( D , B )$ .
|
| 433 |
+
|
| 434 |
+
The testing is done for a time horizon of $T = 3 0 0 0$ timesteps. The queue, modelled as $N$ restless arms, has $M$ positions activated at each timestep. Each arm has a unique sequence of job arrivals from other arms that differentiates its index value. For the deadline Whittle index, we calculate the indices according to 8, and activate the highest $M$ indices-associated arms. The accumulated reward from all arm (activated and passive) is then discounted with $\beta$ .
|
| 435 |
+
|
| 436 |
+
For NeurWIN control policy, we instantiate $N$ arms, and test the trained models up to a given episode. For example, we load a NeurWIN model trained for 100 episodes on one arm, and set $N$ arms each with its own trained agent on 100 episodes. Once the testing is complete, we load the next model trained at 105 episodes, and repeat the process for 105 episodes. The final result is NeurWIN’s control policy’s performance on $N$ arms given the models’ training.
|
| 437 |
+
|
| 438 |
+
We perform the testing over 200 independent runs up to 1000 episodes, where each run the arms are seeded differently. We stress that both the deadline Whittle index and NeurWIN policies were applied on identical seeded arms across the 200 runs. Meaning the sequence of arrivals and rewards experienced was fixed for each arm in each run. Results were provided in the main text for this setting.
|
| 439 |
+
|
| 440 |
+
# C.5 REINFORCE TRAINING AND INFERENCE SETTING ON DEADLINE SCHEDULING
|
| 441 |
+
|
| 442 |
+
The REINFORCE algorithm was applied on the $\binom { 4 } { 1 }$ testing case. For training, REINFORCE was trained on the same training setting as described in C.3 with the same parameters when appropriate.
|
| 443 |
+
|
| 444 |
+
The four restless arms were seeded differently to give unique job sequences. Training was made until 1000 episodes, where the trained parameters were saved at an interval of 5 episodes. The selected neural network had 2532 trainable parameters. The REINFORCE parameters’ count are purposefully slightly larger than $6 2 5 \times 4 = 2 5 0 0$ parameters of four NeurWIN neural networks.
|
| 445 |
+
|
| 446 |
+
For testing, the same procedure is followed as explained in C.4. The trained REINFORCE models were loaded, and each tested on the same arms as NeurWIN and deadline Whittle index policies. The testing was made for all 200 trained model (each being trained up to a different episode count). The final control policy result was plotted along with NeurWIN and Whittle index policy for $\binom { 4 } { 1 }$ arms.
|
| 447 |
+
|
| 448 |
+
C.6 QWIC TRAINING AND INFERENCE SETTING ON DEADLINE SCHEDULING
|
| 449 |
+
|
| 450 |
+
QWIC was trained in an offline setting for the sets ${ \binom { 4 } { 1 } } \ { \binom { 1 0 0 } { 1 0 } } \ { \binom { 1 0 0 } { 2 5 } }$ . We select the same candidate set $\Lambda$ as in the recovering bandits case, which is 100 values evenly spaced in the interval [0, 10]. $\epsilon$ was initialized to $\epsilon _ { m a x } = 1$ , and decays with factor $\alpha = 0 . 0 1$ to $\epsilon _ { m i n } = 0 . 0 1$ . $\epsilon$ is updated at each timestep during training until it decays to $\epsilon _ { m i n }$ .
|
| 451 |
+
|
| 452 |
+
Other training parameters: initial learning rate $L = 0 . 0 0 1$ , training episode time horizon of $T =$ 3000 timesteps, discount factor $\beta = 0 . 9 9 9$ , . Training was done up to $1 , 0 0 0$ episodes, where the select $\mathsf { q }$ -learned indices $\bar { \Lambda }$ were saved at an interval of 5 episodes. We test the Q-learning indices using the same setting as NeurWIN and REINFORCE. The estimated index mappings were tested for 200 independent runs.
|
| 453 |
+
|
| 454 |
+
We refer the reader to the code for further implementation details.
|
md/train/QpU7n-6l0n/QpU7n-6l0n.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE CONSISTENCY LOSS FOR LEVERAGING AUGMENTED DATA TO LEARN ROBUST AND INVARIANT REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Data augmentation is one of the most popular techniques for improving the robustness of neural networks. In addition to directly training the model with original samples and augmented samples, a torrent of methods regularizing the distance between embeddings/representations of the original samples and their augmented counterparts have been introduced. In this paper, we explore these various regularization choices, seeking to provide a general understanding of how we should regularize the embeddings. Our analysis suggests the ideal choices of regularization correspond to various assumptions. With an invariance test, we argue that regularization is important if the model is to be used in a broader context than accuracy-driven setting because non-regularized approaches are limited in learning the concept of invariance, despite equally high accuracy. Finally, we also show that the generic approach we identified (squared $\ell _ { 2 }$ norm regularized augmentation) outperforms several recent methods, which are each specially designed for one task and significantly more complicated than ours, over three different tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent advances in deep learning has delivered remarkable empirical performance over i.i.d test data, and the community continues to investigate the more challenging and realistic scenario when models are tested in robustness over non-i.i.d data (e.g., Ben-David et al., 2010; Szegedy et al., $\boxed { 2 0 1 3 }$ . Recent studies suggest that one cause of the fragility is the model’s tendency in capturing undesired signals $( \overline { { \mathbb { W } \mathrm { a n g ~ e t ~ a l . } } } ) \textcircled { 2 0 2 0 } )$ , thus combating this tendency may be a key to robust models.
|
| 12 |
+
|
| 13 |
+
To help models ignore the undesired signals, data augmentation (i.e., diluting the undesired signals of training samples by applying transformations to existing examples) is often used. Given its widely usage, we seek to answer the question: how should we train with augmented samples so that the assistance of augmentation can be taken to the fullest extent to learn robust and invariant models?
|
| 14 |
+
|
| 15 |
+
In this paper, We analyze the generalization behaviors of models trained with augmented data and associated regularization techniques. We investigate a set of assumptions and compare the worstcase expected risk over unseen data when i.i.d samples are allowed to be transformed according to a function belonging to a family. We bound the expected risk with terms that can be computed during training, so that our analysis can inspire how to regularize the training procedure. While all the derived methods have an upper bound of the expected risk, with progressively stronger assumptions, we have progressively simpler regularization, allowing practical choices to be made according to the understanding of the application. Our contributions of this paper are as follows:
|
| 16 |
+
|
| 17 |
+
• We offer analyses of the generalization behaviors of augmented models trained with different regularizations: these regularizations require progressively stronger assumptions of the data and the augmentation functions, but progressively less computational efforts. For example, with assumptions pertaining to augmentation transformation functions, the Wasserstein distance over the original and augmented empirical distributions can be calculated through simple $\ell _ { 1 }$ norm distance. • We test and compare these methods and offer practical guidance on how to choose regularizations in practice. In short, regularizing the squared $\ell _ { 2 }$ distance of logits between the augmented samples and original samples is a favorable method, suggested by both theoretical and empirical evidence.
|
| 18 |
+
|
| 19 |
+
• With an invariance test, we argue that vanilla augmentation does not utilize the augmented samples to the fullest extent, especially in learning invariant representations, thus may not be ideal unless the only goal of augmentation is to improve the accuracy over a specific setting.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK & KEY DIFFERENCES
|
| 22 |
+
|
| 23 |
+
Data augmentation has been used effectively for years. Tracing back to the earliest convolutional neural networks, we notice that even the LeNet applied on MNIST dataset has been boosted by mixing the distorted images to the original ones $\mathrm { ( \mathbb { L } e C u n \ e t \ a l . ) } \ \mathrm { [ 9 9 8 ] ) }$ . Later, the rapidly growing machine learning community has seen a proliferate development of data augmentation techniques (e.g., flipping, rotation, blurring etc.) that have helped models climb the ladder of the state-of-theart (one may refer to relevant survey (Shorten & Khoshgoftaar, 2019) for details). Recent advances expanded the conventional concept of data augmentation and invented several new approaches, such as leveraging the information in unlabelled data (Xie et al., 2019), automatically learning augmentation functions (Ho et al., 2019; Hu et al., 2019; Wang et al., 2019c; Zhang et al., 2020; Zoph et al., $\boxed { 2 0 1 9 }$ , and generating the samples (with constraint) that maximize the training loss along training (Fawzi et al., 2016), which is later widely accepted as adversarial training (Madry et al., 2018).
|
| 24 |
+
|
| 25 |
+
While the above works mainly discuss how to generate the augmented samples, in this paper, we mainly answer the question about how to train the models with augmented samples. For example, instead of directly mixing augmented samples with the original samples, one can consider regularizing the representations (or outputs) of original samples and augmented samples to be close under a distance metric (also known as a consistency loss). Many concrete ideas have been explored in different contexts. For example, $\ell _ { 2 }$ distance and cosine similarities between internal representations in speech recognition (Liang et al., 2018), squared $\ell _ { 2 }$ distance between logits (Kannan et al., 2018) , or KL divergence between softmax outputs $( \mathbb { Z } \mathrm { h a n g ~ e t ~ a l . } ) , \underline { 2 0 1 9 \mathrm { a } } )$ in adversarially robust vision models, Jensen–Shannon divergence (of three distributions) between embeddings for texture invariant image classification (Hendrycks et al., $\boxed { 2 0 2 0 }$ . These are but a few highlights of the concrete and successful implementations for different applications out of a huge collection (e.g., (Wu et al., 2019; Guo et al., 2019; Zhang et al., 2019b; Shah et al., 2019; Asai & Hajishirzi, $\boxed { 2 0 2 0 } ;$ Sajjadi et al., 2016; Zheng et al., 2016; Xie et al., 2015)), and one can easily imagine methods permuting these three elements (distance metrics, representation or outputs, and applications) to be invented. Even further, although we are not aware of the following methods in the context of data augmentation, given the popularity of GAN $\left( \overline { { \mathrm { G o o d f e l l o w } } } , \overline { { \mathrm { 2 0 1 6 } } } \right)$ and domain adversarial neural network $\mathrm { ( } \mathrm { G a n i n ~ e t ~ a l . , } \mathrm { ) } \mathrm { . } \mathrm { \overline { { 2 0 1 6 } } \mathrm { ) } }$ , one can also expect the distance metric generalizes to a specialized discriminator (i.e. a classifier), which can be intuitively understood as a calculated (usually maximized) distance measure, Wasserstein-1 metric as an example (Arjovsky et al., 2017; Gulrajani et al., 2017)
|
| 26 |
+
|
| 27 |
+
Key Differences: With this rich collection of regularizing choices, which one method should we consider in general? More importantly, do we actually need the regularization at all? These questions are important for multiple reasons, especially considering that there are paper suggesting that these regularizations may lead to worse results $( \overbrace { \mathrm { J e o n g ~ e t ~ a l . } } ^ { \bullet } ) \widetilde { \mathbb { Z } \mathrm { 0 1 9 } } )$ . In this paper, we answer the first question with a proved upper bound of the worst case generalization error, and our upper bound explicitly describes what regularizations are needed. For the second question, we will show that regularizations can help the model to learn the concept of invariance.
|
| 28 |
+
|
| 29 |
+
There are also several previous discussions regarding the detailed understandings of data augmentation (Yang et al., 2019; Chen et al., 2019; Hernandez-Garc ´ ´ıa & Konig, 2018; Rajput et al., 2019; ¨ $\boxed { \mathrm { D a o e t ~ a l . } , \boxed { 2 0 1 9 } }$ , among which, $\overline { { \mathbb { Y } \mathrm { a n g ~ e t ~ a l . } \mathrm { | } \mathrm { \mathscr { L } 0 1 9 | } } }$ is probably the most relevant as it also defends the usage of regularizations. However, we believe our discussions are more comprehensive and supported theoretically, since our analysis directly suggests the ideal regularization. Also, empirically, we design an invariance test in addition to the worst-case accuracy used in the preceding work.
|
| 30 |
+
|
| 31 |
+
# 3 TRAINING STRATEGIES WITH AUGMENTED DATA
|
| 32 |
+
|
| 33 |
+
Notations $( \mathbf { X } , \mathbf { Y } )$ denotes the data, where $\mathbf { X } \in \mathcal { R } ^ { n \times p }$ and $\mathbf { Y } \in \{ 0 , 1 \} ^ { n \times k }$ (one-hot vectors for $k$ classes), and $f ( \cdot , \theta )$ denotes the model, which takes in the data and outputs the softmax (probabilities of the prediction) and $\theta$ denotes the corresponding parameters. $g ( \ u )$ completes the prediction (i.e., mapping softmax to one-hot prediction). $l ( \cdot , \cdot )$ denotes a generic loss function. $\overset { \cdot } { a } ( \cdot )$ denotes a transformation that alters the undesired signals of a sample, i.e., the data augmentation method. $a \in { \mathcal { A } }$ , which is the set of transformation functions. $\mathcal { P }$ denotes the distribution of $\displaystyle ( \mathbf { x } , \mathbf { y } )$ . For any sampled $\displaystyle ( \mathbf { x } , \mathbf { y } )$ , we can have $( a ( \mathbf { x } ) , \mathbf { y } )$ , and we use $\mathcal { P } _ { a }$ to denote the distribution of these transformed samples. $r ( \cdot ; \theta )$ denotes the risk of model $\theta . { \widehat { \cdot } }$ denotes the estimated term $\cdot$ .
|
| 34 |
+
|
| 35 |
+
# 3.1 WELL-BEHAVED DATA TRANSFORMATION FUNCTION
|
| 36 |
+
|
| 37 |
+
Despite the strong empirical performance data augmentation has demonstrated, it should be intuitively expected that the performance can only be improved when the augmentation is chosen wisely. Therefore, before we proceed to analyze the behaviors of training with data augmentations, we need first regulate some basic properties of the data transformation functions used. Intuitively, we will consider the following three properties.
|
| 38 |
+
|
| 39 |
+
• “Dependence-preservation” with two perspectives: Label-wise, the transformation cannot alter the label of the data, which is a central requirement of almost all the data augmentation practice. Feature-wise, the transformation will not introduce new dependencies between the samples. • “Efficiency”: the augmentation should only generate new samples of the same label as minor perturbations of the original one. If a transformation violates this property, there should exist other simpler transformations that can generate the same target sample. • “Vertices”: There are extreme cases of the transformations. For example, if one needs the model to be invariant to rotations from $0 ^ { \circ }$ to $6 0 ^ { \circ }$ , we consider the vertices to be $0 ^ { \circ }$ rotation function (thus identity map) and $6 0 ^ { \circ }$ rotation function. In practice, one usually selects the transformation vertices with intuitions and domain knowledge.
|
| 40 |
+
|
| 41 |
+
We now formally define these three properties. The definition will depend on the model, thus these properties are not only regulating the transformation functions, but also the model. We introduce the Assumptions A1-A3 corresponding to the properties.
|
| 42 |
+
|
| 43 |
+
A1: Dependence-preservation: the transformation function will not alter the dependency regarding the label (i.e., for any $a ( ) \in { \mathcal { A } }$ , $a ( \mathbf { x } )$ will have the same label as $\mathbf { x }$ ) or the features (i.e., for any $a _ { 1 } ( \ l ) , a _ { 2 } ( \ l ) \in \mathcal { A } , a _ { 1 } ( \mathbf { x } _ { 1 } ) \ \perp \ l \ a _ { 1 } ( \mathbf { x } _ { 2 } )$ for any $\mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } \in \mathbf { X }$ that $\mathbf { x } _ { 1 } \neq \mathbf { x } _ { 2 }$ ).
|
| 44 |
+
|
| 45 |
+
A2: Efficiency: for $\widehat { \theta }$ and any $a ( ) \in { \mathcal { A } }$ , $f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ is closer to $\mathbf { x }$ than any other samples under a distance metric $d _ { e } ( \cdot , \cdot )$ , i.e., $\begin{array} { r } { \big \langle d _ { e } \big ( f \big ( a ( \mathbf { x } ) ; \widehat { \theta } \big ) , f ( \mathbf { x } ; \widehat { \theta } ) \big ) \leq \operatorname* { m i n } _ { \mathbf { x } ^ { \prime } \in \mathbf { X } - \mathbf { x } } d _ { e } \big ( f \big ( a ( \mathbf { x } ) ; \widehat { \theta } \big ) , f ( \mathbf { x } ^ { \prime } ; \widehat { \theta } ) \big ) } \end{array}$ .
|
| 46 |
+
|
| 47 |
+
A3: Vertices: For a model $\widehat { \theta }$ and a transformation $a ( )$ , we use $\mathcal { P } _ { a , \widehat { \theta } }$ to denote the distribution of $f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ for $( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P }$ . “Vertices” argues that exists two extreme elements in $\mathcal { A }$ , namely $a ^ { + }$ and $a ^ { - }$ , with certain metric $d _ { x } ( \cdot , \cdot )$ , we have
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
d _ { x } ( \mathcal { P } _ { a ^ { + } , \widehat { \theta } } , \mathcal { P } _ { a ^ { - } , \widehat { \theta } } ) = \operatorname* { s u p } _ { a _ { 1 } , a _ { 2 } \in \mathcal { A } } d _ { x } ( \mathcal { P } _ { a _ { 1 } , \widehat { \theta } } , \mathcal { P } _ { a _ { 2 } , \widehat { \theta } } )
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Note that $d _ { x } ( \cdot , \cdot )$ is a metric over two distributions and $d _ { e } ( \cdot , \cdot )$ is a metric over two samples. Also, slightly different from the intuitive understanding of “vertices” above, A3 regulates the behavior of embedding instead of raw data. All of our follow-up analysis will require A1 to hold, but with more assumptions held, we can get computationally lighter methods with bounded error.
|
| 54 |
+
|
| 55 |
+
# 3.2 BACKGROUND, ROBUSTNESS, AND INVARIANCE
|
| 56 |
+
|
| 57 |
+
One central goal of machine learning is to understand the generalization error. When the test data and train data are from the same distribution, many previous analyses can be sketched as:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
r _ { \mathcal { P } } ( \widehat { \theta } ) \leq \widehat { r } _ { \mathcal { P } } ( \widehat { \theta } ) + \phi ( | \Theta | , n , \delta )
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
which states that the expected risk can be bounded by the empirical risk and a function of hypothesis space $| \Theta |$ and number of samples $n$ ; $\delta$ accounts for the probability when the bound holds. $\phi ( )$ is a function of these three terms. Dependent on the details of different analyses, different concrete examples of this generic term will need different assumptions. We use a generic assumption A4 to denote the assumptions required for each example. More concrete discussions are in Appendix A
|
| 64 |
+
|
| 65 |
+
Robustness In addition to the generalization error above, we also study the robustness by following the established definition as in the worst case expected risk when the test data is allowed to be shifted to some other distributions by transformation functions in $\mathcal { A }$ . Formally, we study
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
r _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) = \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } } \operatorname* { m a x } _ { a \sim \mathcal { A } } \mathbb { I } ( g ( f ( a ( \mathbf { x } ) ; \widehat { \theta } ) ) \neq \mathbf { y } )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
As $r _ { \mathcal { P } } ( \widehat { \theta } ) \leq r _ { \mathcal { P ^ { \prime } } } ( \widehat { \theta } )$ , we only need to study $\textcircled{3}$ . We will analyze $\textcircled{3}$ in different scenarios involving different assumptions and offer formalizations of the generalization bounds under each scenario. Our bounds shall also immediately inspire the development of methods in each scenario as the terms involved in our bound are all computable within reasonable computational loads.
|
| 72 |
+
|
| 73 |
+
Invariance In addition to robustness, we are also interested in whether the model learns to be invariant to the undesired signals. Intuitively, if data augmentation is used to help dilute the undesired signals from data by altering the undesired signals with $a ( ) \in { \mathcal { A } }$ , a successfully trained model with augmented data will map the raw data with various undesired signals to the same embedding. Thus, we study the following metric to quantify the model’s ability in learning invariant representations:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r } { I ( \widehat { \theta } , \mathcal { P } ) = \underset { a _ { 1 } , a _ { 2 } \in \mathcal { A } } { \operatorname* { s u p } } d _ { x } ( \mathcal { P } _ { a _ { 1 } , \widehat { \theta } } , \mathcal { P } _ { a _ { 2 } , \widehat { \theta } } ) , } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\mathcal { P } _ { a , \widehat { \theta } }$ to denote the distribution of $f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ for $( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } . ~ d _ { x } ( )$ is a distance over two distributions, and we suggest to use Wasserstein metric given its favorable properties (e.g., see practical examples in Figure 1 of (Cuturi & Doucet, $\boxed { 2 0 1 4 }$ or theoretical discussions in $\mathrm { ( \overline { { V i l l a n i } } , \overline { { 2 0 0 8 } } ) } \mathrm { ) }$ ). Due to the difficulties in assessing ${ \widehat { f ( a ( \mathbf { x } ) ; { \widehat { \theta } } ) } }$ (as it depends on $\widehat { \theta } _ { . }$ ), we mainly study $( 4 )$ empirically, and argue that models trained with explicit regularization of the empirical counterpart of $\bar { ( 4 ) }$ will have favorable invariance property.
|
| 80 |
+
|
| 81 |
+
# 3.3 WORST-CASE AUGMENTATION (ADVERSARIAL TRAINING)
|
| 82 |
+
|
| 83 |
+
We consider robustness first. $( 3 )$ can be written equivalently into the expected risk over a pseudo distribution ${ \mathcal { P } } ^ { \prime }$ (see Lemma 1 in $\boxed { \mathrm { I u ~ e t ~ a l . } } \boxed { 2 0 1 9 } )$ , which is the distribution that can sample the data leading to the worst expected risk. Thus, equivalently, we can consider $\operatorname* { s u p } _ { { \mathcal { P } } ^ { \prime } \in T ( { \mathcal { P } } , A ) } r _ { { \mathcal { P } } ^ { \prime } } ( { \widehat { \theta } } )$ . With an assumption relating the worst distribution of expected risk and the worst distribution of the empirical risk (namely, A5, in Appendix A), the bound of our interest (i.e., $\operatorname* { s u p } _ { { \mathcal { P } } ^ { \prime } \in T ( { \mathcal { P } } , A ) } r _ { { \mathcal { P } } ^ { \prime } } ( { \widehat { \theta } } ) )$ can be analogously analyzed through $\begin{array} { r } { \operatorname* { s u p } _ { \mathcal { P } ^ { \prime } \in T ( \mathcal { P } , \mathcal { A } ) } ^ { - } \widehat { r } _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) } \end{array}$ . By the definition of ${ \mathcal { P } } ^ { \prime }$ , we can have:
|
| 84 |
+
|
| 85 |
+
Lemma 3.1. With Assumptions A1, A4, and A5, with probability at least $1 - \delta$ , we have
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\operatorname* { s u p } _ { \mathcal { P } ^ { \prime } \in T ( \mathcal { P } , A ) } r _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) \leq \frac { 1 } { n } \sum _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } } \operatorname* { s u p } _ { a \in \mathcal { A } } \mathbb { I } \big ( g \big ( f ( a ( \mathbf { x } ) ; \widehat { \theta } ) ) \neq \mathbf { y } \big ) + \phi \big ( | \Theta | , n , \delta \big )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
This result is a straightforward follow-up of the preceding discussions. In practice, it aligns with the adversarial training $\mathrm { ( } \mathbf { M a d r y \ e t \ a l . } , \mathbf { \bar { 2 0 1 8 } } \mathrm { ) }$ , a method that has demonstrated impressive empirical successes in the robust machine learning community.
|
| 92 |
+
|
| 93 |
+
While the adversarial training has been valued by its empirical superiorities, it may still have the following two directions that can be improved: firstly, it lacks an explicit enforcement of the concept of invariance between the original sample and the transformed sample; secondly, it assumes that elements of $\mathcal { A }$ are enumerable, thus $\frac { 1 } { n } \sum _ { ( \mathbf { x } , \mathbf { y } ) \sim \mathcal { P } } \operatorname* { s u p } _ { a \in \cal A } \mathbb { I } ( g ( f ( a ( \mathbf { x } ) ; \widehat { \boldsymbol { \theta } } ) ) \neq \mathbf { y } )$ is computable. The remaining discussions expand along these two directions.
|
| 94 |
+
|
| 95 |
+
# 3.4 REGULARIZED WORST-CASE AUGMENTATION
|
| 96 |
+
|
| 97 |
+
To force the concept of invariance, the immediate solution might be to apply some regularizations to minimize the distance between the embeddings learned from the original sample and the ones learned from the transformed samples. We have offered a summary of these methods in Section 2.
|
| 98 |
+
|
| 99 |
+
To have a model with small invariance score, the direct approach will be regularizing the empirical counterpart of $\textcircled{4}$ . We notice that existing methods barely consider this regularization, probably because of the computational difficulty of Wasserstein distance. Conveniently, we have the following result that links the $\ell _ { 1 }$ regularization to the Wasserstein-1 metric in the context of data augmentation.
|
| 100 |
+
|
| 101 |
+
Proposition 3.2. With $A 2$ , and $d _ { e } ( \cdot , \cdot )$ in $A 2$ chosen to be $\ell _ { 1 }$ norm, for any $a \in { \mathcal { A } }$ , we have
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\sum _ { i } | | f ( \mathbf { x } _ { i } ; \widehat { \boldsymbol { \theta } } ) - f ( a ( \mathbf { x } _ { i } ) ; \widehat { \boldsymbol { \theta } } ) | | _ { 1 } = W _ { 1 } ( f ( \mathbf { x } ; \widehat { \boldsymbol { \theta } } ) , f ( a ( \mathbf { x } ) ; \widehat { \boldsymbol { \theta } } ) )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
This result conveniently allows us to use $\ell _ { 1 }$ norm distance to replace Wasserstein metric, integrating the advantages of Wasserstein metric while avoiding practical issues such as computational complexity and difficulty to pass the gradient back during backpropagation.
|
| 108 |
+
|
| 109 |
+
We continue to discuss the generalization behaviors. Our analysis remains in the scope of multiclass classification, where the risk is evaluated as misclassification rate, and the model is optimized with cross-entropy loss (with the base chosen to be log base in cross-entropy loss). This setup aligns with A4, and should represent the modern neural network studies well enough.
|
| 110 |
+
|
| 111 |
+
Before we proceed, we need another technical assumption A6 (details in Appendix A), which can be intuitively considered as a tool that allows us to relax classification error into cross-entropy error, so that we can bound the generalization error with the terms we can directly optimize during training.
|
| 112 |
+
|
| 113 |
+
We can now offer another technical result:
|
| 114 |
+
|
| 115 |
+
Theorem 3.3. With Assumptions A1, A2, A4, A5, and A6, and $d _ { e } ( \cdot , \cdot )$ in $A 2$ is $\ell _ { 1 }$ norm, with probability at least $1 - \delta$ , the worst case generalization risk will be bounded as
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\operatorname* { s u p } _ { \mathcal { P } ^ { \prime } \in T ( \mathcal { P } , \mathcal { A } ) } r _ { \mathcal { P } ^ { \prime } } ( \widehat { \theta } ) \leq \widehat { r } _ { \mathcal { P } } ( \widehat { \theta } ) + \sum _ { i } | | f ( \mathbf { x } _ { i } ; \widehat { \theta } ) - f ( \mathbf { x } _ { i } ^ { \prime } ; \widehat { \theta } ) | | _ { 1 } + \phi ( | \Theta | , n , \delta )
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
and $\mathbf { x } ^ { \prime } = a ( \mathbf { x } )$ , where $a = \arg \operatorname* { m a x } _ { a \in \mathcal { A } } \mathbf { y } ^ { \top } f ( a ( \mathbf { x } ) ; \widehat { \theta } ) .$
|
| 122 |
+
|
| 123 |
+
This technical result also immediately inspires the method to guarantee worst case performance, as well as to explicitly enforce the concept of invariance. Notice that $a = \arg \operatorname* { m a x } _ { a \in \mathcal { A } } \mathbf { y } ^ { \top } f ( a ( \mathbf { x } ) ; \widehat { \theta } )$ is simply selecting the augmentation function maximizing the cross-entropy loss, a standard used by many worst case augmenting method (e.g., Madry et al., 2018).
|
| 124 |
+
|
| 125 |
+
# 3.5 REGULARIZED TRAINING WITH VERTICES
|
| 126 |
+
|
| 127 |
+
As $\mathcal { A }$ in practice is usually a set with a large number of (and possibly infinite) elements, we may not always be able to identify the worst case transformation function with reasonable computational efforts. This limitation also prevents us from effective estimating the generalization error as the bound requires the identification of the worst case transformation.
|
| 128 |
+
|
| 129 |
+
Our final discussion is to leverage the vertex property of the transformation function to bound the worst case generalization error:
|
| 130 |
+
|
| 131 |
+
Lemma 3.4. With Assumptions A1-A6, and $d _ { e } ( \cdot , \cdot )$ in $A 2$ chosen as $\ell _ { 1 }$ norm distance, $d _ { x } ( \cdot , \cdot )$ in $A 3$ chosen as Wasserstein-1 metric, assuming there is a $a ^ { \prime } ( ) \in { \mathcal { A } }$ where $\begin{array} { r } { \widehat { r } _ { \mathcal { P } _ { a ^ { \prime } } } ( \widehat { \theta } ) = \frac { 1 } { 2 } \big ( \widehat { r } _ { \mathcal { P } _ { a ^ { + } } } ( \widehat { \theta } ) + } \end{array}$ ${ \widehat { r } } _ { { \mathcal { P } } _ { a } - } ( { \widehat { \theta } } ) \big )$ , with probability at least $1 - \delta$ , we have:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\operatorname* { s u p } _ { \substack { 2 \prime \in T ( P , A ) } } r _ { P ^ { \prime } } ( \widehat { \theta } ) \leq \frac { 1 } { 2 } \big ( \widehat { r } _ { \mathcal { P } _ { a } + } ( \widehat { \theta } ) + \widehat { r } _ { \mathcal { P } _ { a } - } ( \widehat { \theta } ) \big ) + \sum _ { i } | | f ( a ^ { + } ( \mathbf { x } _ { i } ) ; \widehat { \theta } ) - f ( a ^ { - } ( \mathbf { x } ^ { \prime } ) ; \widehat { \theta } ) | | _ { 1 } + \phi ( | \Theta | , n , \delta )
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
This result inspires the method that can directly guarantee the worst case generalization result and can be optimized conveniently without searching for the worst-case transformations. However, this method requires a good domain knowledge of the vertices of the transformation functions.
|
| 138 |
+
|
| 139 |
+
# 3.6 ENGINEERING SPECIFICATION OF RELEVANT METHODS
|
| 140 |
+
|
| 141 |
+
Our theoretical analysis has lead to a line of methods, however, not every method can be effectively implemented, especially due to the difficulties of passing gradient back for optimizations. Therefore, to boost the influence of the loss function through backpropagation, we recommend to adapt the methods with the following two changes: 1) the regularization is enforced on logits instead of softmax; 2) we use squared $\ell _ { 2 }$ norm instead of $\ell _ { 1 }$ norm because $\ell _ { 1 }$ norm is not differentiable everywhere. We discuss the effects of these compromises in ablation studies in Appendix E.
|
| 142 |
+
|
| 143 |
+
Also, in the cases where we need to identify the worst case transformation functions, we iterate through all the transformation functions and identify the function with the maximum loss.
|
| 144 |
+
|
| 145 |
+
Overall, our analysis leads to the following main training strategies:
|
| 146 |
+
|
| 147 |
+
• VA (vanilla augmentation): mix the augmented samples of a vertex function to the original ones for training (original samples are considered as from another vertex in following experiments). • VWA (vanilla worst-case augmentation): at each iteration, identify the worst-case transformation functions and train with samples generated by them (also known as adversarial training). • RA (regularized augmentation): regularizing the squared $\ell _ { 2 }$ distance over logits between the original samples and the augmented samples of a fixed vertex transformation function. • RWA (regularized worst-case augmentation): regularizing the squared $\ell _ { 2 }$ distance over logits between the original samples and the worst-case augmented samples identified at each iteration.
|
| 148 |
+
|
| 149 |
+
# 4 EXPERIMENTS
|
| 150 |
+
|
| 151 |
+
We first use some synthetic experiments to verify our assumptions and inspect the consequences when the assumptions are not met (in Appendix $\dot { \mathbf { C } } )$ . Then, in the following paragraphs, we test the methods discussed to support our arguments in learning robustness and invariance. Finally, we show the power of our discussions by competing with advanced methods designed for specific tasks.
|
| 152 |
+
|
| 153 |
+
# 4.1 EXPERIMENTS FOR LEARNING ROBUST & INVARIANT REPRESENTATION
|
| 154 |
+
|
| 155 |
+
Experiment Setup: We first test our arguments with two data sets and three different sets of the augmentations. We study MNIST dataset with LeNet architecture, and CIFAR10 dataset with ResNet18 architecture. To examine the effects of the augmentation strategies, we disable all the heuristics that are frequently used to boost the test accuracy of models, such as the default augmentation many models trained for CIFAR10 adopted, and the BatchNorm (also due to the recent arguments against the effects of BatchNorm in learning robust features $( \overline { { \mathrm { W a n g ~ e t ~ a l . } } } , \overline { { 2 0 2 0 } } ) )$ , although forgoing these heuristics will result in a lower overall performance than one usually expects.
|
| 156 |
+
|
| 157 |
+
We consider three different sets of transformation functions: texture, rotation, and contrast. The details of these transformation functions and the experiment setup are in Appendix D.
|
| 158 |
+
|
| 159 |
+
We consider three different evaluation metrics:
|
| 160 |
+
|
| 161 |
+
• Clean: test accuracy on the original test data, mainly reported as a reference for other metrics.
|
| 162 |
+
• Robustness: the worst accuracy when each sample can be transformed with $a \in { \mathcal { A } }$ .
|
| 163 |
+
Invariance: A metric to test whether the models learns the concept of invariance (details to follow).
|
| 164 |
+
|
| 165 |
+
Invariance-test: To test whether a model can truly learns the concept of invariance within ${ \mathcal { A } } =$ $\{ a _ { 1 } ( ) , a _ { 2 } ( ) , \ldots , a _ { t } ( ) \}$ of $t$ elements, we design a new evaluation metric: for a sampled collection of data of the sample label $i$ , denoted as $\mathbf { X } ^ { ( i ) }$ , we generate the transformed copies of it with $\mathcal { A }$ , resulting in $\mathbf { X } _ { a _ { 1 } } ^ { ( i ) } , \mathbf { X } _ { a _ { 2 } } ^ { ( i ) } , \ldots , \mathbf { X } _ { a _ { t } } ^ { ( i ) }$ . We combined these copies into a dataset, denoted as $\chi ^ { ( i ) }$ . For every sample $\mathbf { x }$ in $\chi ^ { ( i ) }$ , we retrieve its $t$ nearest neighbors of other samples in $\chi ^ { ( i ) }$ , and calculate the overlap of the retrieved samples and $\{ a _ { 1 } ( \mathbf { x } ) , a _ { 2 } ( \mathbf { x } ) , \ldots , a _ { t } ( \mathbf { x } ) \}$ . Since the identify map is in $\mathcal { A }$ , so the calculated overlap score will be in $[ 1 / t , 1 ]$ . The distance used is $d ( \cdot , \cdot ) = | | f ( \cdot ; \widehat { \theta } ) - f ( \cdot ; \widehat { \theta } ) | | _ { 1 }$ , where $\widehat { \theta }$ is the model we are interested to examine. Finally, we report the averaged score for every label. Thus, a high overlap score indicates the prediction of model $\widehat { \theta }$ is invariant to the augmentation functions in $\mathcal { A }$ . If we use other distance functions, the reported values may differ, but we notice that the rank of the methods compared in terms of this test barely changes.
|
| 166 |
+
|
| 167 |
+
Results: We show the results in Table 1 and Table $\bigtriangledown$ (in Appendix) for MNIST and CIFAR10 respectively. Table $^ 1$ shows that RWA is generally a superior method, in terms of all the metrics, especially the invariance evaluation as it shows a much higher invariance score than competing methods. We believe this advantage of invariance comes from two sources: regularizations and the fact that RWA has seen all the augmentation functions in $\boldsymbol { A }$ . In comparison, RA also has regularization but only sees the vertices in $\mathcal { A }$ , so the invariance score of RA is not compatitable to RWA, although better than VA. Table $\boxed { 6 }$ roughly tells the same story. More discussions are in Appendix D.
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Texture</td><td colspan="3">Rotation</td><td colspan="3">Contrast</td></tr><tr><td>C</td><td>R</td><td>I</td><td>C</td><td>R</td><td>I</td><td>C</td><td>R</td><td>I</td></tr><tr><td>Base</td><td>0.9921</td><td>0.9860</td><td>0.9236</td><td>0.9921</td><td>0.2960</td><td>0.2056</td><td>0.9921</td><td>0.2699</td><td>0.2003</td></tr><tr><td>VA</td><td>0.9928</td><td>0.9906</td><td>0.9876</td><td>0.9884</td><td>0.9336</td><td>0.5628</td><td>0.9922</td><td>0.9837</td><td>0.4153</td></tr><tr><td>RA</td><td>0.9909</td><td>0.9904</td><td>1</td><td>0.9930</td><td>0.9525</td><td>0.6044</td><td>0.9936</td><td>0.9823</td><td>0.4166</td></tr><tr><td>VWA</td><td>0.9922</td><td>0.9903</td><td>0.9940</td><td>0.9466</td><td>0.9408</td><td>0.6284</td><td>0.536</td><td>0.4470</td><td>0.2210</td></tr><tr><td>RWA</td><td>0.9915</td><td>0.9911</td><td>1</td><td>0.9934</td><td>0.9882</td><td>0.8856</td><td>0.994</td><td>0.9893</td><td>0.8786</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Table 1: Results of MNIST data (“C” stands for clean accuracy, “R” stands for robustness, and “I” stands for invariance score): invariance score shows big differences while accuracy does not.
|
| 172 |
+
|
| 173 |
+
Other results (Appendix $\mathbf { E } )$ : The strength of RWA can also be shown in several other different scenarios, even in the out-of-domain test scenario where the transformation functions are not in $\mathcal { A }$ . RWA generally performs the best, although not the best in every single test. We also perform ablation test to validate the choice of squared $\ell _ { 2 }$ norm over logits in contrast to other distance metrics. Our choice performs the best in the worst-case performance. This advantage is expected as our choice is validated by theoretical arguments as well as consideration of engineering convenience.
|
| 174 |
+
|
| 175 |
+
Overall, the empirical performances align with our expectation from the theoretical discussion: while all methods discussed have a bounded worst case performance, we do not intend to compare the upper bounds because smaller upper bounds do not necessarily guarantee a smaller risk. However, worst case augmentation methods tend to show a better worst case performances because they have been augmented with all the elements in $\mathcal { A }$ . Also, there is no clear evidence suggesting the difference between augmentation methods and its regularized versions in terms of the worst case performance, but it is clear that regularization helps to learn the concept of invariance.
|
| 176 |
+
|
| 177 |
+
# 4.2 COMPARISON TO ADVANCED METHODS
|
| 178 |
+
|
| 179 |
+
Finally, we also compete our generic data augmentation methods against several specifically designed methods in different applications. We use the four generic methods (VA, RA, VWA, and RWA) with generic transformation functions $\mathcal { A }$ of “rotation”, “contrast”, or ”texture” used in the synthetic experiments). We compare our methods with techniques invented for three different topics of study (rotation invariant, texture perturbation, and cross-domain generalization), and each of these topics has seen a long line of method development. We follow each own tradition (e.g., rotation methods are usually tested in CIFAR10 dataset, seemingly due to the methods’ computational requirements), test over each own most challenging dataset (e.g., ImageNet-Sketch is the most recent and challenging dataset in domain generalization, although less studied), and report each own evaluation metric (e.g., methods tested with ImageNet-C are usually evaluated with mCE).
|
| 180 |
+
|
| 181 |
+
Overall, the performances of our generic methods outperform these advanced SOTA techniques. Thus, the main conclusion, as validated by these challenging scenarios, are (1) usage of data augmentation can outperform carefully designed methods; (2) usage of the consistency loss can further improve the performances; (3) regularized worst-case augmentation generally works the best.
|
| 182 |
+
|
| 183 |
+
Due to the limitation of space, we leave the background details of these experiments in Appendix F, where we introduce the detailed experiment settings, and explain the acronyms in Tables 2-4
|
| 184 |
+
|
| 185 |
+
Rotation-invariant Image Classification We test the models with nine different rotations including $0 ^ { \circ }$ . Augmentation related methods only use the $\mathcal { A }$ of “rotation” in synthetic experiments, so the testing scenario goes beyond what the augmentation methods have seen during training. The results in Table $\bigtriangledown$ strongly endorses the efficacy of augmentation-based methods. Interestingly, regularized augmentation methods probably with the benefit of learning the concept of invariance, tend to behave well in the transformations not considered during training. Also, RA outperforms VWA on average.
|
| 186 |
+
|
| 187 |
+
Texture-perturbed ImageNet classification We also test the performance on the image classification over multiple perturbations. We train the model over standard ImageNet training set and test the model with ImageNet-C data (Hendrycks & Dietterich, 2019), which is a perturbed version of ImageNet by corrupting the original ImageNet validation set with a collection of noises. The results
|
| 188 |
+
|
| 189 |
+
<table><tr><td></td><td>300</td><td>315</td><td>330</td><td>345</td><td>0</td><td>15</td><td>30</td><td>45</td><td>60</td><td>avg.</td></tr><tr><td>Base</td><td>0.2196</td><td>0.2573</td><td>0.3873</td><td>0.6502</td><td>0.8360</td><td>0.6938</td><td>0.4557</td><td>0.3281</td><td>0.2578</td><td>0.4539</td></tr><tr><td>ST</td><td>0.2391</td><td>0.2748</td><td>0.4214</td><td>0.7049</td><td>0.8251</td><td>0.7147</td><td>0.4398</td><td>0.2838</td><td>0.2300</td><td>0.4593</td></tr><tr><td>GC</td><td>0.1540</td><td>0.1891</td><td>0.2460</td><td>0.3919</td><td>0.5859</td><td>0.4145</td><td>0.2534</td><td>0.1827</td><td>0.1507</td><td>0.2853</td></tr><tr><td>ETN</td><td>0.3855</td><td>0.4844</td><td>0.6324</td><td>0.7576</td><td>0.8276</td><td>0.7730</td><td>0.7324</td><td>0.6245</td><td>0.5060</td><td>0.6358</td></tr><tr><td>VA</td><td>0.2233</td><td>0.2832</td><td>0.4318</td><td>0.6364</td><td>0.8124</td><td>0.6926</td><td>0.5973</td><td>0.7152</td><td>0.7923</td><td>0.5761</td></tr><tr><td>RA</td><td>0.3198</td><td>0.3901</td><td>0.5489</td><td>0.7170</td><td>0.8487</td><td>0.7904</td><td>0.7455</td><td>0.8005</td><td>0.8282</td><td>0.6655</td></tr><tr><td>VWA</td><td>0.3383</td><td>0.3484</td><td>0.3835</td><td>0.4569</td><td>0.7474</td><td>0.866</td><td>0.8776</td><td>0.8738</td><td>0.8629</td><td>0.6394</td></tr><tr><td>RWA</td><td>0.4012</td><td>0.4251</td><td>0.4852</td><td>0.6765</td><td>0.8708</td><td>0.8871</td><td>0.8869</td><td>0.8870</td><td>0.8818</td><td>0.7113</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 2: Comparison to advanced rotation-invariant models. We report the test accuracy on the test sets clockwise rotated, $0 ^ { \circ } \ – 6 0 ^ { \circ }$ and $3 0 0 ^ { \circ } - 3 6 0 ^ { \circ }$ . Average accuracy is also reported. Augmentation methods only consider $0 ^ { \circ } \ – 6 0 ^ { \circ }$ clockwise rotations during training.
|
| 192 |
+
|
| 193 |
+
Table 3: Summary comparison to advanced models over ImageNet-C data. Performance reported (mCE) follows the standard in ImageNet-C data: clean error and mCE are both the smaller the better.
|
| 194 |
+
|
| 195 |
+
<table><tr><td></td><td>Base</td><td>SU</td><td>AA</td><td>MBP</td><td>SIN</td><td>AM</td><td>AMS</td><td>VA</td><td>RA</td><td>VWA</td><td>RWA</td></tr><tr><td>Clean</td><td>23.9</td><td>24.5</td><td>22.8</td><td>23</td><td>27.2</td><td>22.4</td><td>25.2</td><td>23.7</td><td>23.6</td><td>23.3</td><td>22.4</td></tr><tr><td>mCE</td><td>80.6</td><td>74.3</td><td>72.7</td><td>73.4</td><td>73.3</td><td>68.4</td><td>64.9</td><td>76.3</td><td>75.6</td><td>74.8</td><td>64.6</td></tr></table>
|
| 196 |
+
|
| 197 |
+
<table><tr><td></td><td>Base</td><td>InfoDrop</td><td>HEX</td><td>PAR</td><td>VA</td><td>RA</td><td>VWA</td><td>RWA</td></tr><tr><td>Top-1</td><td>0.1204</td><td>0.1224</td><td>0.1292</td><td>0.1306</td><td>0.1362</td><td>0.1405</td><td>0.1432</td><td>0.1486</td></tr><tr><td>Top-5</td><td>0.2408</td><td>0.256</td><td>0.2564</td><td>0.2627</td><td>0.2715</td><td>0.2793</td><td>0.2846</td><td>0.2933</td></tr></table>
|
| 198 |
+
|
| 199 |
+
Table 4: Comparison to advanced cross-domain image classification models, over ImageNet-Sketch dataset. We report top-1 and top-5 accuracy following standards on ImageNet related experiments.
|
| 200 |
+
|
| 201 |
+
are reported in Table $^ { 3 , }$ which shows that our generic method can outperform the current SOTA methods after a continued finetuning process with reducing learning rates.
|
| 202 |
+
|
| 203 |
+
Cross-domain ImageNet-Sketch Classification We also compare to the methods used for crossdomain evaluation. with the most challenging setup in this scenario: train the models with standard ImageNet training data, and test the model over ImageNet-Sketch data $( \mathbb { W } \mathrm { a n g ~ e t ~ a l . } ] { \underline { { 2 0 1 9 \mathrm { a } } } } )$ , which is a collection of sketches following the structure ImageNet validation set. Similarly, we only augment the samples with a generic augmentation set ( $\mathcal { A }$ of “contrast” in synthetic experiments, Appendix D) The results in Table 4 again support the strength of the correct usage of data augmentation.
|
| 204 |
+
|
| 205 |
+
# 5 CONCLUSION
|
| 206 |
+
|
| 207 |
+
In this paper, we conducted a systematic inspection to study the proper regularization techniques that are provably related to the generalization error of a machine learning model, when the test distribution are allowed to be perturbed by a family of transformation functions. With progressively more specific assumptions, we identified progressively simpler methods that can bound the worst case risk. We summarize the main take-home messages below:
|
| 208 |
+
|
| 209 |
+
• Regularizing a norm distance between the logits of the originals samples and the logits of the augmented samples enjoys several merits: the trained model tend to have good worst cast performance, and can learn the concept of invariance (as shown in our invariance test). Although our theory suggests $\ell _ { 1 }$ norm, but we recommend squared $\ell _ { 2 }$ norm in practice considering the difficulties of passing the (sub)gradient of $\ell _ { 1 }$ norm in backpropagation. • With the vertex assumption held (it usually requires domain knowledge to choose the vertex functions), one can use “regularized training with vertices” method and get good empirical performance in both accuracy and invariance, and the method is at the same complexity order of vanilla training without data augmentation. When we do not have the domain knowledge (thus are not confident in the vertex assumption), we recommend “regularized worst-case augmentation”, which has the best performance overall, but requires extra computations to identify the worst-case augmentated samples at each iteration.
|
| 210 |
+
|
| 211 |
+
# REFERENCES
|
| 212 |
+
|
| 213 |
+
Alessandro Achille and Stefano Soatto. Information dropout: Learning optimal representations through noisy computation. IEEE transactions on pattern analysis and machine intelligence, 40 (12):2897–2905, 2018.
|
| 214 |
+
|
| 215 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan, 2017. ´
|
| 216 |
+
|
| 217 |
+
Akari Asai and Hannaneh Hajishirzi. Logic-guided data augmentation and regularization for consistent question answering, 2020.
|
| 218 |
+
|
| 219 |
+
Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1-2):151–175, 2010.
|
| 220 |
+
|
| 221 |
+
Sergey Bobkov and Michel Ledoux. One-dimensional empirical measures, order statistics, and Kantorovich transport distances, volume 261. American Mathematical Society, 2019.
|
| 222 |
+
|
| 223 |
+
Olivier Bousquet, Stephane Boucheron, and G ´ abor Lugosi. Introduction to statistical learning the- ´ ory. In Summer School on Machine Learning, pp. 169–207. Springer, 2003.
|
| 224 |
+
|
| 225 |
+
Shuxiao Chen, Edgar Dobriban, and Jane H Lee. A group-theoretic framework for data augmentation, 2019.
|
| 226 |
+
|
| 227 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In International conference on machine learning, pp. 2990–2999, 2016.
|
| 228 |
+
|
| 229 |
+
Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 113–123, 2019.
|
| 230 |
+
|
| 231 |
+
Marco Cuturi and Arnaud Doucet. Fast computation of wasserstein barycenters. 2014.
|
| 232 |
+
|
| 233 |
+
Tri Dao, Albert Gu, Alexander Ratner, Virginia Smith, Chris De Sa, and Christopher Re. A kernel ´ theory of modern data augmentation. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), 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, pp. 1528–1537. PMLR, 2019.
|
| 234 |
+
|
| 235 |
+
Alhussein Fawzi, Horst Samulowitz, Deepak S. Turaga, and Pascal Frossard. Adaptive data augmentation for image classification. In 2016 IEEE International Conference on Image Processing, ICIP 2016, Phoenix, AZ, USA, September 25-28, 2016, pp. 3688–3692. IEEE, 2016.
|
| 236 |
+
|
| 237 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016.
|
| 238 |
+
|
| 239 |
+
Ian Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
|
| 240 |
+
|
| 241 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans, 2017.
|
| 242 |
+
|
| 243 |
+
Hao Guo, Kang Zheng, Xiaochuan Fan, Hongkai Yu, and Song Wang. Visual attention consistency under image transforms for multi-label image classification. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 729– 739. Computer Vision Foundation / IEEE, 2019.
|
| 244 |
+
|
| 245 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. Proceedings of the International Conference on Learning Representations, 2019.
|
| 246 |
+
|
| 247 |
+
Dan Hendrycks, Norman Mu, Ekin Dogus Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
|
| 248 |
+
|
| 249 |
+
Alex Hernandez-Garc ´ ´ıa and Peter Konig. Data augmentation instead of explicit regularization, 2018. ¨
|
| 250 |
+
|
| 251 |
+
Daniel Ho, Eric Liang, Xi Chen, Ion Stoica, and Pieter Abbeel. Population based augmentation: Efficient learning of augmentation policy schedules. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), 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, pp. 2731–2741. PMLR, 2019.
|
| 252 |
+
|
| 253 |
+
Zhiting Hu, Bowen Tan, Russ R Salakhutdinov, Tom M Mitchell, and Eric P Xing. Learning data manipulation for augmentation and weighting. In Advances in Neural Information Processing Systems, pp. 15738–15749, 2019.
|
| 254 |
+
|
| 255 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pp. 2017–2025, 2015.
|
| 256 |
+
|
| 257 |
+
Jisoo Jeong, Seungeui Lee, Jeesoo Kim, and Nojun Kwak. Consistency-based semi-supervised learning for object detection. In Advances in Neural Information Processing Systems, pp. 10758– 10767, 2019.
|
| 258 |
+
|
| 259 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing, 2018.
|
| 260 |
+
|
| 261 |
+
Risi Kondor, Zhen Lin, and Shubhendu Trivedi. Clebsch–gordan nets: a fully fourier space spherical convolutional neural network. In Advances in Neural Information Processing Systems, pp. 10117– 10126, 2018.
|
| 262 |
+
|
| 263 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 264 |
+
|
| 265 |
+
Davis Liang, Zhiheng Huang, and Zachary C Lipton. Learning noise-invariant representations for robust speech recognition. In 2018 IEEE Spoken Language Technology Workshop (SLT), pp. 56–63. IEEE, 2018.
|
| 266 |
+
|
| 267 |
+
Percy Liang. Cs229t/stat231: Statistical learning theory (winter 2016), 2016.
|
| 268 |
+
|
| 269 |
+
Raphael Gontijo Lopes, Dong Yin, Ben Poole, Justin Gilmer, and Ekin D Cubuk. Improving robustness without sacrificing accuracy with patch gaussian augmentation. arXiv preprint arXiv:1906.02611, 2019.
|
| 270 |
+
|
| 271 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
|
| 272 |
+
|
| 273 |
+
Shashank Rajput, Zhili Feng, Zachary Charles, Po-Ling Loh, and Dimitris Papailiopoulos. Does data augmentation lead to positive margin? In International Conference on Machine Learning, pp. 5321–5330, 2019.
|
| 274 |
+
|
| 275 |
+
Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In Advances in neural information processing systems, pp. 1163–1171, 2016.
|
| 276 |
+
|
| 277 |
+
Meet Shah, Xinlei Chen, Marcus Rohrbach, and Devi Parikh. Cycle-consistency for robust visual question answering. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 278 |
+
|
| 279 |
+
Connor Shorten and Taghi M Khoshgoftaar. A survey on image data augmentation for deep learning. Journal of Big Data, 6(1):60, 2019.
|
| 280 |
+
|
| 281 |
+
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.
|
| 282 |
+
|
| 283 |
+
Kai Sheng Tai, Peter Bailis, and Gregory Valiant. Equivariant transformer networks. arXiv preprint arXiv:1901.11399, 2019.
|
| 284 |
+
|
| 285 |
+
Zhuozhuo Tu, Jingwei Zhang, and Dacheng Tao. Theoretical analysis of adversarial learning: A minimax approach. In Advances in Neural Information Processing Systems, pp. 12259–12269, 2019.
|
| 286 |
+
|
| 287 |
+
Cedric Villani. ´ Topics in optimal transportation. Number 58. American Mathematical Soc., 2003.
|
| 288 |
+
|
| 289 |
+
Cedric Villani. ´ Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008.
|
| 290 |
+
|
| 291 |
+
Haohan Wang, Songwei Ge, Eric P. Xing, and Zachary C. Lipton. Learning robust global representations by penalizing local predictive power, 2019a.
|
| 292 |
+
|
| 293 |
+
Haohan Wang, Zexue He, Zachary C. Lipton, and Eric P. Xing. Learning robust representations by projecting superficial statistics out. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019b.
|
| 294 |
+
|
| 295 |
+
Haohan Wang, Xindi Wu, Zeyi Huang, and Eric P. Xing. High frequency component helps explain the generalization of convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 296 |
+
|
| 297 |
+
Yulin Wang, Xuran Pan, Shiji Song, Hong Zhang, Gao Huang, and Cheng Wu. Implicit semantic data augmentation for deep networks. In Advances in Neural Information Processing Systems, pp. 12614–12623, 2019c.
|
| 298 |
+
|
| 299 |
+
Xindi Wu, Yijun Mao, Haohan Wang, Xiangrui Zeng, Xin Gao, Eric P. Xing, and Min Xu. Regularized adversarial training (RAT) for robust cellular electron cryo tomograms classification. In Illhoi Yoo, Jinbo Bi, and Xiaohua Hu (eds.), 2019 IEEE International Conference on Bioinformatics and Biomedicine, BIBM 2019, San Diego, CA, USA, November 18-21, 2019, pp. 1–6. IEEE, 2019.
|
| 300 |
+
|
| 301 |
+
Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. Unsupervised data augmentation. arXiv preprint arXiv:1904.12848, 2019.
|
| 302 |
+
|
| 303 |
+
Saining Xie, Tianbao Yang, Xiaoyu Wang, and Yuanqing Lin. Hyper-class augmented and regularized deep learning for fine-grained image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2645–2654, 2015.
|
| 304 |
+
|
| 305 |
+
Fanny Yang, Zuowen Wang, and Christina Heinze-Deml. Invariance-inducing regularization using worst-case transformations suffices to boost accuracy and spatial robustness. In Advances in Neural Information Processing Systems, pp. 14757–14768, 2019.
|
| 306 |
+
|
| 307 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P. Xing, Laurent El Ghaoui, and Michael I. Jordan. Theoretically principled trade-off between robustness and accuracy. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), 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, pp. 7472–7482. PMLR, 2019a.
|
| 308 |
+
|
| 309 |
+
Richard Zhang. Making convolutional networks shift-invariant again. arXiv preprint arXiv:1904.11486, 2019.
|
| 310 |
+
|
| 311 |
+
Xinyu Zhang, Qiang Wang, Jian Zhang, and Zhao Zhong. Adversarial autoaugment. In International Conference on Learning Representations, 2020.
|
| 312 |
+
|
| 313 |
+
Zhirui Zhang, Shuangzhi Wu, Shujie Liu, Mu Li, Ming Zhou, and Tong Xu. Regularizing neural machine translation by target-bidirectional agreement. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 443–450, 2019b.
|
| 314 |
+
|
| 315 |
+
Stephan Zheng, Yang Song, Thomas Leung, and Ian Goodfellow. Improving the robustness of deep neural networks via stability training. In Proceedings of the ieee conference on computer vision and pattern recognition, pp. 4480–4488, 2016.
|
| 316 |
+
|
| 317 |
+
Barret Zoph, Ekin D. Cubuk, Golnaz Ghiasi, Tsung-Yi Lin, Jonathon Shlens, and Quoc V. Le. Learning data augmentation strategies for object detection, 2019.
|
md/train/QtTKTdVrFBB/QtTKTdVrFBB.md
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RANDOM FEATURE ATTENTION
|
| 2 |
+
|
| 3 |
+
Hao Peng♠∗ Nikolaos Pappas♠ Dani Yogatama♣ Roy Schwartz♥ Noah A. Smith♠♦ Lingpeng $\mathbf { K o n g } ^ { \bullet \ast }$
|
| 4 |
+
|
| 5 |
+
♠Paul G. Allen School of Computer Science & Engineering, University of Washington
|
| 6 |
+
♣DeepMind ♦Allen Institute for Artificial Intelligence
|
| 7 |
+
♥School of Computer Science & Engineering, Hebrew University of Jerusalem
|
| 8 |
+
♦Department of Computer Science , The University of Hong Kong
|
| 9 |
+
{hapeng,npappas,nasmith}@cs.washington.edu
|
| 10 |
+
dyogatama@google.com, roys@cs.huji.ac.il, lpk@cs.hku.hk
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Transformers are state-of-the-art models for a variety of sequence modeling tasks. At their core is an attention function which models pairwise interactions between the inputs at every timestep. While attention is powerful, it does not scale efficiently to long sequences due to its quadratic time and space complexity in the sequence length. We propose RFA, a linear time and space attention that uses random feature methods to approximate the softmax function, and explore its application in transformers. RFA can be used as a drop-in replacement for conventional softmax attention and offers a straightforward way of learning with recency bias through an optional gating mechanism. Experiments on language modeling and machine translation demonstrate that RFA achieves similar or better performance compared to strong transformer baselines. In the machine translation experiment, RFA decodes twice as fast as a vanilla transformer. Compared to existing efficient transformer variants, RFA is competitive in terms of both accuracy and efficiency on three long text classification datasets. Our analysis shows that RFA’s efficiency gains are especially notable on long sequences, suggesting that RFA will be particularly useful in tasks that require working with large inputs, fast decoding speed, or low memory footprints.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Transformer architectures (Vaswani et al., 2017) have achieved tremendous success on a variety of sequence modeling tasks (Ott et al., 2018; Radford et al., 2018; Parmar et al., 2018; Devlin et al., 2019; Parisotto et al., 2020, inter alia). Under the hood, the key component is attention (Bahdanau et al., 2015), which models pairwise interactions of the inputs, regardless of their distances from each other. This comes with quadratic time and memory costs, making the transformers computationally expensive, especially for long sequences. A large body of research has been devoted to improving their time and memory efficiency (Tay et al., 2020c). Although better asymptotic complexity and prominent gains for long sequences have been achieved (Lee et al., 2019; Child et al., 2019; Beltagy et al., 2020, inter alia), in practice, many existing approaches are less well-suited for moderatelength ones: the additional computation steps required by some approaches can overshadow the time and memory they save (Kitaev et al., 2020; Wang et al., 2020; Roy et al., 2020, inter alia).
|
| 19 |
+
|
| 20 |
+
This work proposes random feature attention (RFA), an efficient attention variant that scales linearly in sequence length in terms of time and space, and achieves practical gains for both long and moderate length sequences. RFA builds on a kernel perspective of softmax (Rawat et al., 2019). Using the well-established random feature maps (Rahimi & Recht, 2007; Avron et al., 2016; $\ S 2$ ), RFA approximates the dot-then-exponentiate function with a kernel trick (Hofmann et al., 2008): $\exp ( \mathbf { x } \cdot \mathbf { y } ) \approx \phi ( \mathbf { x } ) \cdot \phi ( \mathbf { y } )$ . Inspired by its connections to gated recurrent neural networks (Hochreiter & Schmidhuber, 1997; Cho et al., 2014) and fast weights (Schmidhuber, 1992), we further augment RFA with an optional gating mechanism, offering a straightforward way of learning with recency bias when locality is desired.
|
| 21 |
+
|
| 22 |
+
RFA and its gated variant (§3) can be used as a drop-in substitute for the canonical softmax attention, and increase the number of parameters by less than $0 . 1 \%$ . We explore its applications in transformers on language modeling, machine translation, and long text classification $( \ S 4 )$ . Our experiments show that RFA achieves comparable performance to vanilla transformer baselines in all tasks, while outperforming a recent related approach (Katharopoulos et al., 2020). The gating mechanism proves particularly useful in language modeling: the gated variant of RFA outperforms the transformer baseline on WikiText-103. RFA shines in decoding, even for shorter sequences. In our head-to-head comparison on machine translation benchmarks, RFA decodes around $2 \times$ faster than a transformer baseline, without accuracy loss. Comparisons to several recent efficient transformer variants on three long text classification datasets show that RFA is competitive in terms of both accuracy and efficiency. Our analysis (§5) shows that more significant time and memory efficiency improvements can be achieved for longer sequences: $1 2 \times$ decoding speedup with less than $10 \%$ of the memory for 2,048-length outputs.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
# 2.1 ATTENTION IN SEQUENCE MODELING
|
| 27 |
+
|
| 28 |
+
The attention mechanism (Bahdanau et al., 2015) has been widely used in many sequence modeling tasks. Its dot-product variant is the key building block for the state-of-the-art transformer architectures (Vaswani et al., 2017). Let $\{ \mathbf { q } _ { t } \} _ { t = 1 } ^ { N }$ denote a sequence of $N$ query vectors, that attend to sequences of $M$ key and value vectors. At each timestep, the attention linearly combines the values weighted by the outputs of a softmax:
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\mathrm { a t t n } \left( \mathbf { q } _ { t } , \{ \mathbf { k } _ { i } \} , \{ \mathbf { v } _ { i } \} \right) = \sum _ { i } \frac { \exp \left( \mathbf { q } _ { t } \cdot \mathbf { k } _ { i } / \tau \right) } { \sum _ { j } \exp \left( \mathbf { q } _ { t } \cdot \mathbf { k } _ { j } / \tau \right) } \mathbf { v } _ { i } ^ { \top } .
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
$\tau$ is the temperature hyperparameter determining how “flat” the softmax is (Hinton et al., 2015).1
|
| 35 |
+
|
| 36 |
+
Calculating attention for a single query takes $\mathcal { O } ( M )$ time and space. For the full sequence of $N$ queries the space amounts to $\mathcal { O } ( M N )$ . When the computation cannot be parallelized across the queries, e.g., in autoregressive decoding, the time complexity is quadratic in the sequence length.
|
| 37 |
+
|
| 38 |
+
# 2.2 RANDOM FEATURE METHODS
|
| 39 |
+
|
| 40 |
+
The theoretical backbone of this work is the unbiased estimation of the Gaussian kernel by Rahimi & Recht (2007). Based on Bochner’s theorem (Bochner, 1955), Rahimi & Recht (2007) proposed random Fourier features to approximate a desired shift-invariant kernel. The method nonlinearly transforms a pair of vectors $\mathbf { x }$ and $\mathbf { y }$ using a random feature map $\phi$ ; the inner product between $\phi ( \mathbf { x } )$ and $\phi ( \mathbf { y } )$ approximates the kernel evaluation on $\mathbf { x }$ and $\mathbf { y }$ . More precisely:
|
| 41 |
+
|
| 42 |
+
Theorem 1 (Rahimi & Recht, 2007). Let $\phi : \mathbb { R } ^ { d } \mathbb { R } ^ { 2 D }$ be a nonlinear transformation:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\phi \left( \mathbf { x } \right) = \sqrt { 1 / D } \left[ \sin \left( \mathbf { w } _ { 1 } \cdot \mathbf { x } \right) , \ldots , \sin \left( \mathbf { w } _ { D } \cdot \mathbf { x } \right) , \cos \left( \mathbf { w } _ { 1 } \cdot \mathbf { x } \right) , \ldots , \cos \left( \mathbf { w } _ { D } \cdot \mathbf { x } \right) \right] ^ { \top } .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
When $d$ -dimensional random vectors $\mathbf { w } _ { i }$ are independently sampled from ${ \mathcal { N } } ( \mathbf { 0 } , \sigma ^ { 2 } \mathbf { I } _ { d } )$ ,
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { r } { \mathbb { E } _ { \mathbf { w } _ { i } } \left[ \boldsymbol { \phi } \left( \mathbf { x } \right) \cdot \boldsymbol { \phi } \left( \mathbf { y } \right) \right] = \exp \left( - \left. \mathbf { x } - \mathbf { y } \right. ^ { 2 } / 2 \sigma ^ { 2 } \right) . } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
Variance of the estimation is inversely proportional to $D$ (Appendix A.2; Yu et al., 2016).
|
| 55 |
+
|
| 56 |
+
Random feature methods proved successful in speeding up kernel methods (Oliva et al., 2015; Avron et al., 2017; Sun, 2019, inter alia), and more recently are used to efficiently approximate softmax (Rawat et al., 2019). In $\ S 3 . 1$ , we use it to derive an unbiased estimate to $\exp ( \langle \cdot , \cdot \rangle )$ and then an efficient approximation to softmax attention.
|
| 57 |
+
|
| 58 |
+
# 3 MODEL
|
| 59 |
+
|
| 60 |
+
This section presents RFA (§3.1) and its gated variant (§3.2). In $\ S 3 . 3$ we lay out several design choices and relate RFA to prior works. We close by practically analyzing RFA’s complexity (§3.4).
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 1: Computation graphs for softmax attention (left) and random feature attention (right). Here, we assume cross attention with source length $M$ and target length $N$ .
|
| 64 |
+
|
| 65 |
+
# 3.1 RANDOM FEATURE ATTENTION
|
| 66 |
+
|
| 67 |
+
RFA builds on an unbiased estimate to $\exp ( \langle \cdot , \cdot \rangle )$ from Theorem 1, which we begin with:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } & { \exp \left( \mathbf { x } \cdot \mathbf { y } / \sigma ^ { 2 } \right) = \exp \left( \left\| \mathbf { x } \right\| ^ { 2 } / 2 \sigma ^ { 2 } + \left\| \mathbf { y } \right\| ^ { 2 } / 2 \sigma ^ { 2 } \right) \exp \left( - \left\| \mathbf { x } - \mathbf { y } \right\| ^ { 2 } / 2 \sigma ^ { 2 } \right) } \\ & { \qquad \approx \exp \left( \left\| \mathbf { x } \right\| ^ { 2 } / 2 \sigma ^ { 2 } + \left\| \mathbf { y } \right\| ^ { 2 } / 2 \sigma ^ { 2 } \right) \phi \left( \mathbf { x } \right) \cdot \phi \left( \mathbf { y } \right) . } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The last line does not have any nonlinear interaction between $\phi ( \mathbf { x } )$ and $\phi ( \mathbf { y } )$ , allowing for a linear time/space approximation to attention. For clarity we assume the query and keys are unit vectors.2
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { l } { { \displaystyle \mathrm { a t t n } \left( { \bf q } _ { t } , \left\{ { \bf k } _ { i } \right\} , \left\{ { \bf v } _ { i } \right\} \right) = \sum _ { i } \frac { \exp \left( { \bf q } _ { t } \cdot { \bf k } _ { i } / \sigma ^ { 2 } \right) } { \sum _ { j } \exp \left( { \bf q } _ { t } \cdot { \bf k } _ { j } / \sigma ^ { 2 } \right) } { \bf v } _ { i } ^ { \top } } \ ~ } \\ { \displaystyle ~ \approx \sum _ { i } \frac { \phi \left( { \bf q } _ { t } \right) ^ { \top } \phi \left( { \bf k } _ { i } \right) { \bf v } _ { i } ^ { \top } } { \sum _ { j } \phi \left( { \bf q } _ { t } \right) \cdot \phi \left( { \bf k } _ { j } \right) } \ ~ } \\ { \displaystyle ~ = \frac { \phi \left( { \bf q } _ { t } \right) ^ { \top } \sum _ { i } \phi \left( { \bf k } _ { i } \right) \otimes { \bf v } _ { i } } { \phi \left( { \bf q } _ { t } \right) \cdot \sum _ { j } \phi \left( { \bf k } _ { j } \right) } = { \bf R F A } \left( { \bf q } _ { t } , \left\{ { \bf k } _ { i } \right\} , \left\{ { \bf v } _ { i } \right\} \right) . } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
$\otimes$ denotes the outer product between vectors, and $\sigma ^ { 2 }$ corresponds to the temperature term $\tau$ in Eq. 1.
|
| 80 |
+
|
| 81 |
+
RFA can be used as a drop-in-replacement for softmax-attention.
|
| 82 |
+
|
| 83 |
+
(a) The input is revealed in full to cross attention and encoder self-attention. Here RFA calculates attention using Eq. 5.
|
| 84 |
+
(b) In causal attention RFA attends only to the prefix.3 This allows for a recurrent computation. Tuple $( \mathbf { S } _ { t } \in \mathbb { R } ^ { 2 D \times d } , \mathbf { z } _ { t } \in \dot { \mathbb { R } } ^ { 2 D } )$ is used as the “hidden state” at time step $t$ to keep track of the history, similar to those in RNNs. Then $\mathrm { R F A } ( \mathbf { q } _ { t } , \{ \mathbf { k } _ { i } \} _ { i \leq t } , \{ \mathbf { v } _ { i } \} _ { i \leq t } ) =$ $\phi ( \mathbf { q } _ { t } ) ^ { \top } \mathbf { S } _ { t } / ( \phi ( \mathbf { q } _ { t } ) \cdot \mathbf { z } _ { t } )$ , where
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathbf { S } _ { t } = \mathbf { S } _ { t - 1 } + \phi \left( \mathbf { k } _ { t } \right) \otimes \mathbf { v } _ { t } , \quad \mathbf { z } _ { t } = \mathbf { z } _ { t - 1 } + \phi \left( \mathbf { k } _ { t } \right) .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
$2 D$ denotes the size of $\phi ( \cdot )$ . Appendix A.1 summarizes the computation procedure of RFA, and Figure 1 compares it against the softmax attention. Appendix A.3 derives causal RFA in detail.
|
| 91 |
+
|
| 92 |
+
Analogously to the softmax attention, RFA has its multiheaded variant (Vaswani et al., 2017). In our experiments we use causal RFA in a transformer language model (§4.1), and both cross and causal RFA in the decoder of a sequence-to-sequence machine translation model.
|
| 93 |
+
|
| 94 |
+
# 3.2 RFA-GATE: LEARNING WITH RECENCY BIAS
|
| 95 |
+
|
| 96 |
+
The canonical softmax attention does not have any explicit modeling of distance or locality. In learning problems where such inductive bias is crucial (Ba et al., 2016; Parmar et al., 2018; Miconi et al., 2018; Li et al., 2019, inter alia), transformers heavily rely on positional encodings. Answering to this, many approaches have been proposed, e.g., learning the attention spans (Sukhbaatar et al.,
|
| 97 |
+
|
| 98 |
+
2019; Wu et al., 2020), and enhancing the attention computation with recurrent (Hao et al., 2019;
|
| 99 |
+
Chen et al., 2019) or convolutional (Wu et al., 2019; Mohamed et al., 2019) components.
|
| 100 |
+
|
| 101 |
+
RFA faces the same issue, but its causal attention variant (Eq. 6) offers a straightforward way of learning with recency bias. We draw inspiration from its connections to RNNs, and augment RFA with a learned gating mechanism (Hochreiter & Schmidhuber, 1997; Cho et al., 2014; Peng et al., 2018, inter alia):
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r l } & { g _ { t } = \mathrm { s i g m o i d } ( \mathbf { w } _ { g } \cdot \mathbf { x } _ { t } + b _ { g } ) , } \\ & { \mathbf { S } _ { t } = g _ { t } \mathbf { S } _ { t - 1 } + \left( 1 - g _ { t } \right) \phi \left( \mathbf { k } _ { t } \right) \otimes \mathbf { v } _ { t } , } \\ & { \mathbf { z } _ { t } = g _ { t } \mathbf { z } _ { t - 1 } + \left( 1 - g _ { t } \right) \phi \left( \mathbf { k } _ { t } \right) . } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
${ \bf w } _ { g }$ and $b _ { g }$ are learned parameters, and $\mathbf { x } _ { t }$ is the input representation at timestep $t$ .4 By multiplying the learned scalar gates $0 ~ < ~ g _ { t } ~ < ~ 1$ against the hidden state $( \mathbf { S } _ { t } , \mathbf { z } _ { t } )$ , history is exponentially decayed, favoring more recent context.
|
| 108 |
+
|
| 109 |
+
The gating mechanism shows another benefit of RFA: it would be otherwise more difficult to build similar techniques into the softmax attention, where there is no clear sense of “recurrence” (Appendix A.5). It proves useful in our language modeling experiments $( \ S 4 . 1 )$ .
|
| 110 |
+
|
| 111 |
+
# 3.3 DISCUSSION
|
| 112 |
+
|
| 113 |
+
On query and key norms, and learned random feature variance. Eq. 5 assumes both the query and keys are of norm-1. It therefore approximates a softmax attention that normalizes the queries and keys before multiplying them, and then scales the logits by dividing them by $\sigma ^ { 2 }$ . Empirically, this normalization step scales down the logits (Vaswani et al., 2017) and enforces that $- 1 \overset { \cdot } { \leq } \mathbf { q } ^ { \intercal } \dot { \mathbf { k } } \leq 1$ . In consequence, the softmax outputs would be “flattened” if not for $\sigma$ , which can be set a priori as a hyperparameter (Yu et al., 2016; Avron et al., 2017; Sun, 2019, inter alia). Here we instead learn it from data with the reparameterization trick (Kingma & Welling, 2014):
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\widetilde { \mathbf { w } } _ { i } \sim { \mathcal { N } } ( \mathbf { 0 } , \mathbf { I } _ { d } ) , \quad \mathbf { w } _ { i } = \pmb { \sigma } \circ \widetilde { \mathbf { w } } _ { i } .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
$\mathbf { I } _ { d }$ is the $d \times d$ identity matrix, and $\circ$ denotes elementwise product between vectors. $d$ -dimensional vector $\sigma$ is learned, but random vectors $\widetilde { \mathbf { w } } _ { i }$ are not.5
|
| 120 |
+
|
| 121 |
+
This norm-1 constraint is never mandatory. Rather, we employ it for notation clarity and easier implementation. In preliminary experiments we find it has little impact on the performance when $\sigma$ is set properly or learned from data. Eq. 12 in Appendix A presents RFA without imposing it.
|
| 122 |
+
|
| 123 |
+
Going beyond the Gaussian kernel. More broadly, random feature methods can be applied to a family of shift-invariant kernels, with the Gaussian kernel being one of them. In the same family, the order-1 arc-cosine kernel (Cho & Saul, 2009) can be approximated with feature map: $\phi _ { \mathrm { a r c c o s } } ( \mathbf { x } ) = \sqrt { 1 / D } [ \mathrm { R e L U } ( \mathbf { w } _ { 1 } \cdot \mathbf { x } ) , \dots , \mathrm { R e L U } ( \mathbf { w } _ { D } \cdot \mathbf { x } ) ] ^ { \top }$ (Alber et al., 2017).6 In our experiments, the Gaussian and arc-cosine variants achieve similar performance. This supplements the exploration of alternatives to softmax in attention (Tsai et al., 2019; Gao et al., 2019).
|
| 124 |
+
|
| 125 |
+
Relations to prior work. Katharopoulos et al. (2020) inspire the causal attention variant of RFA. They use a feature map based on the exponential linear unit activation (Clevert et al., 2016): $\mathrm { e l u } ( \cdot ) + 1$ . It significantly underperforms both the baseline and RFA in our controlled experiments, showing the importance of a properly-chosen feature map. Random feature approximation of attention is also explored by a concurrent work (Choromanski et al., 2021), with applications in masked language modeling for proteins. They propose positive random features to approximate softmax, aiming for a lower variance in critical regions. RFA instead normalizes the queries and keys before random projection to reduce variance. Going beyond both, RFA establishes the benefits of random feature methods as a more universal substitute for softmax across all attention variants, facilitating its applications in, e.g., sequence-to-sequence learning.
|
| 126 |
+
|
| 127 |
+
There are interesting connections between gated RFA and fast weights (Schmidhuber, 1992; 1993; Ba et al., 2016; Miconi et al., 2018, inter alia). Emphasizing recent patterns, they learn a temporal memory to store history similarly to Eqs. 7. The main difference is that RFA additionally normalizes the output using $\phi ( { \bf q } _ { t } ) \cdot { \bf z }$ as in Eq. 6, a by-product of approximating softmax’s partition function. It is intriguing to study the role of this normalization term, which we leave to future work.
|
| 128 |
+
|
| 129 |
+
# 3.4 COMPLEXITY ANALYSIS
|
| 130 |
+
|
| 131 |
+
Time. Scaling linearly in the sequence lengths, RFA needs less computation (in terms of number of operations) for long sequences. This implies speedup wherever the quadratic-time softmax attention cannot be fully-parallelized across time steps. More specifically:
|
| 132 |
+
|
| 133 |
+
• Significant speedup can be expected in autoregressive decoding, both conditional (e.g., machine translation) and unconditional (e.g., sampling from a language model). For example, $1 . 9 \times$ speedup is achieved in our machine translation experiments (§4.2); and more for longer sequences (e.g., $1 2 \times$ for 2,048-length ones; §5). Some applications (e.g., language modeling, text classification) reveal inputs to the model in full.7 When there are enough threads to parallelize softmax attention across time steps, hardly any speedup from RFA can be achieved; when there are not, typically for very long sequences $( > 1 , 0 0 0 )$ , substantial speed gain is possible. For example, RFA does not achieve any speedup when working with 512-length context $( \ S 4 . 1 )$ , but achieves a $5 . 3 \times$ speedup with 4,000-length context $( \ S 4 . 2 )$ .
|
| 134 |
+
|
| 135 |
+
Memory. Asymptotically, RFA has a better memory efficiency than its softmax counterpart (linear vs. quadratic). To reach a more practical conclusion, we include in our analysis the cost of the feature maps. $\phi$ ’s memory overhead largely depends on its size $D$ . For example, let’s consider the cross attention of a decoder. RFA uses $\mathcal { O } ( 4 D + 2 D d )$ space to store ${ \big . } \phi ( \mathbf { q } _ { t } ) , \sum _ { i } ^ { \cdot } \phi ( \mathbf { k } _ { i } ) \otimes \mathbf { v } _ { i }$ , and $\textstyle \sum _ { i } \phi ( \mathbf { k } _ { i } )$ (Eq. 5; line 12 of Algo. 2).8 In contrast, softmax cross attention stores the encoder outputs with $\mathcal O ( M d )$ memory, with $M$ being the source length. In this case RFA has a lower memory overhead when $2 D \ll M$ . Typically $D$ should be no less than $d$ in order for reasonable approximation (Yu et al., 2016); In a transformer model, $d$ is the size of an attention head, which is usually around 64 or 128 (Vaswani et al., 2017; Ott et al., 2018). This suggests that RFA can achieve significant memory saving with longer sequences, which is supported by our empirical analysis in $\ S 5$ . Further, using moderate sized feature maps is also desirable, so that its overhead does not overshadow the time and memory RFA saves. We experiment with $D$ at $d$ and $2 d$ ; the benefit of using $D > 2 d$ is marginal.
|
| 136 |
+
|
| 137 |
+
Appendix A.6 discusses the time and space complexity in more detail, and Appendix C.2 studies the effect of random feature size on performance.
|
| 138 |
+
|
| 139 |
+
# 4 EXPERIMENTS
|
| 140 |
+
|
| 141 |
+
We evaluate RFA on language modeling, machine translation, and long text classification.
|
| 142 |
+
|
| 143 |
+
# 4.1 LANGUAGE MODELING
|
| 144 |
+
|
| 145 |
+
Setting. We experiment with WikiText-103 (Merity et al., 2017). It is based on English Wikipedia. Table 5 in Appendix B summarizes some of its statistics. We compare the following models:
|
| 146 |
+
|
| 147 |
+
• BASE is our implementation of the strong transformer-based language model by Baevski & Auli (2019).
|
| 148 |
+
RFA builds on BASE, but replaces the softmax attention with random feature attention. We experiment with both Gaussian and arc-cosine kernel variants.
|
| 149 |
+
• RFA-GATE additionally learns a sigmoid gate on top of RFA (§3.2). It also has a Gaussian kernel variant and a arc-cosine kernel one.9
|
| 150 |
+
$\phi _ { \mathrm { e l u } }$ is a baseline to RFA. Instead of the random feature methods it uses the $\mathrm { e l u } ( \cdot ) + 1$ feature map, as in Katharopoulos et al. (2020).
|
| 151 |
+
|
| 152 |
+
To ensure fair comparisons, we use comparable implementations, tuning, and training procedure. All models use a 512 block size during both training and evaluation, i.e., they read as input a segment of 512 consecutive tokens, without access to the context from previous mini-batches. RFA variants use 64-dimensional random feature maps. We experiment with two model size settings, small (around 38M parameters) and big (around 242M parameters); they are described in Appendix B.1 along with other implementation details.
|
| 153 |
+
|
| 154 |
+
Table 1: Language model perplexity (lower is better) on the WikiText-103 development and test sets. Bolded numbers outperform BASE.
|
| 155 |
+
|
| 156 |
+
<table><tr><td></td><td colspan="2">Small</td><td colspan="2">Big</td></tr><tr><td>Model</td><td>Dev.</td><td>Test</td><td>Dev.</td><td>Test</td></tr><tr><td>BASE</td><td>33.0</td><td>34.5</td><td>24.5</td><td>26.2</td></tr><tr><td>Φelu (Katharopoulos et al., 2020)</td><td>38.4</td><td>40.1</td><td>28.7</td><td>30.2</td></tr><tr><td>RFA-Gaussian</td><td>33.6</td><td>35.7</td><td>25.8</td><td>27.5</td></tr><tr><td>RFA-arccos</td><td>36.0</td><td>37.7</td><td>26.4</td><td>28.1</td></tr><tr><td>RFA-GATE-Gaussian</td><td>31.3</td><td>32.7</td><td>23.2</td><td>25.0</td></tr><tr><td>RFA-GATE-arCCOS</td><td>32.8</td><td>34.0</td><td>24.8</td><td>26.3</td></tr><tr><td>RFA-GATE-Gaussian-Stateful</td><td>29.4</td><td>30.5</td><td>22.0</td><td>23.5</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Results. Table 1 compares the models’ performance in perplexity on WikiText-103 development and test data. Both kernel variants of RFA, without gating, outperform $\phi _ { \mathrm { e l u } }$ by more than 2.4 and 2.1 test perplexity for the small and big model respectively, confirming the benefits from using random feature approximation.10 Yet both underperform BASE, with RFA-Gaussian having a smaller gap. Comparing RFA against its gated variants, a more than 1.8 perplexity improvement can be attributed to the gating mechanism; and the gap is larger for small models. Notably, RFA-GATE-Gaussian outperforms BASE under both size settings by at least 1.2 perplexity. In general, RFA models with Gaussian feature maps outperform their arc-cosine counterparts.11 From the analysis in $\ S 3 . 4$ we would not expect speedup by RFA models, nor do we see any in the experiments.12
|
| 159 |
+
|
| 160 |
+
Closing this section, we explore a “stateful” variant of RFA-GATE-Gaussian. It passes the last hidden state $( \mathbf { S } _ { t } , \mathbf { z } _ { t } )$ to the next mini-batch during both training and evaluation, a technique commonly used in RNN language models (Merity et al., 2018). This is a consequence of RFA’s RNN-style computation, and is less straightforward to be applicable in the vanilla transformer models.13 From the last row of Table 1 we see that this brings a more than 1.5 test perplexity improvement.
|
| 161 |
+
|
| 162 |
+
# 4.2 MACHINE TRANSLATION
|
| 163 |
+
|
| 164 |
+
Datasets. We experiment with three standard machine translation datasets.
|
| 165 |
+
|
| 166 |
+
• WMT14 EN-DE and EN-FR (Bojar et al., 2014). Our data split and preprocessing follow those of Vaswani et al. (2017). We share the source and target vocabularies within each language pair, with 32,768 byte pair encoding types (BPE; Sennrich et al., 2016). • IWSLT14 DE-EN (Cettolo et al., 2014) is based on TED talks. The preprocessing follows Edunov et al. (2018). Separate vocabularies of 9K/7K BPE types are used for the source and target.
|
| 167 |
+
|
| 168 |
+
Table 5 in Appendix B summarizes some statistics of the datasets.
|
| 169 |
+
|
| 170 |
+
Setting. We compare the RFA variants described in $\ S 4 . 1$ . They build on a BASE model that is our implementation of the base-sized transformer (Vaswani et al., 2017). All RFA models apply random feature attention in decoder cross and causal attention, but use softmax attention in encoders. This setting yields the greatest decoding time and memory savings (§3.4). We use 128/64 for $D$ in cross/causal attention. RFA-GATE learns sigmoid gates in the decoder causal attention. The $\phi _ { \mathrm { e l u } }$ baseline uses the same setting and applies feature map in both decoder cross and causal attention, but not in the encoders. Further details are described in Appendix B.2.
|
| 171 |
+
|
| 172 |
+
<table><tr><td></td><td colspan="2">WMT14</td><td>IWSLT14</td><td></td></tr><tr><td>Model</td><td>EN-DE</td><td>EN-FR</td><td>DE-EN</td><td>Speed</td></tr><tr><td>BASE</td><td>28.1</td><td>39.0</td><td>34.6</td><td>1.0×</td></tr><tr><td>Φelu (Katharopoulos et al., 2020)</td><td>21.3</td><td>34.0</td><td>29.9</td><td>2.0×</td></tr><tr><td>RFA-Gaussian</td><td>28.0</td><td>39.2</td><td>34.5</td><td>1.8×</td></tr><tr><td>RFA-arccos</td><td>28.1</td><td>38.9</td><td>34.4</td><td>1.9×</td></tr><tr><td>RFA-GATE-Gaussian</td><td>28.1</td><td>39.0</td><td>34.6</td><td>1.8×</td></tr><tr><td>RFA-GATE-arccOS</td><td>28.2</td><td>39.2</td><td>34.4</td><td>1.9×</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 2: Machine translation test set BLEU. The decoding speed (last column) is relative to BASE.
|
| 175 |
+
All models are tested on a single TPU v2 accelerator, with batch size 32.
|
| 176 |
+
|
| 177 |
+
Results. Table 2 compares the models’ test set BLEU on three machine translation datasets. Overall both Gaussian and arc-cosine variants of RFA achieve similar performance to BASE on all three datasets, significantly outperforming Katharopoulos et al. (2020). Differently from the trends in the language modeling experiments, here the gating mechanism does not lead to substantial gains. Notably, all RFA variants decode more than $1 . 8 \times$ faster than BASE.
|
| 178 |
+
|
| 179 |
+
# 4.3 LONG TEXT CLASSIFICATION
|
| 180 |
+
|
| 181 |
+
We further evaluate RFA’s accuracy and efficiency when used as text encoders on three NLP tasks from the recently proposed Long Range Arena benchmark (Tay et al., 2021), designed to evaluate efficient Transformer variants on tasks that require processing long sequences.14
|
| 182 |
+
|
| 183 |
+
Experimental setting and datasets. We compare RFA against baselines on the following datasets:
|
| 184 |
+
|
| 185 |
+
• ListOps (LO; Nangia & Bowman, 2018) aims to diagnose the capability of modelling hierarchically structured data. Given a sequence of operations on single-digit integers, the model predicts the solution, also a single-digit integer. It is formulated as a 10-way classification. We follow Tay et al. (2021) and consider sequences with 500–2,000 symbols. Character-level text classification with the IMDb movie review dataset (Maas et al., 2011). This is a binary sentiment classification task. Character-level document retrieval with the ACL Anthology Network (AAN; Radev et al., 2009) dataset. The model classifies whether there is a citation between a pair of papers.
|
| 186 |
+
|
| 187 |
+
To ensure fair comparisons, we implement RFA on top of the transformer baseline by Tay et al. (2021), and closely follow their preprocessing, data split, model size, and training procedure. Speed and memory are evaluated on the IMDb dataset. For our RFA model, we use $D = 6 4$ for the IMDb dataset, and $D = 1 2 8$ for others. We refer the readers to Tay et al. (2021) for further details.
|
| 188 |
+
|
| 189 |
+
Results. From Table 3 we can see that RFA outperforms the transformer baseline on two out of the three datasets, achieving the best performance on IMDb with $66 \%$ accuracy. Averaging across three datasets, RFA outperforms the transformer by $0 . 3 \%$ accuracy, second only to Zaheer et al. (2020) with a $0 . 1 \%$ accuracy gap. In terms of time and memory efficiency, RFA is among the strongest. RFA speeds up over the transformer by $1 . 1 \mathrm { - } 5 . 3 \times$ , varying by sequence length. Importantly, compared to the only two baselines that perform comparably to the baseline transformer model (Tay et al., 2020a; Zaheer et al., 2020), RFA has a clear advantage in both speed and memory efficiency, and is the only model that is competitive in both accuracy and efficiency.
|
| 190 |
+
|
| 191 |
+
<table><tr><td></td><td colspan="4"> Accuracy</td><td colspan="4">Speed</td><td colspan="4">Memory</td></tr><tr><td>Model</td><td>LO</td><td>IMDb</td><td>AAN</td><td>Avg.</td><td>1K</td><td>2K</td><td>3K</td><td>4K</td><td>1K</td><td>2K</td><td>3K</td><td>4K</td></tr><tr><td>Transformer</td><td>36.4</td><td>64.3</td><td>57.5</td><td>52.7</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.00</td><td>1.00</td><td>1.00</td><td>1.00</td></tr><tr><td>Wang et al. (2020)</td><td>35.7</td><td>53.9</td><td>52.3</td><td>47.3</td><td>1.2</td><td>1.9</td><td>3.7</td><td>5.5</td><td>0.44</td><td>0.21</td><td>0.18</td><td>0.10</td></tr><tr><td>Kitaev et al. (2020)</td><td>37.3</td><td>56.1</td><td>53.4</td><td>48.9</td><td>0.5</td><td>0.4</td><td>0.7</td><td>0.8</td><td>0.56</td><td>0.37</td><td>0.28</td><td>0.24</td></tr><tr><td>Tay et al. (2020b)</td><td>17.1</td><td>63.6</td><td>59.6</td><td>46.8</td><td>1.1</td><td>1.6</td><td>2.9</td><td>3.8</td><td>0.55</td><td>0.31</td><td>0.20</td><td>0.16</td></tr><tr><td>Tay et al. (2020a)</td><td>37.0</td><td>61.7</td><td>54.7</td><td>51.1</td><td>1.1</td><td>1.2</td><td>2.9</td><td>1.4</td><td>0.76</td><td>0.75</td><td>0.74</td><td>0.74</td></tr><tr><td>Zaheer et al. (2020)</td><td>36.0</td><td>64.0</td><td>59.3</td><td>53.1</td><td>0.9</td><td>0.8</td><td>1.2</td><td>1.1</td><td>0.90</td><td>0.56</td><td>0.40</td><td>0.30</td></tr><tr><td>Katharopoulos et al. (2020)</td><td>16.1</td><td>65.9</td><td>53.1</td><td>45.0</td><td>1.1</td><td>1.9</td><td>3.7</td><td>5.6</td><td>0.44</td><td>0.22</td><td>0.14</td><td>0.11</td></tr><tr><td>Choromanski et al. (2021)</td><td>18.0</td><td>65.4</td><td>53.8</td><td>45.7</td><td>1.2</td><td>1.9</td><td>3.8</td><td>5.7</td><td>0.44</td><td>0.22</td><td>0.15</td><td>0.11</td></tr><tr><td>RFA-Gaussian (This work)</td><td>36.8</td><td>66.0</td><td>56.1</td><td>53.0</td><td>1.1</td><td>1.7</td><td>3.4</td><td>5.3</td><td>0.53</td><td>0.30</td><td>0.21</td><td>0.16</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Table 3: Accuracy (higher is better) of different models on LO, IMDb, and AAN, along with their speed (higher is better) and peak memory consumption (lower is better) varying sequence lengths (1–4K). Speed and memory are evaluated on the IMDb dataset and relative to the transformer’s. Bold font indicates the best performance in each column, and underlined numbers outperform the transformer in accuracy. Transformer’s and previous works’ numbers are due to Tay et al. (2021).
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 2: Conditional decoding speed (left) and memory overhead (right) varying the output lengths. All models are tested on a single TPU v2 accelerator, with greedy decoding and batch size 16.
|
| 197 |
+
|
| 198 |
+
# 5 ANALYSIS
|
| 199 |
+
|
| 200 |
+
Decoding time and memory varying by sequence length. $\ S 3 . 4$ shows that RFA can potentially achieve more significant speedup and memory saving for longer sequences, which we now explore.
|
| 201 |
+
|
| 202 |
+
We use a simulation conditional generation experiment on to compare RFA’s sequence-to-sequence decoding speed and memory overhead against the baseline’s. Here we assume the input and output sequences are of the same length. The compared models are of the same size as those described in $\ S 4 . 2$ , with 6-layer encoders and decoders. Other hyperparameters are summarized in Appendix B.2. All models are tested using greedy decoding with the same batch size of 16, on a TPU v2 accelerator.
|
| 203 |
+
|
| 204 |
+
From Figures 2 (a) and (b) we observe clear trends. Varying the lengths, both RFA variants achieve consistent decoding speed with nearly-constant memory overhead. In contrast, the baseline decodes slower for longer sequences, taking an increasing amount of memory. Notably, for 2,048-length sequences, RFA decodes around $1 2 \times$ faster than the baseline while using less than $10 \%$ of the memory. RFA-arccos slightly outperforms RFA-Gaussian in terms of speed and memory efficiency. This is because when using the same $D$ (as we do here), the $\phi _ { \mathrm { a r c c o s } }$ is half the size of $\phi _ { \mathrm { G a u s s i a n } }$ . These results suggest that RFA can be particularly useful in sequence-to-sequence tasks with longer sequences, e.g., document-level machine translation (Miculicich et al., 2018).
|
| 205 |
+
|
| 206 |
+
Figure 3 in Appendix C.1 compares the speed and memory consumption in unconditional decoding (e.g., sampling from a language model). The overall trends are similar to those in Figure 2.
|
| 207 |
+
|
| 208 |
+
Notes on decoding speed. With a lower memory overhead, RFA can use a larger batch size than the baseline. As noted by Katharopoulos et al. (2020) and Kasai et al. (2021), if we had used minibatches as large as the hardware allows, RFA could have achieved a more significant speed gain. Nonetheless, we control for batch size even though it is not the most favorable setting for RFA, since the conclusion translates better to common applications where one generates a single sequence at a time (e.g., instantaneous machine translation). For the softmax attention baseline, we follow Ott et al. (2018) and cache previously computed query/key/value representations, which significantly improves its decoding speed (over not caching).
|
| 209 |
+
|
| 210 |
+
Further analysis results. RFA achieves comparable performance to softmax attention. Appendix C.3 empirically shows that this cannot be attributed to RFA learning a good approximation to softmax: when we train with one attention but evaluate with the other, the performance is hardly better than randomly-initialized untrained models. Yet, an RFA model initialized from a pretrained softmax transformer achieves decent training loss after a moderate amount of finetuning steps (Appendix C.4). This suggests some potential applications, e.g., transferring knowledge from a pretrained transformer (e.g., GPT-3; Brown et al., 2020) to an RFA model that is more efficient to sample from.
|
| 211 |
+
|
| 212 |
+
# 6 RELATED WORK
|
| 213 |
+
|
| 214 |
+
One common motivation across the following studies, that is shared by this work and the research we have already discussed, is to scale transformers to long sequences. Note that there are plenty orthogonal choices for improving efficiency such as weight sharing (Dehghani et al., 2019), quantization (Shen et al., 2020), knowledge distillation (Sanh et al., 2020), and adapters (Houlsby et al., 2019). For a detailed overview we refer the reader to Tay et al. (2020c).
|
| 215 |
+
|
| 216 |
+
Sparse attention patterns. The idea behind these methods is to limit the reception field of attention computation. It motivates earlier attempts in improving attention’s efficiency, and still receives lots of interest. The sparse patterns can be set a priori (Liu et al., 2018; Qiu et al., 2020; Ho et al., 2020; You et al., 2020, inter alia) or learned from data (Sukhbaatar et al., 2019; Roy et al., 2020, inter alia). For most of these approaches, it is yet to be empirically verified that they are suitable for large-scale sequence-to-sequence learning; few of them have recorded decoding speed benefits.
|
| 217 |
+
|
| 218 |
+
Compressed context. Wang et al. (2020) compress the context along the timesteps so that the effective sequence length for attention computation is reduced. Another line of work aims to store past context into a memory module with limited size (Lee et al., 2019; Ainslie et al., 2020; Rae et al., 2020, inter alia), so that accessing longer history only moderately increases the overhead. Reminiscent of RNN language models, RFA attends beyond a fixed context window through a stateful computation, without increasing time or memory overhead.
|
| 219 |
+
|
| 220 |
+
# 7 CONCLUSION
|
| 221 |
+
|
| 222 |
+
We presented random feature attention (RFA). It views the softmax attention through the lens of kernel methods, and approximates it with random feature methods. With an optional gating mechanism, RFA provides a straightforward way of learning with recency bias. RFA’s time and space complexity is linear in the sequence length. We use RFA as a drop-in substitute for softmax attention in transformer models. On language modeling, machine translation, and long text classification benchmarks, RFA achieves comparable or better performance than strong baselines. In the machine translation experiment, RFA decodes twice as fast. Further time and memory efficiency improvements can be achieved for longer sequences.
|
| 223 |
+
|
| 224 |
+
# ACKNOWLEDGMENTS
|
| 225 |
+
|
| 226 |
+
We would like to thank Phil Blunsom, Chris Dyer, Nando de Freitas, Jungo Kasai, Adhiguna Kuncoro, Dianqi Li, Ofir Press, Lianhui Qin, Swabha Swayamdipta, Sam Thomson, the language team at DeepMind and the ARK group at the University of Washington for their helpful feedback. We also thank Tay Yi for helping run the Long Range Arena experiments, Richard Tanburn for the advice on implementations, and the anonymous reviewers for their thoughtful comments. This work was supported in part by NSF grant 1562364 and a Google Fellowship. Nikolaos Pappas was supported by the Swiss National Science Foundation under grant number P400P2 183911 “UNISON.”
|
| 227 |
+
|
| 228 |
+
# REFERENCES
|
| 229 |
+
|
| 230 |
+
Joshua Ainslie, Santiago Ontanon, Chris Alberti, Vaclav Cvicek, Zachary Fisher, Philip Pham, Anirudh Ravula, Sumit Sanghai, Qifan Wang, and Li Yang. ETC: Encoding long and structured inputs in transformers. In Proc. of EMNLP, 2020.
|
| 231 |
+
|
| 232 |
+
Maximilian Alber, Pieter-Jan Kindermans, Kristof Schutt, Klaus-Robert M ¨ uller, and Fei Sha. An ¨ empirical study on the properties of random bases for kernel methods. In Proc. of NeurIPS, 2017.
|
| 233 |
+
|
| 234 |
+
Haim Avron, Vikas Sindhwani, Jiyan Yang, and Michael W. Mahoney. Quasi-Monte Carlo feature maps for shift-invariant kernels. Journal of Machine Learning Research, 17(120):1–38, 2016.
|
| 235 |
+
|
| 236 |
+
Haim Avron, L. Kenneth Clarkson, and P. David and Woodruff. Faster kernel ridge regression using sketching and preconditioning. SIAM J. Matrix Analysis Applications, 2017.
|
| 237 |
+
|
| 238 |
+
Jimmy Ba, Geoffrey E Hinton, Volodymyr Mnih, Joel Z Leibo, and Catalin Ionescu. Using fast weights to attend to the recent past. In Proc. of NeurIPS, 2016.
|
| 239 |
+
|
| 240 |
+
Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. In Proc. of ICLR, 2019.
|
| 241 |
+
|
| 242 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proc. of ICLR, 2015.
|
| 243 |
+
|
| 244 |
+
Iz Beltagy, Matthew E. Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv: 2004.05150, 2020.
|
| 245 |
+
|
| 246 |
+
S. Bochner. Harmonic Analysis and the Theory of Probability. University of California Press, 1955.
|
| 247 |
+
|
| 248 |
+
Ondˇrej Bojar, Christian Buck, Christian Federmann, Barry Haddow, Philipp Koehn, Johannes Leveling, Christof Monz, Pavel Pecina, Matt Post, Herve Saint-Amand, Radu Soricut, Lucia Specia, and Ales Tamchyna. Findings of the 2014 workshop on statistical machine translation. In ˇ Proc. of WMT, 2014.
|
| 249 |
+
|
| 250 |
+
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. arXiv: 2005.14165, 2020.
|
| 251 |
+
|
| 252 |
+
Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, and Marcello Federico. Report on ¨ the 11th IWSLT evaluation campaign. In Proc. of IWSLT, 2014.
|
| 253 |
+
|
| 254 |
+
Kehai Chen, Rui Wang, Masao Utiyama, and Eiichiro Sumita. Recurrent positional embedding for neural machine translation. In Proc. of EMNLP, 2019.
|
| 255 |
+
|
| 256 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv: 1904.10509, 2019.
|
| 257 |
+
|
| 258 |
+
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. In Proc. of EMNLP, 2014.
|
| 259 |
+
|
| 260 |
+
Youngmin Cho and Lawrence K. Saul. Kernel methods for deep learning. In Proc. of NeurIPS, 2009.
|
| 261 |
+
|
| 262 |
+
Krzysztof Marcin Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Quincy Davis, Afroz Mohiuddin, Lukasz Kaiser, David Benjamin Belanger, Lucy J Colwell, and Adrian Weller. Rethinking attention with performers. In Proc. of ICLR, 2021.
|
| 263 |
+
|
| 264 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network´ learning by exponential linear units (ELUs). In Proc. of ICLR, 2016.
|
| 265 |
+
|
| 266 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive language models beyond a fixed-length context. In Proc. of ACL, 2019.
|
| 267 |
+
|
| 268 |
+
Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Lukasz Kaiser. Universal transformers. In Proc. of ICLR, 2019.
|
| 269 |
+
|
| 270 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proc. of NAACL, 2019.
|
| 271 |
+
|
| 272 |
+
Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Classical structured prediction losses for sequence to sequence learning. In Proc. of NAACL, 2018.
|
| 273 |
+
|
| 274 |
+
Yingbo Gao, Christian Herold, Weiyue Wang, and Hermann Ney. Exploring kernel functions in the softmax layer for contextual word classification. In International Workshop on Spoken Language Translation, 2019.
|
| 275 |
+
|
| 276 |
+
Jie Hao, Xing Wang, Baosong Yang, Longyue Wang, Jinfeng Zhang, and Zhaopeng Tu. Modeling recurrence for transformer. In Proc. of NAACL, 2019.
|
| 277 |
+
|
| 278 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NeurIPs Deep Learning and Representation Learning Workshop, 2015.
|
| 279 |
+
|
| 280 |
+
Jonathan Ho, Nal Kalchbrenner, Dirk Weissenborn, and Tim Salimans. Axial attention in multidimensional transformers. arXiv: 1912.12180, 2020.
|
| 281 |
+
|
| 282 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
|
| 283 |
+
|
| 284 |
+
Thomas Hofmann, Bernhard Scholkopf, and Alexander J. Smola. Kernel methods in machine learn- ¨ ing. Annals of Statistics, 36(3):1171–1220, 2008.
|
| 285 |
+
|
| 286 |
+
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. In Proc. of ICML, 2019.
|
| 287 |
+
|
| 288 |
+
Jungo Kasai, Nikolaos Pappas, Hao Peng, James Cross, and Noah A. Smith. Deep encoder, shallow decoder: Reevaluating the speed-quality tradeoff in machine translation. In Proc. of ICLR, 2021.
|
| 289 |
+
|
| 290 |
+
Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Francois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In Proc. of ICML, 2020.
|
| 291 |
+
|
| 292 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proc. of ICLR, 2015.
|
| 293 |
+
|
| 294 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Proc. of ICLR, 2014.
|
| 295 |
+
|
| 296 |
+
Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In Proc. of ICLR, 2020.
|
| 297 |
+
|
| 298 |
+
Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In Proc. of ICML, 2019.
|
| 299 |
+
|
| 300 |
+
Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In Proc. of NeurIPS, 2019.
|
| 301 |
+
|
| 302 |
+
Peter J. Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. In Proc. of ICLR, 2018.
|
| 303 |
+
|
| 304 |
+
Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proc. of ACL, 2011.
|
| 305 |
+
|
| 306 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In Proc. of ICLR, 2017.
|
| 307 |
+
|
| 308 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and Optimizing LSTM Language Models. In Proc. of ICLR, 2018.
|
| 309 |
+
|
| 310 |
+
Thomas Miconi, Kenneth Stanley, and Jeff Clune. Differentiable plasticity: training plastic neural networks with backpropagation. In Proc. of ICML, 2018.
|
| 311 |
+
|
| 312 |
+
Lesly Miculicich, Dhananjay Ram, Nikolaos Pappas, and James Henderson. Document-level neural machine translation with hierarchical attention networks. In Proc. of EMNLP, 2018.
|
| 313 |
+
|
| 314 |
+
Abdelrahman Mohamed, Dmytro Okhonko, and Luke Zettlemoyer. Transformers with convolutional context for ASR. arXiv: 1904.11660, 2019.
|
| 315 |
+
|
| 316 |
+
Nikita Nangia and Samuel Bowman. ListOps: A diagnostic dataset for latent tree learning. In Proc. of NAACL Student Research Workshop, 2018.
|
| 317 |
+
|
| 318 |
+
Junier Oliva, William Neiswanger, Barnabas Poczos, Eric Xing, Hy Trac, Shirley Ho, and Jeff Schneider. Fast function to function regression. In Proc. of AISTATS, 2015.
|
| 319 |
+
|
| 320 |
+
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proc. of WMT, 2018.
|
| 321 |
+
|
| 322 |
+
Emilio Parisotto, H. Francis Song, Jack W. Rae, Razvan Pascanu, Caglar Gulcehre, Siddhant M. Jayakumar, Max Jaderberg, Raphael Lopez Kaufman, Aidan Clark, Seb Noury, Matthew M. Botvinick, Nicolas Heess, and Raia Hadsell. Stabilizing transformers for reinforcement learning. In Proc. of ICML, 2020.
|
| 323 |
+
|
| 324 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander $\mathrm { K u }$ , and Dustin Tran. Image transformer. In Proc. of ICML, 2018.
|
| 325 |
+
|
| 326 |
+
Hao Peng, Roy Schwartz, Sam Thomson, and Noah A. Smith. Rational recurrences. In Proc. of EMNLP, 2018.
|
| 327 |
+
|
| 328 |
+
Hao Peng, Roy Schwartz, Dianqi Li, and Noah A. Smith. A mixture of $h - 1$ heads is better than $h$ heads. In Proc. of ACL, 2020.
|
| 329 |
+
|
| 330 |
+
Matt Post. A call for clarity in reporting BLEU scores. In Proc. of WMT, 2018.
|
| 331 |
+
|
| 332 |
+
Jiezhong Qiu, Hao Ma, Omer Levy, Wen-tau Yih, Sinong Wang, and Jie Tang. Blockwise selfattention for long document understanding. In Findings of EMNLP, 2020.
|
| 333 |
+
|
| 334 |
+
Dragomir R. Radev, Pradeep Muthukrishnan, and Vahed Qazvinian. The ACL Anthology network. In Proc. of the Workshop on Text and Citation Analysis for Scholarly Digital Libraries, 2009.
|
| 335 |
+
|
| 336 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners, 2018.
|
| 337 |
+
|
| 338 |
+
Jack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier, and Timothy P. Lillicrap. Compressive transformers for long-range sequence modelling. In Proc. of ICLR, 2020.
|
| 339 |
+
|
| 340 |
+
Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Proc. of NeurIPS, 2007.
|
| 341 |
+
|
| 342 |
+
Ankit Singh Rawat, Jiecao Chen, Felix Xinnan X Yu, Ananda Theertha Suresh, and Sanjiv Kumar. Sampled softmax with random Fourier features. In Proc. of NeurIPS, 2019.
|
| 343 |
+
|
| 344 |
+
Aurko Roy, Mohammad Taghi Saffar, David Grangier, and Ashish Vaswani. Efficient content-based sparse attention with routing transformers. arXiv: 2003.05997, 2020.
|
| 345 |
+
|
| 346 |
+
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv: 1910.01108, 2020.
|
| 347 |
+
|
| 348 |
+
J. Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992.
|
| 349 |
+
J. Schmidhuber. Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets. In Proc. of ICANN, 1993.
|
| 350 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proc. of ACL, 2016.
|
| 351 |
+
Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W. Mahoney, and Kurt Keutzer. Q-BERT: Hessian based ultra low precision quantization of BERT. In Proc. of AAAI, 2020.
|
| 352 |
+
Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. In Proc. of ACL, 2019.
|
| 353 |
+
Yitong Sun. Random Features Methods in Supervised Learning. PhD thesis, The University of Michigan, 2019.
|
| 354 |
+
Yi Tay, Dara Bahri, Donald Metzler, Da-Cheng Juan, Zhe Zhao, and Che Zheng. Synthesizer: Rethinking self-attention in transformer models. arXiv: 2005.00743, 2020a.
|
| 355 |
+
Yi Tay, Dara Bahri, Liu Yang, Don Metzler, and Da-Cheng Juan. Sparse sinkhorn attention. In Proc. of ICML, 2020b.
|
| 356 |
+
Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey. arXiv: 2009.06732, 2020c.
|
| 357 |
+
Yi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen, Dara Bahri, Philip Pham, Jinfeng Rao, Liu Yang, Sebastian Ruder, and Donald Metzler. Long range arena: A benchmark for efficient transformers. In Proc. of ICLR, 2021.
|
| 358 |
+
Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, and Ruslan Salakhutdinov. Transformer dissection: An unified understanding for transformer’s attention via the lens of kernel. In Proc. of EMNLP, 2019.
|
| 359 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proc. of NeurIPS, 2017.
|
| 360 |
+
Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv: 2006.04768, 2020.
|
| 361 |
+
Ronald J. Williams and David Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural Computation, 1:270–280, 1989.
|
| 362 |
+
Felix Wu, Angela Fan, Alexei Baevski, Yann Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In Proc. of ICLR, 2019.
|
| 363 |
+
Zhanghao Wu, Zhijian Liu, Ji Lin, Yujun Lin, and Song Han. Lite transformer with long-short range attention. In Proc. of ICLR, 2020.
|
| 364 |
+
Weiqiu You, Simeng Sun, and Mohit Iyyer. Hard-coded Gaussian attention for neural machine translation. In Proc. of ACL, 2020.
|
| 365 |
+
Felix Xinnan X Yu, Ananda Theertha Suresh, Krzysztof M Choromanski, Daniel N Holtmann-Rice, and Sanjiv Kumar. Orthogonal random features. In Proc. of NeurIPS, 2016.
|
| 366 |
+
Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, and Amr Ahmed. Big bird: Transformers for longer sequences. arXiv: 2007.14062, 2020.
|
| 367 |
+
|
| 368 |
+
# Appendices
|
| 369 |
+
|
| 370 |
+
A RANDOM FEATURE ATTENTION IN MORE DETAIL
|
| 371 |
+
|
| 372 |
+
A.1 DETAILED COMPUTATION PROCEDURE
|
| 373 |
+
|
| 374 |
+
Algorithms 1 and 2 describe causal and cross random feature attention’s computation procedures.
|
| 375 |
+
|
| 376 |
+
# Algorithm 1 Causal random feature attention.
|
| 377 |
+
|
| 378 |
+
1: procedure RFA-CAUSAL( $\{ \mathbf { q } _ { i } \} _ { i = 1 } ^ { N }$ , {ki}Ni=1, {vi}Ni=1)
|
| 379 |
+
2: $\vartriangleright \mathbf { S }$ is a $D \times d$ matrix
|
| 380 |
+
3: $\vartriangleright$ is a $D$ -dimensional vector
|
| 381 |
+
4: S, $\mathbf { z } \gets \mathbf { 0 }$ , 0
|
| 382 |
+
5: for $i = 1$ to $N$ do
|
| 383 |
+
6: $\widetilde { \mathbf { q } } _ { i }$ , $\bar { \mathbf { k } } _ { i } \phi ( \mathbf { q } _ { i } )$ , $\phi ( \mathbf { k } _ { i } )$ . Random feature maps
|
| 384 |
+
7: S ← S + ki ⊗ vi
|
| 385 |
+
8: z z + ki
|
| 386 |
+
9: h>i ← q>i S/(qi · z)
|
| 387 |
+
10: 11: end foreturn $\{ { \bf h } _ { i } \} _ { i = 1 } ^ { N }$
|
| 388 |
+
12: end procedure
|
| 389 |
+
|
| 390 |
+
# Algorithm 2 Cross random feature attention.
|
| 391 |
+
|
| 392 |
+
1: procedure RFA-CROSS( $\{ \mathbf { q } _ { i } \} _ { i = 1 } ^ { N }$ , {ki}Mi=1, {vi}Mi=1)
|
| 393 |
+
2: $\vartriangleright \mathbf { S }$ is a $D \times d$ matrix
|
| 394 |
+
3: $\vartriangleright$ is a $D$ -dimensional vector
|
| 395 |
+
4: S, $\mathbf z \gets \mathbf 0$ , 0
|
| 396 |
+
5: for $i = 1$ to $M$ do
|
| 397 |
+
6: $\begin{array} { r l } & { \widetilde { \mathbf { k } } _ { i } \gets \phi ( \mathbf { k } _ { i } ) \quad \mathrm { ~ \ u ~ { ~ p ~ R ~ } ~ } } \\ & { \mathbf { S } \gets \mathbf { S } + \widetilde { \mathbf { k } } _ { i } \otimes \mathbf { v } _ { i } ^ { \top } } \\ & { \mathbf { z } \gets \mathbf { z } + \widetilde { \mathbf { k } } _ { i } } \end{array}$ andom feature map
|
| 398 |
+
7:
|
| 399 |
+
8:
|
| 400 |
+
9: end for
|
| 401 |
+
10: for $i = 1$ to $N$ do
|
| 402 |
+
11: qi ← φ(qi) . Random feature map
|
| 403 |
+
12: $\mathbf { h } _ { i } ^ { \top } \widetilde { \mathbf { q } } _ { i } ^ { \top } \mathbf { S } / ( \widetilde { \mathbf { q } } _ { i } \cdot \mathbf { z } )$
|
| 404 |
+
13: 14: return end for $\{ { \bf h } _ { i } \} _ { i = 1 } ^ { N }$
|
| 405 |
+
15: end procedure
|
| 406 |
+
|
| 407 |
+
# A.2 VARIANCE OF RANDOM FOURIER FEATURES
|
| 408 |
+
|
| 409 |
+
The following result is due to $\mathrm { Y u }$ et al. (2016). Using the same notation as in $\ S 2 . 2$
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\mathrm { V a r } ( \phi \left( \mathbf { x } \right) \cdot \phi \left( \mathbf { y } \right) ) = \frac { 1 } { 2 D } \left( 1 - e ^ { - z ^ { 2 } } \right) ^ { 2 } ,
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
where $z = \| \mathbf x - \mathbf y \| / \sigma$ .
|
| 416 |
+
|
| 417 |
+
# A.3 DERIVATION OF CAUSAL RFA
|
| 418 |
+
|
| 419 |
+
This section presents a detailed derivation of causal RFA as in $\ S 3 . 1$ . Following Eq. 5 but changing the attended keys and values to the prefix:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\operatorname { R F A } ( \mathbf { q } _ { t } , \{ \mathbf { k } _ { i } \} _ { i \leq t } , \{ \mathbf { v } _ { i } \} _ { i \leq t } ) = \frac { \phi \left( \mathbf { q } _ { t } \right) ^ { \top } \sum _ { i \leq t } \phi \left( \mathbf { k } _ { i } \right) \otimes \mathbf { v } _ { i } } { \phi \left( \mathbf { q } _ { t } \right) \cdot \sum _ { j \leq t } \phi \left( \mathbf { k } _ { j } \right) }
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
Let $\begin{array} { r } { \mathbf { S } _ { t } \triangleq \sum _ { i \leq t } \phi ( \mathbf { k } _ { i } ) \otimes \mathbf { v } _ { i } } \end{array}$ , and $\begin{array} { r } { \mathbf { z } _ { t } \triangleq \sum _ { i \leq t } \phi ( \mathbf { k } _ { i } ) } \end{array}$ ; both can be calculated recurrently. Assuming $\mathbf { S } _ { 0 } = \mathbf { 0 }$ and ${ \bf z } _ { 0 } = { \bf 0 }$ :
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\mathbf { S } _ { t } = \mathbf { S } _ { t - 1 } + \phi \left( \mathbf { k } _ { t } \right) \otimes \mathbf { v } _ { t } , \quad \mathbf { z } _ { t } = \mathbf { z } _ { t - 1 } + \phi \left( \mathbf { k } _ { t } \right) , \quad t \geq 1 .
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
This completes the derivation of causal RFA as in $\ S 3 . 1$ .
|
| 432 |
+
|
| 433 |
+
# A.4 RFA WITHOUT NORM-1 CONSTRAINTS
|
| 434 |
+
|
| 435 |
+
$\ S 3 . 1$ assumes that the queries and keys are unit vectors. This norm-1 constraint is not a must. Here we present a RFA without imposing this constraint. Let $C ( \mathbf { x } ) = \exp ( \left\| \mathbf { x } \right\| ^ { 2 } / 2 \sigma ^ { 2 } )$ . From Eq. 4 we have attn $\left( \mathbf { q } _ { t } , \{ \mathbf { k } _ { i } \} , \{ \mathbf { v } _ { i } \} \right) =$
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\begin{array} { r l r } & { } & { \sum _ { i } \frac { \exp \big ( \mathbf { q } _ { t } \cdot \mathbf { k } _ { i } / \sigma ^ { 2 } \big ) } { \sum _ { j } \exp \big ( \mathbf { q } _ { t } \cdot \mathbf { k } _ { j } / \sigma ^ { 2 } \big ) } \mathbf { v } _ { i } ^ { \top } \approx \displaystyle \sum _ { i } \frac { C \left( \mathbf { q } _ { t } \right) C \left( \mathbf { k } _ { i } \right) \phi \left( \mathbf { q } _ { t } \right) ^ { \top } \phi \left( \mathbf { k } _ { i } \right) \mathbf { v } _ { i } ^ { \top } } { \sum _ { j } C \left( \mathbf { q } _ { t } \right) C \left( \mathbf { k } _ { j } \right) \phi \left( \mathbf { q } _ { t } \right) \cdot \phi \left( \mathbf { k } _ { j } \right) } } \\ & { } & { \qquad = \frac { \phi \left( \mathbf { q } _ { t } \right) ^ { \top } \sum _ { i } C \left( \mathbf { k } _ { i } \right) \phi \left( \mathbf { k } _ { i } \right) \otimes \mathbf { v } _ { i } } { \phi \left( \mathbf { q } _ { t } \right) \cdot \sum _ { j } C \left( \mathbf { k } _ { j } \right) \phi \left( \mathbf { k } _ { j } \right) } . } \end{array}
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
The specific attention computation is similar to those in $\ S 3 . 1$ . In sum, lifting the norm-1 constraint brings an additional scalar term $C ( \cdot )$ .
|
| 442 |
+
|
| 443 |
+
# A.5 RELATING RFA-GATE TO SOFTMAX ATTENTION
|
| 444 |
+
|
| 445 |
+
Drawing inspiration from gated RNNs, $\ S 3 . 2$ introduces a gated variant of RFA. Now we study its “softmax counterpart.”
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\begin{array} { l } { { \displaystyle { \widetilde { \bf { k } } } _ { i } = { \bf { k } } _ { i } { \bf { \Gamma } } ( 1 - g _ { i } ) \prod _ { j = i + 1 } ^ { t } g _ { j } , \quad { \widetilde { \bf { v } } } _ { i } = { \bf { v } } _ { i } { \bf { \Gamma } } ( 1 - g _ { i } ) \prod _ { j = i + 1 } ^ { t } g _ { j } , \quad i = 1 , \dots , t } } \\ { { \displaystyle { \bf { h } } _ { t } = \mathrm { a t t n } ( { \bf { q } } _ { t } , \{ { \widetilde { \bf { k } } } _ { i } \} _ { i \le t } , \{ { \widetilde { \bf { v } } } _ { i } \} _ { i \le t } ) } . } \end{array}
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
$\mathbf { h } _ { t }$ is the output at timestep $t$ and is used for onward computation.
|
| 452 |
+
|
| 453 |
+
At each step, all prefix keys and values are decayed by a gate value before calculating the attention. This implies that the attention computation for $\mathbf { q } _ { t + 1 }$ cannot start until that of $\mathbf { q } _ { t }$ is finished. Combined with the linear complexity of softmax normalization, this amounts to quadratic time in sequence length, even for language modeling training.
|
| 454 |
+
|
| 455 |
+
The above model is less intuitive and more expensive in practice, without the RFA perspective. This shows that RFA brings some benefits in developing new attention models.
|
| 456 |
+
|
| 457 |
+
# A.6 DETAILED COMPLEXITY ANALYSIS
|
| 458 |
+
|
| 459 |
+
Table 4 considers a sequence-to-sequence model, and breaks down the comparisons to training (with teacher forcing; Williams & Zipser, 1989) and autoregressive decoding. Here we assume enough threads to fully parallelize softmax attention across timesteps when the inputs are revealed to the model in full. RFA has a lower space complexity, since it never explicitly populates the attention matrices. As for time, RFA trains in linear time, and so does the softmax attention: in teacher-forcing training a standard transformer decoder parallelizes the attention computation across time steps. The trend of the time comparison differs during decoding: when only one output token is produced at a time, RFA decodes linearly in the output length, while softmax attention decodes quadratically.
|
| 460 |
+
|
| 461 |
+
<table><tr><td></td><td></td><td colspan="3">Time Complexity</td><td colspan="3"> Space Complexity</td></tr><tr><td>Setting</td><td>Model</td><td>Encoder</td><td>Cross</td><td>Causal</td><td>Encoder</td><td>Cross</td><td>Causal</td></tr><tr><td>Training w/</td><td>softmax</td><td>O(M)</td><td>O(M)</td><td>O(N)</td><td>O(M2)</td><td>O(MN)</td><td>O(N2)</td></tr><tr><td>teacher forcing</td><td>RFA</td><td>(M)</td><td>O(M)</td><td>O(N)</td><td>O(M)</td><td>O(M + N)</td><td>O(N)</td></tr><tr><td>Decoding</td><td>softmax RFA</td><td>O(M) O(M)</td><td>O(MN) O(M + N)</td><td>O(N2) O(N)</td><td>O(M2) O(M)</td><td>O(MN) O(M + N)</td><td>O(N2) O(N)</td></tr></table>
|
| 462 |
+
|
| 463 |
+
Table 4: Time and space complexity comparisons between RFA and its softmax counterpart in a sequence-to-sequence attentive model, assuming an infinite amount of available threads. $M$ and $N$ denote the lengths of the source and target sequences respectively. Teacher forcing training (Williams & Zipser, 1989) and autoregressive decoding are assumed. Blue color indicates the cases where RFA asymptotically outperforms softmax attention.
|
| 464 |
+
|
| 465 |
+
<table><tr><td>Data</td><td>Train</td><td>Dev.</td><td>Test</td><td>Vocab.</td></tr><tr><td>WikiText-103</td><td>103M</td><td>218K</td><td>246K</td><td>268K</td></tr><tr><td>WMT14 EN-DE</td><td>4.5M</td><td>3K</td><td>3K</td><td>32K</td></tr><tr><td>WMT14EN-FR</td><td>4.5M</td><td>3K</td><td>3K</td><td>32K</td></tr><tr><td>IWSLT14 DE-EN</td><td>160K</td><td>7K</td><td>7K</td><td>9K/7K</td></tr></table>
|
| 466 |
+
|
| 467 |
+
Table 5: Some statistics for the datasets. WikiText-103 split sizes are in number of tokens, while others are in number of instances.
|
| 468 |
+
|
| 469 |
+
# B EXPERIMENTAL DETAILS
|
| 470 |
+
|
| 471 |
+
Table 5 summarizes some statistics of the datasets used in our experiments. Our implementation is based on JAX.15
|
| 472 |
+
Table 6: WMT14 EN-DE development set performance varying the number of random matrices to sample from during training. No beam search or checkpoint averaging is used.
|
| 473 |
+
|
| 474 |
+
<table><tr><td># Random Matrices</td><td>1</td><td>50</td><td>100</td><td>200</td></tr><tr><td>BLEU</td><td>24.0</td><td>25.7</td><td>25.8</td><td>25.8</td></tr></table>
|
| 475 |
+
|
| 476 |
+
During training, we sample a different random projection matrix for each attention head. Preliminary experiments suggest this performs better than using the same random projection throughout training (Table 6). Our conjecture is that this helps keep the attention heads from “over committing” to any particular random projection (Peng et al., 2020). To avoid the overhead of sampling from Gaussian during training, we do this in an offline manner. I.e., before training we construct a pool of random matrices (typically 200), at each training step we draw from the pool. At test time each attention head uses the same random projection, since no accuracy benefit is observed by using different ones for different test instances.
|
| 477 |
+
|
| 478 |
+
# B.1 LANGUAGE MODELING
|
| 479 |
+
|
| 480 |
+
We compare the models using two model size settings, summarized in Table 7. We use the fixed sinusoidal position embeddings by Vaswani et al. (2017). All models are trained for up to 150K gradient steps using the Adam optimizer (Kingma & Ba, 2015). No $\ell _ { 2 }$ -regularization is used. We apply early stopping based on development set perplexity. All models are trained using 16 TPU v3 accelerators, and tested using a single TPU v2 accelerator.
|
| 481 |
+
|
| 482 |
+
Table 7: Hyperparameters used in the language modeling experiments.
|
| 483 |
+
|
| 484 |
+
<table><tr><td>Hyperprams.</td><td>Small</td><td>Big</td></tr><tr><td>#Layers</td><td>6</td><td>16</td></tr><tr><td>#Heads</td><td>8</td><td>16</td></tr><tr><td>Embedding Size</td><td>512</td><td>1024</td></tr><tr><td>Head Size</td><td>64</td><td>64</td></tr><tr><td>FFN Size</td><td>2048</td><td>4096</td></tr><tr><td>Batch Size</td><td>64</td><td>64</td></tr><tr><td>Learning Rate</td><td>[1 × 10-4,2.5 × 10-4,5 × 10-4]</td><td></td></tr><tr><td>Warmup Steps</td><td>6000</td><td>6000</td></tr><tr><td>Gradient Clipping Norm</td><td>0.25</td><td>0.25</td></tr><tr><td>Dropout</td><td>[0.05, 0.1]</td><td>[0.2, 0.25, 0.3]</td></tr><tr><td>Random Feature Map Size</td><td>64</td><td>64</td></tr></table>
|
| 485 |
+
|
| 486 |
+
# B.2 MACHINE TRANSLATION
|
| 487 |
+
|
| 488 |
+
WMT14. We use the fixed sinusoidal position embeddings by Vaswani et al. (2017). For both EN-DE and EN-FR experiments, we train the models using the Adam (with $\beta _ { 1 } = 0 . 1$ , $\beta _ { 2 } = 0 . 9 8$ , and $\epsilon = 1 0 ^ { - 9 }$ ) optimizer for up to 350K gradient steps. We use a batch size of 1,024 instances for EN-DE, while 4,096 for the much larger EN-FR dataset. The learning rate follows that by Vaswani et al. (2017). Early stopping is applied based on development set BLEU. No $\ell _ { 2 }$ regularization or gradient clipping is used. All models are trained using 16 TPU v3 accelerators, and tested using a single TPU v2 accelerator. Following standard practice, we average 10 most recent checkpoints at test time. We evaluate the models using SacreBLEU (Post, 2018).16 A beam search with beam size 4 and length penalty 0.6 is used. Other hyperparameters are summarized in Table 8.
|
| 489 |
+
|
| 490 |
+
Table 8: Hyperparameters used in the machine translation experiments.
|
| 491 |
+
|
| 492 |
+
<table><tr><td>Hyperprams.</td><td>WMT14</td><td>IWSLT14</td></tr><tr><td>#Layers</td><td>6</td><td>6</td></tr><tr><td>#Heads</td><td>8</td><td>8</td></tr><tr><td>Embedding Size</td><td>512</td><td>512</td></tr><tr><td>Head Size</td><td>64</td><td>64</td></tr><tr><td>FFN Size</td><td>2048</td><td>2048</td></tr><tr><td>Warmup Steps</td><td>6000</td><td>4000</td></tr><tr><td>Dropout</td><td>0.1</td><td>0.3</td></tr><tr><td>Cross Attention Feature Map</td><td>128</td><td>128</td></tr><tr><td>Causal Attention Feature Map</td><td>64</td><td>64</td></tr></table>
|
| 493 |
+
|
| 494 |
+
# C MORE ANALYSIS RESULTS
|
| 495 |
+
|
| 496 |
+
C.1 MORE RESULTS ON DECODING SPEED AND MEMORY OVERHEAD
|
| 497 |
+
|
| 498 |
+
Figure 3 compares the RFA’s unconditional decoding speed and memory against the softmax attention. The setting is the same as that in $\ S 5$ except that here the models do not have an encoder. This experiment aims to simulate the applications such as sampling from a language model.
|
| 499 |
+
|
| 500 |
+
# C.2 EFFECT OF RANDOM FEATURE SIZE
|
| 501 |
+
|
| 502 |
+
This section studies how the size of $\phi ( \cdot )$ affects the performance. Table 9 summarize RFAGaussian’s performance on WMT14 EN-DE development set. The model and training are the same as that used in $\ S 4 . 2$ except random feature size. Recall from $\ S 2 . 2$ that the size of $\bar { \phi } ( \cdot )$ is $2 D$ for
|
| 503 |
+
|
| 504 |
+

|
| 505 |
+
Figure 3: Unconditional decoding speed (left) and memory overhead (right) varying the output lengths. All models are tested on a single TPU v2 accelerator, with greedy decoding and batch size 16.
|
| 506 |
+
|
| 507 |
+
RFA-Gaussian. When the size of $\phi ( \cdot )$ is too small (32 or 64 for cross attention, 32 for causal attention), training does not converge. We observe accuracy improvements by using random features sufficiently large (256 for cross attention and 128 for causal attention); going beyond that, the benefit is marginal.
|
| 508 |
+
|
| 509 |
+
<table><tr><td>Size</td><td>32</td><td>64</td><td>128</td><td>256</td><td>512</td></tr><tr><td>BLEU</td><td>N/A</td><td>N/A</td><td>24.9</td><td>25.8</td><td>26.0</td></tr></table>
|
| 510 |
+
|
| 511 |
+
<table><tr><td> Size</td><td>32</td><td>64</td><td>128</td><td>256</td><td>512</td></tr><tr><td>BLEU</td><td>N/A</td><td>25.3</td><td>25.8</td><td>25.8</td><td>25.6</td></tr></table>
|
| 512 |
+
|
| 513 |
+
(a) Varying cross attention $\phi$ sizes while fixing that of causal attention to be 128.
|
| 514 |
+
|
| 515 |
+
(b) Varying causal attention $\phi$ sizes while fixing that of cross attention to be 256.
|
| 516 |
+
|
| 517 |
+
Table 9: WMT14 EN-DE development set performance of RFA-Gaussian (the size of $\phi$ is $2 D$ ; $\ S 2 . 2 )$ varying the random feature sizes. N/A indicates training does not converge. No beam search or checkpoint averaging is used.
|
| 518 |
+
|
| 519 |
+
# C.3 TRAIN AND EVALUATE WITH DIFFERENT ATTENTION FUNCTIONS
|
| 520 |
+
|
| 521 |
+
RFA achieves comparable performance to its softmax counterpart. Does this imply that it learns a good approximation to the softmax attention? To answer this question, we consider:
|
| 522 |
+
|
| 523 |
+
(i) an RFA-Gaussian model initialized from a pretrained softmax-transformer;
|
| 524 |
+
(ii) a softmax-transformer initialized from a pretrained an RFA-Gaussian model.
|
| 525 |
+
|
| 526 |
+
If RFA’s good performance can be attributed to learning a good approximation to softmax, both, without finetunining, should perform similarly to the pretrained models. However, this is not the case on IWSLT14 DE-EN. Both pretrained models achieve more than 35.2 development set BLEU. In contrast, (i) and (ii) respectively get 2.3 and 1.1 BLEU without finetuning, hardly beating a randomly-initialized untrained model. This result aligns with the observation by Choromanski et al. (2021), and suggests that it is not the case that RFA performs well because it learns to imitate softmax attention’s outputs.
|
| 527 |
+
|
| 528 |
+
# C.4 KNOWLEDGE TRANSFER FROM SOFTMAX ATTENTION TO RFA
|
| 529 |
+
|
| 530 |
+
We first supplement the observation in Appendix C.3 by finetuning (i) on the same pretraining data. Figure 4 plots the learning curves. It takes RFA roughly 1,500 steps to reach similar training loss to the pretrained model. As a baseline, “RFA Reset” resets the multihead attention parameters (i.e., those for query, key, value, and output projections) to randomly initialized ones. Its learning curve is similar to that of (i), suggesting that the pretrained multihead attention parameters are no more useful to RFA than randomly initialized ones. To further confirm this observation, “softmax Reset”
|
| 531 |
+
|
| 532 |
+

|
| 533 |
+
Figure 4: Finetuning an RFA-Gaussian model with its parameters initialized from a pretrained softmax-transformer. “Reset” indicates resetting the multihead attention parameters to randomlyinitialized ones. The dashed line indicates the training loss of the pretrained model.
|
| 534 |
+
|
| 535 |
+
resets the multihead attention parameters without changing the attention functions. It converges to the pretraining loss in less than 200 steps.
|
| 536 |
+
|
| 537 |
+
Takeaway. From the above results on IWSLT14, pretrained knowledge in a softmax transformer cannot be directly transferred to an RFA model. However, from Figure 4 and a much larger-scale experiment by Choromanski et al. (2021), we do observe that RFA can recover the pretraining loss, and the computation cost of finetuning is much less than training a model from scratch. This suggests some potential applications. For example, one might be able to initialize an RFA language model from a softmax transformer pretrained on large-scale data (e.g., GPT-3; Brown et al., 2020), and finetune it at a low cost. The outcome would be an RFA model retaining most of the pretraining knowledge, but is much faster and more memory-friendly to sample from. We leave such exploration to future work.
|
md/train/R-616EWWKF5/R-616EWWKF5.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Do Vision Transformers See Like Convolutional Neural Networks?
|
| 2 |
+
|
| 3 |
+
Maithra Raghu Google Research, Brain Team maithrar@gmail.com
|
| 4 |
+
|
| 5 |
+
Thomas Unterthiner Google Research, Brain Team unterthiner@google.com
|
| 6 |
+
|
| 7 |
+
Simon Kornblith Google Research, Brain Team kornblith@google.com
|
| 8 |
+
|
| 9 |
+
Chiyuan Zhang Google Research, Brain Team chiyuan@google.com
|
| 10 |
+
|
| 11 |
+
Alexey Dosovitskiy Google Research, Brain Team adosovitskiy@google.com
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Convolutional neural networks (CNNs) have so far been the de-facto model for visual data. Recent work has shown that (Vision) Transformer models (ViT) can achieve comparable or even superior performance on image classification tasks. This raises a central question: how are Vision Transformers solving these tasks? Are they acting like convolutional networks, or learning entirely different visual representations? Analyzing the internal representation structure of ViTs and CNNs on image classification benchmarks, we find striking differences between the two architectures, such as ViT having more uniform representations across all layers. We explore how these differences arise, finding crucial roles played by self-attention, which enables early aggregation of global information, and ViT residual connections, which strongly propagate features from lower to higher layers. We study the ramifications for spatial localization, demonstrating ViTs successfully preserve input spatial information, with noticeable effects from different classification methods. Finally, we study the effect of (pretraining) dataset scale on intermediate features and transfer learning, and conclude with a discussion on connections to new architectures such as the MLP-Mixer.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Over the past several years, the successes of deep learning on visual tasks has critically relied on convolutional neural networks [20, 16]. This is largely due to the powerful inductive bias of spatial equivariance encoded by convolutional layers, which have been key to learning general purpose visual representations for easy transfer and strong performance. Remarkably however, recent work has demonstrated that Transformer neural networks are capable of equal or superior performance on image classification tasks at large scale [14]. These Vision Transformers (ViT) operate almost identically to Transformers used in language [13], using self-attention, rather than convolution, to aggregate information across locations. This is in contrast with a large body of prior work, which has focused on more explicitly incorporating image-specific inductive biases [30, 9, 4]
|
| 20 |
+
|
| 21 |
+
This breakthrough highlights a fundamental question: how are Vision Transformers solving these image based tasks? Do they act like convolutions, learning the same inductive biases from scratch? Or are they developing novel task representations? What is the role of scale in learning these representations? And are there ramifications for downstream tasks? In this paper, we study these questions, uncovering key representational differences between ViTs and CNNs, the ways in which these difference arise, and effects on classification and transfer learning. Specifically, our contributions are:
|
| 22 |
+
|
| 23 |
+
35th Conference on Neural Information Processing Systems (NeurIPS 2021).
|
| 24 |
+
|
| 25 |
+
• We investigate the internal representation structure of ViTs and CNNs, finding striking differences between the two models, such as ViT having more uniform representations, with greater similarity between lower and higher layers.
|
| 26 |
+
• Analyzing how local/global spatial information is utilised, we find ViT incorporates more global information than ResNet at lower layers, leading to quantitatively different features.
|
| 27 |
+
• Nevertheless, we find that incorporating local information at lower layers remains vital, with large-scale pre-training data helping early attention layers learn to do this
|
| 28 |
+
• We study the uniform internal structure of ViT, finding that skip connections in ViT are even more influential than in ResNets, having strong effects on performance and representation similarity.
|
| 29 |
+
• Motivated by potential future uses in object detection, we examine how well input spatial information is preserved, finding connections between spatial localization and methods of classification.
|
| 30 |
+
• We study the effects of dataset scale on transfer learning, with a linear probes study revealing its importance for high quality intermediate representations.
|
| 31 |
+
|
| 32 |
+
# 2 Related Work
|
| 33 |
+
|
| 34 |
+
Developing non-convolutional neural networks to tackle computer vision tasks, particularly Transformer neural networks [44] has been an active area of research. Prior works have looked at local multiheaded self-attention, drawing from the structure of convolutional receptive fields [30, 36], directly combining CNNs with self-attention [4, 2, 46] or applying Transformers to smaller-size images [6, 9]. In comparison to these, the Vision Transformer [14] performs even less modification to the Transformer architecture, making it especially interesting to compare to CNNs. Since its development, there has also been very recent work analyzing aspects of ViT, particularly robustness [3, 31, 28] and effects of self-supervision [5, 7]. Other recent related work has looked at designing hybrid ViT-CNN models [49, 11], drawing on structural differences between the models. Comparison between Transformers and CNNs are also recently studied in the text domain [41].
|
| 35 |
+
|
| 36 |
+
Our work focuses on the representational structure of ViTs. To study ViT representations, we draw on techniques from neural network representation similarity, which allow the quantitative comparisons of representations within and across neural networks [17, 34, 26, 19]. These techniques have been very successful in providing insights on properties of different vision architectures [29, 22, 18], representation structure in language models [48, 25, 47, 21], dynamics of training methods [33, 24] and domain specific model behavior [27, 35, 38]. We also apply linear probes in our study, which has been shown to be useful to analyze the learned representations in both vision [1] and text [8, 32, 45] models.
|
| 37 |
+
|
| 38 |
+
# 3 Background and Experimental Setup
|
| 39 |
+
|
| 40 |
+
Our goal is to understand whether there are differences in the way ViTs represent and solve image tasks compared to CNNs. Based on the results of Dosovitskiy et al. [14], we take a representative set of CNN and ViT models — ResNet50x1, ResNet152x2, ViT-B/32, ViT-B/16, ViT-L/16 and ViT-H/14. Unless otherwise specified, models are trained on the JFT-300M dataset [40], although we also investigate models trained on the ImageNet ILSVRC 2012 dataset [12, 37] and standard transfer learning benchmarks [50, 14]. We use a variety of analysis methods to study the layer representations of these models, gaining many insights into how these models function. We provide further details of the experimental setting in Appendix A.
|
| 41 |
+
|
| 42 |
+
Representation Similarity and CKA (Centered Kernel Alignment): Analyzing (hidden) layer representations of neural networks is challenging because their features are distributed across a large number of neurons. This distributed aspect also makes it difficult to meaningfully compare representations across neural networks. Centered kernel alignment (CKA) [17, 10] addresses these challenges, enabling quantitative comparisons of representations within and across networks. Specifically, CKA takes as input $\mathbf { X } \in \mathbb { R } ^ { m \times p _ { 1 } }$ and $\mathbf { Y } \in \mathbb { R } ^ { \bar { m } \times p _ { 2 } }$ which are representations (activation matrices), of two layers, with $p _ { 1 }$ and $p _ { 2 }$ neurons respectively, evaluated on the same $m$ examples. Letting $K = X X ^ { \top }$ and $\pmb { L } = \pmb { Y } \pmb { Y } ^ { \top }$ denote the Gram matrices for the two layers (which measures the similarity of a pair of datapoints according to layer representations) CKA computes:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\operatorname { C K A } ( K , L ) = { \frac { \operatorname { H S I C } ( K , L ) } { \sqrt { \operatorname { H S I C } ( K , K ) \operatorname { H S I C } ( L , L ) } } } ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 1: Representation structure of ViTs and convolutional networks show significant differences, with ViTs having highly similar representations throughout the model, while the ResNet models show much lower similarity between lower and higher layers. We plot CKA similarities between all pairs of layers across different model architectures. The results are shown as a heatmap, with the x and y axes indexing the layers from input to output. We observe that ViTs have relatively uniform layer similarity structure, with a clear grid-like pattern and large similarity between lower and higher layers. By contrast, the ResNet models show clear stages in similarity structure, with smaller similarity scores between lower and higher layers.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 2: Cross model CKA heatmap between ViT and ResNet illustrate that a larger number of lower layers in the ResNet are similar to a smaller set of the lowest ViT layers. We compute a CKA heatmap comparing all layers of ViT to all layers of ResNet, for two different ViT models. We observe that the lower half of ResNet layers are similar to around the lowest quarter of ViT layers. The remaining half of the ResNet is similar to approximately the next third of ViT layers, with the highest ViT layers dissimilar to lower and higher ResNet layers.
|
| 53 |
+
|
| 54 |
+
where HSIC is the Hilbert-Schmidt independence criterion [15]. Given the centering matrix $\begin{array} { r } { \pmb { H } = \pmb { I } _ { n } - \frac { 1 } { n } \pmb { 1 } \pmb { 1 } ^ { \top } } \end{array}$ and the centered Gram matrices $K ^ { \prime } = H K H$ and $L ^ { \prime } = H L H$ , $\mathrm { H S I C } ( \bar { K } , L ) =$ $\mathrm { v e c } ( K ^ { \prime } ) \cdot \mathrm { v e c } ( L ^ { \prime } ) / ( m - 1 ) ^ { 2 }$ , the similarity between these centered Gram matrices. CKA is invariant to orthogonal transformation of representations (including permutation of neurons), and the normalization term ensures invariance to isotropic scaling. These properties enable meaningful comparison and analysis of neural network hidden representations. To work at scale with our models and tasks, we approximate the unbiased estimator of HSIC [39] using minibatches, as suggested in [29].
|
| 55 |
+
|
| 56 |
+
# 4 Representation Structure of ViTs and Convolutional Networks
|
| 57 |
+
|
| 58 |
+
We begin our investigation by using CKA to study the internal representation structure of each model. How are representations propagated within the two architectures, and are there signs of functional differences? To answer these questions, we take every pair of layers $X , Y$ within a model and compute their CKA similarity. Note that we take representations not only from outputs of ViT/ResNet blocks, but also from intermediate layers, such as normalization layers and the hidden activations inside a ViT MLP. Figure 1 shows the results as a heatmap, for multiple ViTs and ResNets. We observe clear differences between the internal representation structure between the two model architectures: (1) ViTs show a much more uniform similarity structure, with a clear grid like structure (2) lower and higher layers in ViT show much greater similarity than in the ResNet, where similarity is divided into different (lower/higher) stages.
|
| 59 |
+
|
| 60 |
+
We also perform cross-model comparisons, where we take all layers $\boldsymbol { X }$ from ViT and compare to all layers $\mathbf { Y }$ from ResNet. We observe (Figure 2) that the lower half of 60 ResNet layers are similar to approximately the lowest quarter of ViT layers. In particular, many more lower layers in the ResNet are needed to compute similar representations to the lower layers of ViT. The top half of the ResNet is approximately similar to the next third of the ViT layers. The final third of ViT layers is less similar to all ResNet layers, likely because this set of layers mainly manipulates the CLS token representation, further studied in Section 6.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 3: Plotting attention head mean distances shows lower ViT layers attend both locally and globally, while higher layers primarily incorporate global information. For each attention head, we compute the pixel distance it attends to, weighted by the attention weights, and then average over 5000 datapoints to get an average attention head distance. We plot the heads sorted by their average attention distance for the two lowest and two highest layers in the ViT, observing that the lower layers attend both locally and globally, while the higher layers attend entirely globally.
|
| 64 |
+
|
| 65 |
+
Taken together, these results suggest that (i) ViT lower layers compute representations in a different way to lower layers in the ResNet, (ii) ViT also more strongly propagates representations between lower and higher layers (iii) the highest layers of ViT have quite different representations to ResNet.
|
| 66 |
+
|
| 67 |
+
# 5 Local and Global Information in Layer Representations
|
| 68 |
+
|
| 69 |
+
In the previous section, we observed much greater similarity between lower and higher layers in ViT, and we also saw that ResNet required more lower layers to compute similar representations to a smaller set of ViT lower layers. In this section, we explore one possible reason for this difference: the difference in the ability to incorporate global information between the two models. How much global information is aggregated by early self-attention layers in ViT? Are there noticeable resulting differences to the features of CNNs, which have fixed, local receptive fields in early layers? In studying these questions, we demonstrate the influence of global representations and a surprising connection between scale and self-attention distances.
|
| 70 |
+
|
| 71 |
+
Analyzing Attention Distances: We start by analyzing ViT self-attention layers, which are the mechanism for ViT to aggregate information from other spatial locations, and structurally very different to the fixed receptive field sizes of CNNs. Each self-attention layer comprises multiple self-attention heads, and for each head we can compute the average distance between the query patch position and the locations it attends to. This reveals how much local vs global information each self-attention layer is aggregating for the representation. Specifically, we weight the pixel distances by the attention weights for each attention head and average over 5000 datapoints, with results shown in Figure 3. In agreement with Dosovitskiy et al. [14], we observe that even in the lowest layers of ViT, self-attention layers have a mix of local heads (small distances) and global heads (large distances). This is in contrast to CNNs, which are hardcoded to attend only locally in the lower layers. At higher layers, all self-attention heads are global.
|
| 72 |
+
|
| 73 |
+
Interestingly, we see a clear effect of scale on attention. In Figure 4, we look at attention distances when training only on ImageNet (no large-scale pre-training), which leads to much lower performance in ViT-L/16 and ViT-H/14 [14]. Comparing to Figure 3, we see that with not enough data, ViT does not learn to attend locally in earlier layers. Together, this suggests that using local information early on for image tasks (which is hardcoded into CNN architectures) is important for strong performance.
|
| 74 |
+
|
| 75 |
+
Does access to global information result in different features? The results of Figure 3 demonstrate that ViTs have access to more global information than CNNs in their lower layers. But does this result in different learned features? As an interventional test, we take subsets of the ViT attention heads from the first encoder block, ranging from the subset corresponding to the most local attention heads to a subset of the representation corresponding to the most global attention heads. We then compute CKA similarity between these subsets and the lower layer representations of ResNet.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 4: With less training data, lower attention layers do not learn to attend locally. Comparing the results to Figure 3, we see that training only on ImageNet leads to the lower layers not learning to attend more locally. These models also perform much worse when only trained on ImageNet, suggesting that incorporating local features (which is hardcoded into CNNs) may be important for strong performance. (See also Figure C.5.)
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 5: Lower layer representations of ResNet are most similar to representations corresponding to local attention heads of ViT. We take subsets of ViT attention heads in the first encoder block, ranging from the most locally attending heads (smallest mean distance) to the most global heads (largest mean distance). We then compute CKA similarity between these subsets and lower layer representations in the ResNet. We observe that lower ResNet layers are most similar to the features learned by local attention heads of ViT, and decrease monotonically in similarity as more global information is incorporated, demonstrating that the global heads learn quantitatively different features.
|
| 82 |
+
|
| 83 |
+
The results, shown in Figure 5, which plot the mean distance for each subset against CKA similarity, clearly show a monotonic decrease in similarity as mean attention distance grows, demonstrating that access to more global information also leads to quantitatively different features than computed by the local receptive fields in the lower layers of the ResNet.
|
| 84 |
+
|
| 85 |
+
Effective Receptive Fields: We conclude by computing effective receptive fields [23] for both ResNets and ViTs, with results in Figure 6 and Appendix C. We observe that lower layer effective receptive fields for ViT are indeed larger than in ResNets, and while ResNet effective receptive fields grow gradually, ViT receptive fields become much more global midway through the network. ViT receptive fields also show strong dependence on their center patch due to their strong residual connections, studied in the next section. As we show in Appendix C, in attention sublayers, receptive fields taken before the residual connection show far less dependence on this central patch.
|
| 86 |
+
|
| 87 |
+
# 6 Representation Propagation through Skip Connections
|
| 88 |
+
|
| 89 |
+
The results of the previous section demonstrate that ViTs learn different representations to ResNets in lower layers due to access to global information, which explains some of the differences in represen tation structure observed in Section 4. However, the highly uniform nature of ViT representations (Figure 1) also suggests lower representations are faithfully propagated to higher layers. But how does this happen? In this section, we explore the role of skip connections in representation propagation across ViTs and ResNets, discovering ViT skip connections are highly influential, with a clear phase transition from preserving the CLS (class) token representation (in lower layers) to spatial token representations (in higher layers).
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
|
| 93 |
+
Figure 7: Most information in ViT passes through skip connections. Comparison of representation norms between the skip-connection (identity) and the long branch for ViT-B/16 trained on ImageNet and a ResNet. For ViT, we show the CLS token separately from the rest of the representation. (left) shows the ratios separated for the first few tokens (token 0 is CLS), (right) shows averages over all tokens.
|
| 94 |
+
|
| 95 |
+
Like Transformers, ViTs contain skip (aka identity or shortcut) connections throughout, which are added on after the (i) self-attention layer, and (ii) MLP layer. To study their effect, we plot the norm ratio $\vert \vert z _ { i } \vert \vert / \vert \vert f ( z _ { i } ) \vert \vert$ where $z _ { i }$ is the hidden representation of the ith layer coming from the skip connection, and $f ( z _ { i } )$ is the transformation of $z _ { i }$ from the long branch (i.e. MLP or self-attention.)
|
| 96 |
+
|
| 97 |
+
The results are in Figure 7 (with additional cosine similarity analysis in Figure E.2.) The heatmap on the left shows $\| z _ { i } \| / \| f ( z _ { i } ) \|$ for different token representations. We observe a striking phase transition: in the first half of the network, the CLS token (token 0) representation is primarily propagated by the skip connection branch (high norm ratio), while the spatial token representations have a large contribution coming from the long branch (lower norm ratio). Strikingly, in the second half of the network, this is reversed.
|
| 98 |
+
|
| 99 |
+
The right pane, which has line plots of these norm ratios across ResNet50, the ViT CLS token and the ViT spatial tokens additionally demonstrates that skip connection is much more influential in ViT compared to ResNet: we observe much higher norm ratios for ViT throughout, along with the phase transition from CLS to spatial token propagation (shown for the MLP and self-attention layers.)
|
| 100 |
+
|
| 101 |
+
ViT Representation Structure without Skip Connections: The norm ratio results strongly suggest that skip connections play a key role in the representational structure of ViT. To test this interventionally, we train ViT models with skip connections removed in block $i$ for varying $i$ , and plot the CKA representation heatmap. The results, in Figure 8, illustrate that removing the skip connections in a block partitions the layer representations on either side. (We note a performance drop of $4 \%$ when removing skip connections from middle blocks.) This demonstrates the importance of representations being propagated by skip connections for the uniform similarity structure of ViT in Figure 1.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 8: ViT models trained without any skip connections in block $_ { i }$ show very little representation similarity between layers before/after block $_ { i }$ . We train several ViT models without any skip connections at block $_ { i }$ for varying $_ { i }$ to interventionally test the effect on representation structure. For middle blocks without skip connections, we observe a performance drop of $4 \%$ . We also observe that removing a skip connection at block $i$ partitions similar representations to before/after block $_ { i }$ — this demonstrates the importance of skip connections in ViT’s standard uniform representation structure.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
ViT-B/32 final block Token at Location(0, 0) Token at Location(2, 1) Token at Location(4, 2) Token at Location(4, 4)
|
| 108 |
+
Figure 9: Higher layers of ViT maintain spatial location information more faithfully than ResNets. Each heatmap plot shows the CKA similarity between a single token representation in final block of the model and the input images, which are divided into non-overlapping patches. We observe that ViT tokens have strongest similarity to their corresponding spatial location in the image, but tokens corresponding to spatial locations at the edge of the image (e.g. token 0) additionally show similarity to other edge positions. This demonstrates that spatial information from the input is preserved even at the final layer of ViT. By contrast, ResNet “tokens” (features at a specific spatial location) are much less spatially discriminative, showing comparable similarity across a broad set of input spatial locations. See Appendix for additional layers and results.
|
| 109 |
+
|
| 110 |
+
# 7 Spatial Information and Localization
|
| 111 |
+
|
| 112 |
+
The results so far, on the role of self-attention in aggregating spatial information in ViTs, and skipconnections faithfully propagating representations to higher layers, suggest an important followup question: how well can ViTs perform spatial localization? Specifically, is spatial information from the input preserved in the higher layers of ViT? And how does it compare in this aspect to ResNet? An affirmative answer to this is crucial for uses of ViT beyond classification, such as object detection.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 10: When trained with global average pooling (GAP) instead of a CLS token, ViTs show less clear localization (compare Figure 9). We plot the same CKA heatmap between a token and different input images patches as in Figure 9, but for a ViT model trained with global average pooling (like ResNet) instead of a CLS token. We observe significantly less localization.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 11: Spatial localization experiments with linear probes. We train linear classifiers on 10-shot ImageNet classification from the representations extracted from different layers of ViT-B/32 models. We then plot the accuracy of the probe versus the (normalized) layer number. Left: We train a classifier on each token separately and report the average accuracy over all tokens (excluding the CLS token for the ViT CLS model.) Right: Comparison of ViT models pre-trained with a classification token or with global average pooling (GAP) and then evaluated with different ways of aggregating the token representations.
|
| 119 |
+
|
| 120 |
+
We begin by comparing token representations in the higher layers of ViT and ResNet to those of input patches. Recall that ViT tokens have a corresponding input patch, and thus a corresponding input spatial location. For ResNet, we define a token representation to be all the convolutional channels at a particular spatial location. This also gives it a corresponding input spatial location. We can then take a token representation and compute its CKA score with input image patches at different locations. The results are illustrated for different tokens (with their spatial locations labelled) in Figure 9.
|
| 121 |
+
|
| 122 |
+
For ViT, we observe that tokens corresponding to locations at the edge of the image are similar to edge image patches, but tokens corresponding to interior locations are well localized, with their representations being most similar to the corresponding image patch. By contrast, for ResNet, we see significantly weaker localization (though Figure D.3 shows improvements for earlier layers.)
|
| 123 |
+
|
| 124 |
+
One factor influencing this clear difference between architectures is that ResNet is trained to classify with a global average pooling step, while ViT has a separate classification (CLS) token. To examine this further, we test a ViT architecture trained with global average pooling (GAP) for localization (see Appendix A for training details). The results, shown in Figure 10, demonstrate that global average pooling does indeed reduce localization in the higher layers. More results in Appendix Section D.
|
| 125 |
+
|
| 126 |
+
Localization and Linear Probe Classification: The previous results have looked at localization through direct comparison of each token with input patches. To complete the picture, we look at using each token separately to perform classification with linear probes. We do this across different layers of the model, training linear probes to classify image label with closed-form few-shot linear regression similar to Dosovitskiy et al. [14] (details in Appendix A). Results are in Figure 11, with further results in Appendix F. The left pane shows average accuracy of classifiers trained on individual tokens, where we see that ResNet50 and ViT with GAP model tokens perform well at higher layers, while in the standard ViT trained with a CLS token the spatial tokens do poorly – likely because their representations remain spatially localized at higher layers, which makes global classification challenging. Supporting this are results on the right pane, which shows that a single token from the
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 12: Measuring similarity of representations learned with varying amounts of data shows the importance of large datasets for higher layers and larger model representations. We compute the similarity of representations at each block for ViT models that have been trained on smaller subsets of the data to a model that has been trained on the full data on ViT-L/16 (left) and ViT-B/32 (right). We observe that while lower layer representations have high similarity even with $1 0 \%$ of the data, higher layers and larger models require significantly more data to learn similar representations.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 13: Experiments with linear probes. We train linear classifiers on 10-shot ImageNet classification from the aggregated representations of different layers of different models. We then plot the accuracy of the probe versus the (normalized) layer number. Left: Comparison of ViTs pre-trained on JFT-300M or ImageNet and evaluated with linear probes on Imagenet. Right: Comparison of ViT and ResNet models trained JFT- $3 0 0 \mathrm { m }$ evaluated with linear probes on ImageNet.
|
| 133 |
+
|
| 134 |
+
ViT-GAP model achieves comparable accuracy in the highest layer to all tokens pooled together. With the results of Figure 9, this suggests all higher layer tokens in GAP models learn similar (global) representations.
|
| 135 |
+
|
| 136 |
+
# 8 Effects of Scale on Transfer Learning
|
| 137 |
+
|
| 138 |
+
Motivated by the results of Dosovitskiy et al. [14] that demonstrate the importance of dataset scale for high performing ViTs, and our earlier result (Figure 4) on needing scale for local attention, we perform a study of the effect of dataset scale on representations in transfer learning.
|
| 139 |
+
|
| 140 |
+
We begin by studying the effect on representations as the JFT-300M pretraining dataset size is varied. Figure 12 illustrates the results on ViT-B/32 and ViT-L/16. Even with $3 \%$ of the entire dataset, lower layer representations are very similar to the model trained on the whole dataset, but higher layers require larger amounts of pretraining data to learn the same representations as at large data scale, especially with the large model size. In Section G, we study how much representations change in finetuning, finding heterogeneity over datasets.
|
| 141 |
+
|
| 142 |
+
We next look at dataset size effect on the larger ViT-L/16 and ViT-H/14 models. Specifically, in the left pane of Figure 13, we train linear classifer probes on ImageNet classes for models pretrained on JFT-300M vs models only pretrained on ImageNet. We observe the JFT-300M pretained models achieve much higher accuracies even with middle layer representations, with a $3 0 \%$ gap in absolute accuracy to the models pretrained only on ImageNet. This suggests that for larger models, the larger dataset is especially helpful in learning high quality intermediate representations. This conclusion is further supported by the results of the right pane of Figure 13, which shows linear probes on different ResNet and ViT models, all pretrained on JFT-300M. We again see the larger ViT models learn much stronger intermediate representations than the ResNets. Additional linear probes experiments in Section F demonstrate this same conclusion for transfer to CIFAR-10 and CIFAR-100.
|
| 143 |
+
|
| 144 |
+
# 9 Discussion
|
| 145 |
+
|
| 146 |
+
Limitations: Our study uses CKA [17], which summarizes measurements into a single scalar, to provide quantitative insights on representation similarity. While we have complemented this with interventional tests and other analyses (e.g. linear probes), more fine-grained methods may reveal additional insights and variations in the representations.
|
| 147 |
+
|
| 148 |
+
Conclusion: Given the central role of convolutional neural networks in computer vision breakthroughs, it is remarkable that Transformer architectures (almost identical to those used in language) are capable of similar performance. This raises fundamental questions on whether these architectures work in the same way as CNNs. Drawing on representational similarity techniques, we find surprisingly clear differences in the features and internal structures of ViTs and CNNs. An analysis of self-attention and the strength of skip connections demonstrates the role of earlier global features and strong representation propagation in ViTs for these differences, while also revealing that some CNN properties, e.g. local information aggregation at lower layers, are important to ViTs, being learned from scratch at scale. We examine the potential for ViTs to be used beyond classification through a study of spatial localization, discovering ViTs with CLS tokens show strong preservation of spatial information — promising for future uses in object detection. Finally, we investigate the effect of scale for transfer learning, finding larger ViT models develop significantly stronger intermediate representations through larger pretraining datasets. These results are also very pertinent to understanding MLP-based architectures for vision proposed by concurrent work [42, 43], further discussed in Section H, and together answer central questions on differences between ViTs and CNNs, and suggest new directions for future study. From the perspective of societal impact, these findings and future work may help identify potential failures as well as greater model interpretability.
|
| 149 |
+
|
| 150 |
+
# References
|
| 151 |
+
|
| 152 |
+
[1] G. Alain and Y. Bengio. Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644, 2016.
|
| 153 |
+
[2] I. Bello, B. Zoph, A. Vaswani, J. Shlens, and Q. V. Le. Attention augmented convolutional networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3286–3295, 2019.
|
| 154 |
+
[3] S. Bhojanapalli, A. Chakrabarti, D. Glasner, D. Li, T. Unterthiner, and A. Veit. Understanding robustness of transformers for image classification. arXiv preprint arXiv:2103.14586, 2021.
|
| 155 |
+
[4] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pages 213–229. Springer, 2020.
|
| 156 |
+
[5] M. Caron, H. Touvron, I. Misra, H. Jégou, J. Mairal, P. Bojanowski, and A. Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021.
|
| 157 |
+
[6] M. Chen, A. Radford, R. Child, J. Wu, H. Jun, D. Luan, and I. Sutskever. Generative pretraining from pixels. In International Conference on Machine Learning, pages 1691–1703. PMLR, 2020.
|
| 158 |
+
[7] X. Chen, S. Xie, and K. He. An empirical study of training self-supervised vision transformers. arXiv preprint arXiv:2104.02057, 2021.
|
| 159 |
+
[8] A. Conneau, G. Kruszewski, G. Lample, L. Barrault, and M. Baroni. What you can cram into a single vector: Probing sentence embeddings for linguistic properties. In ACL, 2018.
|
| 160 |
+
[9] J.-B. Cordonnier, A. Loukas, and M. Jaggi. On the relationship between self-attention and convolutional layers. arXiv preprint arXiv:1911.03584, 2019.
|
| 161 |
+
[10] C. Cortes, M. Mohri, and A. Rostamizadeh. Algorithms for learning kernels based on centered alignment. The Journal of Machine Learning Research, 13(1):795–828, 2012.
|
| 162 |
+
[11] S. d’Ascoli, H. Touvron, M. Leavitt, A. Morcos, G. Biroli, and L. Sagun. Convit: Improving vision transformers with soft convolutional inductive biases. arXiv preprint arXiv:2103.10697, 2021.
|
| 163 |
+
[12] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 164 |
+
[13] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 165 |
+
[14] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 166 |
+
[15] A. Gretton, K. Fukumizu, C. H. Teo, L. Song, B. Schölkopf, A. J. Smola, et al. A kernel statistical test of independence. In Nips, volume 20, pages 585–592. Citeseer, 2007.
|
| 167 |
+
[16] A. Kolesnikov, L. Beyer, X. Zhai, J. Puigcerver, J. Yung, S. Gelly, and N. Houlsby. Big transfer (bit): General visual representation learning. arXiv preprint arXiv:1912.11370, 6(2):8, 2019.
|
| 168 |
+
[17] S. Kornblith, M. Norouzi, H. Lee, and G. Hinton. Similarity of neural network representations revisited. In ICML, 2019.
|
| 169 |
+
[18] S. Kornblith, H. Lee, T. Chen, and M. Norouzi. What’s in a loss function for image classification? arXiv preprint arXiv:2010.16402, 2020.
|
| 170 |
+
[19] N. Kriegeskorte, M. Mur, and P. A. Bandettini. Representational similarity analysis-connecting the branches of systems neuroscience. Frontiers in systems neuroscience, 2:4, 2008.
|
| 171 |
+
[20] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 172 |
+
[21] S. R. Kudugunta, A. Bapna, I. Caswell, N. Arivazhagan, and O. Firat. Investigating multilingual nmt representations at scale. arXiv preprint arXiv:1909.02197, 2019.
|
| 173 |
+
[22] G. W. Lindsay. Convolutional neural networks as a model of the visual system: past, present, and future. Journal of cognitive neuroscience, pages 1–15, 2020.
|
| 174 |
+
[23] W. Luo, Y. Li, R. Urtasun, and R. Zemel. Understanding the effective receptive field in deep convolutional neural networks. arXiv preprint arXiv:1701.04128, 2017.
|
| 175 |
+
[24] N. Maheswaranathan, A. H. Williams, M. D. Golub, S. Ganguli, and D. Sussillo. Universality and individuality in neural dynamics across large populations of recurrent networks. Advances in neural information processing systems, 2019:15629, 2019.
|
| 176 |
+
[25] A. Merchant, E. Rahimtoroghi, E. Pavlick, and I. Tenney. What happens to bert embeddings during fine-tuning? arXiv preprint arXiv:2004.14448, 2020.
|
| 177 |
+
[26] A. S. Morcos, M. Raghu, and S. Bengio. Insights on representational similarity in neural networks with canonical correlation. arXiv preprint arXiv:1806.05759, 2018.
|
| 178 |
+
[27] B. Mustafa, A. Loh, J. Freyberg, P. MacWilliams, M. Wilson, S. M. McKinney, M. Sieniek, J. Winkens, Y. Liu, P. Bui, et al. Supervised transfer learning at scale for medical imaging. arXiv preprint arXiv:2101.05913, 2021.
|
| 179 |
+
[28] M. Naseer, K. Ranasinghe, S. Khan, M. Hayat, F. S. Khan, and M.-H. Yang. Intriguing properties of vision transformers, 2021.
|
| 180 |
+
[29] T. Nguyen, M. Raghu, and S. Kornblith. Do wide and deep networks learn the same things? uncovering how neural network representations vary with width and depth. arXiv preprint arXiv:2010.15327, 2020.
|
| 181 |
+
[30] N. Parmar, A. Vaswani, J. Uszkoreit, L. Kaiser, N. Shazeer, A. Ku, and D. Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
|
| 182 |
+
[31] S. Paul and P.-Y. Chen. Vision transformers are robust learners. arXiv preprint arXiv:2105.07581, 2021.
|
| 183 |
+
[32] M. E. Peters, M. Neumann, L. Zettlemoyer, and W.-t. Yih. Dissecting contextual word embeddings: Architecture and representation. In EMNLP, 2018.
|
| 184 |
+
[33] A. Raghu, M. Raghu, S. Bengio, and O. Vinyals. Rapid learning or feature reuse? towards understanding the effectiveness of maml. arXiv preprint arXiv:1909.09157, 2019.
|
| 185 |
+
[34] M. Raghu, J. Gilmer, J. Yosinski, and J. Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. arXiv preprint arXiv:1706.05806, 2017.
|
| 186 |
+
[35] M. Raghu, C. Zhang, J. Kleinberg, and S. Bengio. Transfusion: Understanding transfer learning for medical imaging. arXiv preprint arXiv:1902.07208, 2019.
|
| 187 |
+
[36] P. Ramachandran, N. Parmar, A. Vaswani, I. Bello, A. Levskaya, and J. Shlens. Stand-alone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019.
|
| 188 |
+
[37] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 189 |
+
[38] J. Shi, E. Shea-Brown, and M. Buice. Comparison against task driven artificial neural networks reveals functional properties in mouse visual cortex. Advances in Neural Information Processing Systems, 32:5764–5774, 2019.
|
| 190 |
+
[39] L. Song, A. Smola, A. Gretton, J. Bedo, and K. Borgwardt. Feature selection via dependence maximization. Journal of Machine Learning Research, 13(5), 2012.
|
| 191 |
+
[40] C. Sun, A. Shrivastava, S. Singh, and A. Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pages 843–852, 2017.
|
| 192 |
+
[41] Y. Tay, M. Dehghani, J. Gupta, D. Bahri, V. Aribandi, Z. Qin, and D. Metzler. Are pre-trained convolutions better than pre-trained transformers? arXiv preprint arXiv:2105.03322, 2021.
|
| 193 |
+
[42] I. Tolstikhin, N. Houlsby, A. Kolesnikov, L. Beyer, X. Zhai, T. Unterthiner, J. Yung, D. Keysers, J. Uszkoreit, M. Lucic, et al. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021.
|
| 194 |
+
[43] H. Touvron, P. Bojanowski, M. Caron, M. Cord, A. El-Nouby, E. Grave, A. Joulin, G. Synnaeve, J. Verbeek, and H. Jégou. Resmlp: Feedforward networks for image classification with dataefficient training. arXiv preprint arXiv:2105.03404, 2021.
|
| 195 |
+
[44] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 196 |
+
[45] E. Voita, R. Sennrich, and I. Titov. The bottom-up evolution of representations in the transformer: A study with machine translation and language modeling objectives. In EMNLP, 2019.
|
| 197 |
+
[46] B. Wu, C. Xu, X. Dai, A. Wan, P. Zhang, Z. Yan, M. Tomizuka, J. Gonzalez, K. Keutzer, and P. Vajda. Visual transformers: Token-based image representation and processing for computer vision. arXiv preprint arXiv:2006.03677, 2020.
|
| 198 |
+
[47] J. M. Wu, Y. Belinkov, H. Sajjad, N. Durrani, F. Dalvi, and J. Glass. Similarity analysis of contextual word representation models. arXiv preprint arXiv:2005.01172, 2020.
|
| 199 |
+
[48] S. Wu, A. Conneau, H. Li, L. Zettlemoyer, and V. Stoyanov. Emerging cross-lingual structure in pretrained language models. arXiv preprint arXiv:1911.01464, 2019.
|
| 200 |
+
[49] L. Yuan, Y. Chen, T. Wang, W. Yu, Y. Shi, Z. Jiang, F. E. Tay, J. Feng, and S. Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
|
| 201 |
+
[50] X. Zhai, J. Puigcerver, A. Kolesnikov, P. Ruyssen, C. Riquelme, M. Lucic, J. Djolonga, A. S. Pinto, M. Neumann, A. Dosovitskiy, et al. The visual task adaptation benchmark. 2019.
|
| 202 |
+
|
| 203 |
+
# Checklist
|
| 204 |
+
|
| 205 |
+
1. For all authors...
|
| 206 |
+
|
| 207 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 208 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 9
|
| 209 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 210 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 211 |
+
|
| 212 |
+
2. If you are including theoretical results...
|
| 213 |
+
|
| 214 |
+
(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]
|
| 215 |
+
|
| 216 |
+
3. If you ran experiments...
|
| 217 |
+
|
| 218 |
+
(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]
|
| 219 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 220 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Where possible, we show variation arising from different sampling aspects, be that dataset samples or model runs. Note that for some of the pretrained models, we only have access to one pretrained checkpoint, and so we show results across multiple model architectures to demonstrate the results hold more broadly.
|
| 221 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No]
|
| 222 |
+
|
| 223 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 224 |
+
|
| 225 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 226 |
+
(b) Did you mention the license of the assets? [No]
|
| 227 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 228 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 229 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 230 |
+
|
| 231 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 232 |
+
|
| 233 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 234 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 235 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/RHY_9ZVcTa_/RHY_9ZVcTa_.md
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON LINEAR IDENTIFIABILITY OF LEARNED REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Identifiability is a desirable property of a statistical model: it implies that the true model parameters may be estimated to any desired precision, given sufficient computational resources and data. We study identifiability in the context of representation learning: discovering nonlinear data representations that are optimal with respect to some downstream task. When parameterized as deep neural networks, such representation functions lack identifiability in parameter space, because they are overparameterized by design. In this paper, building on recent advances in nonlinear Independent Components Analysis, we aim to rehabilitate identifiability by showing that a large family of discriminative models are in fact identifiable in function space, up to a linear indeterminacy. Many models for representation learning in a wide variety of domains have been identifiable in this sense, including text, images and audio, state-of-the-art at time of publication. We derive sufficient conditions for linear identifiability and provide empirical support for the result on both simulated and real-world data.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
An increasingly common methodology in machine learning is to improve performance on a primary down-stream task by first learning a high-dimensional representation of the data on a related, proxy task. In this paradigm, training a model reduces to fine-tuning the learned representations for optimal performance on a particular sub-task (Erhan et al., 2010). Deep neural networks (DNNs), as flexible function approximators, have been surprisingly successful in discovering effective high-dimensional representations for use in downstream tasks such as image classification (Sharif Razavian et al., 2014), text generation (Radford et al., 2018; Devlin et al., 2018), and sequential decision making (Oord et al., 2018).
|
| 12 |
+
|
| 13 |
+
When learning representations for downstream tasks, it would be useful if the representations were reproducible, in the sense that every time a network relearns the representation function on the same data distribution, they were approximately the same, regardless of small deviations in the initialization of the parameters or the optimization procedure. In some applications, such as learning real-world causal relationships from data, such reproducible learned representations are crucial for accurate and robust inference (Johansson et al., 2016; Louizos et al., 2017). A rigorous way to achieve reproducibility is to choose a model whose representation function is identifiable in function space. Informally speaking, identifiability in function space is achieved when, in the limit of infinite data, there exists a single, global optimum in function space. Interestingly, Figure 1 exhibits learned representation functions that appear to be the same up to a linear transformation, even on finite data and optimized without convergence guarantees (see Appendix A.1 for training details).
|
| 14 |
+
|
| 15 |
+
In this paper, we account for Figure 1 by making precise the relationship it exemplifies. We prove that a large class of discriminative and autoregressive models are identifiable in function space, up to a linear transformation. Our results extend recent advances in the theory of nonlinear Independent Components Analysis (ICA), which have recently provided strong identifiability results for generative models of data (Hyvärinen et al., 2018; Khemakhem et al., 2019; 2020; Sorrenson et al., 2020). Our key contribution is to bridge the gap between these results and discriminative models, commonly used for representation learning (e.g., (Hénaff et al., 2019; Brown et al., 2020)).
|
| 16 |
+
|
| 17 |
+
The rest of the paper is organized as follows. In Section 2, we describe a general discriminative model family, defined by its canonical mathematical form, which generalizes many supervised, selfsupervised, and contrastive learning frameworks. In Section 3, we prove that learned representations in this family have an asymptotic property desirable for representation learning: equality up to a linear transformation. In Section 4, we show that this family includes a number of highly performant models, state-of-the-art at publication for their problem domains, including CPC (Oord et al., 2018), BERT (Devlin et al., 2018), and GPT-2 and GPT-3 (Radford et al., 2018; 2019; Brown et al., 2020). Section 5 investigates the actually realizable regime of finite data and partial optimization, showing that representations learned by members of the identifiable model family approach equality up to a linear transformation as a function of dataset size, neural network capacity, and optimization progress.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Left and Middle: Two learned DNN representation functions ${ \bf f } _ { \pmb { \theta } _ { 1 } } ( { \boldsymbol { B } } )$ , $\cdot$ visualized on held-out data $\boldsymbol { B }$ . The DNNs are word embedding models Mnih and Teh (2012) trained on the Billion Word Dataset (Chelba et al., 2013) (see Appendix A.1 for code release and training details). Right: $A \mathbf { f } _ { \pmb { \theta } _ { 1 } } ( B )$ and $\cdot$ , where $\pmb { A }$ is a linear transformation learned after training. The overlap exhibits linear identifiability (see Section 3): different representation functions, learned on the same data distribution, live within linear transformations of each other in function space.
|
| 21 |
+
|
| 22 |
+
# 2 MODEL FAMILY AND DATA DISTRIBUTION
|
| 23 |
+
|
| 24 |
+
The learned embeddings of a DNN are a function not only of the parameters, but also the network architecture and size of dataset (viewed as a sample from the underlying data distribution). This renders any analysis in full generality challenging. To make such an analysis tractable, in this section, we begin by specifying a set of assumptions about the underlying data distribution and model family that must hold for the learned representations to be similar up to a linear transformation. These assumptions are, in fact, satisfied by a number of already published, highly performant models. We establish definitions in this section, and discuss these existing approaches in depth in Section 4.
|
| 25 |
+
|
| 26 |
+
Data Distribution We assume the existence of a generalized dataset in the form of an empirical distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ over random variables $\mathbf { x }$ , y and S with the following properties:
|
| 27 |
+
|
| 28 |
+
• The random variable $\mathbf { x }$ is an input variable, typically high-dimensional, such as text or an image.
|
| 29 |
+
• The random variable y is a target variable whose value the model predicts. In case of object classification, this would be some semantically meaningful class label. However, in our model family, y may also be a high-dimensional context variable, such a text, image, or sentence fragment.
|
| 30 |
+
• S is a set containing the possible values of y given x, so $p _ { \mathcal { D } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) > 0 \iff \mathbf { y } \in \mathbf { S } .$
|
| 31 |
+
|
| 32 |
+
Note that the set of labels S is not fixed, but a random variable. This allows supervised, contrastive, and self-supervised learning frameworks to be analyzed together: the meaning of S encodes the task. For supervised classification, S is deterministic and contains class labels. For self-supervised pretraining, S contains randomly-sampled high-dimensional variables such as image embeddings. For deep metric learning (Hoffer and Ailon, 2015; Sohn, 2016), the set S contains one positive and $k$ negative samples of the class to which $\mathbf { x }$ belongs.
|
| 33 |
+
|
| 34 |
+
Canonical Discriminative Form Given a data distribution as above, a generalized discriminative model family may be defined by its parameterization of the probability of a target variable $\mathbf { y }$ conditioned on an observed variable x and a set S that contains not only the true target label $\mathbf { y }$ , but
|
| 35 |
+
|
| 36 |
+
also a collection of distractors $\mathbf { y } ^ { \prime }$ :
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
p _ { \theta } ( \mathbf { y } \vert \mathbf { x } , \mathbf { S } ) = \frac { \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ) ) } { \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ^ { \prime } ) ) } ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
The codomain of the functions $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ and $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ is $\mathbb { R } ^ { M }$ , and the domains vary according to modelling task. For notational convenience both are parameterized by $\pmb \theta \in \Theta$ , but f and $\mathbf { g }$ may use disjoint parts of $\pmb { \theta }$ , meaning that they do not necessarily share parameters.
|
| 43 |
+
|
| 44 |
+
With $\mathcal { F }$ and $\mathcal { G }$ we denote the function spaces of $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \pmb { \theta } }$ respectively. Our primary domain of interest is when $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \theta }$ are highly flexible function approximators, such as DNNs. This brings certain analytical challenges. In neural networks, different choices of parameters $\pmb \theta$ can result in the same functions $\mathbf { f } _ { \pmb { \theta } }$ and $\mathbf { g } _ { \theta }$ , hence the map $\Theta \to { \mathcal { F } } \times { \mathcal { G } }$ is many-to-one. In the context of representation learning, the function $\mathbf { f } _ { \theta }$ is typically viewed as a nonlinear feature extractor, e.g., the learned representation of the input data. While other choices meet the membership conditions for the family defined by the canonical form of Equation (1), in the remainder, we will focus on DNNs in the remainder. We next present a definition of identifiability suitable for DNNs, and prove that members of the above family satisfy it under additional assumptions.
|
| 45 |
+
|
| 46 |
+
# 3 MODEL IDENTIFIABILITY
|
| 47 |
+
|
| 48 |
+
In this section, we derive identifiability conditions for models in the family defined in Section 2.
|
| 49 |
+
|
| 50 |
+
# 3.1 IDENTIFIABILITY IN PARAMETER SPACE
|
| 51 |
+
|
| 52 |
+
Identifiability analysis answers the question of whether it is theoretically possible to learn the parameters of a statistical model exactly. Specifically, given some estimator $\pmb { \theta } ^ { \prime }$ for model parameters $\pmb { \theta } ^ { * }$ , identifiability is the property that, for any $\{ \theta ^ { \prime } , \theta ^ { \ast } \} \subset \Theta$ ,
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
p _ { \pmb { \theta } ^ { \prime } } = p _ { \pmb { \theta } ^ { * } } \quad \Longrightarrow \quad \pmb { \theta } ^ { \prime } = \pmb { \theta } ^ { * } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Models that do not have this property are said to be non-identifiable. This happens when different values $\{ \theta ^ { \prime } , \theta ^ { \ast } \} \subset \Theta$ can give rise to the same model distribution $p _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } | \mathbf { x } , \bar { \mathbf { S } } ) = p _ { \pmb { \theta } ^ { * } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ . In such a case, observing an empirical distribution $p _ { \pmb { \theta } ^ { * } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ , and fitting a model $p _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ to it perfectly does not guarantee that $\pmb { \theta } ^ { \prime } = \pmb { \theta } ^ { * }$ .
|
| 59 |
+
|
| 60 |
+
Neural networks exhibit various symmetries in parameter space such that there is almost always a many-to-one correspondence between a choice of $\pmb { \theta }$ and resulting probability function $p _ { \pmb { \theta } }$ . A simple example in neural networks is that one can swap the (incoming and outgoing) connections of two neurons in a hidden layer. This changes the value of the parameters, but does not change the network’s function. Thus, when representation functions $\mathbf { f } _ { \theta }$ or $\mathbf { g } _ { \pmb { \theta } }$ are parameterized as DNNs, equation 2 is not satisfiable.
|
| 61 |
+
|
| 62 |
+
# 3.2 IDENTIFIABILITY IN FUNCTION SPACE
|
| 63 |
+
|
| 64 |
+
For reliable and efficient representation learning, we want learned representations $\mathbf { f } _ { \theta }$ from two identifiable models to be sufficiently similar for interchangeable use in downstream tasks. The most general property we wish to preserve among learned representations is their ability to discriminate among statistical patterns corresponding to categorical groupings. In the model family defined in Section 2, the data and context functions $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \pmb { \theta } }$ parameterize $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ , the probability of label assignment, through a normalized inner product. This induces a hyperplane boundary, for discrimination, in a joint space of learned representations for data $\mathbf { x }$ and context $\mathbf { y }$ . Therefore, in the following, we will derive identifiability conditions up to a linear transformation, using a notion of similarity in parameter space inspired by Hyvärinen et al. (2018).
|
| 65 |
+
|
| 66 |
+
Definition 1. Let $\overset { L } { \sim }$ be a pairwise relation on $\Theta$ defined as:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r } { \pmb { \theta } ^ { \prime } \stackrel { L } { \sim } \pmb { \theta } ^ { * } \iff \mathbf { f } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = A \mathbf { f } _ { \pmb { \theta } ^ { * } } ( \mathbf { x } ) } \\ { \mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } ) = B \mathbf { g } _ { \pmb { \theta } ^ { * } } ( \mathbf { y } ) } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\pmb { A }$ and $\textbf { { B } }$ are invertible $M \times M$ matrices. See Appendix $\mathbf { B }$ for proof that $\stackrel { \mathrm { L } } { \sim }$ is an equivalence relation. In the remainder, we refer to identifiability up to the equivalence relation $\stackrel { \mathrm { L } } { \sim }$ as $\overset { L } { \sim }$ -identifiable or linearly identifiable.
|
| 73 |
+
|
| 74 |
+
# 3.3 LINEAR IDENTIFIABILITY OF LEARNED REPRESENTATIONS
|
| 75 |
+
|
| 76 |
+
We next present a simple derivation of the $\stackrel { \mathrm { L } } { \sim }$ -identifiability of members of the generalized discriminative family defined in Section 2. This result reveals sufficient conditions under which a discriminative probabilistic model $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ has a useful property: the learned representations of the input $\mathbf { x }$ and target random variables $\mathbf { y }$ for any two pairs of parameters $( \theta ^ { \prime } , \theta ^ { * } )$ are related as $\theta ^ { \prime } \stackrel { \triangledown } { \sim } \theta ^ { * }$ , that is, $\mathbf { f } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = A \mathbf { f } _ { \pmb { \theta } ^ { * } } ( \mathbf { x } )$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } ) = \mathbf { \bar { \phi } } B \mathbf { g } _ { \pmb { \theta } ^ { \ast } } ( \mathbf { \bar { y } } )$ .
|
| 77 |
+
|
| 78 |
+
We first review the notation for the proof, which is introduced in detail in Section 2. We then highlight an important requirement on the diversity of the data distribution, which must be satisfied for the proof statement to hold. We prove the result immediately after.
|
| 79 |
+
|
| 80 |
+
Notation. The target random variables $\mathbf { y }$ , associated with input random variables x, may be class labels (as in supervised classification), or they could be stochastically generated from datapoints x as, e.g., perturbed image patches (as in self-supervised learning). We account for this additional stochasticity as a set-valued random variable S, containing all possible values of $\mathbf { y }$ conditioned on some $\mathbf { x }$ . For brevity, we will use shorthands that drop the parameters $\pmb { \theta }$ : $p ^ { \prime } : = p _ { \pmb { \theta } ^ { \prime } } , p ^ { * } : = p _ { \pmb { \theta } ^ { * } }$ , $\mathbf { f } ^ { * } : = \mathbf { f } _ { \theta ^ { * } } , \mathbf { f } ^ { \prime } : = \mathbf { f } _ { \theta ^ { \prime } } , \mathbf { g } ^ { \prime } : = \mathbf { g } _ { \theta ^ { \prime } }$ .
|
| 81 |
+
|
| 82 |
+
Diversity condition. We assume that for any $( \theta ^ { \prime } , \theta ^ { * } )$ for which it holds that $p ^ { \prime } = p ^ { * }$ , and for any distinct tuples given $\mathbf { x }$ , by repeated sampling $\{ ( \mathbf { y } _ { A } ^ { ( i ) } , \mathbf { y } _ { B } ^ { ( i ) } ) \} _ { i = 1 } ^ { M }$ $\mathbf { S } \sim p _ { \mathcal { D } } ( \mathbf { S } | \mathbf { x } )$ such that the matrices and picking $\mathbf { L } ^ { \prime }$ $\mathbf { y } _ { A } , \mathbf { y } _ { B } \in \mathbf { S }$ and $\mathbf { L } ^ { \ast }$ are invertible, where , we can construct a set of $\mathbf { L } ^ { \prime }$ consists $M$ of columns $( \mathbf { g } ^ { \prime } ( \mathbf { y } _ { A } ^ { ( i ) } ) - \mathbf { g } ^ { \prime } ( \mathbf { y } _ { B } ^ { ( i ) } ) )$ , and $\mathbf { L } ^ { \ast }$ consists of columns $\mathbf { g } ^ { * } ( \mathbf { y } _ { A } ^ { ( i ) } ) - \mathbf { g } ^ { * } ( \mathbf { y } _ { B } ^ { ( i ) } )$ , $i \in \{ 1 , \ldots , M \}$ . See Section 3.4 for detailed discussion.
|
| 83 |
+
|
| 84 |
+
Theorem 1. Under the diversity condition, models in the family defined by Equation (1) are linearly identifiable. That is, for any $\theta ^ { \prime } , \theta ^ { \ast } \in \Theta$ , and $\mathbf { f } ^ { * } , \mathbf { f } ^ { \prime } , \mathbf { g } ^ { * } , \mathbf { g } ^ { \prime } , p ^ { * } , \bar { p ^ { \prime } }$ defined as in Section 2,
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
p ^ { \prime } = p ^ { * } \implies \pmb { \theta } ^ { \prime } \stackrel { \perp } { \sim } \pmb { \theta } ^ { * } .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
To establish the result, we proceed by directly constructing an invertible linear transformation that satisfies Definition 1. Consider $\mathbf { y } _ { A } , \mathbf { y } _ { B } \in \mathbf { S }$ . The likelihood ratios for these points
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\frac { p ^ { \prime } ( \mathbf { y } _ { A } | \mathbf { x } , \mathbf { S } ) } { p ^ { \prime } ( \mathbf { y } _ { B } | \mathbf { x } , \mathbf { S } ) } = \frac { p ^ { * } ( \mathbf { y } _ { A } | \mathbf { x } , \mathbf { S } ) } { p ^ { * } ( \mathbf { y } _ { B } | \mathbf { x } , \mathbf { S } ) }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
are equal. Substituting our model definition from equation (1), we find:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\frac { \exp ( \mathbf { f } ^ { \prime } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { \prime } ( \mathbf { y } _ { A } ) ) } { \exp ( \mathbf { f } ^ { \prime } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { \prime } ( \mathbf { y } _ { B } ) ) } = \frac { \exp ( \mathbf { f } ^ { * } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { * } ( \mathbf { y } _ { A } ) ) } { \exp ( \mathbf { f } ^ { * } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { * } ( \mathbf { y } _ { B } ) ) } ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where the normalizing constants cancelled out on the left- and right-hand sides. Taking the logarithm, this simplifies to:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
( \mathbf { g } ^ { \prime } ( \mathbf { y } _ { A } ) - \mathbf { g } ^ { \prime } ( \mathbf { y } _ { B } ) ) ^ { \top } \mathbf { f } ^ { \prime } ( \mathbf { x } ) = ( \mathbf { g } ^ { * } ( \mathbf { y } _ { A } ) - \mathbf { g } ^ { * } ( \mathbf { y } _ { B } ) ) ^ { \top } \mathbf { f } ^ { * } ( \mathbf { x } ) .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Note that this equation is true for any triple $\left( \mathbf { x } , \mathbf { y } _ { A } , \mathbf { y } _ { B } \right)$ for which $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } _ { B } , \mathbf { y } _ { B } ) > 0$ .
|
| 109 |
+
|
| 110 |
+
We next collect $M$ distinct tuples $( \mathbf { y } _ { A } ^ { ( i ) } , \mathbf { y } _ { B } ^ { ( i ) } )$ so that by repeating Equation (7) $M$ times and by the diversity condition noted above, the resulting difference vectors are linearly independent. We collect these vectors together as the columns of $( M \times M )$ -dimensional matrices $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ , forming the following system of $M$ linear equations:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathbf { L ^ { \prime } } ^ { \top } \mathbf { f ^ { \prime } } ( \mathbf { x } ) = \mathbf { L ^ { * } } ^ { \top } \mathbf { f ^ { * } } ( \mathbf { x } ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Since $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ are invertible, we rearrange:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbf { f } ^ { \prime } ( \mathbf { x } ) = ( \mathbf { L } ^ { * } \mathbf { L } ^ { \prime - 1 } ) ^ { \top } \mathbf { f } ^ { * } ( \mathbf { x } ) .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Hence, $\mathbf { f } ^ { \prime } ( \mathbf { x } ) = \mathbf { A } \mathbf { f } ^ { * } ( \mathbf { x } )$ where $\mathbf { A } = ( \mathbf { L } ^ { * } \mathbf { L } ^ { \prime - 1 } )$ . This completes the first half of the proof. See Appendix $\textrm { C }$ for the second half of the proof, which is similar, and handles the function g.
|
| 123 |
+
|
| 124 |
+
# 3.4 DISCUSSION: WHEN DOES THE DIVERSITY CONDITION HOLD?
|
| 125 |
+
|
| 126 |
+
Theorem 1 is a constructive proof of existence that exhibits invertible $( M \times M )$ matrices $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ . We require the diversity condition to hold in order to guarantee invertibility. Such a requirement is similar to the conditions in earlier work on nonlinear ICA such as (Hyvärinen et al., 2018), as discussed in Section 6. Informally, this means that there needs to be a sufficient number of possible values $\mathbf { y } \in \mathbf { S }$ . In the case of supervised classification with $K$ classes, S is fixed and of size $K$ . Then, we need $K \ge M + 1$ in order to generate $M$ difference vectors $\mathbf { g } _ { \theta } ( \mathbf { y } ^ { ( 1 ) } ) - \mathbf { g } _ { \theta } ( \mathbf { y } ^ { ( j ) } )$ , $j = 2 , \ldots , M + 1$ . In case of self-supervised or deep metric learning, where $\mathbf { S }$ and y may be algorithmically generated from $\mathbf { x }$ , this requirement is easy to satisfy, as there will typically be a diversity of values of y. The same holds for language models with large vocabularies. However, for supervised classification with a small number of classes, this requirement on the size of S may be restrictive, as we discuss further in Section 4.
|
| 127 |
+
|
| 128 |
+
Note that by placing the diversity requirement on the number of classes $K$ , we implicitly assumed that the context representation function $\mathbf { g } _ { \theta }$ has the following property: the $M$ difference vectors span the range of $\mathbf { g } _ { \theta }$ . This is a mild assumption in the context of DNNs: for random initialization and iterative weight updates, this property follows from the stochasticity of the distribution used to initialize the network. Briefly, a set of $M + 1$ unique points $\mathbf { y } ^ { ( j ) }$ such that the $M$ vectors $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ^ { ( 1 ) } ) - \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ^ { ( j ) } ) , j = 2 , \dots , M + 1$ are not linearly independent has measure zero. For other choices of $\mathbf { g } _ { \pmb { \theta } }$ , care must be taken to ensure this condition is satisfied.
|
| 129 |
+
|
| 130 |
+
What can be said when $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ are ill-conditioned, that is, the ratio between maximum and minimum singular value $\frac { \sigma _ { \mathrm { m a x } } ( \mathbf { L } ) } { \sigma _ { \mathrm { m i n } } ( \mathbf { L } ) }$ (dropping superscripts when a statement apply to both) is large? In the context of a data representation matrix such as $\mathbf { L }$ , this implies that there exists at least one column $\ell _ { j }$ of $\mathbf { L }$ and constants $\lambda _ { k }$ for $k \neq j$ such that $\begin{array} { r } { \| \ell _ { j } - \sum _ { k \neq j } \bar { \lambda } _ { k } \ell _ { k } \| _ { 2 } < \varepsilon } \end{array}$ for small $\varepsilon$ . In other words, sometuple $( \mathbf { y } ^ { ( k ) } , \mathbf { y } ^ { ( i ) } )$ early a linear combination of the others. T such that the resulting difference vector $\ell _ { j } = \dot { \mathbf { g } } _ { \pmb { \theta } } ( \mathbf { y } _ { A } ^ { ( k ) } ) - \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } _ { B } ^ { ( i ) } )$ ere exists somecan nearly (in the sense above) be written as a linear combination of the other columns. Such near singularity is in this case a function of the choice of samples $\mathbf { y }$ that yield the difference vectors. The issue could be handled by resampling different data points until the condition number of the matrices is satisfactory. This amounts to strengthening the diversity condition. We leave more detailed analysis to future work, as the result will depend on the choice of architectures for f and $\mathbf { g }$ .
|
| 131 |
+
|
| 132 |
+
# 4 EXAMPLES OF LINEARLY IDENTIFIABLE MODELS
|
| 133 |
+
|
| 134 |
+
The form of Equation (1) is already used as a general approach for a variety of machine learning problems. We present a non-exhaustive sample of such publications, chosen to exhibit the range of applications. Many of these approaches were state-of-the-art at the time of their release: Contrastive Predictive Coding (Hénaff et al., 2019), BERT (Devlin et al., 2018), GPT-2 and GPT-3 (Radford et al., 2018; 2019; Brown et al., 2020), XLNET (Yang et al., 2019), and the triplet loss for deep metric learning (Sohn, 2016). In this section, we discuss how to interpret the functional components of these frameworks with respect to the generalized data distribution of Section 2 and canonical parameterization of Equation (1). See Appendix D for reductions to the canonical form of Equation (1).
|
| 135 |
+
|
| 136 |
+
Supervised Classification. Although the scope of this paper is identifiable representation learning, under certain conditions, standard supervised classifiers can learn identifiable representations as well. In this case, the number of classes must be strictly greater than the feature dimension, as noted in Section 3.4. We simulate such a model in Section 5.1 to show evidence of its linear identifiability. We stress that representation learning as pretraining for classification is a way to ensure that the conditions on label diversity are met, rather than relying on the supervised classifier itself to generate identifiable representations. This paradigm is discussed in the next subsection.
|
| 137 |
+
|
| 138 |
+
Representations learned during supervised classification can be linearly identifiable under the following model specification. The input random variables $\mathbf { x }$ represent some data domain to be classified, such as images or word embeddings. The target variables $\mathbf { y }$ represent label assignments for $\mathbf { x }$ typically semantically meaningful. These are often encoded these as the standard basis vectors $\mathbf { e _ { y } }$ a “one-hot encoding." The set $\mathbf { S }$ contains all $K$ possible values of $\mathbf { y }$ . In this case, notice that S is not stochastic: the empirical distribution $p _ { \mathcal { D } } ( \mathbf { S } | \mathbf { x } )$ is modelled as a Dirac measure with all probability mass on the set $\mathbf { S } = \{ 0 , \ldots , K - 1 \}$ (using integers, here, to represent distinct labels) . The representation function $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ of a classifier is often implemented as DNN that maps from the input layer to the layer just prior to the model logits. The context map $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ is given by the weights in the final, linear projection layer, which outputs unnormalized logits. Concretely, $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ) = \mathbf { W } \mathbf { e } _ { \mathbf { y } }$ , where $\mathbf { W } \in \mathbb { R } ^ { M \times M }$ is a learnable weight matrix. In order satisfy the diversity condition, the dimension $M$ of the number of classes $K$ must be strictly greater than the dimension of the learned representation $M$ , that is, $| \mathbf { S } | \geq M + 1$ . Finally, the output of the final, linear projection layer is normalized through a Softmax function, yielding the parameterization of Equation (1).
|
| 139 |
+
|
| 140 |
+
Self-Supervised Pretraining for Image Classification. Self-supervised learning is a framework that first pretrains a DNN before deploying it on some other, related task. The pretraining task often takes the form of Equation (1) and meets the sufficient conditions to be linearly identifiable. A paradigmatic example is Contrastive Predictive Coding (CPC) (Oord et al., 2018). CPC is a general pretraining framework, but we focus for the sake of clarity on its use in image models here. CPC as applied to images involves: (1) preprocessing an image into augmented patches, (2) assigning labels according to which image the patch came from, and then (3) predicting the representations of the patches whether below, to the right, to the left, or above a certain level (Oord et al., 2018).
|
| 141 |
+
|
| 142 |
+
The context function of CPC, $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ , encodes a particular position in the sequence of patches, and the representation function, $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ , is an autoregressive function of the previous $k$ patches, according to some predefined patch ordering. Given some $\mathbf { x }$ , the collection of all patches from the sequence, from a given minibatch of images, is the set $\mathbf { S } \sim p _ { \mathit { D } } ( \mathbf { S } | \mathbf { x } )$ , where the randomness enters via the patch preprocessing algorithm. Since the preprocessing phase is part of the algorithm design, it is straightforward to make it sufficiently diverse (enough transformations of enough patches) so as to meet the requirements for the model to be linearly identifiable.
|
| 143 |
+
|
| 144 |
+
Multi-task Pretraining for Natural Language Generation. Autoregressive language models, such as (Mikolov et al., 2010; Dai and Le, 2015) and more recently GPT-2 and GPT-3 (Radford et al., 2018; 2019; Brown et al., 2020), are typically also instances of the model family of Equation 1. Data points $\mathbf { x }$ are the past tokens, $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ is a nonlinear representation of the past estimated by either an LSTM (Hochreiter and Schmidhuber, 1997) or an autoregressive Transformer model (Vaswani et al., 2017), y is the next token, and $\mathbf { w } _ { i } = \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } = i )$ is a learned representation of the next token, often implemented as a simple look-up table, as in supervised classification.
|
| 145 |
+
|
| 146 |
+
BERT (Devlin et al., 2018) is also a member of the linearly identifiable family. This model pretrains word embeddings through a denoising autoencoder-like (Vincent et al., 2008) architecture. For a given sequence of tokenized text, some fixed percentage of the symbols are extracted and set aside, and their original values set to a special null symbol, “corrupting" the original sequence. The pretraining task in BERT is to learn a continuous representation of the extracted symbols conditioned on the remainder of the text. A transformer (Vaswani et al., 2017) function approximator is used to map from the corrupted sequence into a continuous space. The transformer network is the $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ function of Equation 1. The context map $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ is a lookup map into the learned basis vector for each token.
|
| 147 |
+
|
| 148 |
+
# 5 EXPERIMENTS
|
| 149 |
+
|
| 150 |
+
The derivation in Section 3 shows that, for models in the general discriminative family defined in Section 2, the functions $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \theta }$ are identifiable up to a linear transformation given unbounded data and assuming model convergence. The question remains as to how close a model trained on finite data and without convergence guarantees will approach this limit. One subtle issue is that poor architecture choices (such as too few hidden units, or inadequate inductive priors) or insufficient data samples when training can interfere with model estimation and thereby linear identifiability of the learned representations, due to underfitting. In this section, we study this issue over a range of models, from low-dimensional language embedding and supervised classification (Figures 1 and 2 respectively) to GPT-2 (Radford et al., 2019), an approximately $1 . 5 * 1 0 ^ { 9 }$ -parameter generative model of natural language (Figure 4). See Appendix A and the code release for details needed to reproduce.
|
| 151 |
+
|
| 152 |
+
Through these experiments, we show that (1) in the small dimensional, large data regime, linearly identifiable models yield learned representations that lie approximately within a linear transformation of each other (Figures 1 and 2) as predicted by Theorem 1; and (2) in the high dimensional, large data regime, linearly identifiable models yield learned representations that exhibit a strong trend towards linear identifiability. The learned representations approach a linear transformation of each other monotonically, as a function of dataset sample size, neural network capacity (number of hidden units), and optimization progress. In the case of GPT-2, which has benefited from substantial tuning by engineers to improve model estimation, we find strong evidence of linear identifiability.
|
| 153 |
+
|
| 154 |
+
Measuring linear similarity between learned representations. How can we measure whether pairs of learned representations live within a linear transformation of each other in function space? We adapt Canonical Correlation Analysis (CCA) (Hotelling, 1936) for this purpose, which finds the optimal linear transformations to maximize correlation among two random vectors. On a randomly selected held-out subset $B \subset D$ of the training data we compute $\mathbf { f } _ { \pmb { \theta } _ { 1 } } ( \pmb { \cal { B } } )$ and $\mathbf { f } _ { \pmb { \theta } _ { 2 } } ( { \pmb { \cal { B } } } )$ for two models with parameters $\pmb { \theta } _ { 1 }$ and $\pmb { \theta } _ { 2 }$ respectively. Assume without loss of generality that $\mathbf { f } _ { \pmb { \theta } _ { 1 } } ( \pmb { \cal { B } } )$ and $\mathbf { f } _ { \pmb { \theta } _ { 2 } } ( { \pmb { \cal { B } } } )$ are centered. CCA finds the optimal linear transformations $C$ and $_ { D }$ such that the pairwise correlations $\rho _ { i }$ between the $i ^ { t h }$ columns of $C ^ { \top } \mathbf { f } _ { \pmb { \theta } _ { 1 } } ( B )$ and $D ^ { \top } \mathbf { f } _ { \theta _ { 2 } } ( B )$ are maximized. We collect correlations together in $\rho$ . If after linear transformation the two matrices are aligned, the mean of $\rho$ will be 1; if they are instead uncorrelated, then the mean of $\rho$ will be 0. We use the mean of $\rho$ as a proxy for the existence of a linear transformation between $\mathbf { f } _ { \pmb { \theta } _ { 1 } } ( \pmb { \cal { B } } )$ and $\mathbf { f } _ { \pmb { \theta } _ { 2 } } ( { \pmb { \cal { B } } } )$ . For DNNs, it is a well known phenomenon that most of the variability in a learned representation tends to concentrate in a low-dimensional subspace, leaving many noisy, random dimensions (Morcos et al., 2018). Such random noise can result in spurious high correlations in CCA. A solution to this problem is to apply Principal Components Analysis (PCA) (Pearson, 1901) to each of the two matrices ${ \bf \dot { f } } _ { \pmb { \theta } _ { 2 } } ( B )$ and ${ \bf f } _ { \pmb { \theta } _ { 1 } } ( { \pmb { \cal { B } } } )$ , projecting onto their top- $k$ principal components, before applying CCA. This technique is known as SVCCA (Raghu et al., 2017).
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Deep Supervised Classification. (a) Data distribution for a linearly identifiable K-way classification problem. (b) Mean (centered) CCA between the learned representations over the course of training. After approx. 4000 iterations, CCA finds a linear transformation that rotate the learned representations into alignment, up to optimization error. (c) Learned representations after transformation via optimal linear transformation. The first dimension of the first model’s feature space is plotted against the first dimension of second. The learned representations have a nearly linear relationship, modulo estimation noise.
|
| 158 |
+
|
| 159 |
+
We report first on a simulation study of linearly identifiable $K$ -way classification, where all assumptions and sufficient conditions of Theorem 1 are guaranteed to be met. We generated a synthetic data distribution with the properties required by Section 2, and chose DNNs that had sufficient capacity to learn a specified nonlinear relationship between inputs $\mathbf { x }$ and targets y. In short, the data distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ consists of inputs $\mathbf { x }$ sampled from a 2-D Gaussian with $\sigma = 3$ . The targets $\mathbf { y }$ were assigned among $K = 1 8$ classes according to their radial position (angle swept out by a ray fixed at the origin). The number of classes $K$ was chosen to ensure $K \geq \mathrm { d i m } [ { \bf f } _ { \theta } ( { \bf \bar { x } } ) ] + 1$ , the diversity condition. See Appendix D.1 for more details.
|
| 160 |
+
|
| 161 |
+
To evaluate linear similarity, we trained two randomly initialized models of $p _ { \mathcal { D } } ( \mathbf { y } \vert \mathbf { x } , \mathbf { S } )$ . Plots show $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ , the data representation function, on random $\mathbf { x }$ . Figure 2b shows that the mean CCA increases to its maximum value over training, demonstrating that the feature spaces converge to the same solution up to a linear transformation modulo model estimation noise. Similarly, Figure 2c shows that the learned representations exhibit a strongly linear relationship.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 3: Self-Supervised Representation Learning. Error bars are computed over 5 pairs of models. (a) Input data. Two patches are taken (one from top half, and one from the bottom half) of an image at random. Using a contrastive loss, we predict the identity of the bottom patch encoding from the top. (b) Linear similarity of learned representations at checkpoints (see legend). As models converge, linear similarity increases. (c) Linear similarity as we increase the amount of data for $\mathbf { f } _ { \pmb { \theta } }$ and $\mathbf { g } _ { \theta }$ . Error bars are computed over 5 pairs of models. (d) As we increase model size, linear similarity after convergence increases for both $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \pmb { \theta } }$ .
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: Text Embeddings by GPT-2. GPT-2 results. Representations of the last hidden layer (which is identifiable), in addition to three earlier layers (not necessarily identifiable) for four GPT-2 models. For each representation layer, SVCCA is computed over to all pairs of models, over which correlation coefficients were averaged. SVCCA was applied with 16, 64, 256 and 768 principal components. The learned representations in the last, identifiable layer more correlated than representations learned in preceding layers.
|
| 168 |
+
|
| 169 |
+
We next investigate high-dimensional, self-supervised representation learning on CIFAR-10 (Krizhevsky et al., 2009) using CPC (Oord et al., 2018; Hénaff et al., 2019). For a given input image, this model predicts the identity of a bottom image patch representation given a top patch representation (Figure 3a.) Here, S comprises the true patch with a set of distractor patches from across the current minibatch. For each model we define both $\mathbf { f } _ { \pmb { \theta } ^ { \prime } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ as a 3-layer MLP with 256 units per layer (except where noted otherwise) and fix output dimensionality of 64.
|
| 170 |
+
|
| 171 |
+
In Figure 3b, CCA coefficients are plotted over the course of training. As training progresses, alignment between the learned representations increases. In Figure 3c, we artificially limited the size of the dataset, and plot mean correlation after training and convergence. This shows that increasing availability of data correlates with closer alignment. In Figure 3d, we fix dataset size and artificially limit the model capacity (number hidden units) to investigate the effect of model size on the learned representations, varying the number of hidden units from 64 to 8192. This show that increasing model capacity correlates with increase in alignment of learned representations.
|
| 172 |
+
|
| 173 |
+
# 5.3 GPT-2
|
| 174 |
+
|
| 175 |
+
Finally, we report on a study of GPT-2 (Radford et al., 2019), a massive-scale language model. The identifiable representation is the set of features just before the last linear layer of the model. We use pretrained models from HuggingFace (Wolf et al., 2019). HuggingFace provides four different versions of the GPT-2: gpt2, gpt2-medium, gpt2-large and $\mathtt { g p t 2 - x 1 }$ , which differ mainly in the hyper-parameters that determine the width and depth of the neural network layers. For approximately 2000 input sentences, per timestep, for each model, we extracted representations at the last layer (which is identifiable) in addition to the representations per timestep given by three earlier layers in the model. Then, we performed SVCCA on each possible pair of models, on each of the four representations. SVCCA was performed with 16, 64, 256 and 768 principal components, computed by applying SVD separately for each representations of each model. We chose 768 as the largest number of principal components, since that is the representation size for the smallest model in the repository (gpt2). We then averaged the CCA correlation coefficients across the pairs of models. Figure 4 shows the results. The results align well with our theory, namely that the representations at the last layer are more linearly related than the representations at other layers of the model.
|
| 176 |
+
|
| 177 |
+
# 5.4 INTERPRETATION AND SUMMARY
|
| 178 |
+
|
| 179 |
+
Theorem 1 establishes linear identifiability as an asymptotic property of a model that holds in the limit of infinite data and exact estimation. The experiments of this section have shown that for linear identifiable models, when the dimensionality is small relative to dataset size (Figures 1 and 2), the learned embeddings are closely linearly related, up to noise. Problems of model estimation and sufficient dataset size are more pronounced in high dimensions. Nevertheless, in GPT2, representations among different trained models do in fact approach a mean correlation coefficient of 1.0 after training (Figure 4, blue line), providing strong evidence of linear identifiability.
|
| 180 |
+
|
| 181 |
+
# 6 RELATED WORKS
|
| 182 |
+
|
| 183 |
+
Prior to Hyvärinen and Morioka (2016), identifiability analysis was uncommon in deep learning. We build on advances in the theory of nonlinear ICA (Hyvärinen and Morioka, 2016; Hyvärinen et al., 2018; Khemakhem et al., 2019). In this section, we carefully distinguish our results from prior and concurrent works. Our diversity assumption is similar to diversity assumptions in these earlier works, while differing on certain conditions. The main difference is that their results apply to related but distinct families of models compared to the general discriminative family outlined in this paper. Arguably most related is Theorem 3 of Hyvärinen et al. (2018) and its proof, which shows that a class of contrastive discriminative models will estimate, up to an affine transformation, the true latent variables of a nonlinear ICA model. The main difference with our result is that they additionally assume: (1) that the mapping between observed variables and latent representations is invertible; and (2) that the discriminative model is binary logistic regression exhibiting universal approximation (Hornik et al., 1989), estimated with a contrastive objective. In addition, (Hyvärinen et al., 2018) does not present conditions for affine identifiability for their version of the context representation function g. It should be noted that Theorem 1 in (Hyvärinen et al., 2018) provides a potential avenue for further generalization of our theorem 1 to discriminative models with non-linear interaction between f and g.
|
| 184 |
+
|
| 185 |
+
Concurrent work (Khemakhem et al., 2020) has expanded the theory of identifiable nonlinear ICA to a class of conditional energy-based models (EBMs) with universal density approximation capability, therefore imposing milder assumptions than previous nonlinear ICA results. Their version of affine identifiability is similar to our result of linear identifiability in Section 3.2. The main differences are that Khemakhem et al. (2020) focus in both theory and experiment on EBMs. This allows for alternative versions of the diversity condition, assuming that the Jacobians of their versions of f or g are full rank. This is only possible if $\mathbf { x }$ or y are assumed continuous-valued; note that we do not make such an assumption. Khemakhem et al. (2020) also presents an architecture for which the conditions provably hold, in addition to sufficient conditions for identifiability up to element-wise scaling, which we did not explore in this work. While we build on these earlier results, we are, to the best of our knowledge, the first to apply identifiability analysis to state-of-the-art discriminative and autoregressive generative models.
|
| 186 |
+
|
| 187 |
+
# 7 CONCLUSION
|
| 188 |
+
|
| 189 |
+
We have shown that representations learned by a large family of discriminative models are identifiable up to a linear transformation, providing a novel perspective on representation learning using DNNs. Since identifiability is a property of a model class, and identification is realized in the asymptotic limit of data and compute, we perform experiments in the more realistic setting with finite datasets and finite compute. Our empirical results show that as the representational capacity of the model and dataset size increases, learned representations indeed tend towards solutions that are equal up to only a linear transformation.
|
| 190 |
+
|
| 191 |
+
REFERENCES
|
| 192 |
+
J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, and S. Wandermanmilne. Jax: Composable transformations of Python+NumPy programs, 2018. URL Http: //Github.Com/Google/Jax.
|
| 193 |
+
T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, and Others. Language Models are Few-Shot Learners. Arxiv Preprint Arxiv:2005.14165, 2020.
|
| 194 |
+
C. Chelba, T. Mikolov, M. Schuster, Q. Ge, T. Brants, P. Koehn, and t. Robinson. One Billion Word Benchmark for Measuring Progress in Statistical Language Modeling. Arxiv Preprint Arxiv:1312.3005, 2013.
|
| 195 |
+
A. M. Dai and Q. V. Le. Semi-Supervised Sequence Learning. In Advances in Neural information Processing Systems, pages 3079–3087, 2015.
|
| 196 |
+
J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Arxiv Preprint Arxiv:1810.04805, 2018.
|
| 197 |
+
D. Erhan, Y. Bengio, A. Courville, P.-A. Manzagol, P. Vincent, and S. Bengio. Why Does Unsupervised Pre-training Help Deep Learning? Journal of Machine Learning Research, 11(Feb):625–660, 2010.
|
| 198 |
+
O. J. Hénaff, A. Razavi, C. Doersch, S. Eslami, and A. V. D. Oord. Data-Efficient Image Recognition with Contrastive Predictive Coding. Arxiv Preprint Arxiv:1905.09272, 2019.
|
| 199 |
+
S. Hochreiter and J. Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8):1735–1780, 1997.
|
| 200 |
+
E. Hoffer and N. Ailon. Deep Metric Learning Using Triplet Network. In International Workshop On Similarity-Based Pattern Recognition, pages 84–92. Springer, 2015.
|
| 201 |
+
K. Hornik, M. Stinchcombe, and H. White. Multilayer Feedforward Networks are Universal Approximators. Neural Networks, 2(5):359–366, 1989.
|
| 202 |
+
H. Hotelling. Relations Between Two Sets of Variates. Biometrika, 28(3/4):321–377, 1936.
|
| 203 |
+
A. Hyvärinen and H. Morioka. Unsupervised Feature Extraction by Time-Contrastive Learning and Nonlinear ICA. In Advances in Neural information Processing Systems, pages 3765–3773, 2016.
|
| 204 |
+
A. Hyvärinen, H. Sasaki, and R. E. Turner. Nonlinear ICA Using Auxiliary Variables and Generalized Contrastive Learning. Arxiv Preprint Arxiv:1805.08651, 2018.
|
| 205 |
+
F. Johansson, U. Shalit, and D. Sontag. Learning representations for counterfactual inference. In International conference on machine learning, pages 3020–3029, 2016.
|
| 206 |
+
I. Khemakhem, D. P. Kingma, and A. Hyvärinen. Variational Autoencoders and Nonlinear ICA: A Unifying Framework. Arxiv Preprint Arxiv:1907.04809, 2019.
|
| 207 |
+
I. Khemakhem, R. P. Monti, D. P. Kingma, and A. Hyvärinen. ICE-BeeM: Identifiable Conditional Energy-based Deep Models. Arxiv Preprint Arxiv:2002.11537, 2020.
|
| 208 |
+
D. P. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. Arxiv Preprint Arxiv:1412.6980, 2014.
|
| 209 |
+
A. Krizhevsky, G. Hinton, and Others. Learning Multiple Layers of Features from Tiny Images. 2009.
|
| 210 |
+
P. J. Liu, M. Saleh, E. Pot, B. Goodrich, R. Sepassi, L. Kaiser, and N. Shazeer. Generating Wikipedia by Summarizing Long Sequences. Arxiv Preprint Arxiv:1801.10198, 2018.
|
| 211 |
+
C. Louizos, U. Shalit, J. M. Mooij, D. Sontag, R. Zemel, and M. Welling. Causal effect inference with deep latent-variable models. In Advances in Neural Information Processing Systems, pages 6446–6456, 2017.
|
| 212 |
+
Under review as a conference paper at ICLR 2021
|
| 213 |
+
T. Mikolov, M. Karafiát, L. Burget, J. Cernock ˇ y, and S. Khudanpur. Recurrent Neural Network Based \` Language Model. In Eleventh Annual Conference of The international Speech Communication Association, 2010.
|
| 214 |
+
T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed Representations of Words and Phrases and their Compositionality. In Advances in Neural information Processing Systems, pages 3111–3119, 2013.
|
| 215 |
+
A. Mnih and G. E. Hinton. A Scalable Hierarchical Distributed Language Model. In Advances in Neural information Processing Systems, pages 1081–1088, 2009.
|
| 216 |
+
A. Mnih and Y. W. Teh. A Fast and Simple Algorithm for Training Neural Probabilistic Language Models. Arxiv Preprint Arxiv:1206.6426, 2012.
|
| 217 |
+
A. S. Morcos, M. Raghu, and S. Bengio. Insights on Representational Similarity in Neural Networks with Canonical Correlation, 2018.
|
| 218 |
+
A. V. D. Oord, Y. Li, and O. Vinyals. Representation Learning with Contrastive Predictive Coding. Arxiv Preprint Arxiv:1807.03748, 2018.
|
| 219 |
+
K. Pearson. LIII. On Lines and Planes of Closest Fit to Systems of Points in Space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559–572, 1901.
|
| 220 |
+
A. Radford, K. Narasimhan, T. Salimans, and I. Sutskever. Improving Language Understanding by Generative Pre-training. 2018.
|
| 221 |
+
A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language Models are Unsupervised Multitask Learners. Openai Blog, 1(8), 2019.
|
| 222 |
+
M. Raghu, J. Gilmer, J. Yosinski, and J. Sohl-Dickstein. SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and interpretability. In Advances in Neural information Processing Systems, pages 6076–6085, 2017.
|
| 223 |
+
A. Sharif Razavian, H. Azizpour, J. Sullivan, and S. Carlsson. CNN Features Off-the-Shelf: An Astounding Baseline for Recognition. In Proceedings of The Ieee Conference On Computer Vision and Pattern Recognition Workshops, pages 806–813, 2014.
|
| 224 |
+
K. Sohn. Improved Deep Metric Learning with Multi-class N-Pair Loss Objective. In Advances in Neural information Processing Systems, pages 1857–1865, 2016.
|
| 225 |
+
P. Sorrenson, C. Rother, and U. Köthe. Disentanglement by Nonlinear ICA with General Incompressible-flow Networks (Gin). Arxiv:2001.04872 [Cs, Stat], Jan. 2020.
|
| 226 |
+
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is All You Need. In Advances in Neural information Processing Systems, pages 5998– 6008, 2017.
|
| 227 |
+
P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol. Extracting and Composing Robust Features with Denoising Autoencoders. In Proceedings of The 25th international Conference On Machine Learning, pages 1096–1103, 2008.
|
| 228 |
+
T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, and J. Brew. Huggingface’s Transformers: State-of-the-art Natural Language Processing. Arxiv, Abs/1910.03771, 2019.
|
| 229 |
+
Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. Salakhutdinov, and Q. V. Le. XLNET: Generalized Autoregressive Pretraining for Language Understanding. Arxiv Preprint Arxiv:1906.08237, 2019.
|
| 230 |
+
|
| 231 |
+
# A REPRODUCING EXPERIMENTS AND FIGURES
|
| 232 |
+
|
| 233 |
+
In this section, we present training and optimization details needed to reproduce our empirical validation of Theorem 1. We also published notebooks and check-pointed weights for two crucial experiments that investigate the result in the small and massive scale regimes, for Figure 1 and GPT-2 (ANONYMIZED).
|
| 234 |
+
|
| 235 |
+
# A.1 FIGURE 1
|
| 236 |
+
|
| 237 |
+
We provide a Jupyter notebook and model checkpoints for reproducing Figure 1. Please refer to this for hyperparameter settings. In short, we implemented a model (Mnih and Teh, 2012) in the family of Section 2 and trained it on the Billion Word dataset (Chelba et al., 2013). This is illustrative of the property of Theorem 1 because the relatively modest size of the parameter space (see notebook) and massive dataset minimizes model convergence and data availability restrictions, e.g., approaches the asymptotic regime.
|
| 238 |
+
|
| 239 |
+
The word embedding space is 2-D for ease of visualization. We randomly selected a subset of words, mapped them into their learned embeddings, and visualized them as points in the left and middle panes. We then regress pane one onto pane two in order to learn the best linear transformation between them. Note that if the two are linear transformations of each other, regression will recover that transformation exactly.
|
| 240 |
+
|
| 241 |
+
# A.2 SIMULATION STUDY: CLASSIFICATION BY DNNS
|
| 242 |
+
|
| 243 |
+
For this experiment, we want to ensure that the chosen model can fit the data distribution exactly. Controlling this removes one possible factor that could prevent linear identifiability of learned representations despite the model formally having that property. We do this by making sure that the process that generates the dataset matches the model chosen to learn the relationships between inputs and labels.
|
| 244 |
+
|
| 245 |
+
This is achieved through the following algorithm. We first randomly assign initialization labels based on angular position, then fit two neural networks $f _ { \theta ^ { \star } }$ and $g _ { \pmb { \theta } ^ { \star } }$ to predict the final labels, using the discriminative model of Equation (1) and Appendix D.1. Both $f _ { \theta ^ { \star } }$ and $g _ { \pmb { \theta } ^ { \star } }$ 4-hidden-layer MLPs with two 64 unit layers and one 2-D bottle neck layer. After training these representation functions to convergence, generated new batch of points $\mathbf { x }$ , and used the trained networks to predict the ground truth labels y.
|
| 246 |
+
|
| 247 |
+
Finally, to conduct experiments, we chose $\mathbf { f } _ { \theta ^ { \prime } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ to be the same architecture as $\mathbf { f } _ { \theta ^ { \star } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \star } }$ . This ensures that the supervised classifier we attempted to learn would using the function approximators $\mathbf { f } _ { \pmb { \theta } ^ { \prime } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ would be able to capture the true data generating process, e.g, would not fail due to too few hidden units, or too complex a relationship between targets and inputs.
|
| 248 |
+
|
| 249 |
+
Remaining training details are as follows. We optimize weights using Adam with a learning rate of $1 0 ^ { - 4 }$ for $5 * 1 0 ^ { 4 }$ iterations. To make the classification problem more challenging, we additionally add 20 input dimensions of random noise to the data. The Adam optimizer Kingma and Ba (2014) with a learning rate of $3 \cdot 1 0 ^ { - 4 }$ is used.
|
| 250 |
+
|
| 251 |
+
# A.3 SELF-SUPERVISED LEARNING FOR IMAGE CLASSIFICATION
|
| 252 |
+
|
| 253 |
+
To compute linear similarity between representations, we train two independent models in parallel. For each model we define both $\mathbf { f } _ { \pmb { \theta } }$ and $\mathbf { g } _ { \theta }$ as a 3-layer fully connected neural network with $\bar { 2 } ^ { 8 }$ units per layer and a fixed output dimensionality of $2 ^ { 6 }$ . We define our model following Equation (1), where $S$ is the set of the other image patches from the current minibatch and optimize the objective of (Hénaff et al., 2019). We augment both sampled patches independently with randomized brightness, saturation, hue, and contrast adjustments, following the recipe of (Hénaff et al., 2019). We train on the CIFAR10 dataset (Krizhevsky et al., 2009) with batchsize $2 ^ { 8 }$ , using the Adam optimizer with a learning rate of $1 0 ^ { - 4 }$ and the JAX (Bradbury et al., 2018) software package. For each model, we early stop based on a validation loss failing to improve further.
|
| 254 |
+
|
| 255 |
+
Additional details about the experiments that generated Figure 3:
|
| 256 |
+
|
| 257 |
+
Figure 3 a. Patches are sampled randomly from training images.
|
| 258 |
+
|
| 259 |
+
Figure 3 b. For each model, we train for at most $3 * 1 0 ^ { 4 }$ iterations, early stopping when necessary based on validation loss.
|
| 260 |
+
|
| 261 |
+
Figure $_ { 3 \mathrm { ~ c ~ } }$ . For each model, we train for at most $3 * 1 0 ^ { 4 }$ iterations, early stopping when necessary based on validation loss.
|
| 262 |
+
|
| 263 |
+
Figure 3 d. Error bars show standard error computed over 5 pairs of models after $1 . 5 * 1 0 ^ { 4 }$ training iterations.
|
| 264 |
+
|
| 265 |
+
# A.4 GPT-2
|
| 266 |
+
|
| 267 |
+
We include all details through a notebook in the code release. Pretrained GPT-2 weights as specified in the main text are publicly available from HuggingFace Wolf et al. (2019).
|
| 268 |
+
|
| 269 |
+
# A.5 REMARK ON EFFECT OF INITIALIZATION AND HYPERPARAMETERS OF MODELS
|
| 270 |
+
|
| 271 |
+
One question that may be of interest is whether initialization affects whether learned representations will be within a linear transformation of each other. This depends on whether the optimization routines (like Adam, AdaGrad, etc.) are robust to wider initialization within a certain range. If so, model convergence will be unaffected. However, this cannot make up for poor initialization or poor optimization: just as in any deep neural network, a poor initialization and inadequate optimizer will interfere with learning the model parameters. In the case of a linearly identifiable model, means that the learned representations would not live within a linear transformation of each other (up to noise from model fitting), since the models have failed to converge to a reasonable solution for the task at hand.
|
| 272 |
+
|
| 273 |
+
When the hyperparameters of a DNN are changed, this changes the class of functions that the network can represent (i.e., the size and stride of convolution filters will change which input pixels could be correlated in deeper layers). Typically, hyperparameters are carefully tuned using cross validation based on held-out data. We did so in our experiments also. We expect that such a tuning procedure would yield hyperparameters that are as good as possible for the model to be optimized, allowing sufficient optimization so that the linear identifiability of the learned representations is realized. If the hyperparameters are sufficiently bad and optimization suffers, this will interfere with model fitting, and with linear identifiability of the learned representations also.
|
| 274 |
+
|
| 275 |
+
# B PROOF THAT LINEAR SIMILARITY IS AN EQUIVALENCE RELATION
|
| 276 |
+
|
| 277 |
+
We claim that $\stackrel { \mathrm { L } } { \sim }$ is an equivalence relation. It suffices to show that it is reflexive, transitive, and symmetric.
|
| 278 |
+
|
| 279 |
+
Proof. Consider some function $\mathbf { g } _ { \pmb { \theta } }$ and some $\pmb { \theta } ^ { \prime } , \pmb { \theta } ^ { \star } , \pmb { \theta } ^ { \dagger } \subset \Theta$ . Suppose $\theta ^ { \prime } \stackrel { \scriptscriptstyle \perp } { \sim } \theta ^ { \star }$ . Then, there exists an invertible matrix $\mathbf { B }$ such that $\mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = \mathbf { B } \mathbf { g } _ { \pmb { \theta } ^ { \star } } ( \mathbf { x } )$ . Since ${ \bf g } _ { \pmb { \theta } ^ { \star } } ( { \bf x } ) = { \bf B } ^ { - 1 } { \bf g } _ { \pmb { \theta } ^ { \prime } } ( { \bf x } )$ , $\stackrel { \mathrm { L } } { \sim }$ is symmetric. Reflexivity follows from setting $\mathbf { g } _ { \pmb { \theta } ^ { \star } }$ to $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ and $\mathbf { B }$ to the identity matrix. To show transitivity, suppose also that $\smash { \theta ^ { \star } \stackrel { \scriptscriptstyle \perp } { \sim } \theta ^ { \dagger } }$ . Then, there exists an invertible $\mathbf { C }$ such that $\mathbf { g } _ { \pmb { \theta } ^ { \star } } ( \mathbf { x } ) = \mathbf { C } \mathbf { g } _ { \pmb { \theta } ^ { \dagger } } ( \mathbf { x } )$ . Since $\mathbf { g } _ { \pmb { \theta } ^ { \prime } } \overset { \mathtt { L } } { \sim } \mathbf { g } _ { \pmb { \theta } ^ { \star } }$ , $\mathbf { B } ^ { - 1 } \mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = \mathbf { C } \mathbf { g } _ { \pmb { \theta } ^ { \dagger } } ( \mathbf { x } )$ . Rearranging terms, ${ \bf g } _ { \theta ^ { \prime } } ( { \bf x } ) = { \bf B } { \bf C } { \bf g } _ { \theta ^ { \dagger } } ( { \bf x } )$ , so that $\pmb { \theta } ^ { \prime } \sim \pmb { \theta } ^ { \dagger }$ as required.
|
| 280 |
+
|
| 281 |
+
# C SECTION 3.2 CONTINUED: CASE OF CONTEXT REPRESENTATION FUNCTION g
|
| 282 |
+
|
| 283 |
+
Our derivation of identifiability of $\mathbf { g } _ { \theta }$ is similar to the derivation of $\mathbf { f } _ { \pmb { \theta } }$ . The primary difference is that the normalizing constants in Equation (6) do not cancel out. First, note that we can rewrite Equation 1 as:
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) = \exp ( \widetilde { \mathbf { f } _ { \pmb { \theta } } } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } _ { \pmb { \theta } } ( \mathbf { y } ) )
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
where:
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\begin{array} { r l } & { \displaystyle \widetilde { \mathbf { f } _ { \theta } } ( \mathbf { x } , \mathbf { S } ) = \left[ - Z ( \mathbf { x } , \mathbf { S } ) ; \mathbf { f } _ { \theta } ( \mathbf { x } ) \right] } \\ & { \quad \widetilde { \mathbf { g } _ { \theta } } ( \mathbf { y } ) = \left[ 1 ; \mathbf { g } _ { \theta } ( \mathbf { y } ) \right] } \\ & { \displaystyle Z ( \mathbf { x } , \mathbf { S } ) = \log \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ^ { \prime } ) ) . } \end{array}
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
Below, we will show that for the model family defined in Section 2,
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\begin{array} { r } { p _ { \pmb { \theta } ^ { \prime } } = p _ { \pmb { \theta } ^ { * } } \quad \Longrightarrow \quad \mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } ) = \mathbf { B } \mathbf { g } _ { \pmb { \theta } ^ { \star } } ( \mathbf { y } ) , } \end{array}
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
where $\mathbf { B }$ is an invertible $( M \times M )$ -dimensional matrix, concluding the proof of the linear identifiability of models in the family defined by Equation (1). We adopt the same shorthands as in the main text.
|
| 302 |
+
|
| 303 |
+
# C.1 DIVERSITY CONDITION
|
| 304 |
+
|
| 305 |
+
We assume that for any $( \theta ^ { \prime } , \theta ^ { \ast } ) \subset \Theta$ for which it holds that $p ^ { \prime } = p ^ { * }$ , and for any given $\mathbf { y }$ , there exist $M + 1$ tuples $\{ ( \mathbf { x } ^ { ( i ) } , \mathbf { S } ^ { ( i ) } ) \} _ { i = 0 } ^ { M }$ , such that $p _ { \mathcal { D } } ( \mathbf { x } ^ { ( i ) } , \mathbf { y } , \mathbf { S } ^ { ( i ) } ) > 0$ , and such that the $( ( M + 1 ) \times ( M + 1 ) )$ matrices $\mathbf { M } ^ { \prime }$ and $\mathbf { M } ^ { \ast }$ are invertible, where $\mathbf { M } ^ { \prime }$ consists of columns $\widetilde { \mathbf { f } } ^ { \prime } ( \mathbf { x } ^ { ( i ) } , \mathbf { S } ^ { ( i ) } )$ , and $\mathbf { M } ^ { * }$ consists of columns $\widetilde { \mathbf { f } } ^ { * } ( \mathbf { x } ^ { ( i ) } , \mathbf { S } ^ { ( i ) } )$ .
|
| 306 |
+
|
| 307 |
+
This is similar to the diversity condition of Section 3.2 but milder, since a typical dataset will have multiple $\mathbf { x }$ for each $\mathbf { y }$ .
|
| 308 |
+
|
| 309 |
+
# C.2 PROOF
|
| 310 |
+
|
| 311 |
+
With the data distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ , for a given $\mathbf { y }$ , there exists a conditional distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { S } | \mathbf { y } )$ Let $( \mathbf { x } , \mathbf { S } )$ be a sample from this distribution. From equation 1 and the statement to prove, it follows that:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
p ^ { \prime } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) = p ^ { * } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Substituting in the definition of our model from equation (9), we find:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\exp ( \widetilde { \mathbf { f } } ^ { \prime } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) ) = \exp ( \widetilde { \mathbf { f } } ^ { * } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) ) ,
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
which, evaluating logarithms, becomes
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\widetilde { \mathbf { f } } ^ { \prime } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \widetilde { \mathbf { f } } ^ { * } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) ,
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
which is true for any triple $( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ where $p _ { \mathcal { D } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) > 0$ .
|
| 330 |
+
|
| 331 |
+
From $\mathbf { M } ^ { \prime }$ and $\mathbf { M } ^ { * }$ (Section C.1) and equation 16 we form a linear system of equations, collecting the $M + 1$ relationships together:
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r } { \mathbf { M ^ { \prime } } ^ { \top } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \mathbf { M ^ { * } } ^ { \top } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) } \\ { \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \mathbf { A } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) , \quad } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
where $\mathbf { A } = ( \mathbf { M } ^ { * } \mathbf { M } ^ { \prime - 1 } ) ^ { \top }$ , an invertible $( M + 1 ) \times ( M + 1 )$ matrix.
|
| 338 |
+
|
| 339 |
+
It remains to show the existence of an invertible $M \times M$ matrix $\mathbf { B }$ such that
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\mathbf { g } ^ { \prime } ( \mathbf { y } ) = \mathbf { B } \mathbf { g } ^ { * } ( \mathbf { y } ) .
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
We proceed by constructing $\mathbf { B }$ from A. Since A is invertible, there exist $j$ elementary matrices $\{ \mathbf { E } _ { 1 } , \hdots , \mathbf { E } _ { j } \}$ such that their action $\mathbf { R } = \mathbf { E } _ { j } \mathbf { E } _ { j - 1 } \ldots \mathbf { E } _ { 1 }$ converts $\mathbf { A }$ to a (non-unique) row echelon form. Without loss of generality, we build $\mathbf { R }$ such that the $^ { a _ { 1 , 1 } }$ entry of $\mathbf { A }$ is the first pivot, leading to the particular row echelon form:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\mathbf { R A } = \left[ \begin{array} { c c c c c c } { a _ { 1 , 1 } } & { a _ { 1 , 2 } } & { a _ { 1 , 3 } } & { . . . } & { a _ { 1 , m \times 1 } } \\ { 0 } & { \tilde { a } _ { 2 , 2 } } & { \tilde { a } _ { 2 , 3 } } & { . . . } & { \tilde { a } _ { 2 , m \times 1 } } \\ { 0 } & { 0 } & { \tilde { a } _ { 3 , 3 } } & { . . . } & { \tilde { a } _ { 2 , m \times 1 } } \\ { \vdots } & { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { 0 } & { 0 } & { . . . } & { 0 } & { \tilde { a } _ { m \times 1 , m \times 1 } } \end{array} \right] ,
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
where $\tilde { a } _ { i , j }$ indicates that the corresponding entry in RA may differ from A due to the action of $\mathbf { R }$ Applying $\mathbf { R }$ to Equation (17), we have
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\mathbf { R } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \mathbf { R } \mathbf { A } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
We now show that removing the first row and column of RA and $\mathbf { R }$ generates matrices of rank $M$ . Let $\overline { { \mathbf { R A } } }$ and $\overline { { \mathbf { R } } }$ denote the $( M \times M )$ submatrices formed by removing the first row and column of RA and $\mathbf { R }$ respectively.
|
| 358 |
+
|
| 359 |
+
Equation (20) shows that $\overline { { { \bf R } { \bf A } } }$ has a pivot in each column, and thus has rank $M$ . To show that $\overline { { \mathbf { R } } }$ is invertible, we must show that removing the first row and column reduces the rank of $\mathbf { R } = \mathbf { E } _ { j } \mathbf { E } _ { j - 1 } \ldots \mathbf { E } _ { 1 }$ by exactly 1. Clearly, each $\mathbf { E } _ { k }$ is invertible, and their composition is invertible. We must show the same for the composition of $\overline { { \mathbf { E } _ { k } } }$ .
|
| 360 |
+
|
| 361 |
+
There are three cases to consider, corresponding to the three unique types of elementary matrices. Each elementary matrix acts on A by either (1) swapping rows $i$ and $j$ , (2) replacing row $j$ by a multiple $m$ of itself, or (3) adding a multiple $m$ of row $i$ to row $j$ . We denote elementary matrix types by superscripts.
|
| 362 |
+
|
| 363 |
+
In Case (1), $\mathbf { E } _ { k } ^ { 1 }$ is an identity matrix with row $i$ and row $j$ swapped. For Case (2), $\mathbf { E } _ { l } ^ { 2 }$ is an identity matrix with the $j , j ^ { t h }$ entry replaced by some $m$ . For each $\mathbf { E } _ { k } ^ { 1 }$ and $\mathbf { E } _ { l } ^ { 2 }$ in $\mathbf { R }$ , where $1 \leq k , l \leq j$ , we know that the indices $i , j \geq 2$ , because we chose the first entry of the first row of $\mathbf { A }$ to be the pivot, and hence do not swap the first row, or replace the first row by itself multiplied by a constant. This implies that removing the first row and column of $\mathbf { E } _ { k } ^ { 1 }$ and $\mathbf { E } _ { l } ^ { \bar { 2 } }$ removes a pivot entry 1 in the $( 1 , 1 )$ position, and removes zeros elsewhere. Hence, the $( M \times M )$ submatrices $\overline { { \mathbf { E } _ { k } ^ { 1 } } }$ and $\overline { { \mathbf { E } _ { l } ^ { 2 } } }$ are elementary matrices with rank $M$ .
|
| 364 |
+
|
| 365 |
+
For Case (3), $\mathbf { E } _ { k } ^ { 3 }$ has some value $m \in \mathbb { R }$ in the $j , i ^ { t h }$ entry, and 1s along the diagonal. In this case, we may find a non-zero entry in some $\mathbf { E } _ { k } ^ { 3 }$ , so that, e.g., the second row has a pivot at position $( 2 , 2 )$ . Without loss of generality, suppose $i = 1$ , $j = 2$ and let $m$ be some nonzero constant. Removing the first row and column of ${ \bf E } _ { 1 } ^ { 3 }$ removes this $m$ also. Nevertheless, $\overline { { \mathbf { E } _ { 1 } ^ { 3 } } } = \mathbf { I } _ { M }$ , the rank $M$ identity matrix. For any other $\mathbf { E } _ { k } ^ { 3 } \ 1 < i \leq M + 1$ , $j \geq 2$ because we chose $^ { a _ { 1 , 1 } }$ as the first pivot, and hence do not swap the first row, or replace the first row by itself multiplied by a constant. In both cases, removing the first row and first column creates an $\overline { { \mathbf { E } _ { k } ^ { 3 } } }$ that is a rank $M$ elementary matrix.
|
| 366 |
+
|
| 367 |
+
We have shown by the above that $\overline { { \mathbf { R } } }$ is a composition of rank $M$ matrices. We now construct the matrix $\mathbf { B }$ by removing the first entries of $\widetilde { \mathbf { g } } ^ { \prime }$ and $\widetilde { \mathbf { g } } ^ { \star }$ , and removing the first row and first column of $\mathbf { R }$ e eand RA in Equation (equation 21). Then, we have
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\begin{array} { r l } & { \overline { { { \bf R } } } { \bf g } ^ { \prime } ( { \bf y } ) = \overline { { { \bf R } { \bf A } } } { \bf g } ^ { * } ( { \bf y } ) , } \\ & { { \bf g } ^ { \prime } ( { \bf y } ) = \overline { { { \bf R } } } ^ { - 1 } \overline { { { \bf R } { \bf A } } } { \bf g } ^ { * } ( { \bf y } ) . } \end{array}
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Choosing ${ \bf B } = \overline { { { \bf R } } } ^ { - 1 } \overline { { { \bf R } { \bf A } } }$ proves the result.
|
| 374 |
+
|
| 375 |
+
# D REDUCTIONS TO CANONICAL FORM OF EQUATION (1)
|
| 376 |
+
|
| 377 |
+
In the following, we show membership in the model family of Equation 1 using the mathematical notation of the papers under discussion in Section 4. Note that each subsection will change notation to match the papers under discussion, which varies quite widely. We employ the following colour-coding scheme to aid in clarity:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\log p _ { \theta } ( \mathbf { y } \vert \mathbf { x } , \mathbf { S } ) = \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ) - \log \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ^ { \prime } ) ) ,
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
where $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ is generalized to a data representation function, $\mathbf { g } _ { \boldsymbol { \theta } } ( \mathbf { y } )$ is generalized to a context representation function, and $\begin{array} { r } { \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ^ { \prime } ) ) } \end{array}$ is some constant.
|
| 384 |
+
|
| 385 |
+
# D.1 SUPERVISED CLASSIFICATION
|
| 386 |
+
|
| 387 |
+
Supervised classifiers commonly employ a neural network feature extractor followed by a linear projection of the output of this network into a space of unnormalized logits. All the layers prior to the logits are the representation function $\mathbf { f } _ { \theta }$ , and the final projection layer is the context map $\mathbf { g } _ { \pmb { \theta } } ( y = i ) = \mathbf { w } _ { i }$ , where $\mathbf { w } _ { i }$ is the $i$ -th column of a weight matrix W. The set S in this case contains human-chosen labels and has no stochasticity. The loss function is the negative log-likelihood of the data under a categorical distribution with a softmax parameterization:
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\log p _ { \pmb { \theta } } ( y = i | \mathbf { x } ; \mathbf { S } ) = \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } ) ^ { \top } \pmb { w } _ { i } - \varinjlim \sum _ { j = 1 } ^ { | \mathbf { S } | } \exp ( \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } ) ^ { \top } \pmb { w } _ { j } )
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Supervised classification is thus an member of the family defined in Section 2. It exhibits the simplest functional form for the $\mathbf { g }$ function while allowing f to be arbitrarily complicated.
|
| 394 |
+
|
| 395 |
+
# D.2 CPC
|
| 396 |
+
|
| 397 |
+
Consider a sequence of points $\mathbf { x } _ { t }$ . We wish to learn the parameters $\phi$ to maximize the $k$ -step ahead predictive distribution $p ( \mathbf { x } _ { t + k } | \mathbf { x } _ { t } , \phi )$ . In the image patch example, each patch center $i , j$ is indexed by $t$ . Each $\mathbf { x } _ { t }$ is mapped to a sequence of feature vectors $z _ { t } = f _ { \theta } ( \mathbf { x } _ { t } )$ An autoregressive model, already updated with the previous latent representations $z _ { \leq t - 1 }$ , transforms the ${ \boldsymbol { z } } _ { t }$ into a “context" latent representation ${ \bf c } _ { t } = g _ { A R } ( z _ { \leq t } )$ . Instead of predicting future observations $k$ steps ahead, $\mathbf { x } _ { t + k }$ , directly through a generative model $\dot { p } _ { k } \big ( \mathbf { x } _ { t + k } | \mathbf { c } _ { t } \big )$ , Oord et al. (2018) model a density ratio in order to preserve the mutual information between $\mathbf { x } _ { t + k }$ and $\mathbf { c } _ { t }$ .
|
| 398 |
+
|
| 399 |
+
Objective Let $\mathbf { X } = \{ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } \}$ be a set of $N$ random samples containing one positive sample from $p ( \mathbf { x } _ { t + k } | \mathbf { c } _ { t } )$ and $N - 1$ samples from the proposal distribution $p ( \mathbf { x } _ { t + k } )$ . Oord et al. (2018) define the following link function: $l _ { k } ( \mathbf { x } _ { t + k } , \mathbf { c } _ { t } ) \triangleq \exp \left( \mathbf { z } _ { t + k } ^ { \intercal } \mathbf { W } _ { k } \mathbf { c } _ { t } \right)$ . Then, CPC optimizes
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
- \mathbb { E } _ { \mathbf { X } } \left[ \log \frac { l _ { k } ( \mathbf { x } _ { t + k } , \mathbf { c } _ { t } ) } { \sum _ { x _ { j } \in X } l _ { k } ( \mathbf { x } _ { j } , \mathbf { c } _ { t } ) } \right] = - \mathbb { E } _ { \mathbf { X } } \left[ \log \frac { \exp \left( \mathbf { z } _ { t + k } \mathbf { \Xi } ^ { \top } \mathbf { W } _ { k } \mathbf { c } _ { t } \right) } { \sum _ { \mathbf { x } _ { j } \in \mathbf { X } } \exp \left( \mathbf { z } _ { j } ^ { \top } \mathbf { W } _ { k } \mathbf { c } _ { t } \right) } \right] .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Substituting in the definition of $l _ { k }$ makes equation (24) identical to the model family (Equation 1).
|
| 406 |
+
|
| 407 |
+
D.3 AUTOREGRESSIVE LANGUAGE MODELS (E.G. GPT-2)
|
| 408 |
+
|
| 409 |
+
Let ${ \mathcal { U } } = \{ u _ { 1 } , \ldots , u _ { n } \}$ be a corpus of tokens. Autoregressive language models maximize a loglikelihood $\begin{array} { r } { \dot { L } ( \mathcal { U } ) = \sum _ { i = 1 } ^ { n } \log P ( u _ { i } | u _ { i - k } , \dots , u _ { i - 1 } ; \Theta ) } \end{array}$ , Concretely, the conditional density is modelled as
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\begin{array} { r } { \log P ( u _ { i } | u _ { i - k : i - 1 } ; \Theta ) \qquad } \\ { = \mathbf { W } _ { i : } \mathbf { h } _ { i } - \log \displaystyle \sum _ { j } \exp ( \mathbf { W } _ { j : } \mathbf { h } _ { i } ) , } \end{array}
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
where $\mathbf { h } _ { i }$ is the $m \times 1$ output of a function approximator (e.g. a Transformer decoder (Liu et al., 2018)), and $\mathbf { W } _ { i }$ : is the $i$ ’th row of the $| \mathcal { U } | \times m$ token embedding matrix.
|
| 416 |
+
|
| 417 |
+
# D.4 BERT
|
| 418 |
+
|
| 419 |
+
Consider a sequence of text $\mathbf x = [ x _ { 1 } , \dots , x _ { T } ]$ . Some proportion of the symbols in $\mathbf { x }$ are extracted into a vector $\bar { \bf x }$ , and then set in $\mathbf { x }$ to a special null symbol, “corrupting" the original sequence. This operation generates the corrupted sequence $\mathbf { \underline { { x } } }$ . The representational learning task is to predict $\bar { \bf x }$ conditioned on $\mathbf { \underline { { x } } }$ , that is, to maximize w.r.t. $\pmb { \theta }$ ¯:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\log p _ { \theta } ( \bar { \mathbf { x } } | \mathbf { x } ) \approx \sum _ { t = 1 } ^ { T } m _ { t } \log p _ { \theta } ( x _ { t } | \mathbf { x } ) = \sum _ { t = 1 } ^ { T } m _ { t } \Biggl ( \overline { { H _ { \theta } ( \mathbf { x } ) _ { t } } } ^ { \top } e ( x _ { t } ) - \log \sum _ { x ^ { \prime } } \exp \left( H _ { \theta } ( \mathbf { x } ) _ { t } ^ { \top } e ( x ^ { \prime } ) \right) \Biggr ) ,
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
where $H$ is a transformer, $e$ is a lookup table, and $m _ { t } = 1$ if symbol $x _ { t }$ is masked. That is, corrupted symbols are “reconstructed" by the model, meaning that their index is predicted. As noted in Yang et al. (2019), BERT models the joint conditional probability $p ( { \bar { \mathbf { x } } } | \mathbf { x } )$ as factorized so that each masked token is separately reconstructed. This means that the log likelihood is approximate instead of exact.
|
| 426 |
+
|
| 427 |
+
# D.5 QUICKTHOUGHT VECTORS
|
| 428 |
+
|
| 429 |
+
Let f and $\mathbf { g }$ be functions that take a sentence as input and encode it into an fixed length vector. Let $s$ be a given sentence, and $S _ { c t x t }$ be the set of sentences appearing in the context of $s$ for a fixed context size. Let $S _ { c a n d }$ be the set of candidate sentences considered for a given context sentence $s _ { c t x t } \in S _ { c t x t }$ . Then, $S _ { c a n d }$ contains a valid context sentence $s _ { c t x t }$ as well as many other non-context sentences. $S _ { c a n d }$ is used for the classification objective. For any given sentence position in the context of $s$ (for example, the preceding sentence), the probability that a candidate sentence $s _ { c a n d } \in S _ { c a n d }$ is the correct sentence for that position is given by
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\log p ( s _ { c a n d } | s , S _ { c a n d } ) = f _ { \theta } ( s ) ^ { \top } \underline { { { g } _ { \theta } ( s _ { c a n d } ) ) } } - \log \sum _ { s ^ { \prime } \in S _ { c a n d } } \exp \left( f _ { \theta } ( s ) ^ { \top } g _ { \theta } ( s _ { c a n d } ^ { \prime } ) \right) .
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
# D.6 DEEP METRIC LEARNING
|
| 436 |
+
|
| 437 |
+
The multi-class N-pair loss in Sohn (2016) is proportional to
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\log N - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( 1 + \sum _ { j \neq i } \exp \{ \mathbf { f } _ { \theta } ( { x _ { i } } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) - \mathbf { f } _ { \theta } ( { x _ { i } } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) ) \} \right) ,
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
which can be simplified as
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\begin{array} { l } { { \displaystyle - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) - \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) \} \right) } } \\ { { \displaystyle = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( \frac { 1 } { \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) - \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) \} } \right) } } \\ { { \displaystyle = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( \frac { \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) \} } { \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) \} } \right) . } } \end{array}
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
Setting $\mathbf { N }$ to 1 and evaluating the log gives
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\mathbf { f } _ { \pmb { \theta } } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \pmb { \theta } } ( y _ { i } ) - \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp ( \mathbf { f } _ { \pmb { \theta } } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \pmb { \theta } } ( y _ { j } ) ) ,
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
which is Equation 1 where $\mathbf { f } _ { \theta } = \mathbf { g } _ { \theta }$
|
| 456 |
+
|
| 457 |
+
# D.7 NEURAL PROBABILISTIC LANGUAGE MODELS (NPLMS)
|
| 458 |
+
|
| 459 |
+
Figure 1 shows results from a neural probabilistic language model as proposed in Mnih and Teh (2012). Mnih and Teh (2012) propose using a log-bilinear model (Mnih and Hinton, 2009) which, given some context $h$ , learns a context word vectors $r _ { w }$ and target word vectors $q _ { w }$ . Two different embedding matrices are maintained, in other words: one to capture the embedding of the word and the other the context. The representation for the context vectorlinear combination of the context words and a context weight matrix $\hat { q }$ , is thenso that . $C _ { i }$ $\begin{array} { r } { \hat { q } = \bar { \sum } _ { i = 1 } ^ { n - 1 } C _ { i } r _ { w _ { i } } } \end{array}$ The score for the match between the context and the next word is computed as a dot product, e.g., $s _ { \theta } ( w , h ) = \hat { q } ^ { \top } \tilde { q } _ { w } { } ^ { 1 }$ and substituting into the definition of $P _ { \theta } ^ { h } ( w )$ , we see that
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\log P _ { \theta } ^ { h } ( w ) = \boldsymbol { \hat { q } } ^ { \top } \boldsymbol { \tilde { q } } _ { w } - \log \sum _ { w ^ { \prime } } \exp \left( \boldsymbol { \hat { q } } ^ { \top } \boldsymbol { \tilde { q } } _ { w ^ { \prime } } \right)
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
shows that Mnih and Teh (2012) is a member of the model family.
|
| 466 |
+
|
| 467 |
+
Interestingly, a touchstone work in the area of NPLMs, Word2Vec (Mikolov et al., 2013), does not fall under the model family due to an additional nonlinearity applied to the score of Mnih and Teh (2012).
|
md/train/RJ7XFI15Q8f/RJ7XFI15Q8f.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Achieving Forgetting Prevention and Knowledge Transfer in Continual Learning
|
| 2 |
+
|
| 3 |
+
Zixuan $\mathbf { K } \mathbf { e } ^ { 1 }$ , Bing Liu1, Nianzu $\mathbf { M } \mathbf { a } ^ { 1 }$ , $\mathbf { H } \mathbf { u } \mathbf { X } \mathbf { u } ^ { 2 }$ and Lei $\mathbf { S h u ^ { 3 * } }$
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science, University of Illinois at Chicago 2Facebook AI Research 3Amazon AWS AI 1{zke4,liub,nma4}@uic.edu 2huxu@fb.com 3shulindt@gmail.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Continual learning (CL) learns a sequence of tasks incrementally with the goal of achieving two main objectives: overcoming catastrophic forgetting (CF) and encouraging knowledge transfer (KT) across tasks. However, most existing techniques focus only on overcoming CF and have no mechanism to encourage KT, and thus do not do well in KT. Although several papers have tried to deal with both CF and KT, our experiments show that they suffer from serious CF when the tasks do not have much shared knowledge. Another observation is that most current CL methods do not use pre-trained models, but it has been shown that such models can significantly improve the end task performance. For example, in natural language processing, fine-tuning a BERT-like pre-trained language model is one of the most effective approaches. However, for CL, this approach suffers from serious CF. An interesting question is how to make the best use of pre-trained models for CL. This paper proposes a novel model called CTR to solve these problems. Our experimental results demonstrate the effectiveness of CTR.2
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
This paper studies continual learning (CL) of a sequence of natural language processing (NLP) tasks in the task continual learning (Task-CL) setting. It aims to (i) prevent catastrophic forgetting (CF), and (ii) transfer knowledge across tasks. (ii) is particularly important because many tasks in NLP share similar knowledge that can be leveraged to achieve better accuracy. CF means that in learning a new task, the existing network parameters learned for the previous tasks may be modified, which degrades the performance of previous tasks [40]. In the Task-CL setting, the task id is provided for each test case in testing so that the specific model for the task in the network can be applied to classify the test case. Another popular CL setting is class continual learning, which does not provide the task id during testing but it is for solving a different type of problems.
|
| 14 |
+
|
| 15 |
+
Most existing CL papers focus on dealing with CF [21, 5]. There are also some papers that perform knowledge transfer. To achieve both objectives is highly challenging. To overcome CF in the Task-CL setting, we don’t want the training of the new task to update the model parameters learned for previous tasks to achieve model separation. But to transfer knowledge across tasks, we want the new task to leverage the knowledge learned from previous tasks for learning a better model (forward transfer) and also want the new task to enhance the performance of similar previous tasks (backward transfer).
|
| 16 |
+
|
| 17 |
+
This means it is necessary to update previous model parameters. This is a dilemma. Although several papers have tried to deal with both [22, 37], they were only tested using sentiment analysis tasks with strong shared knowledge. When tested with tasks that don’t have much shared knowledge, they suffer from severe CF (see Sec. 5.4). Those existing papers that focus on dealing with CF do not do well with knowledge transfer as they have no explicit mechanism to facilitate the transfer.
|
| 18 |
+
|
| 19 |
+
Another observation about the current CL research is that most techniques do not use pre-trained models. But such pre-trained models or feature extractors can significantly improve the CL performance [18, 24]. An important question is how to make the best use of pre-trained models in CL. This paper studies the problem as well using NLP tasks, but we believe that the developed ideas are also applicable to computer vision tasks because most pre-trained models are based on the transformer architecture [60]. We will see that the naive or the conventional way of directly adding the CL module on top of a pre-trained model is not the best choice (see Sec. 5.4).
|
| 20 |
+
|
| 21 |
+
In NLP, fine-tuning a BERT [8] like pre-trained language model has been regarded as one of the most effective techniques in applications [65, 57]. However, fine-tuning works poorly for continual learning. This is because the fine-tuned BERT for a task captures highly task-specific information [41], which is difficult to be used by other tasks. When fine-tuning for a new task, it has to update the already fine-tuned parameters for previous tasks, which causes serious CF (see Sec. 5.4).
|
| 22 |
+
|
| 23 |
+
This paper proposes a novel neural architecture to achieve both CF prevention and knowledge transfer, which also deals with the CF problem with BERT fine-tuning. The proposed system is called CTR (Capsules and Transfer Routing for continual learning). CTR inserts a continual learning plug-in (CL-plugin) module in two locations in BERT. With the pair of CL-plugin modules added to BERT, we no longer need to fine-tune BERT for each task, which causes CF in BERT, and yet we can achieve the power of BERT fine-tuning. CTR has some similarity to Adapter-BERT [16], which adds adapters in BERT for parameter efficient transfer learning such that different end tasks can have their separate adapters (which are very small in size) to adapt BERT for individual end tasks and to transfer the knowledge from BERT to the end tasks. Then, there is no need to employ a separate BERT and fine-tuning it for each task, which is extremely parameter inefficient if many tasks need to be learned. An adapter is a simple 2-layer fully-connected network for adapting BERT to a specific end task. A CL-plugin is very different from an adapter. We do not use a pair of CL-plugin modules to adapt BERT for each task. Instead, CTR learns all tasks using only one pair of CL-plugin modules inserted into BERT. A CL-plugin is a full CL network that can leverage a pre-trained model and deal with both CF and knowledge transfer. Specifically, it uses a capsule [15] to represent each task and a proposed transfer routing algorithm to identify and transfer knowledge across tasks to achieve improved accuracy. It further learns and uses task masks to protect task-specific knowledge to avoid forgetting. Empirical evaluations show that CTR outperforms strong baselines. Ablation experiments have also been conducted to study where to insert the CL-plugin module in BERT in order to achieve the best performance (see Sec. 5.4).
|
| 24 |
+
|
| 25 |
+
# 2 Related Work
|
| 26 |
+
|
| 27 |
+
Catastrophic Forgetting: Existing work in CL mainly focused on overcoming CF using the following approaches. (1) Regularization-based approaches, such as those in [27, 30, 51, 69], add a regularization in the loss to consolidate weights for previous tasks when learning a new task. (2) Replay-based approaches, such as those in [45, 36, 4, 63], retain some training data of old tasks and use them in learning a new task. The methods in [54, 20, 47, 14] learn data generators and generate old task data for learning a new task. (3) Parameter isolation-based approaches, such as those in [52, 21, 39, 10], allocate model parameters dedicated to different tasks and mask them out when learning a new task. (4) Gradient projection-based approaches [68] ensure the gradient updates occur only in the orthogonal direction to the input of old tasks and thus will not affect old tasks. Some recent papers used pre-trained models [18, 23, 24] and learn one class per task [18]. Tackling CF only deals with model deterioration. These methods perform worse than learning each task separately. An empirical study of the cause of CF and the impact of task similarity on CF was done in [44].
|
| 28 |
+
|
| 29 |
+
Some NLP applications have also dealt with CF. For example, CL models have been proposed for sentiment analysis [23, 24, 37, 43], dialogue slot filling [53], language modeling [58, 7], language learning [31], sentence embedding [33], machine translation [25], cross-lingual modeling [35], and question answering [12]. A dialogue CL dataset is also reported in [38].
|
| 30 |
+
|
| 31 |
+
Knowledge Transfer: Ideally, learning from a sequence of tasks should also allow multiple tasks to support each other via knowledge transfer. CAT [21] (a Task-CL system) works on a mixed sequence of similar and dissimilar tasks and can transfer knowledge among similar tasks detected automatically. Progressive Network [48] does forward transfer but it is for class continual learning (Class-CL).
|
| 32 |
+
|
| 33 |
+
Knowledge transfer in this paper is closely related to lifelong learning (LL), which aims to improve the new/last task learning without handling CF [56, 49, 5]. In the NLP area, NELL [3] performs LL information extraction, and several other papers worked on lifelong document sentiment classification (DSC) and aspect sentiment classification (ASC). [6] and [61] proposed two Naive Bayesian methods to help improve the new task learning. [64] proposed a LL approach based on voting. [55] used LL for aspect extraction. [43] and [62] used neural networks for DSC and ASC, respectively. Several papers also studied lifelong topic modeling [5, 13]. However, all these works do not deal with CF.
|
| 34 |
+
|
| 35 |
+
SRK [37] and KAN [22] try to deal with both CF and knowledge transfer in continual sentiment classification. However, they have two critical weaknesses: (i) Their RNN architectures cannot use plug-in or adapter modules to tune BERT, which significantly limits their power. (ii) Since they were mainly designed for knowledge transfer, they suffer from serious CF (see Sec. 5.4). B-CL [24] uses the adapter idea [16] to adapt BERT for sentiment analysis tasks, which are similar to each other. However, since its mechanism of dynamic routing for knowledge transfer is very week, its knowledge transfer ability is markedly poorer than CTR (see Sec. 5.4). CLASSIC [23] is another recent work on continual learning for knowledge transfer, but its CL setting is domain continual learning. Its knowledge transfer method is based on contrastive learning.
|
| 36 |
+
|
| 37 |
+
AdapterFusion [42] used adapters proposed in [16]. It proposes a two-stage method to learn a set of tasks. In the first stage, it learns one adapter for each task independently using the task’s training data. In the second stage, it uses the training data again to learn a good composition of the learned adapters in the first stage to produce the final model for all tasks. AdapterFusion basically tries to improve multi-task learning. It is not for continual learning and thus has no CF. As explained in Sec. 1, the CL-plugin concept in CTR is different from that of adapters for adapting BERT for each task. CL-plugins are continual learning systems that make use of a pre-trained model.
|
| 38 |
+
|
| 39 |
+
# 3 CTR Architecture
|
| 40 |
+
|
| 41 |
+
This section describes the general architecture of CTR. The details about its key component CLplugin is presented in the next section. Due to its good performance, BERT [8] and its transformer [60] architecture are used as the base in our model CTR. Since BERT fine-tuning is prone to CF (Sec. 1), we propose the CL plug-in idea, which is inspired by Adapter-BERT [16]. CL-plugin is a full continual learning module designed to interact with a pre-trained model, in our case, BERT.
|
| 42 |
+
|
| 43 |
+
Inserting CL-plugins in BERT. A commonly used method of leveraging a pre-trained model is to add the end task module on top of the pre-trained model. However, as explained in Sec. 1, fine-tuning the pre-trained model can cause serious CF for CL. The CL system PCL [18], which uses this approach, has the pre-trained model frozen to avoid forgetting. But as we will see in Sec. 5.4, this is not the best choice. CTR inserts the proposed CL-plugin in two locations in BERT, i.e., in each transformer layer of BERT. We will also see in Sec. 5.4 that inserting only one CL-plugin in one location is sub-optimal. Figure 1 gives the CTR architecture and we can see the two CL-plugins are added into BERT. In learning, only the two CL-plugins and the classification heads are trained. The components of the original pre-trained BERT are fixed.
|
| 44 |
+
|
| 45 |
+
Continual learning plug-in (CL-plugin). CL-plugin employs a capsule network (CapsNet) [15, 50] like architecture. In the classic neural network, a neuron outputs a scalar, real-valued activation as a feature detector. CapsNets replaces that with a vector-output capsule to preserve additional information. A simple CapsNet consists of two capsule layers. The first layer stores low-level feature maps, and the second layer generates the classification probability with each capsule corresponding to one class. CapsNet uses a dynamic routing algorithm to make each lower-level capsule to send its output to a similar (or “agreed”, computed by dot product) higher-level capsule. This property can already be used to group similar tasks and their shareable features to produce a CL system (see the ablation study in Sec. 5.4). One of the key ideas of CL-plugin (see Figure 2(A)) is a transfer capsule layer with a new transfer routing algorithm to explicitly identify transferable features/knowledge from previous tasks to transfer to the new task. Additionally, transfer routing avoids the need for hyper-parameter tuning on the number of iterations of dynamic routing [50] to update the agreements.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: Architecture of BERT (left) and the proposed system CTR (right), which inserts two CL-plugins in BERT. Each CL-plugin module (far right) has two sub-modules and a skip connection: knowledge sharing sub-module (KSM) and task-specific sub-module (TSM).
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: (A) CL-plugin Architecture. (B) Illustration of task masking. Cells/neurons in brown, green and red are respectively used by tasks 0, 1 and 2. Neurons with two colors are used by two tasks
|
| 52 |
+
|
| 53 |
+
# 4 Continual Learning Plug-in (CL-plugin)
|
| 54 |
+
|
| 55 |
+
The architecture of our continual learning plug-in (CL-plugin) is shown in Figure 2(A). CL-plugin takes two inputs: (1) hidden states $h ^ { ( t ) }$ from the feed-forward layer inside a transformer layer and (2) task $\textrm Ḋ \textrm Ḋ \textrm Ḋ \textrm Ḋ t Ḍ Ḍ Ḍ$ , which is required by task continual learning (Task-CL). The outputs are hidden states with features suitable for the $t$ -th task for classification. Inside CL-plugin, there are two modules: (1) knowledge sharing module (KSM) for identifying and transferring the shareable knowledge from similar previous tasks to the new task $t$ , and (2) task specific module (TSM) for learning task specific neurons and their masks (which can protect the neurons from being updated by future tasks to deal with CF). Since TSM is differentiable, the whole system CTR can be trained end-to-end.
|
| 56 |
+
|
| 57 |
+
# 4.1 Knowledge Sharing Module (KSM)
|
| 58 |
+
|
| 59 |
+
KSM achieves knowledge transfer among similar tasks via a task capsule layer (TK-Layer), a transfer capsule layer (TR-Layer), and a transfer routing mechanism.
|
| 60 |
+
|
| 61 |
+
# 4.1.1 Task Capsule Layer (TK-Layer)
|
| 62 |
+
|
| 63 |
+
Each capsule in the TK-Layer represents a task, and it prepares the low-level features derived from each task (Figure 2(A)). As such, a capsule is added to the TK-Layer for each new task. This incremental growth is efficient and easy because these capsules are discrete and do not share parameters. Also, each capsule is simply a 2-layer fully connected network with a small number of parameters. Let $h ^ { ( t ) } \in \mathbb { R } ^ { d _ { t } \times d _ { e } }$ be the input of CL-plugin, where $d _ { t }$ is the number of tokens, $d _ { e }$ the number of dimensions, and $t$ is the current task. In the TK-Layer, we have one capsule for each task. Assume we have learned $t$ tasks so far. The capsule for the $i$ -th $( i \leq t )$ ) task is
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
p _ { i } ^ { ( t ) } = f _ { i } ( h ^ { ( t ) } ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $f _ { i } ( \cdot ) = \mathbf { M } \mathbf { L } \mathbf { P } _ { i } ( \cdot )$ denotes a 2-layer fully-connected network.
|
| 70 |
+
|
| 71 |
+
# 4.1.2 Transfer Routing and Transfer Capsule Layer
|
| 72 |
+
|
| 73 |
+
Each capsule in the transfer capsule layer (TR-Layer) represents the transferable representation extracted from TK-Layer. As shown in Figure 2(A), transfer routing between the lower-level capsules in TK-Layer and high-level capsules in TR-Layer has three components: pre-route vector generator $( P V G )$ , similarity estimator $( S E )$ and task router $( T R )$ . Given the task capsules in the TK-Layer, we first transform the feature through a trainable weight matrix. We call the output of this transformation the pre-route vector. Each SE estimates the similarity between a previous task and the current task using the pre-route vector, resulting in a similarity score for each higher-level capsule. Additionally, each SE is augmented by a TR module, a differentiable task router acting as a gate. This router estimates a binary signal that decides whether to connect or disconnect the current route between the two consecutive capsule layers (i.e. TK-Layer and TR-Layer in CL-plugin). The binary signal estimated by TR can be seen as a differentiable binary attention. Conceptually, each SE and TR pair together learns the connectivity between capsules in a stochastic and differentiable manner, which can be seen as a task similarity-based connectivity search mechanism. This transfer routing identifies the shared features/knowledge from multiple task capsules and helps knowledge transfer across similar tasks. Next, we discuss the pre-route vector generator, similarity estimator and task router.
|
| 74 |
+
|
| 75 |
+
Pre-route Vector Generator (PVG). We first turns each transfer capsule $p _ { i } ^ { ( t ) }$ into a pre-route vector,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
u _ { j | i } ^ { ( t ) } = W _ { i j } p _ { i } ^ { ( t ) } ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $W _ { i j } \in \mathbb { R } ^ { d _ { s } \times d _ { k } }$ is the weight matrix, $d _ { s }$ and $d _ { k }$ are the dimensions of task capsule $i$ (also representing a task) and transfer capsule $j$ , and $t$ is the current task. The number of transfer capsules $n _ { j }$ is a hyperparameter detailed in Sec. 5.
|
| 82 |
+
|
| 83 |
+
Similarity Estimator (SE). Since tasks $i$ and $t$ are different, it is crucial to determine what in task $i$ ’s representation is transferable. Inspired by [67], we use a convolution layer and activation units to compare task $i$ with task $t$ to determine the transferable proportion from the previous task $i$ . In SE, we compute the task similarity as follows:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r } { \boldsymbol q _ { j | t } ^ { ( t ) } = \mathbf { M a x P o o l } ( \mathbf { R e l u } ( \boldsymbol u _ { j | t } ^ { ( t ) } * W _ { q } + b _ { q } ) ) , } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
a _ { j | i } ^ { ( t ) } = \mathbf { M a x P o o l } ( \operatorname { R e l u } ( u _ { j | i } ^ { ( t ) } * W _ { a } + f _ { a } ( q _ { j | t } ^ { ( t ) } ) + b _ { a } ) ) ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $b _ { a } , b _ { q } \in \mathbb { R }$ are the bias, $W _ { a } , W _ { q } \in \mathbb { R } ^ { d _ { e } \times d _ { w } }$ are convolutions filters and $d _ { w }$ is the windows size. We extract important features from the current task representation u(t)j|t via the convolution network in Eq. (3). The MaxPool helps remove the insignificant features to generate a fixed-size vector with the size equal to the number of filters $n _ { w }$ . Similarly, we extract important features from the previous task i’s representation u(t)j|i . Using the important features for the current and previous tasks, we compute a similarity score between them in Eq. (4) with ReLU activation. Note $f _ { a }$ is a 1-layer fully-connected network to match the dimensions. As a result, $a _ { j | i } ^ { ( t ) }$ indicates how similar the representation of the $i$ -th task is to the current task t. For those tasks with a very low a(t)j|i , t heir representations are less similar to the current task and thus has little transferable knowledge.
|
| 94 |
+
|
| 95 |
+
Task Router (TR). TR controls which previous task representation should flow to the next layer with the goal of letting only the transferable information to flow. Given the similarity $a _ { j | i } ^ { ( t ) }$ , TR estimates a binary decision signal $\delta _ { j \vert t } ^ { ( t ) } \in \{ 0$ :disconnect, 1:connect}. We first apply a convolution layer with 2 output channels and $1 \times 1$ kernel size to generate un-normalized decision value. To estimate the binary decision, we need to generate a decision chosen from the set of two mutually exclusive and exhaustive events (disconnect and connect). In our work, we adopt the Gumbel-Softmax [19] to help make the TR gate differentiable.
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\delta _ { j | i } ^ { ( t ) } = \mathrm { G u m b e l \_ s o f t m a x } ( a _ { j | i } ^ { ( t ) } * W _ { \delta } + b _ { \delta } ) .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
Given the similarity aj |t , binary decision δ(t )t and the pre-route vector u(t)j|t, we compute the transferable representation ${ v _ { j \mid i } ^ { \mathrm { t r a n } ( t ) } }$ and final output $v _ { j } ^ { ( t ) }$ as follows:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
v _ { j | i } ^ { \mathrm { t r a n } ( t ) } = a _ { j | i } ^ { ( t ) } \otimes u _ { j | i } ^ { ( t ) } , ~ v _ { j } ^ { ( t ) } = \sum _ { i = 1 \atop \delta _ { i j } ^ { ( t ) } = 1 } ^ { n + 1 } v _ { j | i } ^ { \mathrm { t r a n } ( t ) } .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
This makes sure only task capsules for tasks that are salient or similar to the new task are used, and the others task capsules are ignored (and thus protected) to learn more general shareable knowledge. As many NLP applications have similar tasks, such learning of task-sharing features can be very important. Note that in backpropagation, only the similar tasks with connected gate $( \delta _ { i j } ^ { ( t ) } = 1 )$ are
|
| 108 |
+
|
| 109 |
+
# 4.2 Task Specific Module (TSM)
|
| 110 |
+
|
| 111 |
+
We now discuss how to preserve task-specific knowledge of previous tasks to prevent forgetting (CF). To achieve this, we use task masks (Figure 2(B)). Specifically, we first detect the neurons used by each old task and then block off or mask out all the used neurons when learning a new task.
|
| 112 |
+
|
| 113 |
+
The task-specific module consists of differentiable layers (a 2-layer fully-connected network is used). Each layer’s output is further applied with a task mask to indicate which neurons should be protected for that task to overcome CF and forbids gradient updates for those neurons during backpropagation for a new task. Those tasks with overlapping masks indicate some parameter sharing. Due to KSM, the features flowing into those overlapping neurons enable the related old tasks to also improve in learning the new task. Here we borrow the hard attention idea in [52] and leverage the task ID embedding to train the task mask. Further details can be found in Supplementary.
|
| 114 |
+
|
| 115 |
+
Illustration. The task masking process is illustrated in Figure 2(B), which shows the learning process of three tasks. Before training, those solid cells with a 0 are the neurons that have been used by some previous tasks and should be protected (masked). Those empty cells are free neurons (not used). After training, those solid cells with a 1 are neurons that are important for the current task, which will be used as masks in the future. Those solid cells with a 0 are masked as they are important for previous tasks. Those non-solid cells with a 0 are neurons that are not used so far.
|
| 116 |
+
|
| 117 |
+
Let us walk through the learning process of the three tasks. After training task 0, we obtain its useful neurons indicated by the 1 entries. Before training task 1, those useful neurons for task 0 are first masked (those previous 1’s entries are turned to 0’s). After training task 1, two neurons with 1 are used by the task. When task 2 arrives, all used neurons by tasks 0 and 1 are masked before training, i.e., their entries are set to 0. After training task 2, we see that tasks 2 and 1 have a shared neuron (the cell with two colors, red and green), which is used by both of tasks.
|
| 118 |
+
|
| 119 |
+
# 5 Experiments
|
| 120 |
+
|
| 121 |
+
We evaluate CTR using three applications. We follow the continual learning (CL) evaluation method given in [29]. CTR first learns a sequence of tasks. After a task is trained, the training data of the task is no longer accessible. After all tasks are learned, their task models are tested using their respective test sets. In training each task, we use its validation set to decide when to stop training.
|
| 122 |
+
|
| 123 |
+
# 5.1 Three Applications and Their Datasets
|
| 124 |
+
|
| 125 |
+
The first two applications (and datasets) are used to show the knowledge transferability of CTR because their tasks are similar and have shared knowledge. Catastrophic forgetting (CF) is not a major concern for them. The third application (and dataset) is mainly used to test CTR’s ability to overcome CF as its tasks are very different and have little shared knowledge to transfer.
|
| 126 |
+
|
| 127 |
+
<table><tr><td>Data source</td><td colspan="3">Liu3domain</td><td colspan="5">HL5domain</td><td colspan="10">Ding9domain</td></tr><tr><td>Task/</td><td>paede</td><td>Poener</td><td>Ccoindetr</td><td>NO990T90</td><td>NN14am00</td><td>Ceieea</td><td>Conoees</td><td>AAx2dA</td><td>Capoong0</td><td>Craonen</td><td>radera</td><td>Thah</td><td></td><td>srss</td><td>JITIIT5</td><td>NO994P00</td><td>UOJION</td><td>Jreererer</td><td>doider</td></tr><tr><td>Train</td><td>352</td><td>245</td><td>283</td><td>271</td><td>162</td><td>677</td><td>228</td><td>343</td><td>118</td><td>175</td><td>191</td><td>212</td><td>153</td><td>176</td><td>484</td><td>362</td><td>194</td><td>3452</td><td>2163</td></tr><tr><td>Val.</td><td>44</td><td>31</td><td>35</td><td>34</td><td>20</td><td>85</td><td>29</td><td>43</td><td>15</td><td>22</td><td>24</td><td>26</td><td>19</td><td>22</td><td>61</td><td>45</td><td>24</td><td>150</td><td>150</td></tr><tr><td>Test</td><td>44</td><td>31</td><td>36</td><td>34</td><td>21</td><td>85</td><td>29</td><td>43</td><td>15</td><td>22</td><td>24</td><td>27</td><td>20</td><td>23</td><td>61</td><td>46</td><td>25</td><td>1120</td><td>638</td></tr></table>
|
| 128 |
+
|
| 129 |
+
Table 1: Statistics of datasets for ASC. The datasets statistics for DSC and 20News have been described in the text. More detailed data statistics are given in Supplementary.
|
| 130 |
+
|
| 131 |
+
1. Document Sentiment Classification (DSC). This application is to classify each full product review into one of the two opinion classes (positive and negative). The training data of each task consists of reviews of a particular type of product. We adopt the text classification formulation in [8], where a [CLS] token is used to predict the opinion polarity.
|
| 132 |
+
|
| 133 |
+
We employ a set of 10 DSC datasets (reviews of 10 products) to produce sequences of tasks. The products are Sports, Toys, Tools, Video, Pet, Musical, Movies, Garden, Offices, and Kindle [22]. Two experiments are conducted: (1) using small data in each task: 100 positive and 100 negative training reviews per task; (2) using the full data in each task: 2500 positive and 2500 negative training reviews per task [22]. (1) is more useful in practice because labeling a large number of examples is very costly. The same validation reviews (250 positive and 250 negative) and the same test reviews (250 positive and 250 negative) are used in both experiments.
|
| 134 |
+
|
| 135 |
+
2. Aspect Sentiment Classification (ASC). It classifies a review sentence on the aspect-level sentiment (one of positive, negative, and neutral). For example, the sentence “The picture is great but the sound is lousy” about a TV expresses a positive opinion about the aspect “picture” and a negative opinion about the aspect “sound.” We adopt the ASC formulation in [65], where the aspect term and sentence are concatenated via [SEP] in BERT. The opinion is predicted on top of the [CLS] token.
|
| 136 |
+
|
| 137 |
+
We employ a set of 19 ASC datasets (review sentences of 19 products) to produce sequences of tasks. Each dataset represents a task. The datasets are from 4 sources: (1) HL5Domains [17] with reviews of 5 products; (2) Liu3Domains [32] with reviews of 3 products; (3) Ding9Domains [9] with reviews of 9 products; and (4) SemEval14 with reviews of 2 products - SemEval 2014 Task 4 for laptop and restaurant. For (1), (2) and (3), we use about $10 \%$ of the original data as the validate data, another about $10 \%$ of the original data as the testing data. For (4), we use 150 examples from the training set for validation. To be consistent with existing research [59], sentences with conflict opinions about a single aspect are not used. Statistics of the 19 datasets are given in Table 1.
|
| 138 |
+
|
| 139 |
+
3. Text classification using 20News data. This dataset [28] has 20 classes and each class has about 1000 documents. The data split for train/validation/test is 1600/200/200. We created 10 tasks, 2 classes per task. Since this is topic-based text classification data, the classes are very different and have little shared knowledge. As mentioned above, this application (and dataset) is mainly used to show CTR’s ability to overcome forgetting.
|
| 140 |
+
|
| 141 |
+
# 5.2 Baselines
|
| 142 |
+
|
| 143 |
+
We setup 38 baselines, including both standalone and continual learning methods.
|
| 144 |
+
|
| 145 |
+
Multitask learning (MTL: Results of multitask learning is considered the upper-bound of those of continual learning. Here MTL fine-tunes BERT.
|
| 146 |
+
|
| 147 |
+
Standalone (SDL) Baselines: The SDL setting builds a model for each task independently using a separate network. It clearly has no knowledge transfer or forgetting. We have 4 baselines under SDL, BERT, BERT (Frozen), Adapter-BERT and W2V (word2vec embeddings). For BERT, we use trainable BERT, i.e., fine-tuning. BERT (Frozen) uses frozen BERT with a trainable CNN text classification network [26] on top of it.; Adapter-BERT adapts the BERT as in [16], where only the adapter blocks are trainable; W2V uses embeddings trained on the Amazon review data in [66] using FastText [11]. For ASC, we adopt the ASC classification network in [67], which takes aspect term and review sentence as input. For DSC and 20News, we adopt the classification network in [8].
|
| 148 |
+
|
| 149 |
+
Continual Learning (CL) Baselines. CL setting includes 4 baselines with no forgetting handling (NFH) (corresponding to the 4 standalone baselines), and 25 baselines from 9 state-of-the art task continual learning (Task-CL) methods that deal with forgetting (CF). NFH baselines learn the tasks one by one with no awareness of forgetting/transfer.
|
| 150 |
+
|
| 151 |
+
The 12 state-of-the-art CL systems are: KAN [22] and SRK [37] are Task-CL methods for document sentiment classification. The rest were designed initially for image classification. Therefore, we replace their original MLP or CNN image classification network with CNN for text classification [26]. HAT [52] is one of the best Task-CL methods with almost no forgetting. CAT [21] is similar to HAT but can work with a mixed sequence. UCL [1] is a recent Task-CL method. EWC [27] is a popular regularization-based class continual learning (Class-CL) method, which was adapted for Task-CL by only training on the corresponding head of the specific task ID during training and only considering the corresponding head’s prediction during testing. OWM [68] is also a Class-CL method, which we also adapt to Task-CL. L2 [27] is a classic regularization based Class-CL method, which we adapt to Task-CL. A-GEM [4] is an efficient version of the replay Task-CL method GEM [36], which penalizes the previous task loss from being increased. $\mathbf { D E R + + }$ [2] is a recent replay method using distillation to regularize the new task training and it can function as a Task-CL method. B-CL [24] is similar to CTR but uses dynamic routing for knowledge transfer and it performs markedly worse than CTR. LAMOL [58] is a pseudo-replay method based on GPT-2.
|
| 152 |
+
|
| 153 |
+
From the 10 systems, we created 10 baselines using W2V embeddings with the aspect term added before the sentence so that the Task-CL methods can take both aspect and the review sentence for ASC; 7 baselines using Adapter-BERT (SRK, KAN and CAT’s architectures cannot work with adapters); and 10 baselines using BERT (Frozen) (which replaces W2V embeddings). The BERT formulation in Sec. 3 naturally takes both aspect and review sentence in the ASC case.
|
| 154 |
+
|
| 155 |
+
# 5.3 Hyper-parameters
|
| 156 |
+
|
| 157 |
+
Unless otherwise stated, the same hyper-parameters are used in experiments for ASC, DSC and 20News datasets. For the knowledge sharing module (KSM), we employ 2 layers of fully connected network with dimensions 768 in the TK-Layer. We employ 3 transfer capsules. We experimented with 2 to 15 capsules and selected 3 based on the validation data accuracy. For the task specific module (TSM), we use 2000 dimensions as the final and the hidden layers of the TSM. The task ID embeddings have 2000 dimensions. A fully connected layer with softmax output is used as the classification heads in the last layer of the BERT, together with the categorical cross-entropy loss. dropout of 0.5 between fully connected layers. The training of BERT, Adapter-BERT and CTR follows that of [65]. We adopt BERTBASE (uncased). The maximum input length is set to 128 which is long enough for both ASC and DSC. We use Adam optimizer and set the learning rate to 3e-5. We use 10 epochs for SemEval datasets and 30 epochs for the other datasets in the ASC application. For DSC, we use 20 epochs. For 20News, we use 10 epochs. These are selected based on the validation results. The batch size is set to 32 for all cases. For all the other CL baselines, we use the code provided by their authors and adapt them for text classification. We also adopt their original parameters, including learning rate, early stopping, and batch size.
|
| 158 |
+
|
| 159 |
+
# 5.4 Evaluation Results and Analysis
|
| 160 |
+
|
| 161 |
+
Since the order of the tasks in a sequence may impact the final results, we randomly sampled 5 task sequences and averaged their results. We compute both accuracy and Macro-F1, where Macro-F1 is the primary metric as the imbalanced classes (in ASC) introduce biases on accuracy. Table 2 gives the average results of all the 19 tasks (or datasets) for ASC and 10 tasks (or datasets) for DSC and 20News over the 5 random task sequences.
|
| 162 |
+
|
| 163 |
+
Overall Performance. Table 2 shows that CTR clearly outperforms all baselines.
|
| 164 |
+
|
| 165 |
+
(1). For the standalone (SDL) baselines, BERT (with fine-tuning) and Adapter-BERT perform similarly. W2V and BERT (Frozen) are poorer, which is understandable.
|
| 166 |
+
|
| 167 |
+
(2). Comparing SDL (standalone learning) and NFH (continual learning with no forgetting handling), we see NFH is much better than SDL for W2V and BERT (Frozen). This indicates ASC and DSC tasks have similarities and thus shared knowledge. Catastrophic forgetting (CF) is not a major issue for W2V and BERT (Frozen). However, for 20News, NFH variants have serious CF. NFH with BERT (fine-tuning) is much worse than SDL and Adapter-BERT, which we explained in Introduction.
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2">Scenarios</td><td rowspan="2">Category</td><td rowspan="2">Model</td><td colspan="2">ASC</td><td colspan="2">DSC (small)</td><td colspan="2">DSC (full)</td><td colspan="2">20News</td><td colspan="2">20News (FR)</td></tr><tr><td>Acc.</td><td>MF1</td><td>Acc.</td><td>MF1</td><td>Acc.</td><td>MF1</td><td>Acc.</td><td>MF1</td><td>Acc.</td><td>MF1</td></tr><tr><td rowspan="2">Non-continual Learning (SDL)</td><td>BERT BERT BERT (Frozen)</td><td>MTL SDL SDL</td><td>91.91 85.84 78.14</td><td>88.11 76.35 58.13</td><td>85.05 78.04 73.88</td><td>84.03 74.17</td><td>89.77 87.84</td><td>89.28 86.80</td><td>96.77 96.49</td><td>96.77 96.48</td><td></td><td></td></tr><tr><td>Adapter-BERT W2V BERT</td><td>SDL SDL NFH</td><td>85.96 77.01 49.60</td><td>78.07 51.89 43.08</td><td>76.31 62.06 73.87</td><td>67.97 71.04 53.80 69.44</td><td>85.34 88.30 69.57 73.08</td><td>80.17 87.31 65.51 71.81</td><td>96.49 96.20 94.72 52.50</td><td>96.48 96.19 94.72 39.22</td><td>24.29</td><td>30.52</td></tr><tr><td rowspan="10">Continual Learning (CL)</td><td>BERT (Frozen) Adapter-BERT W2V</td><td>NFH NFH NFH L2</td><td>85.51 54.03 82.69</td><td>76.64 44.81 73.56</td><td>83.12 63.76 65.16</td><td>79.23 53.95 57.48</td><td>61.88 64.94 70.40</td><td>45.79 63.40 68.03</td><td>83.28 68.29</td><td>81.81 61.70</td><td>8.76 30.59 4.30</td><td>9.73 3.79 4.47</td></tr><tr><td rowspan="5">BERT (frozen)</td><td rowspan="5">A-GEM DER++ KAN</td><td rowspan="5">56.04 86.06 84.27 85.49</td><td rowspan="5">38.40 78.44 75.08</td><td rowspan="5">59.17 59.33 72.29</td><td rowspan="5">48.39 45.94</td><td rowspan="5">69.80 70.67 86.70</td><td rowspan="5">62.63 61.77 85.46</td><td rowspan="5">90.74 72.14 93.31</td><td rowspan="5">90.59</td><td rowspan="5">24.57 4.09</td><td rowspan="5">32.05 4.48</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td>65.39</td></tr><tr><td>92.95</td></tr><tr><td>66.28</td></tr><tr><td colspan="10"></td><td>49.67</td><td>10.54</td><td>12.16</td></tr><tr><td rowspan="6"></td><td rowspan="6"></td><td>SRK EWC</td><td>84.76 86.37</td><td>77.38 78.52 74.52</td><td>77.27 78.58 82.38</td><td>72.34 76.03</td><td>82.32 83.99</td><td>81.23</td><td>73.07 69.97 77.89</td><td></td><td>15.52 12.06</td><td>18.87 13.97 3.03</td></tr><tr><td>UCL</td><td>83.89</td><td></td><td>78.41</td><td>72.77 74.76</td><td>82.66 65.76 69.48</td><td>79.64 80.26 94.65</td><td>78.60</td><td>3.50</td><td>0.48</td></tr><tr><td></td><td></td><td>74.82</td><td>74.13</td><td></td><td></td><td></td><td>94.63</td><td>0.48</td><td></td></tr><tr><td>OWM HAT</td><td>87.02</td><td>79.31</td><td>80.12 58.07</td><td>42.63</td><td>86.30</td><td>85.36</td><td>84.54</td><td>82.73</td><td>13.80</td></tr><tr><td>CAT</td><td>86.74 83.68</td><td>78.16</td><td>79.48</td><td>72.78</td><td></td><td></td><td></td><td></td><td>15.81 2.89</td></tr><tr><td></td><td>63.97</td><td>68.64 52.43</td><td>67.41</td><td>56.22</td><td>87.29 87.34</td><td>86.14 86.51</td><td>93.51 95.17</td><td>92.93 95.16</td><td>2.26 0.80</td></tr><tr><td rowspan="4"></td><td rowspan="4">Adapter-BERT</td><td>L2</td><td></td><td>67.26</td><td>62.76</td><td>73.03</td><td>71.50</td><td>69.56</td><td>65.50</td><td>23.12</td><td>0.81 27.39</td></tr><tr><td>A-GEM</td><td>45.88 47.63</td><td>28.21 62.89</td><td>55.96</td><td>71.22</td><td>69.94</td><td>60.29</td><td>50.40</td><td>40.22</td><td>51.20</td></tr><tr><td>DER++ EWC</td><td>56.30</td><td>35.54 49.58</td><td>70.52 63.56</td><td>59.67</td><td>57.82</td><td>58.95</td><td>49.58</td><td>36.39</td><td>45.30</td></tr><tr><td>UCL OWM</td><td>64.46 72.99</td><td>58.23 36.64 48.30</td><td>51.03 32.07</td><td>62.69 57.06</td><td>61.51 55.86</td><td>61.86 51.75</td><td>53.94 36.06</td><td>37.79 4.70</td><td>46.58 6.60</td></tr><tr><td rowspan="4">W2V</td><td rowspan="4">HAT L2 KAN</td><td>86.14 60.36</td><td>66.51</td><td>73.97 80.83</td><td>71.96 78.41</td><td>85.46</td><td>84.57</td><td>71.10</td><td>66.25 95.21</td><td>27.38 0.33</td><td>32.76 0.34</td></tr><tr><td>81.33</td><td>78.52 39.13 63.35</td><td>54.34</td><td>43.19</td><td>88.00 57.71</td><td>87.26 48.00</td><td>95.22 59.54</td><td>54.40</td><td>7.83</td><td>11.89</td></tr><tr><td>A-GEM DER++</td><td>69.93</td><td>69.80</td><td>60.07</td><td>77.67</td><td>70.75</td><td>90.72</td><td>90.60</td><td>3.94</td><td>4.08</td></tr><tr><td>SRK</td><td>83.27 40.01</td><td>77.51 57.13 64.47</td><td>73.13 43.75</td><td>74.79</td><td>66.68</td><td>89.28</td><td>89.19</td><td>4.32</td><td>4.42</td></tr><tr><td rowspan="6"></td><td rowspan="5">HAT CAT</td><td rowspan="5">EWC UCL OWM</td><td>72.06 71.01 84.16</td><td></td><td>55.93</td><td>69.35</td><td>64.78</td><td>57.92</td><td>51.65</td><td>20.98</td><td>27.02 8.81</td></tr><tr><td></td><td>39.63</td><td></td><td>69.65</td><td>65.25</td><td>61.07</td><td>58.47</td><td>7.26</td><td></td></tr><tr><td></td><td>72.29</td><td>64.82</td><td>57.20 70.00</td><td>65.11</td><td>91.86</td><td>91.80</td><td>2.64</td><td>2.71 4.70</td></tr><tr><td>84.41 82.70</td><td>75.99</td><td>56.23</td><td>41.34</td><td>70.56</td><td>67.01</td><td>90.61</td><td>90.46</td><td>4.53</td></tr><tr><td></td><td>71.18</td><td>53.40</td><td>38.44</td><td>67.15</td><td>65.42</td><td>71.97</td><td>68.75</td><td>24.00</td></tr><tr><td colspan="2">B-CL LAMOL</td><td>80.83 76.28 88.29 88.91</td><td>63.63 54.65</td><td>62.57 55.19</td><td>50.83 35.28</td><td>69.75 79.58</td><td>65.44 75.99</td><td>67.73 70.38</td><td>64.43 68.04</td><td>26.04 24.37</td><td>27.56 29.70 26.95</td></tr><tr><td colspan="2"></td><td></td><td>81.40</td><td>82.01</td><td>80.63</td><td>79.76</td><td>76.51</td><td>95.07</td><td>95.04</td><td></td><td></td><td>0.59</td></tr><tr><td colspan="2">CTR(forward) CTR</td><td>87.89 89.47</td><td>80.59 80.25</td><td>89.12 83.75</td><td>86.58 82.55</td><td></td><td>92.11 89.86</td><td>91.72 89.16 95.63</td><td>66.13</td><td>45.74 95.62</td><td>0.58 20.03</td><td>16.60</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Table 2: Accuracy (Acc.) and Macro-F1 (MF1), averaged over 5 random sequences. The architectures of SRK, KAN and CAT cannot work with Adapter-BERT. “—” means not applicable. Due to the limited space, standard deviation, running time and network size are given in Supplementary.
|
| 172 |
+
|
| 173 |
+
(3). Unlike BERT and Adapter-BERT, CTR does very well in both forgetting avoidance and knowledge transfer (outperforming all baselines). For baselines, EWC, UCL, OWM and HAT, although they perform better than NFH, they are significantly poorer than CTR as they don’t have methods to encourage knowledge transfer for ASC and DSC. KAN and SRK do knowledge transfer but they are weaker than many other CL methods. They perform very poorly for 20News as they have limited ability to overcome CF. CAT works well with large datasets, but is weak for small datasets.
|
| 174 |
+
|
| 175 |
+
(4). CTR’s improvements over SDL variants for DSC (large) is less than for DCS (small). This is understandable because when the training data is large, learning a separate model is already good, and knowledge transfer is less important.
|
| 176 |
+
|
| 177 |
+
(5). Compared with the SDL results, we can see that CTR has the least forgetting on 20News.
|
| 178 |
+
|
| 179 |
+
(6). Compared to B-CL, CTR is markedly better in knowledge transfer. The forgetting rates (FR) of B-CL and CTR are both low. The comparison is in fact the same as comparing dynamics routing and transfer routing. We can see that the proposed transfer routing is dramatically better than dynamic routing for knowledge transfer. Additionally, transfer routing eliminates the need for hyper-parameter tuning on the number of iterations of dynamic routing [50] to update the agreements.
|
| 180 |
+
|
| 181 |
+
(7). CTR outperforms LAMOL in ASC and 20News even with the less powerful BERT model that CTR adopts. LAMOL outperforms BERT-based MTL in DSC. This may be because LAMOL is based on GPT-2, which is known to be more powerful than BERT (also shown in the LAMOL paper). For 20News, since its tasks are very different/dissimilar, there is little shared knowledge. Dealing with CF is the main issue. LAMOL has serious forgetting as its FR values show.
|
| 182 |
+
|
| 183 |
+
(8). The results of MTL (the upper bound) are only slightly better than CTR, which again shows that CTR is highly effective in overcoming forgetting and encouraging knowledge transfer.
|
| 184 |
+
|
| 185 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">ASC</td><td colspan="2">DSC (small)</td><td colspan="2">DSC (full)</td><td colspan="2">20News</td></tr><tr><td>Acc.</td><td>MF1</td><td>Acc.</td><td>MF1</td><td>Acc.</td><td>MF1</td><td>Acc.</td><td>MF1</td></tr><tr><td>CTR(-KSM;-TSM)</td><td>0.5403</td><td>0.4481</td><td>0.6376</td><td>0.5395</td><td>0.6494</td><td>0.6340</td><td>0.6829</td><td>0.6170</td></tr><tr><td>CTR (-TSM)</td><td>0.8312</td><td>0.7107</td><td>0.7085</td><td>0.6759</td><td>0.8545</td><td>0.8380</td><td>0.8275</td><td>0.8064</td></tr><tr><td>CTR (-KSM)</td><td>0.8614</td><td>0.7852</td><td>0.8083</td><td>0.7841</td><td>0.8800</td><td>0.8726</td><td>0.9522</td><td>0.9521</td></tr><tr><td>CTR(-TR/KSM)</td><td>0.8819</td><td>0.8155</td><td>0.8244</td><td>0.8119</td><td>0.8831</td><td>0.8762</td><td>0.9476</td><td>0.9469</td></tr><tr><td>CTR(dynamic routing) (B-CL)</td><td>0.8829</td><td>0.8140</td><td>0.8201</td><td>0.8063</td><td>0.7976</td><td>0.7651</td><td>0.9507</td><td>0.9504</td></tr><tr><td>CTR (on top)</td><td>0.8135</td><td>0.6390</td><td>0.7301</td><td>0.6875</td><td>0.8266</td><td>0.8105</td><td>0.8927</td><td>0.8920</td></tr><tr><td>CTR (after the first FF layer)</td><td>0.8741</td><td>0.8014</td><td>0.8300</td><td>0.8183</td><td>0.8699</td><td>0.8596</td><td>0.9381</td><td>0.9373</td></tr><tr><td>CTR (after the other two FF layers)</td><td>0.8662</td><td>0.7863</td><td>0.8269</td><td>0.8161</td><td>0.8714</td><td>0.8612</td><td>0.9339</td><td>0.9316</td></tr><tr><td>CTR</td><td>0.8947</td><td>0.8362</td><td>0.8434</td><td>0.8329</td><td>0.8931</td><td>0.8875</td><td>0.9525</td><td>0.9523</td></tr></table>
|
| 186 |
+
|
| 187 |
+
Table 3: Ablation experiment results.
|
| 188 |
+
|
| 189 |
+
Effectiveness of Knowledge Transfer. Forward transfer is defined as the forward performance (CTR(forward) in Table 2) subtracting the standalone (SDL) result. CTR(forward) is the test accuracy or MF1 of each task when it was first learned. Backward transfer is defined as the difference between the backward performance (CTR in Table 2, the final result after all tasks are learned) and the forward performance. The average results of CTR (forward) and CTR are given in Table 2. We observe that forward transfer of CTR is highly effective for the three datasets with similar tasks. For DSC, the less the data, the more effective is the transfer, which is reasonable. Backward transfer improves the accuracy and MF1 of ASC and DSC (small). For DSC (full), it is slightly weaker and for 20News, it is also slightly weaker due to a very small amount of forgetting, but the less than 0.0055 CF is negligible. Note that in [36, 46], forward transfer is measured by comparing the test results of the new task on the current learned network and a random initialized network before/without training the new task (like zero-shot). This method indicates whether the learned network contains some useful knowledge for the new task. However, it does not tell how much forward transfer actually happens after learning the new task, which is more important and is what our method measures.
|
| 190 |
+
|
| 191 |
+
Overcoming Forgetting. To validate CTR’s effectiveness in dealing forgetting with a sequence of dissimilar tasks, we compute the Forgetting Rate [34], $\begin{array} { r } { \mathrm { F R } = \frac { 1 } { t - 1 } \bar { \sum _ { i = 1 } ^ { t - 1 } A _ { i , i } } - \bar { A _ { t , i } } } \end{array}$ , where $A _ { i , i }$ is the forward accuracy of task $i$ and $A _ { t , i }$ is the accuracy of task $i$ after training the last task $t$ . We average over all tasks except the last one because the last task obviously has no forgetting. We report the forgetting rate FR (averaged over 5 random task sequences) for the 20News data on the two evaluation metrics in the last two columns of Table 2 (the other two datasets are mainly for knowledge transfer). CTR has very low FR values which indicate very little forgetting.
|
| 192 |
+
|
| 193 |
+
Ablation Study. The results of ablation experiments are in Table 3. “-KSM;-TSM” means that the knowledge sharing module (KSM) and the task specific module (TSM) are not used, and we simply deploy the Adapter-BERT. “-KSM” means that the knowledge sharing module (KSM) is not used. “-TSM” means that the task specific module (TSM) is not used. “-TR/KSM” means that the task router (TR) in KSM is not used. We directly send the transferable representation vtran(j|i to the next layer. “dynamic routing” means that we replace our transfer routing (-(SE&TR)/KSM) with dynamic routing [50], which is one of the most popular routing algorithms in capsule networks. “on top” means adding a CL-plugin on top of BERT. “after the first FF layer” means adding only one CL-plugin there in BERT. ”after the other two FF layers” means adding only one CL-plugin module there in BERT. Table 3 shows that the full CTR system gives the best results, indicating every component contributes to the model and other options of adding CL-plugins are all poorer.
|
| 194 |
+
|
| 195 |
+
# 6 Conclusion
|
| 196 |
+
|
| 197 |
+
This paper studied task continual learning (Task-CL) using the pre-trained model BERT to achieve both CF presentation and knowledge transfer. It proposed a novel technique called CTR to leverage the pre-trained BERT for CL. The key component of CTR is the CL-plugin inserted in BERT. A CL-plugin is a capsule network with a new transfer routing mechanism to encourage knowledge transfer among tasks and also to isolate task-specific knowledge to avoid forgetting. Experimental results using three NLP applications showed that CTR markedly improves the performance of both the new task and the old tasks via knowledge transfer and is also effective at overcoming catastrophic forgetting. One limitation of our work is the efficiency due to the use of capsules. Capsules try to represent a group of neurons in a vector reflecting properties of an entity. In NLP, an entity is a sentence/document which contains many tokens (e.g., 128) and features (e.g. 768 in BERTBASE). Grouping them makes the capsule very large (e.g., $1 2 8 \times 7 6 8 $ ), which slows down training.
|
| 198 |
+
|
| 199 |
+
# Acknowledgments
|
| 200 |
+
|
| 201 |
+
This work was supported in part by two National Science Foundation (NSF) grants (IIS-1910424 and IIS-1838770), a DARPA Contract HR001120C0023, and a Northrop Grumman research gift.
|
| 202 |
+
|
| 203 |
+
# References
|
| 204 |
+
|
| 205 |
+
[1] H. Ahn, S. Cha, D. Lee, and T. Moon. Uncertainty-based continual learning with adaptive regularization. In NIPS, 2019. [2] P. Buzzega, M. Boschini, A. Porrello, D. Abati, and S. Calderara. Dark experience for general continual learning: a strong, simple baseline. arXiv preprint arXiv:2004.07211, 2020.
|
| 206 |
+
[3] A. Carlson, J. Betteridge, B. Kisiel, B. Settles, E. Hruschka, and T. Mitchell. Toward an architecture for never-ending language learning. In AAAI, volume 24, 2010. [4] A. Chaudhry, M. Ranzato, M. Rohrbach, and M. Elhoseiny. Efficient lifelong learning with A-GEM. In ICLR, 2019. [5] Z. Chen and B. Liu. Lifelong machine learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 12(3):1–207, 2018. [6] Z. Chen, N. Ma, and B. Liu. Lifelong learning for sentiment classification. In ACL, 2015. [7] Y.-S. Chuang, S.-Y. Su, and Y.-N. Chen. Lifelong language knowledge distillation. arXiv preprint arXiv:2010.02123, 2020.
|
| 207 |
+
[8] J. Devlin, M. Chang, K. Lee, and K. Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In J. Burstein, C. Doran, and T. Solorio, editors, NAACL-HLT, 2019. [9] X. Ding, B. Liu, and P. S. Yu. A holistic lexicon-based approach to opinion mining. In Proceedings of the 2008 international conference on web search and data mining, 2008.
|
| 208 |
+
[10] C. Fernando, D. Banarse, C. Blundell, Y. Zwols, D. Ha, A. A. Rusu, A. Pritzel, and D. Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. CoRR, 2017.
|
| 209 |
+
[11] E. Grave, P. Bojanowski, P. Gupta, A. Joulin, and T. Mikolov. Learning word vectors for 157 languages. In LREC, 2018.
|
| 210 |
+
[12] C. Greco, B. Plank, R. Fernández, and R. Bernardi. Psycholinguistics meets continual learning: Measuring catastrophic forgetting in visual question answering. arXiv preprint arXiv:1906.04229, 2019.
|
| 211 |
+
[13] P. Gupta, Y. Chaudhary, T. Runkler, and H. Schuetze. Neural topic modeling with continual lifelong learning. In International Conference on Machine Learning, pages 3907–3917. PMLR, 2020.
|
| 212 |
+
[14] X. He and H. Jaeger. Overcoming catastrophic interference using conceptor-aided backpropagation. In ICLR, 2018.
|
| 213 |
+
[15] G. E. Hinton, A. Krizhevsky, and S. D. Wang. Transforming auto-encoders. In International conference on artificial neural networks, 2011.
|
| 214 |
+
[16] N. Houlsby, A. Giurgiu, S. Jastrzebski, B. Morrone, Q. de Laroussilhe, A. Gesmundo, M. Attariyan, and S. Gelly. Parameter-efficient transfer learning for NLP. In K. Chaudhuri and R. Salakhutdinov, editors, ICML, 2019.
|
| 215 |
+
[17] M. Hu and B. Liu. Mining and summarizing customer reviews. In Proceedings of ACM SIGKDD, 2004.
|
| 216 |
+
[18] W. Hu, Q. Qin, M. Wang, J. Ma, and B. Liu. Continual learning by using information of each class holistically. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 7797–7805, 2021.
|
| 217 |
+
[19] E. Jang, S. Gu, and B. Poole. Categorical reparameterization with gumbel-softmax. In ICLR, 2017.
|
| 218 |
+
[20] N. Kamra, U. Gupta, and Y. Liu. Deep generative dual memory network for continual learning. CoRR, 2017.
|
| 219 |
+
[21] Z. Ke, B. Liu, and X. Huang. Continual learning of a mixed sequence of similar and dissimilar tasks. In NeurIPS, 2020.
|
| 220 |
+
[22] Z. Ke, B. Liu, H. Wang, and L. Shu. Continual learning with knowledge transfer for sentiment classification. In ECML-PKDD, 2020.
|
| 221 |
+
[23] Z. Ke, B. Liu, H. Xu, and L. Shu. Classic: Continual and contrastive learning of aspect sentiment classification tasks. In EMNLP, 2021.
|
| 222 |
+
[24] Z. Ke, H. Xu, and B. Liu. Adapting bert for continual learning of a sequence of aspect sentiment classification tasks. In NAACL, pages 4746–4755, 2021.
|
| 223 |
+
[25] H. Khayrallah, B. Thompson, K. Duh, and P. Koehn. Regularized training objective for continued training for domain adaptation in neural machine translation. In Proceedings of the 2nd Workshop on Neural Machine Translation and Generation, pages 36–44, 2018.
|
| 224 |
+
[26] Y. Kim. Convolutional neural networks for sentence classification. In A. Moschitti, B. Pang, and W. Daelemans, editors, EMNLP, 2014.
|
| 225 |
+
[27] J. Kirkpatrick, R. Pascanu, N. C. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, D. Hassabis, C. Clopath, D. Kumaran, and R. Hadsell. Overcoming catastrophic forgetting in neural networks. CoRR, 2016.
|
| 226 |
+
[28] K. Lang. Newsweeder: Learning to filter netnews. In Proceedings of the Twelfth International Conference on Machine Learning, 1995.
|
| 227 |
+
[29] M. D. Lange, R. Aljundi, M. Masana, and T. Tuytelaars. Continual learning: A comparative study on how to defy forgetting in classification tasks. CoRR, 2019.
|
| 228 |
+
[30] S. Lee, J. Kim, J. Jun, J. Ha, and B. Zhang. Overcoming catastrophic forgetting by incremental moment matching. In NIPS.
|
| 229 |
+
[31] Y. Li, L. Zhao, K. Church, and M. Elhoseiny. Compositional language continual learning. In International Conference on Learning Representations, 2019.
|
| 230 |
+
[32] Q. Liu, Z. Gao, B. Liu, and Y. Zhang. Automated rule selection for aspect extraction in opinion mining. In IJCAI, 2015.
|
| 231 |
+
[33] T. Liu, L. Ungar, and J. Sedoc. Continual learning for sentence representations using conceptors. arXiv preprint arXiv:1904.09187, 2019.
|
| 232 |
+
[34] Y. Liu, Y. Su, A. Liu, B. Schiele, and Q. Sun. Mnemonics training: Multi-class incremental learning without forgetting. In CVPR, 2020.
|
| 233 |
+
[35] Z. Liu, G. I. Winata, A. Madotto, and P. Fung. Exploring fine-tuning techniques for pre-trained cross-lingual models via continual learning. arXiv preprint arXiv:2004.14218, 2020.
|
| 234 |
+
[36] D. Lopez-Paz and M. Ranzato. Gradient episodic memory for continual learning. In NIPS, 2017.
|
| 235 |
+
[37] G. Lv, S. Wang, B. Liu, E. Chen, and K. Zhang. Sentiment classification by leveraging the shared knowledge from a sequence of domains. In DASFAA, 2019.
|
| 236 |
+
[38] A. Madotto, Z. Lin, Z. Zhou, S. Moon, P. Crook, B. Liu, Z. Yu, E. Cho, and Z. Wang. Continual learning in task-oriented dialogue systems. arXiv preprint arXiv:2012.15504, 2020.
|
| 237 |
+
[39] A. Mallya and S. Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In CVPR, 2018.
|
| 238 |
+
[40] M. McCloskey and N. J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation. 1989.
|
| 239 |
+
[41] A. Merchant, E. Rahimtoroghi, E. Pavlick, and I. Tenney. What happens to BERT embeddings during fine-tuning? CoRR, 2020.
|
| 240 |
+
[42] J. Pfeiffer, A. Kamath, A. Rücklé, K. Cho, and I. Gurevych. Adapterfusion: Non-destructive task composition for transfer learning.
|
| 241 |
+
[43] Q. Qin, W. Hu, and B. Liu. Using the past knowledge to improve sentiment classification. In EMNLP-findings, 2020.
|
| 242 |
+
[44] V. V. Ramasesh, E. Dyer, and M. Raghu. Anatomy of catastrophic forgetting: Hidden representations and task semantics. In ICLR, 2021.
|
| 243 |
+
[45] S. Rebuffi, A. Kolesnikov, G. Sperl, and C. H. Lampert. icarl: Incremental classifier and representation learning. In CVPR, 2017.
|
| 244 |
+
[46] M. Riemer, I. Cases, R. Ajemian, M. Liu, I. Rish, Y. Tu, , and G. Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. In International Conference on Learning Representations, 2019.
|
| 245 |
+
[47] M. Rostami, S. Kolouri, and P. K. Pilly. Complementary learning for overcoming catastrophic forgetting using experience replay. In IJCAI, 2019.
|
| 246 |
+
[48] A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell. Progressive neural networks. CoRR, 2016.
|
| 247 |
+
[49] P. Ruvolo and E. Eaton. ELLA: an efficient lifelong learning algorithm. In ICML, pages 507–515, 2013.
|
| 248 |
+
[50] S. Sabour, N. Frosst, and G. E. Hinton. Dynamic routing between capsules. In NIPS, 2017.
|
| 249 |
+
[51] A. Seff, A. Beatson, D. Suo, and H. Liu. Continual learning in generative adversarial nets. CoRR, abs/1705.08395, 2017.
|
| 250 |
+
[52] J. Serrà, D. Suris, M. Miron, and A. Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. In ICML, 2018.
|
| 251 |
+
[53] Y. Shen, X. Zeng, and H. Jin. A progressive model to enable continual learning for semantic slot filling. In EMNLP-IJCNLP, Nov. 2019.
|
| 252 |
+
[54] H. Shin, J. K. Lee, J. Kim, and J. Kim. Continual learning with deep generative replay. In NIPS, 2017.
|
| 253 |
+
[55] L. Shu, H. Xu, and B. Liu. Lifelong learning CRF for supervised aspect extraction. In ACL, 2017.
|
| 254 |
+
[56] D. L. Silver, Q. Yang, and L. Li. Lifelong machine learning systems: Beyond learning algorithms. In Lifelong Machine Learning, Papers from the 2013 AAAI Spring Symposium, Palo Alto, California, USA, March 25-27, 2013, 2013.
|
| 255 |
+
[57] C. Sun, L. Huang, and X. Qiu. Utilizing BERT for aspect-based sentiment analysis via constructing auxiliary sentence. In NAACL, 2019.
|
| 256 |
+
[58] F.-K. Sun, C.-H. Ho, and H.-Y. Lee. Lamol: Language modeling is all you need for lifelong language learning. In ICLR, 2020.
|
| 257 |
+
[59] D. Tang, B. Qin, and T. Liu. Aspect level sentiment classification with deep memory network. In EMNLP, Nov. 2016.
|
| 258 |
+
[60] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 259 |
+
[61] H. Wang, B. Liu, S. Wang, N. Ma, and Y. Yang. Forward and backward knowledge transfer for sentiment classification. In ACML, 2019.
|
| 260 |
+
[62] S. Wang, G. Lv, S. Mazumder, G. Fei, and B. Liu. Lifelong learning memory networks for aspect sentiment classification. In IEEE International Conference on Big Data, 2018.
|
| 261 |
+
[63] Z. Wang, S. V. Mehta, B. Póczos, and J. Carbonell. Efficient meta lifelong-learning with limited memory. In EMNLP, 2020.
|
| 262 |
+
[64] R. Xia, J. Jiang, and H. He. Distantly supervised lifelong learning for large-scale social media sentiment analysis. IEEE Trans. Affective Computing, 8(4):480–491, 2017.
|
| 263 |
+
[65] H. Xu, B. Liu, L. Shu, and P. S. Yu. BERT post-training for review reading comprehension and aspect-based sentiment analysis. In J. Burstein, C. Doran, and T. Solorio, editors, NAACL-HLT, 2019.
|
| 264 |
+
[66] H. Xu, S. Xie, L. Shu, and P. S. Yu. Dual attention network for product compatibility and function satisfiability analysis. In AAAI, 2018.
|
| 265 |
+
[67] W. Xue and T. Li. Aspect based sentiment analysis with gated convolutional networks. In I. Gurevych and Y. Miyao, editors, ACL, 2018.
|
| 266 |
+
[68] G. Zeng, Y. Chen, B. Cui, and S. Yu. Continuous learning of context-dependent processing in neural networks. Nature Machine Intelligence, 2019.
|
| 267 |
+
[69] F. Zenke, B. Poole, and S. Ganguli. Continual learning through synaptic intelligence. In International Conference on Machine Learning, pages 3987–3995. PMLR, 2017.
|
md/train/RLRXCV6DbEJ/RLRXCV6DbEJ.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VERY DEEP VAES GENERALIZE AUTOREGRESSIVE MODELS AND CAN OUTPERFORM THEM ON IMAGES
|
| 2 |
+
|
| 3 |
+
Rewon Child
|
| 4 |
+
OpenAI
|
| 5 |
+
San Francisco, CA
|
| 6 |
+
rewon@openai.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
We present a hierarchical VAE that, for the first time, generates samples quickly and outperforms the PixelCNN in log-likelihood on all natural image benchmarks. We begin by observing that, in theory, VAEs can actually represent autoregressive models, as well as faster, better models if they exist, when made sufficiently deep. Despite this, autoregressive models have historically outperformed VAEs in loglikelihood. We test if insufficient depth explains why by scaling a VAE to greater stochastic depth than previously explored and evaluating it CIFAR-10, ImageNet, and FFHQ. In comparison to the PixelCNN, these very deep VAEs achieve higher likelihoods, use fewer parameters, generate samples thousands of times faster, and are more easily applied to high-resolution images. Qualitative studies suggest this is because the VAE learns efficient hierarchical visual representations. We release our source code and models at https://github.com/openai/vdvae.
|
| 11 |
+
|
| 12 |
+

|
| 13 |
+
Figure 1: Selected samples from our very deep VAE on FFHQ-256, and a demonstration of the learned generative process. VAEs can learn to first generate global features at low resolution, then fill in local details in parallel at higher resolutions. When made sufficiently deep, this learned, parallel, multiscale generative procedure attains a higher log-likelihood than the PixelCNN.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
One potential path to increased data-efficiency, generalization, and robustness of machine learning methods is to train generative models. These models can learn useful representations without human supervision by learning to create examples of the data itself. Many types of generative models have flourished in recent years, including likelihood-based generative models, which include autoregressive models (Uria et al., 2013), variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), and invertible flows (Dinh et al., 2014; 2016). Their objective, the negative log-likelihood, is equivalent to the KL divergence between the data distribution and the model distribution. A wide variety of models can be compared and assessed along this criteria, which corresponds to how well they fit the data in an information-theoretic sense.
|
| 18 |
+
|
| 19 |
+
Starting with the PixelCNN (Van den Oord et al., 2016), autoregressive models have long achieved the highest log-likelihoods across many modalities, despite counterintuitive modeling assumptions. For example, although natural images are observations of latent scenes, autoregressive models learn dependencies solely between observed variables. That process can require complex function approximators that integrate long-range dependencies (Oord et al., 2016; Child et al., 2019). In contrast, VAEs and invertible flows incorporate latent variables and can thus, in principle, learn a simpler model that mirrors how images are actually generated. Despite this theoretical advantage, on the landmark ImageNet density estimation benchmark, the Gated PixelCNN still achieves higher likelihoods than all flows and VAEs, corresponding to a better fit with the data.
|
| 20 |
+
|
| 21 |
+
Is the autoregressive modeling assumption actually a better inductive bias for images, or can VAEs, sufficiently improved, outperform autoregressive models? The answer has significant practical stakes, because large, compute-intensive autoregressive models (Strubell et al., 2019) are increasingly used for a variety of applications (Oord et al., 2016; Brown et al., 2020; Dhariwal et al., 2020; Chen et al., 2020). Unlike autoregressive models, latent variable models only need to learn dependencies between latent and observed variables; such models can not only support faster synthesis and higher-dimensional data, but may also do so using smaller, less powerful architectures.
|
| 22 |
+
|
| 23 |
+
We start this work with a simple but (to the best of our knowledge) unstated observation: hierarchical VAEs should be able to at least match autoregressive models, because autoregressive models are equivalent to VAEs with a powerful prior and restricted approximate posterior (which merely outputs observed variables). In the worst case, VAEs should be able to replicate the functionality of autoregressive models; in the best case, they should be able to learn better latent representations, possibly with much fewer layers, if such representations exist.
|
| 24 |
+
|
| 25 |
+
We formalize this observation in Section 3, showing it is only true for VAEs with more stochastic layers than previous work has explored. Then we experimentally test it on competitive natural image benchmarks. Our contributions are the following:
|
| 26 |
+
|
| 27 |
+
• We provide theoretical justification for why greater depth (up to the data dimension $D$ , but also as low as some value $K \ll D$ ) could improve VAE performance (Section 3)
|
| 28 |
+
• We introduce an architecture capable of scaling past 70 layers, when previous work explored at most 30 (Section 4)
|
| 29 |
+
• We verify that depth, independent of model capacity, improves log-likelihood, and allows VAEs to outperform the PixelCNN on all benchmarks (Section 5.1)
|
| 30 |
+
• Compared to the PixelCNN, we show the model also uses fewer parameters, generates samples thousands of times more quickly, and can be scaled to larger images. We show evidence these qualities may emerge from the model learning an efficient hierarchical representation of images (Section 5.2)
|
| 31 |
+
• We release code and models at https://github.com/openai/vdvae.
|
| 32 |
+
|
| 33 |
+
# 2 PRELIMINARIES
|
| 34 |
+
|
| 35 |
+
We review prior work and introduce some of the basic terminology used in the field.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 2: Different possible learned generative models in a VAE. Left: A hierarchical VAE can learn an autoregressive model by using the deterministic identity function as an encoder, and learning the autoregression in the prior. Right: Learning the encoder can lead to efficient hierarchies of latent variables (black). If the bottom group of three latent variables is conditionally independent given the first, they can be generated in parallel within a single layer, potentially leading to faster sampling.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
|
| 42 |
+
# 2.1 VARIATIONAL AUTOENCODERS
|
| 43 |
+
|
| 44 |
+
Variational autoencoders (Kingma & Welling, 2014; Rezende et al., 2014) consist of a generator $p _ { \theta } ( { \pmb x } | { \pmb z } )$ , a prior $p _ { \theta } ( z )$ , and an approximate posterior $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ . Neural networks $\phi$ and $\theta$ are trained end-to-end with backpropagation and the reparameterization trick in order to maximize the evidence lower bound (ELBO):
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r } { \log p _ { \theta } ( \mathbf { x } ) \geq E _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) - D _ { K L } [ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p _ { \theta } ( \mathbf { z } ) ] } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
See Kingma & Welling (2019) for an in-depth introduction. There are many choices for what networks are used for $p _ { \theta } ( { \pmb x } | { \pmb z } )$ , $q _ { \phi } ( \pmb { z } | \pmb { x } )$ , and whether $p _ { \theta } ( z )$ is also learned or set to a simple distribution.
|
| 51 |
+
|
| 52 |
+
We study VAEs with independent $p _ { \theta } ( { \pmb x } | { \pmb z } )$ – that is, where each observed $x _ { i }$ is output without conditioning on any other $x _ { j }$ . This ensures generation time does not increase linearly with the dimensionality of the data, and requires that these VAEs learn to incorporate the complexity of the data into a rich distribution over latent variables $_ { z }$ . It is possible to have autoregressive $p _ { \theta } ( { \pmb x } | { \pmb z } )$ (Gulrajani et al., 2016), but generation is slow for these models. They also sometimes ignore latent variables entirely, becoming equivalent to normal autoregressive models (Chen et al. (2016)).
|
| 53 |
+
|
| 54 |
+
# 2.2 HIERARCHICAL VARIATIONAL AUTOENCODERS
|
| 55 |
+
|
| 56 |
+
Much of the early work on VAEs incorporate fully-factorized Gaussian $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p _ { \theta } ( z )$ . This can lead to poor outcomes if the latent variables required for good generation take on a more complex distribution, as is common with independent $p _ { \theta } ( \pmb { x } | \pmb { z } )$ . One of the simplest methods of gaining greater expressivity in both distributions is to use a hierarchical VAE, which has several stochastic layers of latent variables. These variables are emitted in groups $z _ { 0 } , z _ { 1 } , . . . , z _ { N }$ , which are conditionally dependent upon each other in some way. For images, latent variables are typically output in feature maps of varying resolutions, with $z _ { \mathrm { 0 } }$ corresponding to a small number of latent variables at low resolution at the “top” of the network, and $z _ { N }$ corresponding to a larger number of latent variables at high resolution at the “bottom”.
|
| 57 |
+
|
| 58 |
+
One particularly elegant conditioning structure is the top-down $V A E$ , introduced in Sønderby et al. (2016). In this model, both the prior and the approximate posterior generate latent variables in the same order:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { c } { { p _ { \theta } ( z ) = p _ { \theta } ( z _ { 0 } ) p _ { \theta } ( z _ { 1 } | z _ { 0 } ) . . . p _ { \theta } ( z _ { N } | z _ { < N } ) } } \\ { { q _ { \phi } ( z | x ) = q _ { \phi } ( z _ { 0 } | x ) q _ { \phi } ( z _ { 1 } | z _ { 0 } , x ) . . . q _ { \phi } ( z _ { N } | z _ { < N } , x ) } } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
A diagram of this process appears in Figure 3. A typical implementation of this model has $\phi$ first perform a deterministic “bottom-up” pass on the data to generate features, then processes the groups of latent variables from top to bottom, using feedforward networks to generate features which are shared between the approximate posterior, prior, and reconstruction network $p _ { \theta } ( { \pmb x } | { \pmb z } )$ . We adopt this base architecture as it is simple, empirically effective, and has been postulated to resemble biological processes of perception (Dayan et al., 1995).
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 3: A diagram of our top-down VAE architecture. Residual blocks are similar to bottleneck ResNet blocks (He et al., 2016). Each convolution is preceded by the GELU nonlinearity (Hendrycks & Gimpel, 2016). $q _ { \phi } ( . )$ and $p _ { \theta } ( . )$ are diagonal Gaussian distributions. $\mathbf { z }$ is sampled from $\dot { q } _ { \phi } ( . )$ during training, and $p _ { \theta } ( . )$ when sampling. We use average pooling and nearest-neighbor upsampling for pool and unpool layers.
|
| 68 |
+
|
| 69 |
+
# 3 WHY DEPTH MATTERS FOR HIERARCHICAL VAES
|
| 70 |
+
|
| 71 |
+
We find that hierarchical VAEs with sufficient depth can not only learn arbitrary orderings over observed variables, but also learn more effective latent variable distributions, if such distributions exist. We present these results below.
|
| 72 |
+
|
| 73 |
+
Definition ( $N$ -layer VAE). A deep hierarchical VAE with $N$ stochastic layers, independent $p ( { \pmb x } | z )$ , and the top-down factorization of the prior and approximate posterior in Equations 2-3.
|
| 74 |
+
|
| 75 |
+
Proposition 1. N-layer VAEs generalize autoregressive models when N is the data dimension
|
| 76 |
+
|
| 77 |
+
Proposition 2. $N$ -layer VAEs are universal approximators of $N$ -dimensional latent densities
|
| 78 |
+
|
| 79 |
+
Proposition 1 (proof in Appendix, also visualized in Figure 2, left) leads to a possible explanation of why autoregressive models to date have outperformed VAEs: they are deeper, in the sense of statistical dependence. A VAE must be as deep as the data dimension $D$ (3072 layers in the case of $3 2 \mathrm { x } 3 2$ images) if the images truly require $D$ steps to generate.
|
| 80 |
+
|
| 81 |
+
Luckily, however, Proposition 2 (proof and further technical requirements in Appendix) suggests that shorter procedures, if they exist, are also learnable. $N = D$ is an extreme case, where the most effective latent variables $z \in \mathbb { R } ^ { D }$ may simply be copies of the observed variables. But if for some $K < D$ there exist latent variables $z \in \mathbb { R } ^ { K }$ that the generator can use to more efficiently compress the data, Proposition 2 states a $K$ -layer VAE can learn the posterior and prior distribution over those variables.
|
| 82 |
+
|
| 83 |
+
Such shorter generative paths could emerge in two ways. First, as depicted in Figure 2 (right), if the model discovers that certain variables are conditionally independent given others, the model can generate them in parallel inside a single layer, where $\begin{array} { r } { q _ { \phi } ( z _ { N } \vert z _ { < N } , \pmb { x } ) = \prod _ { d } q _ { \phi } ( z _ { N } ^ { ( d ) } \vert z _ { < N } , \pmb { x } ) } \end{array}$ . We hypothesize these efficient hierarchies should emerge in images, as they contain many spatially independent textures, and study this in Section 5.2. Second, the model could learn a low-dimensional representation of the data. Dai & Wipf (2019) recently showed that when a VAE is trained on data distributed on a $K$ -dimensional manifold embedded in $\mathbb { R } ^ { D }$ , a VAE will only activate $K$ dimensions in its latent space, meaning that the VAE will require fewer layers unless the manifold dimension is $D$ , which is unlikely to be the case for images.
|
| 84 |
+
|
| 85 |
+
It is difficult to ascertain the lowest possible value of $K$ for a given dataset, but it may be deeper than most hierarchical VAEs to date. Images have many thousands of observed variables, but early hierarchical VAEs did not exceed 3 layers, until Maaløe et al. (2019) investigated a Gaussian VAE with 15 layers and found it displayed impressive performance along a variety of measures. Kingma et al. (2016) and Vahdat & Kautz (2020) additionally explored networks up to 12 and 30 layers. (These additionally incorporated additional statistical dependencies in the approximate posterior through the usage of inverse autoregressive flow (Kingma et al., 2016), an alternative approach which we contrast with our approach in Section A.4). Nevertheless, given these results we hypothesize that greater depth may improve the performance of VAEs. In the next section, we introduce an architecture capable of scaling to a greater number of stochastic layers. In Section 5.1 we show depth indeed improves performance.
|
| 86 |
+
|
| 87 |
+
# 4 AN ARCHITECTURE FOR VERY DEEP VAES
|
| 88 |
+
|
| 89 |
+
We consider a “very deep” VAE to simply be one with greater depth than has previously been explored (and do not define it to be a specific number of layers). As existing implementations of VAEs did not support many more stochastic layers than they were trained on, we reimplemented a minimal VAE with the sole aim of increasing the number of stochastic layers. This VAE consists only of convolutions, nonlinearities, and Gaussian stochastic layers. It does not exhibit posterior collapse even for large numbers of stochastic layers. We describe key architectural choices here and refer readers to our source code for more details.
|
| 90 |
+
|
| 91 |
+
# 4.1 ARCHITECTURAL COMPONENTS AND INITIALIZATION
|
| 92 |
+
|
| 93 |
+
A diagram of our network appears in Figure 3. It resembles the ResNet VAE in Kingma et al. (2016), but with bottleneck residual blocks. For each stochastic layer, the prior and posterior are diagonal Gaussian distributions, as used in prior work (Maaløe et al., 2019).
|
| 94 |
+
|
| 95 |
+
As an alternative to weight normalization and data-dependent initialization (Salimans & Kingma, 2016), we adopt the default PyTorch weight intialization. The one exception is the final convolutional layer in each residual bottleneck block, which we scale by $\scriptstyle { \frac { 1 } { \sqrt { N } } }$ , where $_ \mathrm { N }$ is the depth (similar to Radford et al. (2019); Child et al. (2019); Zhang et al. (2019)). This residual scaling improves stability and performance with many layers, as we show in the Appendix (Table 3).
|
| 96 |
+
|
| 97 |
+
Additionally, we use nearest-neighbor upsampling for our “unpool” layer, which when paired with our ResNet architecture, allows us to completely remove the “free bits” and KL “warming up” terms that appear in related work. As we detail in the Appendix (Figure 5), when upsampling is done through transposed convolutional layer, the network may ignore layers at low resolution (for instance, 1x1 or 4x4 layers). We found no evidence of posterior collapse in any networks trained with nearest neighbor interpolation.
|
| 98 |
+
|
| 99 |
+
# 4.2 STABILIZING TRAINING WITH GRADIENT SKIPPING
|
| 100 |
+
|
| 101 |
+
VAEs have notorious “optimization difficulties,” which are not frequently discussed in the literature but nevertheless well-known by practitioners. These manifest as extremely high reconstruction or KL losses and corresponding large gradient norms (up to 1e15). We address this by skipping updates with a gradient norm above a certain threshold, set by hyperparameter. Though we select high thresholds that affect fewer than $0 . 0 1 \%$ of updates, this technique almost entirely eliminates divergence, and allows networks to train smoothly. We plot the evolution of grad norms and the values we select in (Figure 6). An alternative approach to stabilizing networks may be the spectral regularization method introduced in Vahdat & Kautz (2020).
|
| 102 |
+
|
| 103 |
+
Table 1: Loss by network with different configurations of stochastic layers on ImageNet-32 (similar trends appear on CIFAR-10). Left: Networks with equal number of layers, but with lower stochastic depth as described in Section 5.1. Increasing depth up to 48 layers still shows gains, which is farther than previous work has explored. Right: Networks with 48 layers, but distributed at different resolutions. We find higher resolutions benefit more from layers.
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Depth</td><td>Params</td><td>Test Loss</td><td colspan="5">Distribution of 48 layers</td><td rowspan="2">Test Loss</td></tr><tr><td>3</td><td>41M</td><td>4.30</td><td>32x32</td><td>2 16x16</td><td>8x8</td><td>4x4</td><td>1x1</td></tr><tr><td>6</td><td>41M</td><td>4.18</td><td>10</td><td>10</td><td>10</td><td>10</td><td>8</td><td>3.98</td></tr><tr><td>12</td><td>41M</td><td>4.06</td><td>12</td><td>12</td><td>10</td><td>8</td><td>6</td><td>3.97</td></tr><tr><td>24</td><td>41M</td><td>3.98</td><td>14</td><td>14</td><td>10</td><td>6</td><td>4</td><td>3.96</td></tr><tr><td>48</td><td>41M</td><td>3.95</td><td>16</td><td>16</td><td>10</td><td>4</td><td>2</td><td>3.95</td></tr></table>
|
| 106 |
+
|
| 107 |
+
# 5 EXPERIMENTS
|
| 108 |
+
|
| 109 |
+
We trained very deep VAEs on challenging natural image datasets. All hyperparameters for experiments are available in the Appendix and in our source code.
|
| 110 |
+
|
| 111 |
+
# 5.1 STATISTICAL DEPTH, INDEPENDENT OF CAPACITY, IMPROVES PERFORMANCE
|
| 112 |
+
|
| 113 |
+
We first tested whether greater statistical depth, independent of other factors, can result in improved performance. We trained a network with 48 layers for 600k steps on ImageNet-32, grouping layers to output variables independently instead of conditioning on each other. If the input for the ith topdown block is $x _ { i }$ , we can make $K$ consecutive blocks independent by setting $x _ { i + 1 } , . . . , x _ { i + K }$ all equal to $x _ { i }$ . (Normally, $x _ { i + 1 } = x _ { i } + f ( \mathrm { b l o c k } ( x _ { i } ) ) )$ . This technique reduces the stochastic depth without affecting parameter count. Stochastic depth shows a clear correlation with performance, even up to 48 layers, which is past what previous work has explored (Table 1, left).
|
| 114 |
+
|
| 115 |
+
We then tested our hypothesis at scale. We trained networks on CIFAR-10, ImageNet-32, and ImageNet-64 with greater numbers of stochastic layers, but with fewer parameters than related work (see Table 2). On CIFAR-10, we trained a model with 45 stochastic layers and only 39M parameters, and found it achieved a test log-likelihood of 2.87 bits per dim (average of 4 seeds). On ImageNet32 and ImageNet-64, we trained networks with 78 and 75 stochastic layers and only approximately 120M parameters, and achieved likelihoods of 3.80 and 3.52.
|
| 116 |
+
|
| 117 |
+
On all tasks, these results outperform all GatedPixelCNN/PixelCNN $^ { + + }$ models, and all nonautoregressive models, while using similar or fewer parameters. These results support our hypothesis that stochastic depth, as opposed to other factors, explains the gap between VAEs and autoregressive models.
|
| 118 |
+
|
| 119 |
+
# 5.2 VERY DEEP VAES LEARN AN EFFICIENT HIERARCHICAL ORDERING
|
| 120 |
+
|
| 121 |
+
One question that emerges from the analysis in Section 3 is whether VAEs need to be as deep as autoregressive models, or whether they can learn a latent hierarchy of conditionally independent variables which are able to be synthesized in parallel. We qualitatively show this is true in Figure 4. For FFHQ-256 images, the first several layers at low resolution almost wholly determine the global features of the image, even though they only account for less than $1 \%$ of the latent variables. The rest of the high-resolution variables appear to be spatially independent, meaning they can be emitted in parallel in a number of layers much lower than the dimensionality of the image. This efficient hierarchical representation may underlie the VAE’s ability to achieve better log-likelihoods than the PixelCNN while simultaneously sampling thousands of times faster. This can be viewed as a learned parallel multiscale generation method, unlike the handcrafted approaches of Kolesnikov & Lampert (2017); Menick & Kalchbrenner (2018); Reed et al. (2017).
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 4: Cumulative percentage of latent variables at a given resolution, and reconstructions of samples on FFHQ-256. We sample latent variables from the approximate posterior until the given resolution, and sample the rest from the prior at low temperature. This shows what images are likely given a subset of latent variables. Low-resolution latents comprise a small fraction of the total latents, but encode significant portions of the global structure. This suggests deep VAEs learn efficient, hierarchical representations of the data.
|
| 125 |
+
|
| 126 |
+
Additionally, we found that on all datasets we tested, very deep VAEs used roughly $30 \%$ fewer parameters than the PixelCNN (Table 2). One possible explanation is that the learned hierarchical generation procedure involves fewer long-range dependencies, or may otherwise be simpler to learn.
|
| 127 |
+
|
| 128 |
+
We found that networks in general benefited from more layers at higher resolutions (Table 1, right). This suggests that global features may account for a smaller fraction of information than local details and textures, and that it is important to have many latent variables at high resolution.
|
| 129 |
+
|
| 130 |
+
# 5.2.1 VERY DEEP VAES ARE EASILY SCALED TO HIGH DIMENSIONAL DATA
|
| 131 |
+
|
| 132 |
+
Scaling autoregressive models to higher resolutions presents several challenges. First, the sampling time and memory requirements of autoregressive models increase linearly with resolution. This scaling makes datasets like FFHQ-256 and FFHQ-1024 intractable for naive approaches. Although clever factorization techniques have been adopted for $2 5 6 \mathrm { x } 2 5 6$ images (Menick & Kalchbrenner, 2018), such factorizations may not be as effective for alternate datasets or higher-resolution images.
|
| 133 |
+
|
| 134 |
+
Our VAE, in contrast, readily scales to higher resolutions. The same network used for $3 2 \mathrm { x } 3 2 $ images can be applied to 1024x1024 images by introducing a greater number of upsampling layers throughout the network. We found we could train an equal number of steps (1.5M) using a similar number of training resources (32 GPUs for 2.5 weeks) on both $3 2 \mathrm { x } 3 2 $ and 1024x1024 images with few hyperparameter changes (see Appendix for hyperparameters). Samples from both models (displayed in Appendix) require a single forward pass of the model to generate, with only minor differences in runtime. An autoregressive model, on the other hand, would require a thousand times more network evaluations to sample 1024x1024 images and likely require a custom training procedure.
|
| 135 |
+
|
| 136 |
+
# 6 RELATED WORK AND DISCUSSION
|
| 137 |
+
|
| 138 |
+
Our work is inspired by previous and concurrent work in hierarchical VAEs (Sønderby et al., 2016; Maaløe et al., 2019; Vahdat & Kautz, 2020). Relative to these works, we provide some justification for why deeper networks may perform better, introduce a new architecture, and empirically demonstrate gains in log-likelihood. Many aspects of prior work are complementary with ours and could be combined. Maaløe et al. (2019), for instance, incorporates a “bottom-up” stochastic path that doubles the depth of the approximate posterior, and Vahdat & Kautz (2020) introduces a number of powerful architecture components and improved training techniques. We seek here not to introduce a significantly better method than these alternatives, but to demonstrate that depth is a key overlooked factor in most prior approaches to VAEs.
|
| 139 |
+
|
| 140 |
+
Table 2: Our main results on standard benchmark datasets. Very deep VAEs outperform PixelCNN-based autoregressive models with fewer parameters while maintaining fast sampling. “Depth” refers to the number of stochastic layers for hierarchical VAEs (although BIVA and IAFbased networks have additional statistical dependencies). Sampling refers to the number of network evaluations per sample, and $D$ designates the dimensionality of the data. An asterisk $( ^ { * } )$ denotes our estimate of parameters. Samples for ImageNet and CIFAR-10 are in the Appendix.
|
| 141 |
+
|
| 142 |
+
<table><tr><td></td><td>Model type</td><td>Params</td><td>Depth</td><td>Sampling</td><td>NLL</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CIFAR-10 PixelCNN++ (Salimans et al., 2017)</td><td>AR</td><td>53M*</td><td></td><td>D</td><td>2.92</td></tr><tr><td>PixelSNAIL (Chen et al., 2017)</td><td>AR</td><td></td><td></td><td>D</td><td>2.85</td></tr><tr><td>Sparse Transformer (Child et al.,2019)</td><td>AR</td><td>59M</td><td></td><td>D</td><td>2.80</td></tr><tr><td></td><td>VAE</td><td></td><td></td><td></td><td></td></tr><tr><td>VLAE (Chen et al., 2016)</td><td>VAE</td><td></td><td>12</td><td>D</td><td>≤2.95</td></tr><tr><td>IAF-VAE (Kingma et al., 2016) Flow++ (Ho et al.,2019)</td><td>Flow</td><td>31M</td><td></td><td>1</td><td>≤3.11</td></tr><tr><td>BIVA (Maalpe et al.,2019)</td><td>VAE</td><td>103M</td><td>15</td><td>1</td><td>≤3.08</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.08</td></tr><tr><td>NVAE (Vahdat & Kautz, 2020) Very Deep VAE (ours)</td><td>VAE VAE</td><td>131M 39M</td><td>30 45</td><td>1 1</td><td>≤ 2.91 ≤ 2.87</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-32 Gated PixelCNN</td><td>AR</td><td>177M*</td><td>10</td><td></td><td></td></tr><tr><td>Image Transformer (Parmar et al., 2018)</td><td>AR</td><td></td><td></td><td>D</td><td>3.83</td></tr><tr><td>BIVA</td><td>VAE</td><td>103M*</td><td>15</td><td>D</td><td>3.77</td></tr><tr><td>NVAE</td><td></td><td>268M</td><td>28</td><td>1</td><td>≤3.96</td></tr><tr><td>Flow++</td><td>VAE</td><td>169M</td><td></td><td>1</td><td>≤3.92</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>119M</td><td>78</td><td>1 1</td><td>≤3.86 ≤3.80</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ImageNet-64 Gated PixelCNN</td><td></td><td>177M*</td><td></td><td></td><td></td></tr><tr><td>SPN (Menick & Kalchbrenner, 2018)</td><td>AR AR</td><td>150M</td><td></td><td>D</td><td>3.57</td></tr><tr><td>Sparse Transformer</td><td>AR</td><td>152M</td><td></td><td>D</td><td>3.52</td></tr><tr><td>Glow (Kingma & Dhariwal, 2018)</td><td>Flow</td><td></td><td></td><td>D</td><td>3.44</td></tr><tr><td>Flow++</td><td></td><td>73M</td><td></td><td>1</td><td>3.81</td></tr><tr><td>Very Deep VAE (ours)</td><td>Flow VAE</td><td>125M</td><td>75</td><td>1</td><td>≤3.69</td></tr><tr><td></td><td></td><td></td><td></td><td>1</td><td>≤3.52</td></tr><tr><td>FFHQ-256 (5 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>NVAE</td><td>VAE</td><td></td><td>36</td><td>1</td><td>≤0.68</td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>62</td><td>1</td><td>≤0.61</td></tr><tr><td>FFHQ-1024 (8 bit)</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Very Deep VAE (ours)</td><td>VAE</td><td>115M</td><td>72</td><td>1</td><td>≤ 2.42</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Diffusion models can be seen as deep VAEs that, like autoregressive models, have a specific analytical posterior. Ho et al. (2020) showed that such models achieve impressive sample quality with great depth, which is in line with our observations that greater depth is helpful for VAEs. One benefit of the VAEs we outline in this work over diffusion models is that our VAEs generate samples with a single network evaluation, whereas diffusion models currently require a large number of network evaluations per sample.
|
| 145 |
+
|
| 146 |
+
Inverse autoregressive flows (IAF) are also closely related, and we discuss the differences with hierarchical models in Section A.4. The work of Zhao et al. (2017) may also appear to contradict our findings, and we discuss that work in Section A.5.
|
| 147 |
+
|
| 148 |
+
# 7 CONCLUSION
|
| 149 |
+
|
| 150 |
+
We argue deeper VAEs should perform better, introduce a deeper architecture, and show it outperforms all PixelCNN-based autoregressive models in likelihood while being more efficient. We hope this encourages work in further improving VAEs and latent variable models.
|
| 151 |
+
|
| 152 |
+
# ACKNOWLEDGMENTS
|
| 153 |
+
|
| 154 |
+
We thank Aditya Ramesh, Pranav Shyam, Johannes Otterbach, Heewoo Jun, Mark Chen, Prafulla Dhariwal, Alec Radford, Yura Burda, Bowen Baker, Raul Puri, and Ilya Sutskever for helpful discussions. We also thank the anonymous reviewers for helping improve our work.
|
| 155 |
+
|
| 156 |
+
# REFERENCES
|
| 157 |
+
|
| 158 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 159 |
+
|
| 160 |
+
Mark Chen, Alec Radford, Rewon Child, Jeff Wu, Heewoo Jun, Prafulla Dhariwal, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 161 |
+
|
| 162 |
+
Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational lossy autoencoder. arXiv preprint arXiv:1611.02731, 2016.
|
| 163 |
+
|
| 164 |
+
Xi Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. Pixelsnail: An improved autoregressive generative model. arXiv preprint arXiv:1712.09763, 2017.
|
| 165 |
+
|
| 166 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 167 |
+
|
| 168 |
+
Bin Dai and David Wipf. Diagnosing and enhancing vae models. arXiv preprint arXiv:1903.05789, 2019.
|
| 169 |
+
|
| 170 |
+
Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The helmholtz machine. Neural computation, 7(5):889–904, 1995.
|
| 171 |
+
|
| 172 |
+
Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, and Ilya Sutskever. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020.
|
| 173 |
+
|
| 174 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 175 |
+
|
| 176 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
|
| 177 |
+
|
| 178 |
+
Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. arXiv preprint arXiv:1611.05013, 2016.
|
| 179 |
+
|
| 180 |
+
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.
|
| 181 |
+
|
| 182 |
+
Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
|
| 183 |
+
|
| 184 |
+
Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow $^ { + + }$ : Improving flowbased generative models with variational dequantization and architecture design. arXiv preprint arXiv:1902.00275, 2019.
|
| 185 |
+
|
| 186 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. arXiv preprint arxiv:2006.11239, 2020.
|
| 187 |
+
|
| 188 |
+
Chin-Wei Huang, Ahmed Touati, Laurent Dinh, Michal Drozdzal, Mohammad Havaei, Laurent Charlin, and Aaron Courville. Learnable explicit density for continuous latent space and variational inference. arXiv preprint arXiv:1710.02248, 2017.
|
| 189 |
+
|
| 190 |
+
Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. arXiv preprint arXiv:1804.00779, 2018.
|
| 191 |
+
|
| 192 |
+
Diederik P Kingma and Max Welling. Stochastic gradient vb and the variational auto-encoder. In Second International Conference on Learning Representations, ICLR, volume 19, 2014.
|
| 193 |
+
|
| 194 |
+
Diederik P Kingma and Max Welling. An introduction to variational autoencoders. arXiv preprint arXiv:1906.02691, 2019.
|
| 195 |
+
|
| 196 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
|
| 197 |
+
|
| 198 |
+
Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743–4751, 2016.
|
| 199 |
+
|
| 200 |
+
Alexander Kolesnikov and Christoph H Lampert. Pixelcnn models with auxiliary variables for natural image modeling. In International Conference on Machine Learning, pp. 1905–1914. PMLR, 2017.
|
| 201 |
+
|
| 202 |
+
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, pp. 6548–6558, 2019.
|
| 203 |
+
|
| 204 |
+
Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. arXiv preprint arXiv:1812.01608, 2018.
|
| 205 |
+
|
| 206 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 207 |
+
|
| 208 |
+
George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. arXiv preprint arXiv:1912.02762, 2019.
|
| 209 |
+
|
| 210 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018.
|
| 211 |
+
|
| 212 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019.
|
| 213 |
+
|
| 214 |
+
Scott Reed, Aaron van den Oord, Nal Kalchbrenner, Sergio G ¨ omez Colmenarejo, Ziyu Wang, Dan ´ Belov, and Nando De Freitas. Parallel multiscale autoregressive density estimation. arXiv preprint arXiv:1703.03664, 2017.
|
| 215 |
+
|
| 216 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 217 |
+
|
| 218 |
+
Tim Salimans and Durk 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.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Table 3: Effects of scaling residual initialization on very deep VAEs. We trained networks with varying depths for $8 0 \mathrm { k }$ iterations. Scaling the last layer in the residual block by $\scriptstyle { \frac { 1 } { \sqrt { N } } }$ results in higher losses for shallower networks, but lower losses and greater stability for deeper networks. The number of updates which are skipped because the gradient norm would destabilize the network is significantly reduced with scaling.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Depth</td><td>Without scaling Loss</td><td>Skipped Updates</td><td>With scaling Loss</td><td>Skipped Updates</td></tr><tr><td>15</td><td>2.50</td><td>13</td><td>2.51</td><td>0</td></tr><tr><td>30</td><td>2.36</td><td>41</td><td>2.38</td><td>1</td></tr><tr><td>45</td><td>2.31</td><td>48</td><td>2.30</td><td>0</td></tr><tr><td>60</td><td>2.30</td><td>76</td><td>2.29</td><td>1</td></tr><tr><td>75</td><td>Diverged</td><td>1</td><td>2.28</td><td>0</td></tr></table>
|
| 225 |
+
|
| 226 |
+
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.
|
| 227 |
+
|
| 228 |
+
Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019.
|
| 229 |
+
|
| 230 |
+
Benigno Uria, Iain Murray, and Hugo Larochelle. Rnade: The real-valued neural autoregressive density-estimator. In Advances in Neural Information Processing Systems, pp. 2175–2183, 2013.
|
| 231 |
+
|
| 232 |
+
Arash Vahdat and Jan Kautz. Nvae: A deep hierarchical variational autoencoder. arXiv preprint arXiv:2007.03898, 2020.
|
| 233 |
+
|
| 234 |
+
Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pp. 4790–4798, 2016.
|
| 235 |
+
|
| 236 |
+
Hongyi Zhang, Yann N Dauphin, and Tengyu Ma. Fixup initialization: Residual learning without normalization. arXiv preprint arXiv:1901.09321, 2019.
|
| 237 |
+
|
| 238 |
+
Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from generative models. arXiv preprint arXiv:1702.08396, 2017.
|
| 239 |
+
|
| 240 |
+
# A APPENDIX
|
| 241 |
+
|
| 242 |
+
# A.1 ABLATIONS OF ARCHITECTURAL COMPONENTS
|
| 243 |
+
|
| 244 |
+
First, we visualize data that suggests upsampling layers and residual connections have an impact on posterior collapse (Figure 5). Architectural differences may explain why our VAEs do not need “free bits” or KL warmups to avoid posterior collapse.
|
| 245 |
+
|
| 246 |
+
In Table 3, we show residual initialization leads to smoother and better training of very deep VAEs. Without residual initialization, very deep VAEs encounter a high number of unstable updates and have higher losses.
|
| 247 |
+
|
| 248 |
+
In Figure 6, we show the max gradient norms experienced throughout training, and show that our skipping criterion avoids a small number of updates that would destabilize the network.
|
| 249 |
+
|
| 250 |
+
A.2 PROPOSITION 1: N-LAYER VAES GENERALIZE AUTOREGRESSIVE MODELS WHEN N IS THE DATA DIMENSION
|
| 251 |
+
|
| 252 |
+
Proposition 1 shows that an autoregressive model with an arbitrary ordering over observed variables in $\dot { \boldsymbol { x } } \in \mathbb { R } ^ { N }$ is equivalent to an $N$ -layer VAE with an approximate posterior that simply outputs the observed variables in the given order, and a generator that performs the identity function (see Figure 2).
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 5: Relationship between architecture and posterior collapse. We visualize the cumulative KL divergence (or “rate”, in bits per dimension) for several different architectures across a 73 layer network on ImageNet-32. When residual connections are removed from the “res block” in the topdown path (Figure 3), the model encodes no information in the first 45 layers of the network and the loss is highest (”FFN”). When a learned convolutional upsampler is used as the “unpool” layer, the first 13 layers of the network encode no information. When nearest-neighbor upsampling is used, the first layers all encode information, and the loss is the lowest.
|
| 256 |
+
|
| 257 |
+
Without loss of generality, we simplify notation by assuming each vector-valued latent variable $z _ { i }$ only has one element, which we write as $z _ { i } \in \mathbb { R }$ . We assume a prior and approximate posterior distribution following Equation 2 and 3.
|
| 258 |
+
|
| 259 |
+
Proof. Let $q ( z _ { i } ~ = ~ x _ { i } | \boldsymbol { z } _ { < i } , \pmb { x } ) ~ = ~ 1$ , and $p ( x _ { i } ~ = ~ z _ { i } | z ) ~ = ~ 1$ . Then $p ( z | \mathbf { x } ) ~ = ~ q ( z | \mathbf { x } ) .$ , which is well-known to imply equality in the evidence lower bound (ELBO) of Eq. 1. Since $\log q ( z | \pmb { x } ) = \log p ( \pmb { x } | z ) = 0$ , the ELBO becomes $\begin{array} { r } { \log p _ { \theta } ( { \pmb x } ) = \log p _ { \theta } ( { \pmb z } ) = \sum _ { i = 1 } ^ { N } \log p _ { \theta } ( z _ { i } | z _ { < i } ) = } \end{array}$ $\textstyle \sum _ { i = 1 } ^ { N } \log p _ { \theta } ( x _ { i } | \boldsymbol { x } _ { < i } )$ , which is equivalent to an autoregressive model over the observed variables. □
|
| 260 |
+
|
| 261 |
+
# A.3 PROPOSITION 2: $N$ -LAYER VAES ARE UNIVERSAL APPROXIMATORS OF $N$ -DIMENSIONAL LATENT DENSITIES
|
| 262 |
+
|
| 263 |
+
Proposition 2 shows that hierarchical VAEs learn depthwise autoregressive flows, and under certain conditions (described in Huang et al. (2017)) can express any density over latent variables of $N$ dimensions, given enough capacity.
|
| 264 |
+
|
| 265 |
+
Proof. We omit full proof, and refer readers to Huang et al. (2017); Papamakarios et al. (2019), where universality is established for autoregressive flows. Here we only note that the prior and approximate posterior in an $N$ -layer VAE are autoregressive flows: Let $p _ { \theta } ( z )$ be the prior distribution. $p _ { \theta } ( z )$ can be written using the reparameterization trick as a deterministic function of noise $\epsilon$ drawn from a known base density $p _ { N }$ $\begin{array} { r } { \mathrm { : ~ } p _ { \theta } ( z ) = p _ { N } ( \epsilon ) \left| \operatorname* { d e t } \frac { \partial f ( \epsilon , \theta ) } { \partial \epsilon } \right| } \end{array}$ where $f$ is a neural network that implements the factorization in Eq. 2. Since $f$ is autoregressive and its Jacobian is lower triangular, $p _ { \theta } ( z )$ can approximate any $p ( z )$ that fits the criteria in Huang et al. (2017). The same logic applies to $q _ { \phi } ( \pmb { z } | \pmb { x } )$ and $p ( \boldsymbol { z } | \boldsymbol { x } )$ . It should be noted that this result depends on $f$ being able to implement the inverse CDF of an arbitrary probability density, and so using Gaussian distributions will restrict the densities the VAE can express in practice. This is a limitation of our architecture that we nevertheless adopt since we hypothesize depth, not the elementwise density, is the more important factor. More discussion on this subject, and options for removing this restriction, are described in Huang et al. (2017) and Huang et al. (2018), and we defer studying more expressive elementwise densities to future work. □
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 6: Effect of gradient skipping. We plot the max gradient norm encountered per 500 updates for our best models across datasets. The dashed black line indicates the “skip threshold”, or value above which the update is skipped. We choose a high threshold that affects fewer than 0.01 percent of training updates. Without this skip heuristic, networks will diverge when extreme updates are encountered. These updates can have norm as high as 1e15.
|
| 269 |
+
|
| 270 |
+
# A.4 A NOTE ON INVERSE AUTOREGRESSIVE FLOW
|
| 271 |
+
|
| 272 |
+
Inverse autoregressive flows (IAF, Kingma et al. (2016)) and are similar to very deep VAEs in that they are universal approximators of posterior distributions in VAEs, even with just a single layer and sufficiently expressive univariate density (Huang et al., 2018).
|
| 273 |
+
|
| 274 |
+
There are several practical differences between IAFs and deep hierarchical VAEs, however, which can result in qualitatively very different behavior. First, the masked autoregressive components in IAF build statistical dependencies spatially, whereas a very deep hierarchical VAE builds dependencies depthwise, and these inductive biases may better suit different domains. Additionally, IAFs spend an equal amount of computation and parameters on each variable. In contrast, a deep VAE can specify a structure, like a hierarchy of global-to-local variables, which have different computational and modeling capacities for each stage. For images, these differences may result in qualitatively different behavior, and it is not clear whether a single layer IAF can readily learn the sort of rich hierarchical decomposition of images that appear with very deep VAEs.
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 7: Non-cherrypicked, temperature 1.0 samples on FFHQ-256. Cover images were each cherrypicked from a batch of 16 (unadjusted temperature) samples. Here we show a random batch of 16 images for comparison.
|
| 278 |
+
|
| 279 |
+
Nevertheless, the two techniques are complementary – IAF was introduced in a deep hierarchical VAE (Kingma et al., 2016), in fact, and it is likely that introducing IAF into our architecture (as in Vahdat & Kautz (2020)) would improve performance.
|
| 280 |
+
|
| 281 |
+
# A.5 A NOTE ON LEARNING HIERARCHICAL FEATURES
|
| 282 |
+
|
| 283 |
+
The work of Zhao et al. (2017) may appear to contradict our work, by suggesting that additional layers in hierarchical VAEs do not lead to additional expressivity, based off their finding that Gibbs sampling from the last stochastic layer is sufficient to recover the data. For high dimensional data like images, however, the last stochastic layer may have many thousands of variables, and Gibbs sampling may take unacceptably long to converge. A hierarchy of latent variables as in our model allows efficient and tractable sampling from this distribution. Additionally, assumptions regarding global maximization of the ELBO may not apply in practice. Nevertheless, we think further clarifying these contradictory statements would be useful future work.
|
| 284 |
+
|
| 285 |
+
# A.6 BROADER IMPACT
|
| 286 |
+
|
| 287 |
+
Broadly speaking, any generative model will reflect the biases of the datasets they are trained on. If deployed without careful consideration, generative models (including but not limited to VAEs) trained on research datasets like ImageNet, CIFAR-10, and FFHQ may inadvertently cause harm by propagating or otherwise reinforcing harmful biases in the dataset. Further work is required to improve and debias research benchmark datasets to mitigate this source of negative impact.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 8: Non-cherrypicked, temperature 0.85 samples on FFHQ-256. Lower temperature samples result in greater regularity in images.
|
| 291 |
+
|
| 292 |
+
Some VAEs are distinguished from other generative models by their fast synthesis of new data examples. Generative models with fast synthesis can allow for realtime synthesis of high dimensional data, such as music, speech, and video. These models could be used to augment human creativity and lead to a number of helpful applications in real-time media applications. Such models could also be used for compression, which could assist in delivering content to bandwidth-constrained regions of the world. They can also be used for spreading disinformation, generally making it less possible to distinguish real from generated data. An additional potential harm is that fast, high quality synthesis of data could end up economically displacing individuals who rely upon creative work, such as musicians, visual artists, and more.
|
| 293 |
+
|
| 294 |
+
VAEs also are distinguished by their usage of latent variables. Generative models with useful latent variables could have positive impacts in scientific domains, where density estimation could lead to novel insights about chemical, physical, or biological data. Latent variable representations of data could also be helpful in efforts to debias, interpret, or otherwise increase understandibility of models and their representations.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 9: Non-cherrypicked, temperature 0.60 samples on FFHQ-256. We visualize temperature 0.60 samples for comparison with Vahdat & Kautz (2020)
|
| 298 |
+
|
| 299 |
+
Table 4: Key hyperparameters for experiments. We detail here the main hyperparameters used in training. FFHQ-1024 has reduced hidden size for higher resolutions; see code for details.
|
| 300 |
+
|
| 301 |
+
<table><tr><td>Parameter</td><td>CIFAR-10</td><td>ImageNet-32</td><td>ImageNet-64</td><td>FFHQ-256</td><td>FFHQ-1024</td></tr><tr><td>Num layers</td><td>45</td><td>78</td><td>75</td><td>62</td><td>72</td></tr><tr><td>Hidden size</td><td>384</td><td>512</td><td>512</td><td>512</td><td>Varies</td></tr><tr><td>Bottleneck size</td><td>96</td><td>128</td><td>128</td><td>128</td><td>Varies</td></tr><tr><td>Latent dim per layer</td><td>16</td><td>16</td><td>16</td><td>16</td><td>16</td></tr><tr><td>Batch size</td><td>32</td><td>256</td><td>128</td><td>32</td><td>32</td></tr><tr><td>Learning rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00007</td></tr><tr><td>Optimizer</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td></tr><tr><td>Skip threshold</td><td>400</td><td>300</td><td>380</td><td>180</td><td>500</td></tr><tr><td>Weight Decay</td><td>0.01</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td></tr><tr><td>EMA rate</td><td>0.0002</td><td>0.00015</td><td>0.00015</td><td>0.00015</td><td>0.00015</td></tr><tr><td>Training iterations</td><td>1.1M</td><td>1.7M</td><td>1.6M</td><td>1.7M</td><td>1.7M</td></tr><tr><td>GPUs</td><td>2 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td><td>32 x V100</td></tr><tr><td>Training time</td><td>6 days</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td><td>2.5 weeks</td></tr><tr><td>Parameters</td><td>39M</td><td>119M</td><td>125M</td><td>115M</td><td>115M</td></tr></table>
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 10: ImageNet-32 (left) and ImageNet-64 (right) reconstructions and samples. Reconstructions of validation images from various stages in the latent hierarchy (top), and unconditional samples from the model at temperature 1.0 (bottom).
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 11: FFHQ-1024 samples. These are generated with reduced temperature (top) and temperature 1.0 (bottom). The model we train has similar capacity to smaller ones we use on $3 2 \mathrm { x } 3 2 $ , 64x64, and $2 5 6 \times 2 5 6$ images, and so fails to capture the intricacies of this more complex distribution well. A larger model, trained for longer, may achieve better sample quality.
|
md/train/RO4DM85Z4P7/RO4DM85Z4P7.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# XIRL: Cross-embodiment Inverse Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Kevin Zakka1,3⇤, Andy $\mathbf { Z e n g } ^ { 2 }$ , Pete Florence2, Jonathan Tompson2, Jeannette $\mathbf { B o h g } ^ { 1 }$ , and Debidatta Dwibedi2 1Stanford University, 2Robotics at Google, 3UC Berkeley
|
| 4 |
+
|
| 5 |
+
Abstract: We investigate the visual cross-embodiment imitation setting, in which agents learn policies from videos of other agents (such as humans) demonstrating the same task, but with stark differences in their embodiments – shape, actions, end-effector dynamics, etc. In this work, we demonstrate that it is possible to automatically discover and learn vision-based reward functions from cross-embodiment demonstration videos that are robust to these differences. Specifically, we present a self-supervised method for Crossembodiment Inverse Reinforcement Learning (XIRL) that leverages temporal cycleconsistency constraints to learn deep visual embeddings that capture task progression from offline videos of demonstrations across multiple expert agents, each performing the same task differently due to embodiment differences. Prior to our work, producing rewards from self-supervised embeddings typically required alignment with a reference trajectory, which may be difficult to acquire under stark embodiment differences. We show empirically that if the embeddings are aware of task progress, simply taking the negative distance between the current state and goal state in the learned embedding space is useful as a reward for training policies with reinforcement learning. We find our learned reward function not only works for embodiments seen during training, but also generalizes to entirely new embodiments. Additionally, when transferring real-world human demonstrations to a simulated robot, we find that XIRL is more sample efficient than current best methods. Qualitative results, code, and datasets are available at https://x-irl.github.io
|
| 6 |
+
|
| 7 |
+
Keywords: inverse reinforcement learning, imitation learning, self-supervised learning
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
The ability to learn new tasks from third-person demonstrations holds the potential to enable robots to leverage the vast quantities of tutorial videos that can be gleaned from the world-wide web (e.g., YouTube videos). However, distilling diverse and unstructured videos into motor skills with vision-based policies can be daunting – as the videos themselves are often not only captured from different camera viewpoints in different environments, but also with different experts that may use different tools, objects, or strategies to perform the same task. Perhaps most critically, there often exists a clear embodiment gap between the human expert demonstrator, and the robot hardware that executes the learned policies. One approach to close this gap is to learn a mapping between the human and robot embodiment [1], which is a non-trivial intermediate problem in itself.
|
| 12 |
+
|
| 13 |
+
Despite considerable progress in learning policies with paired observations and actions (e.g., collected via teleoperation) [2, 3], much less work has been done in getting robots to learn policies from tasks defined only by third-person observations of demonstrations [4, 5, 6]. This is a surprisingly challenging problem, as different embodiments are likely to use unique strategies that suit them and allow them to make progress on a given task. For example, if asked to “place five pens into a cup”, a human hand is likely to scoop up all pens before slipping them into the cup, whereas a two-fingered gripper might instead need to pick and place each pen individually. Both strategies complete the task, but generate different state-action trajectories. In this setting, it may be difficult to acquire labeled frame-to-frame correspondences between expert demonstration videos and learned embodiments [6], particularly across a multitude of embodiments or experts. The approach we investigate instead is whether we can successfully learn tasks through a learned notion of task progress that is invariant to the embodiment performing the task.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1. Cross-embodiment Inverse Reinforcement Learning. We learn embodiment-invariant visual representations from offline video demonstrations (stick agents on the left) using TCC [7], then use the trained encoder to generate embodiment-invariant visual reward functions that can be used to learn policies on new embodiments (gripper on the right) with reinforcement learning.
|
| 17 |
+
|
| 18 |
+
In this work, we propose to enable agents to imitate video demonstrations of experts – including ones with different embodiments – by using a task-specific, embodiment-invariant reward formulation trained via temporal cycle-consistency (TCC) [7]. We demonstrate how we can leverage an encoder trained with TCC to define dense rewards for downstream reinforcement learning (RL) policies via simple distances in the learned embedding space. Simulated experiments across four different embodiments show that these learned rewards are capable of generalizing to new embodiments, enabling unseen agents to learn the task via reinforcement, and surprisingly in some cases, exceeding the sample efficiency of the same agent learned with ground truth sparse rewards. We also demonstrate the effectiveness of our approach for learning robot policies using human demonstrations on the State Pusher environment from [6], where our reward is first learned on real-world human demonstrations, then used to teach a Sawyer arm how to perform the task in simulation.
|
| 19 |
+
|
| 20 |
+
Our contributions are as follows: (i) We introduce Cross-embodiment Inverse Reinforcement Learning (XIRL), an effective, label-free framework for tackling cross-embodiment visual imitation learning. Our core contribution is to use self-supervised learning on third-person demonstration videos to define dense reward functions amenable for downstream reinforcement learning policies, (ii) Along with XIRL, we release a cross-embodiment imitation learning benchmark, X-MAGICAL, which features multiple simulated agents with different embodiments performing the same manipulation task, including one thousand expert demonstrations for each agent, (iii) We show that XIRL significantly outperforms alternative methods on both the X-MAGICAL benchmark and the human-to-robot transfer benchmark from [6], and discuss our observations, which point to interesting areas for future research, (iv) Finally, we introduce a real-world dataset, X-REAL (Cross-embodiment Real demonstrations), of a manipulation task performed with nine different embodiments, which can be used to evaluate cross-embodiment reward learning methods2.
|
| 21 |
+
|
| 22 |
+
# 2 Related Work
|
| 23 |
+
|
| 24 |
+
Traditional formulations of imitation learning [8, 1, 9] assume access to a corpus of expert demonstration data which includes both state and action trajectories of the expert policy. In the context of third-person imitation learning, including when learning from expert agents with different embodiments, obtaining access to ground-truth actions is difficult or impossible3.
|
| 25 |
+
|
| 26 |
+
Inferring expert actions. To address this issue, several approaches either try to infer expert actions [10, 11, 12] – for example by training an inverse dynamics model on agent interaction data [10] – or employ forward prediction on the next state to imitate the expert without direct action supervision [13]. While these methods successfully address learning from observation-only demonstrations, they either do not support skill transfer to different policy embodiments at all, or they cannot take advantage of multiple embodiments in order to improve generalization to unseen policy configurations. We explicitly address these problems in this work.
|
| 27 |
+
|
| 28 |
+
Imitation via learned reward functions. In contrast to imitation via supervised methods, such as BCO [10], a recent body of work [4, 5, 14, 6, 15] has focused on learning reward functions from expert video data and then training RL policies to maximize this reward. In [4], the authors combine ImageNet pre-trained visual features with an L2-norm distance reward to match policy and expert observations in a latent feature space. In their follow-up work [5], the reward is computed in a viewpoint-invariant representation that is self-supervised on video data. While both these methods are compelling in their use of cheap unlabeled data to learn invariant rewards, the use of a time index as a heuristic for defining weak correspondence is a constraining limitation for tasks that need to be executed at different speeds, or are not strictly monotonic (e.g., have ambiguous sub-task ordering). In [14] a dense reward is learned via unsupervised learning on YouTube data and the authors make no assumption about time alignment. However, in their work, the expert and learned policy are executed in the same domain and embodiment, an assumption we relax in our work. Framed in a multi-task learning setting, [16] propose training policies with morphologically different embodiments first on a similar set of proxy tasks, in order to learn a latent space to map between domains, and then sharing skills on a held-out task from one policy to another. A time-index heuristic is used to define a metric reward when performing RL training of the new task. In our work, the learned embedding finds correspondences in a fully-unsupervised fashion, without the need for such strict time alignment. In [17], a small sub-set of states is human labeled for goal success and a convolutional network is then trained to detect successful task completion from image observations, where on-policy samples are used as negatives for the classifier. By contrast, our learned embedding encodes task progress in its latent representation without the use of expensive human labels.
|
| 29 |
+
|
| 30 |
+
Imitation via domain adaptation. An additional category of approaches to third-person imitation learning are those that perform domain adaptation of expert observations [18, 19, 20, 21]. For instance, in [18] a CycleGAN [22] architecture is used to perform pixel-level image-to-image translation between policy domains, which is then used to construct a reward function for a model-based RL algorithm. A similar model-free approach is proposed in [19]. In [20], a generative model is used to predict robot high-level sub-goals conditioned on a third-person demonstration video, and a lower-level control policy is trained in a task-agnostic manner. Similarly, [21] uses high level task conditioning from zero-shot transfer of expert demonstrations, but they use KL matching to perform both high and low-level imitation. In contrast to these methods, the unsupervised TCC alignment in this work avoids performing explicit domain adaptation or pixel-level image translation by instead learning a robust and invariant feature space in a fully offline fashion.
|
| 31 |
+
|
| 32 |
+
Reinforcement learning with demonstrations. Recent work in offline-reinforcement learning [6] explicitly tackles the problem of policy embodiment and domain shift. Their method, Reinforcement Learning from Videos (RLV), uses a labelled collection of expert-policy state pairs in conjunction with adversarial training to learn an inverse dynamics model jointly optimized with the policy. In contrast, we avoid the limitation of collecting human-labeled dense state correspondences by using a self-supervised algorithm (i.e., TCC [7]) which uses cycle-consistency to automatically learn the correspondence between states of two domains. We also show that this formulation improves generalization to unseen embodiments. Since the problem setup is similar to ours, we also compare to their method as a baseline.
|
| 33 |
+
|
| 34 |
+
# 3 Approach
|
| 35 |
+
|
| 36 |
+
Our overall XIRL framework (Figure 1) addresses the cross-embodiment visual imitation problem (Section 3.1). The framework consists of first using TCC to self-supervise embodiment-invariant visual representations (Section 3.2), then using a novel embodiment-invariant visual reward function (Section 3.3) to perform cross-embodiment visual imitation via reinforcement learning (Section 3.4).
|
| 37 |
+
|
| 38 |
+
# 3.1 Problem Formulation
|
| 39 |
+
|
| 40 |
+
Our objective is to extract an agent-invariant definition of a task, via a learned reward function, from a dataset of videos of separate agents performing the same task. In particular, we are interested in agents that may solve the task in entirely different ways due to differences in their end-effector, shapes, dynamics, etc., which we refer to as embodiment differences. For example, consider how differently a vacuum gripper and a parallel-jaw gripper will grasp an object as a result of their respective end-effectors. Such a setup is quite common in robotic imitation learning, where we might have access to observation data of humans demonstrating a task, but want to teach a robot to perform it. It is very likely that the way the human executes the task will diverge from how the robot would execute it.
|
| 41 |
+
|
| 42 |
+
We define a dataset of multiple agents performing the same task $T$ as $\textstyle D = \bigcup _ { i = 1 } ^ { n } D _ { i }$ , where $D _ { i }$ is an agent-specific dataset containing observations of only agent $i$ performing task $T$ . Each agent’s dataset $D _ { i }$ is a collection of videos defined as ${ { D } _ { i } } = \{ v _ { i } ^ { 1 } , v _ { i } ^ { 2 } . . . v _ { i } ^ { K } \}$ , where $v _ { i } ^ { j }$ represents the video of the $j ^ { t h }$ demonstration of agent $i$ successfully performing the task $T$ . We would like to highlight that $D$ only contains observation data, i.e., it does not store the actions taken by the respective agents. We use self-supervised representation learning techniques to learn task-specific representations from this dataset.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2. Difference in state distributions of the across different embodiments performing the same task in X-MAGICAL (Section 4.1).
|
| 46 |
+
|
| 47 |
+
# 3.2 Representation Learning
|
| 48 |
+
|
| 49 |
+
In this work, we use TCC [7] to learn task-specific representations in a self-supervised way. The method has been shown to learn useful representations on videos of the same action for temporally fine-grained downstream tasks. In their paper, the authors show that TCC representations can predict frame-level task progress, such as predicting how much water is in a cup during pouring, without requiring any human annotations. Task progress can provide dense signals for learning a new task and we would like to bake this property into our learned reward. Another advantage of TCC is that it does not require supervision for frame-level alignment (i.e., which frames in two videos correspond to each other). Such frame-to-frame correspondences are required by a prior method, RLV [6], to achieve successful reinforcement learning on the considered tasks, but we would like to avoid this type of manual supervision.
|
| 50 |
+
|
| 51 |
+
We train an image encoder $\phi$ , that ingests an image $I$ and returns an embedding vector $\phi ( I )$ , using TCC. TCC assumes that there exist semantic temporal correspondences between two video sequences, even though they are not labeled and the actions may be executed at different speeds. Note that in our case, the assumption holds since all sequences in our dataset originate from the same task. Furthermore, even if two different agents accomplish the task very differently, there will be a common set of states or frames that will temporally correspond. When we apply the TCC loss, we compare frames of one agent performing the task with frames from another, and search for temporal similarities in how both execute the task. By performing multiple such comparisons and cycling-back (described in the next paragraph), TCC encodes task progress in its latent representation, a property that is useful for learning task-specific, yet embodiment-invariant reward functions. For completeness, we describe the training technique below.
|
| 52 |
+
|
| 53 |
+
We define a dataset $D _ { \mathrm { a l l } } = \{ v _ { 1 } , v _ { 2 } . . . v _ { N } \}$ that contains the videos of all agents executing the same task $T$ . We are able to merge the datasets of different agents since TCC does not require embodiment labels (i.e., IDs) during training. We first sample a random batch of videos and embed all their frames using the aforementioned image encoder $\phi$ . For each video $v _ { i }$ , this results in a sequence of embeddings $V _ { i } { = } \{ \phi ( v _ { i } ^ { 1 } ) , \phi ( v _ { i } ^ { 2 } ) { \ldots } , \phi ( v _ { i } ^ { L _ { i } } ) \}$ , where $L _ { i }$ is the length of the $i ^ { t h }$ video. From this mini-batch of sequences of video frame embeddings, we choose a pair of sequences $V _ { i }$ and $V _ { j }$ and compute their TCC loss. In particular, we randomly sample a frame embedding from sequence $V _ { i } -$ say $V _ { i } ^ { t }$ corresponding to the $t ^ { t h }$ frame of video $v _ { i }$ – and compute the soft nearest-neighbor of $V _ { i } ^ { t }$ in sequence $V _ { j }$ in the embedding space as follows:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\widetilde { V _ { i j } ^ { t } } = \sum _ { k } ^ { L _ { j } } \alpha _ { k } V _ { j } ^ { k } , \quad \mathrm { w h e r e } \quad \alpha _ { k } = \frac { e ^ { - \| V _ { i } ^ { t } - V _ { j } ^ { k } \| ^ { 2 } } } { \sum _ { k } ^ { L _ { j } } e ^ { - \| V _ { i } ^ { t } - V _ { j } ^ { k } \| ^ { 2 } } }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
We then cycle-back [7] to the first sequence $V _ { i }$ by computing the soft-nearest neighbor of $\widetilde { V _ { i j } ^ { t } }$ with all the frames in $V _ { i }$ . The probability of cycling-back to the $k ^ { t h }$ frame in $V _ { i }$ can be computed as:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\beta _ { i j t } ^ { k } = \frac { e ^ { - \| \widetilde { V _ { i j } ^ { t } } - V _ { i } ^ { k } \| ^ { 2 } } } { \sum _ { k } ^ { L _ { i } } e ^ { - \| \widetilde { V _ { i j } ^ { t } } - V _ { i } ^ { k } \| ^ { 2 } } }
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
The expected frame index we cycle-back to is then $\begin{array} { r } { \mu _ { i j } ^ { t } = \sum _ { k } ^ { L _ { i } } \beta _ { i j t } ^ { k } k } \end{array}$ . Since we know the index of the frame that started the cycle, in this case $t$ , we can minimize the mean-squared (MSE) error loss between $t$ and the closest index retrieved via soft-nearest neighbor, i.e., $\widetilde { V _ { i j } ^ { t } }$ . The loss for a single frame is thus: $L _ { i j } ^ { t } = ( \mu _ { i j } ^ { t } - t ) ^ { 2 }$ . Finally, we minimize the average loss $L$ over all frames in video $v _ { i }$ with all other videos in the dataset $v _ { j }$ , defined as $\begin{array} { r } { L = \sum _ { i j t } L _ { i j } ^ { t } } \end{array}$ .
|
| 66 |
+
|
| 67 |
+
Table 1. Statistics of Demos of the X-MAGICAL Embodiments
|
| 68 |
+
|
| 69 |
+
<table><tr><td>Embodiment</td><td>Mean ± Std.Dev. Demo Length (no. of frames)</td></tr><tr><td>Long-stick</td><td>48.0 ±28.5</td></tr><tr><td>Medium-stick</td><td>59.9 ±27.9</td></tr><tr><td>Short-stick</td><td>81.7 ±35.0</td></tr><tr><td>Gripper</td><td>110.8 ±39.8</td></tr></table>
|
| 70 |
+
|
| 71 |
+
# 3.3 Reward Function
|
| 72 |
+
|
| 73 |
+
Once the encoder $\phi$ has been trained on demonstrations of different agents performing the same task $T$ , we want to use it to transfer information about the task from one agent to another. We do this by leveraging $\phi$ to generate rewards via distances to goal observations in the learned embedding space. Specifically, we define the goal embedding $g$ as the mean embedding of the last frame of all the demonstration videos in our offline dataset $D _ { \mathrm { a l l } }$ . Concretely, $\scriptstyle g = \sum _ { i = 1 } ^ { N } \phi ( v _ { i } ^ { L _ { i } } ) \neq N$ , where $L _ { i }$ is the length of video $v _ { i }$ . Our reward $r$ then is the scaled negative distance of the current state embedding to the goal embedding $g$ i.e., $r ( s ) =$ $- 1 / \kappa \cdot \| \phi ( s ) - g \| _ { 2 } ^ { 2 }$ , where $\phi ( s )$ is the state embedding at the current timestep and $\kappa$ is a scale parameter that ensures the distances are in a range amenable for training reinforcement learning algorithms [23]. We found it effective to set $\kappa$ to be the average distance of the first frame’s embedding to the goal embedding for all the demonstrations in the dataset. Defining $r$ in this manner gives us several advantages: (a) it is dense, encoding both task completion and task progress, (b) it does not require any correspondence with a reference trajectory [5, 14] and (c) it sidesteps the need for a finite library of reference trajectories, unlike prior work [5, 16] that define time-indexed rewards relative to some reference trajectory. Thus, agents with trajectories of varying lengths (due to embodiment-specific constraints) can efficiently leverage this reward because the learned encoder can map different strategies to a common notion of task progress.
|
| 74 |
+
|
| 75 |
+
# 3.4 Reinforcement Learning
|
| 76 |
+
|
| 77 |
+
Using the pre-trained frozen encoder $\phi$ , we define a Markov Decision Process (MDP) for any agent as the tuple $\langle \bar { \boldsymbol { S } } , \boldsymbol { A } , \boldsymbol { P } , \boldsymbol { r } \rangle$ where $s$ is the set of possible states, $\mathcal { A }$ is the set of possible actions, $P$ is the state transition probability matrix encoding the dynamics of the environment (including the agent) and $r$ is the learned reward function (defined in Section 3.3). Notice how we are able to use the same reward function $r$ for any agent – even ones that the encoder may not have seen during training. Furthermore, this reward function solely depends on the learned encoder. Hence, the task represented by the MDP now depends solely on how well the encoder has learned task-specific representations since we do not use the environment reward to either define the task or learn the policy. This is an important distinction because we are expecting the encoder to generalize to new states that an agent might encounter during training, as the expert demonstrations in our dataset only contain successful trajectories. It is also possible to augment sparse rewards (which only define task success or failure) with our learned dense reward while training policies.
|
| 78 |
+
|
| 79 |
+
# 4 Experimental Setup
|
| 80 |
+
|
| 81 |
+
# 4.1 X-MAGICAL Benchmark
|
| 82 |
+
|
| 83 |
+
We introduce a cross-embodiment imitation learning benchmark, X-MAGICAL, which is based on the imitation learning benchmark MAGICAL [24], implemented on top of the physics engine PyMunk [25]. In this work, we consider a simplified 2D equivalent of a common household robotic sweeping task, wherein an agent has to push three objects into a predefined zone in the environment (colored in pink). We choose this task specifically because its long-horizon nature highlights how different agent embodiments can generate entirely different trajectories. The reward in this environment is defined as the fraction of debris swept into the zone at the end of the episode.
|
| 84 |
+
|
| 85 |
+
Multiple Embodiments in X-MAGICAL. We create multiple embodiments by designing agents with different shapes and end-effectors that induce variations in how each agent solves a task. In Figure 1, we show three of these embodiments and some sample trajectories that solve the sweeping task. Please see Appendix B for a detailed description of the benchmark. Three agents are shaped like a stick and they differ only in length. We call them short-stick, medium-stick and long-stick based on the length of their body. The agent in the last row is called gripper: it is circular in shape and has two arms that can actuate. All agents are capable of two actions - a rotation around their axis and a translation in a forward/backward direction along this axis (similar to the agent in the MAGICAL benchmark). All agents have a two-dimensional action space and use force and torque control to change their position and orientation respectively. The gripper agent has an additional degree of freedom for opening or closing its fingers. The default state of the gripper’s fingers is open. For all agents, the state representation is a 16-dimensional vector with the following information: $( { \bar { x } } , y )$ position of the agent, $( \cos \bar { \theta } , \sin \theta _ { . } ^ { \cdot }$ ) where $\theta$ is the agent’s 2D orientation, and for each of the three debris: its $( x , y )$ position, its distance to the agent and its distance to the goal zone. We frame-stack [26] three consecutive state vectors to encode temporal and velocity information, resulting in a final state dimension of 48.
|
| 86 |
+
|
| 87 |
+
Demonstrations and Different Embodiment Strategies in X-MAGICAL. To learn task-specific representations for this task, we collect 1000 demonstrations per agent, where each demonstration consists in sweeping all three debris, initialized with random positions, into the target zone. This is the dataset $D _ { \mathrm { a l l } }$ (described in Section 3.1) containing observation-only agent-specific demonstrations. In Figure 2, we highlight the differences that exist between the trajectories taken by these agents. Figure 2a shows a heat map of the frequency of visits (state visitation count) of each agent at every 2D position in the grid, across all demonstrations in the dataset. We plot the 2D projection of the state visitation count onto the $X Y$ plane with a bin width of 0.1. Yellow encodes higher state visitation whereas blue encodes lower state visitation. We observe that agent long-stick has less coverage of the environment as opposed to agent gripper, which has significantly more coverage. Similarly, we show the distribution of debris locations for all agents across all demonstrations in Figure 2b. In Figure 2c, we plot a randomly sampled trajectory from each agent’s demonstration pool. We use transparency to encode the start (lighter) and end (darker) of the trajectory. It is clear from this figure that each agent solves the task in a different manner. Additionally, there is a significant difference in the time taken by each agent to execute this task, as shown in Table 1. Agent long-stick is able to finish the task the quickest because of its long shape that can sweep all the debris at once, while agents short-stick and gripper take longer because they have to frequently push or grasp one debris at a time. These differences are the types of challenges that a representation must overcome to successfully generalize across embodiments. As such, X-MAGICAL serves to create a highly simplified version of a real-world scenario where we might want to learn new tasks from an observation dataset of humans performing these tasks in highly diverse ways.
|
| 88 |
+
|
| 89 |
+
# 4.2 Baselines
|
| 90 |
+
|
| 91 |
+
Here, we describe the alternative reward functions we baseline our method against, color coded to match their appearance in Figs. 3, 4, and 5. 1) ImageNet: We use an ImageNet pre-trained ResNet-18 encoder with no additional self-supervised training, i.e., we load the pre-trained weights, discard the classification head, and use the 512-dimensional embedding space from the previous layer. 2) Goal classifier: We follow [27] and train a goal frame classifier on a binary classification task where the last frame of all the demonstrations is considered positive and all the others are considered negatives. We use the output probabilities of the classifier as the reward function. 3) LIFS: We implement the method from [16] which learns a feature space that is invariant to different embodiments using a contrastive loss function paired with an autoencoding loss. 4) TCN: single-view Time-Contrastive Network (TCN) [5] with positive and negative frame windows of 1 and 4 respectively. For more details regarding baseline implementations, see Appendix D.1.1.
|
| 92 |
+
|
| 93 |
+
# 4.3 Implementation Details
|
| 94 |
+
|
| 95 |
+
Our encoder for all experiments and methods is a ResNet-18 [28] initialized with ImageNet pre-trained weights. We replace the classification head with an embedding layer outputting a 32-dimensional vector. The encoder is trained on images of resolution $2 2 4 \times 2 2 4$ with ADAM [29] and a learning rate of $1 0 ^ { - 5 }$ Note that our learned reward is agnostic to the RL algorithm used – in this work, we opt for Soft-Actor Critic (SAC) [30], which is a reinforcement learning algorithm that has been successfully used to train policies for continuous control tasks [31]. Once the TCC encoder is trained, we use it to embed the observation frames as the agent interacts with the environment.
|
| 96 |
+
|
| 97 |
+
# 5 Experiments
|
| 98 |
+
|
| 99 |
+
We execute a series of experiments to evaluate whether the learned reward functions are effective at visual imitation. Specifically, our experiments seek to answer the following questions: first (Section 5.1), in the same-embodiment case, where the demonstration dataset $D$ contains the embodiment of the learning agent, does our method enable successful reinforcement learning for that agent? Next (Section 5.2), we investigate our primary interest, the cross-embodiment case, where the demonstration dataset $D$ does not contain the embodiment of the learning agent. To additionally test our approach using real-world data (Section 5.3), we use the dataset from [6] to leverage real-world human demonstrations to learn policies in simulation. Note that each embodiment’s performance is evaluated over 50 episodes and all figures plot the mean performance over 5 random seeds, with a standard deviation shading of $\pm 0 . 5$ . Videos of our results are in the supplementary video.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 3. Same-embodiment setting: Comparison of XIRL with other baseline reward functions, using SAC [30] for RL policy learning on the X-MAGICAL sweeping task.
|
| 105 |
+
Figure 4. Cross-embodiment setting: XIRL performs favorably when compared with other baseline reward functions, trained on observation-only demonstrations from different embodiments. Each agent{long-stick, medium-stick, short-stick, gripper} is shown using demonstrations from the other 3 embodiments, with SAC [30] for RL policy learning on the X-MAGICAL sweeping task.
|
| 106 |
+
|
| 107 |
+
# 5.1 Results on Learning from Same-Embodiment Demonstrations
|
| 108 |
+
|
| 109 |
+
In this experiment, we want to validate whether our approach of using a reward function trained with TCC is good enough to train agents to perform the task defined in a dataset of expert demonstrations. Note that the learned reward function has to be robust enough such that it can provide a useful signal for new states an agent might encounter while learning a policy and interacting with the environment. In Figure 3, we compare our method XIRL with baselines described in Section 4.2. We find XIRL is more sample-efficient than the other learned reward baselines. We attribute this sample efficiency to the fact that the TCC embeddings encode task progress which helps the agent learn to reach for objects and goal zones while interacting with the environment, rather than exploring in a purely random manner. This experiment provides evidence that XIRL’s reward function is suitable for downstream reinforcement learning.
|
| 110 |
+
|
| 111 |
+
# 5.2 Results on Learning from Cross-Embodiment Demonstrations
|
| 112 |
+
|
| 113 |
+
After verifying that XIRL works on the embodiments it was trained with, we move to the experiments that answer the core question in our work: can XIRL generalize to unseen embodiments? In this section we conduct experiments where the reward function is learned using embodiments that are different from the ones on which the policy is trained. As noted in Table 1, the timescales with which the agents execute the task can vary significantly. We conduct four experiments, each one corresponding to holding-out one agent from the expert demonstration set. In each such experiment, we train an encoder on demonstrations from the remaining three agents. We compare with reward functions learned using TCN, LIFS, and goal frame classifiers. While both TCC and TCN are contrastive losses, the former makes explicit comparisons across different embodiments, whereas the latter implicitly relies on an encoder shared across embodiments to learn the cross-embodiment representation. In Figure 4, we show that XIRL generalizes to new agents significantly better than the other learned reward baselines.
|
| 114 |
+
|
| 115 |
+
# 5.3 Results on Learning from Real-World Cross-Embodiment Demonstrations
|
| 116 |
+
|
| 117 |
+
In this experiment, we test how well we can learn rewards from more challenging real-world human demonstration videos. To do so, we use the dataset and State Pusher environment introduced in [6]. We train two XIRL encoders: XIRL (sim only) trained on 5 teleoperated simulated trajectories (i.e., no domain shift) and XIRL (real only) trained solely on the real-world human demonstrations without using any form of human labeling of paired frames. We compare our results to training the policy on the sparse reward from the environment and the RLV method presented in [6]. As demonstrated in Figure 5, we find our approach can improve the sample-efficiency of learning in the environment, compared to using RLV or solely the environment reward.
|
| 118 |
+
|
| 119 |
+
# 5.4 Qualitative comparison between learned reward functions vs. handcrafted rewards
|
| 120 |
+
|
| 121 |
+
In Figures 6 and 7, we visualize and compare the XIRL reward function with the environment’s reward (ground truth) for the Sweeping task from X-MAGICAL (see Sec. 4.1 for details) and the State Pusher and Drawer Opening tasks from $[ 6 ] ^ { 4 }$ . We find that the learned reward is highly correlated with the ground truth reward from the environment for both successful demos (first column in Figures 6 and 7) and unsuccessful demos (second column in Figures 6 and 7). It is especially encouraging to see that in a sparser reward environment like the Drawer Opening task, XIRL provides a dense signal that should allow the agent to learn the task more efficiently. Additionally, we can see that in the example of the failed collision trajectory (i.e., second row third column in Fig. 7), where the arm collides with the drawer rather than opening it, XIRL is able to provide it with a partial reward (i.e., for correctly moving towards the drawer) as opposed to the environment reward which remains zero.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 5. Real-world-demo cross-embodiment setting: Comparison of XIRL with baselines using the simulated State Pusher environment from [6]. XIRL (real only) leverages real-world demonstration videos of humans (left, row 2) to teach a robot arm in sim (left, row 1), but unlike [6], we do not use human-labeled data of paired frame correspondences. $\mathrm { R L V ^ { \ast } }$ denotes results taken verbatim from [6] which uses a different implementation of SAC for RL policy learning.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 6. X-MAGICAL demo cross-embodiment setting: Visualizing our learned reward function XIRL vs. the environment’s sparse reward on a successful and unsuccessful demonstration, for the short-stick agent on the X-MAGICAL sweeping task. The learned reward was trained on the three other agents.
|
| 130 |
+
Figure 7. Real-world-demo cross-embodiment setting: Visualizing our learned XIRL reward function vs. the environment’s sparse reward on the State Pusher (top) and Drawer Opening (bottom) tasks from [6].
|
| 131 |
+
|
| 132 |
+
# 6 Conclusion
|
| 133 |
+
|
| 134 |
+
This paper presents XIRL, a framework for learning vision-based reward functions from videos of expert demonstrators exhibiting different embodiments. XIRL uses TCC to self-supervise a deep visual encoder from videos, and uses this encoder to generate rewards via simple distances to goal observations in the embedding space. XIRL enables unseen agents with new embodiments to learn the demonstrated tasks via IRL. Reward functions from XIRL are fully self-supervised from videos, and we can successfully learn tasks without requiring manually paired video frames [6] between the demonstrator and learner. In this sense, our method presents favorable scalability to an arbitrary number of embodiments or experts with varying skill levels. Experiments show that policies learned via XIRL are more sample efficient than multiple baseline alternatives, including TCN [5], LIFS [16], and RLV [6]. While our experiments demonstrate promising results for learning policies in simulated environments using rewards learned from both simulated and real-world videos, we have yet to show policy learning on a real robot, which we look forward to trying post-COVID.
|
| 135 |
+
|
| 136 |
+
# Acknowledgments
|
| 137 |
+
|
| 138 |
+
We would like to thank Alex Nichol, Nick Hynes, Sean Kirmani, Brent Yi and Jimmy Wu for fruitful technical discussions, Sam Toyer for invaluable help with setting up the simulated benchmark, and Karl Schmeckpeper for discussions and help related to RLV.
|
| 139 |
+
|
| 140 |
+
# References
|
| 141 |
+
|
| 142 |
+
[1] B. D. Argall, S. Chernova, M. Veloso, and B. Browning. A survey of robot learning from demonstration. Robotics and autonomous systems, 57(5), 2009. 1, 2, 11
|
| 143 |
+
[2] T. Zhang, Z. McCarthy, O. Jow, D. Lee, X. Chen, K. Goldberg, and P. Abbeel. Deep imitation learning for complex manipulation tasks from virtual reality teleoperation. In ICRA. IEEE, 2018. 1
|
| 144 |
+
[3] P. Florence, L. Manuelli, and R. Tedrake. Self-supervised correspondence in visuomotor policy learning. IEEE RAL, 5(2), 2019. 1
|
| 145 |
+
[4] P. Sermanet, K. Xu, and S. Levine. Unsupervised perceptual rewards for imitation learning. arXiv preprint arXiv:1612.06699, 2016. 1, 2, 11
|
| 146 |
+
[5] P. Sermanet, C. Lynch, Y. Chebotar, J. Hsu, E. Jang, S. Schaal, and S. Levine. Time-contrastive networks: Self-supervised learning from video. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 1134–1141. IEEE, 2018. 1, 2, 3, 5, 6, 8, 11, 16
|
| 147 |
+
[6] K. Schmeckpeper, O. Rybkin, K. Daniilidis, S. Levine, and C. Finn. Reinforcement learning with videos: Combining offline observations with interaction, 2020. 1, 2, 3, 4, 6, 7, 8, 11, 20
|
| 148 |
+
[7] D. Dwibedi, Y. Aytar, J. Tompson, P. Sermanet, and A. Zisserman. Temporal cycle-consistency learning. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 2, 3, 4, 12, 16
|
| 149 |
+
[8] C. Atkeson and S. Schaal. Robot learning from demonstration. In ICML, 1997. 2, 11
|
| 150 |
+
[9] T. Osa, J. Pajarinen, G. Neumann, J. Bagnell, P. Abbeel, and J. Peters. An algorithmic perspective on imitation learning. Found. Trends Robotics, 7:1–179, 2018. 2, 11
|
| 151 |
+
[10] F. Torabi, G. Warnell, and P. Stone. Behavioral cloning from observation. In IJCAI, 2018. 2, 11
|
| 152 |
+
[11] A. D. Edwards, H. Sahni, Y. Schroecker, and C. L. Isbell. Imitating latent policies from observation. arXiv preprint arXiv:1805.07914, 2018. 2, 11
|
| 153 |
+
[12] I. Radosavovic, X. Wang, L. Pinto, and J. Malik. State-only imitation learning for dexterous manipulation. arXiv preprint arXiv:2004.04650, 2020. 2, 11
|
| 154 |
+
[13] D. Pathak, P. Mahmoudieh, G. Luo, P. Agrawal, D. Chen, Y. Shentu, E. Shelhamer, J. Malik, A. A. Efros, and T. Darrell. Zero-shot visual imitation. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 2050–2053, 2018. 2, 11
|
| 155 |
+
[14] Y. Aytar, T. Pfaff, D. Budden, T. Paine, Z. Wang, and N. de Freitas. Playing hard exploration games by watching youtube. In Advances in Neural Information Processing Systems, pages 2930–2941, 2018. 2, 3, 5, 11
|
| 156 |
+
[15] O. Mees, M. Merklinger, G. Kalweit, and W. Burgard. Adversarial skill networks: Unsupervised robot skill learning from video. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 4188–4194. IEEE, 2020. 2, 11
|
| 157 |
+
[16] A. Gupta, C. Devin, Y. Liu, P. Abbeel, and S. Levine. Learning invariant feature spaces to transfer skills with reinforcement learning, 2017. 3, 5, 6, 8, 11, 16
|
| 158 |
+
[17] A. Singh, L. Yang, K. Hartikainen, C. Finn, and S. Levine. End-to-end robotic reinforcement learning without reward engineering. arXiv preprint arXiv:1904.07854, 2019. 3, 11
|
| 159 |
+
[18] L. Smith, N. Dhawan, M. Zhang, P. Abbeel, and S. Levine. Avid: Learning multi-stage tasks via pixel-level translation of human videos. arXiv preprint arXiv:1912.04443, 2019. 3, 11
|
| 160 |
+
[19] Y. Liu, A. Gupta, P. Abbeel, and S. Levine. Imitation from observation: Learning to imitate behaviors from raw video via context translation. In ICRA. IEEE, 2018. 3, 11
|
| 161 |
+
[20] P. Sharma, D. Pathak, and A. Gupta. Third-person visual imitation learning via decoupled hierarchical controller. In Advances in Neural Information Processing Systems, pages 2597–2607, 2019. 3, 11
|
| 162 |
+
[21] D. Hejna, L. Pinto, and P. Abbeel. Hierarchically decoupled imitation for morphological transfer. In International Conference on Machine Learning, pages 4159–4171. PMLR, 2020. 3, 11
|
| 163 |
+
[22] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 3, 11
|
| 164 |
+
[23] P. Henderson, R. Islam, P. Bachman, J. Pineau, D. Precup, and D. Meger. Deep reinforcement learning that matters. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. 5
|
| 165 |
+
[24] S. Toyer, R. Shah, A. Critch, and S. Russell. The magical benchmark for robust imitation. arXiv preprint arXiv:2011.00401, 2020. 5, 12
|
| 166 |
+
[25] V. Blomqvist. Pymunk: A easy-to-use pythonic rigid body 2d physics library (version 6.0.0), 2007. URL https://www.pymunk.org. 5
|
| 167 |
+
[26] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540): 529–533, 2015. 6
|
| 168 |
+
[27] M. Vecerik, O. Sushkov, D. Barker, T. Rothorl, T. Hester, and J. Scholz. A practical approach to insertion with ¨ variable socket position using deep reinforcement learning. In 2019 International Conference on Robotics and Automation (ICRA), pages 754–760. IEEE, 2019. 6, 15, 16
|
| 169 |
+
[28] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016. 6
|
| 170 |
+
[29] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint:1412.6980, 2014. 6
|
| 171 |
+
[30] T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018. 6, 7, 17
|
| 172 |
+
[31] T. Haarnoja, A. Zhou, K. Hartikainen, G. Tucker, S. Ha, J. Tan, V. Kumar, H. Zhu, A. Gupta, P. Abbeel, and S. Levine. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018. 6
|
| 173 |
+
[32] C. Yang, X. Ma, W. Huang, F. Sun, H. Liu, J. Huang, and C. Gan. Imitation learning from observations by minimizing inverse dynamics disagreement. ArXiv, abs/1910.04417, 2019. 11
|
| 174 |
+
[33] L. Shao, T. Migimatsu, Q. Zhang, K. Yang, and J. Bohg. Concept2robot: Learning manipulation concepts from instructions and human demonstrations. Robotics: Science and Systems, 2020. 11
|
| 175 |
+
[34] G. Berseth and C. Pal. Visual imitation learning with recurrent siamese networks. ArXiv, abs/1901.07186, 2019. 11
|
| 176 |
+
[35] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey. Maximum entropy inverse reinforcement learning. In Aaai, volume 8, pages 1433–1438. Chicago, IL, USA, 2008. 11
|
| 177 |
+
[36] B. D. Ziebart, J. A. Bagnell, and A. K. Dey. Modeling interaction via the principle of maximum causal entropy. In ICML, 2010. 11
|
| 178 |
+
[37] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014. 11
|
| 179 |
+
[38] J. Ho and S. Ermon. Generative adversarial imitation learning. In NeurIPS, 2016. 11
|
| 180 |
+
[39] F. Torabi, G. Warnell, and P. Stone. Generative adversarial imitation from observation. arXiv preprint arXiv:1807.06158, 2018. 11
|
| 181 |
+
[40] B. C. Stadie, P. Abbeel, and I. Sutskever. Third-person imitation learning. arXiv:1703.01703, 2017. 11
|
| 182 |
+
[41] Y. Lu and J. Tompson. Adail: Adaptive adversarial imitation learning. NeurIPS Workshop on Learning Transferable Skills,, 2019. 11
|
| 183 |
+
[42] F. Liu, Z. Ling, T. Mu, and H. Su. State alignment-based imitation learning. arXiv preprint arXiv:1911.10947, 2019. 11
|
| 184 |
+
[43] W. Sun, A. Vemula, B. Boots, and J. Bagnell. Provably efficient imitation learning from observation alone. ArXiv, abs/1905.10948, 2019. 11
|
| 185 |
+
[44] K. Kim, Y. Gu, J. Song, S. Zhao, and S. Ermon. Domain adaptive imitation learning. arXiv, 2020. 11
|
| 186 |
+
[45] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32. Curran Associates, Inc., 2019. 14
|
| 187 |
+
[46] A. Buslaev, A. Parinov, E. Khvedchenya, V. Iglovikov, and A. A. Kalinin. Albumentations: fast and flexible image augmentations. arXiv e-prints, 2018. 16
|
| 188 |
+
[47] D. Yarats and I. Kostrikov. Soft actor-critic (sac) implementation in pytorch. https://github.com/ denisyarats/pytorch_sac, 2020. 17
|
| 189 |
+
[48] H. van Hasselt, A. Guez, and D. Silver. Deep reinforcement learning with double q-learning. arXiv e-prints, 2015. 17
|
| 190 |
+
[49] S. Fujimoto, H. van Hoof, and D. Meger. Addressing function approximation error in actor-critic methods. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018, 2018. 17
|
| 191 |
+
[50] A. M. Saxe, J. L. McClelland, and S. Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv e-prints, 2013. 17
|
| 192 |
+
[51] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. 17, 18
|
md/train/RQfcckT1M_4/RQfcckT1M_4.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Self-Supervised Learning Disentangled Group Representation as Feature
|
| 2 |
+
|
| 3 |
+
Tan Wang1 Zhongqi Yue1,3 Jianqiang Huang1,3 Qianru Sun2 Hanwang Zhang1 1Nanyang Technological University 2Singapore Management University 3Damo Academy, Alibaba Group {tan317,yuez0003,hanwangzhang}@ntu.edu.sg jianqiang.jqh@gmail.com qianrusun@smu.edu.sg
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
A good visual representation is an inference map from observations (images) to features (vectors) that faithfully reflects the hidden modularized generative factors (semantics). In this paper, we formulate the notion of “good” representation from a group-theoretic view using Higgins’ definition of disentangled representation [40], and show that existing Self-Supervised Learning (SSL) only disentangles simple augmentation features such as rotation and colorization, thus unable to modularize the remaining semantics. To break the limitation, we propose an iterative SSL algorithm: Iterative Partition-based Invariant Risk Minimization (IP-IRM), which successfully grounds the abstract semantics and the group acting on them into concrete contrastive learning. At each iteration, IP-IRM first partitions the training samples into two subsets that correspond to an entangled group element. Then, it minimizes a subset-invariant contrastive loss, where the invariance guarantees to disentangle the group element. We prove that IP-IRM converges to a fully disentangled representation and show its effectiveness on various benchmarks. Codes are available at https://github.com/Wangt-CN/IP-IRM.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Deep learning is all about learning feature representations [5]. Compared to the conventional end-to-end supervised learning, Self-Supervised Learning (SSL) first learns a generic feature representation (e.g., a network backbone) by training with unsupervised pretext tasks such as the prevailing contrastive objective [36, 16], and then the above stage-1 feature is expected to serve various stage-2 applications with proper fine-tuning. SSL for visual representation is so fascinating that it is the first time that we can obtain “good” visual features for free, just like the trending pre-training in NLP community [26, 8]. However, most SSL works only care how much stage-2 performance an SSL feature can improve, but overlook what feature SSL is learning, why it can be learned, what cannot be learned, what the gap between SSL and Supervised Learning (SL) is, and when SSL can surpass SL?
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: Disentangled representation is an equivariant map between the semantic space $\mathcal { U }$ and the vector space $\mathcal { X }$ , which is decomposed into “color” and “digit”.
|
| 15 |
+
|
| 16 |
+
The crux of answering those questions is to formally understand what a feature representation is and what a good one is. We postulate the classic world model of visual generation and feature representation [1, 69] as in Figure 1. Let $\mathcal { U }$ be a set of (unseen) semantics, e.g., attributes such as “digit” and “color”. There is a set of independent and causal mechanisms [66] $\varphi : \mathcal { U } \to \mathcal { T }$ , generating images from semantics, e.g., writing a digit $ { { } ^ { 6 } } 0 ^ { 9 }$ when thinking of $\mathbf { \vec { \nabla } } _ { 0 } , \mathbf { \vec { \mathbf { \phi } } } _ { }$ [74]. A visual representation is the inference process $\phi : \mathcal { T } \mathcal { X }$ that maps image pixels to vector space features, e.g., a neural network. We define semantic representation as the functional composition $f : \mathcal { U } \to \mathcal { T } \to \mathcal { X }$ . In this paper, we are only interested in the parameterization of the inference process for feature extraction, but not the generation process, i.e., we assume $\forall I \in \mathcal { T }$ , $\exists u \in \mathcal { U }$ , such that $I = \varphi ( u )$ is fixed as the observation of each image sample. Therefore, we consider semantic and visual representations the same as feature representation, or simply representation, and we slightly abuse ${ \dot { \phi } } ( I ) : = f \left( \varphi ^ { - 1 } ( I ) \right)$ , i.e., $\phi$ and $f$ share the same trainable parameters. We call the vector $\mathbf { x } = \phi ( I )$ as feature, where $\mathbf { x } \in \mathcal { X }$ .
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
Figure 2: (a) The heat map visualizes feature dimensions related to augmentations (aug. related) and unrelated to augmentations (aug. unrelated), whose respective classification accuracy is shown in the bar chart below. Dashed bar denotes the accuracy using full feature dimensions. Experiment was performed on STL10 [22] with representation learnt with SimCLR [16] and our IP-IRM. (b) Visualization of CNN activations [77] of 4 filters on layer 29 and 18 of VGG [75] trained on ImageNet100 [81]. The filters were chosen by first clustering the aug. unrelated filters with $k$ -means $k = 4$ ) and then selecting the filters corresponding to the cluster centers.
|
| 20 |
+
|
| 21 |
+
# We propose to use Higgins’ definition of disentangled representation [40] to define what is “good”.
|
| 22 |
+
|
| 23 |
+
Definition 1. (Disentangled Representation) Let $\mathcal { G }$ be the group acting on $\mathcal { U }$ , i.e., $g \cdot u \in \mathcal { U } \times \mathcal { U }$ transforms $u \in \mathcal { U }$ , e.g., a “turn green” group element changing the semantic from “red” to “green”. Suppose there is a direct product decomposition1 $\mathcal { G } = g _ { 1 } \times . . . \times g _ { m }$ and ${ \mathcal { U } } = { \mathcal { U } } _ { 1 } \times \ldots \times { \mathcal { U } } _ { m }$ , where $g _ { i }$ acts on $\mathcal { U } _ { i }$ respectively. A feature representation is disentangled if there exists a group $\mathcal { G }$ acting on $\mathcal { X }$ such that:
|
| 24 |
+
|
| 25 |
+
1. Equivariant: $\forall g \in \mathcal { G } , \forall u \in \mathcal { U }$ , $f ( g \cdot u ) = g \cdot f ( u )$ , e.g., the feature of the changed semantic: “red” to “green” in $\mathcal { U }$ , is equivalent to directly change the color vector in $\mathcal { X }$ from “red” to “green”.
|
| 26 |
+
2. Decomposable: there is a decomposition ${ \mathcal { X } } = { \mathcal { X } } _ { 1 } \times \ldots \times { \mathcal { X } } _ { m } ,$ , such that each $\mathcal { X } _ { i }$ is fixed by the action of all $g _ { j } , j \neq i$ and affected only by $g _ { i }$ , e.g., changing the “color” semantic in $\mathcal { U }$ does not affect the “digit” vector in $\mathcal { X }$ .
|
| 27 |
+
|
| 28 |
+
Compared to the previous definition of feature representation which is a static mapping, the disentangled representation in Definition 1 is dynamic as it explicitly incorporate group representation [35], which is a homomorphism from group to group actions on a space, e.g., $\mathcal { G } \mathcal { X } \times \mathcal { X }$ , and it is common to use the feature space $\mathcal { X }$ as a shorthand—this is where our title stands.
|
| 29 |
+
|
| 30 |
+
Definition 1 defines “good” features in the common views: 1) Robustness: a good feature should be invariant to the change of environmental semantics, such as external interventions [45, 87] or domain shifts [32]. By the above definition, a change is always retained in a subspace $\mathcal { X } _ { i }$ , while others are not affected. Hence, the subsequent classifier will focus on the invariant features and ignore the ever-changing $\mathcal { X } _ { i }$ . 2) Zero-shot Generalization: even if a new combination of semantics is unseen in training, each semantic has been learned as features. So, the metrics of each $\mathcal { X } _ { i }$ trained by seen samples remain valid for unseen samples [95].
|
| 31 |
+
|
| 32 |
+
Are the existing SSL methods learning disentangled representations? No. We show in Section 4 that they can only disentangle representations according to the hand-crafted augmentations, e.g., color jitter and rotation. For example, in Figure 2 (a), even if we only use the augmentation-related feature, the classification accuracy of a standard SSL (SimCLR [16]) does not lose much as compared to the full feature use. Figure 2 (b) visualizes that the CNN features in each layer are indeed entangled (e.g., tyre, motor, and background in the motorcycle image). In contrast, our approach IP-IRM, to be introduced below, disentangles more useful features beyond augmentations.
|
| 33 |
+
|
| 34 |
+
In this paper, we propose Iterative Partition-based Invariant Risk Minimization (IP-IRM [ai"p@:m]) that guarantees to learn disentangled representations in an SSL fashion. We present the algorithm in Section 3, followed by the theoretical justifications in Section 4. In a nutshell, at each iteration, IP-IRM first partitions the training data into two disjoint subsets, each of which is an orbit of the already disentangled group, and the cross-orbit group corresponds to an entangled group element $g _ { i }$ Then, we adopt the Invariant Risk Minimization (IRM) [2] to implement a partition-based SSL, which disentangles the representation $\mathcal { X } _ { i }$ w.r.t. $g _ { i }$ . Iterating the above two steps eventually converges to a fully disentangled representation w.r.t. $\textstyle \prod _ { i = 1 } ^ { m } g _ { i }$ . In Section 5, we show promising experimental results on various feature disentanglement and SSL benchmarks.
|
| 35 |
+
|
| 36 |
+
# 2 Related Work
|
| 37 |
+
|
| 38 |
+
Self-Supervised Learning. SSL aims to learn representations from unlabeled data with hand-crafted pretext tasks [28, 63, 33]. Recently, Contrastive learning [65, 61, 38, 80, 16] prevails in most state-ofthe-art methods. The key is to map positive samples closer, while pushing apart negative ones in the feature space. Specifically, the positive samples are from the augmented views [82, 3, 94, 42] of each instance and the negative ones are other instances. Along this direction, follow-up methods are mainly four-fold: 1) Memory-bank [90, 61, 36, 18]: storing the prototypes of all the instances computed previously into a memory bank to benefit from a large number of negative samples. 2) Using siamese network [7] to avoid representation collapse [34, 19, 83]. 3) Assigning clusters to samples to integrate inter-instance similarity into contrastive learning [11, 12, 13, 88, 56]. 4) Seeking hard negative samples with adversarial training or better sampling strategies [73, 20, 44, 48]. In contrast, our proposed IP-IRM jumps out of the above frame and introduces the disentangled representation into SSL with group theory to show the limitations of existing SSL and how to break through them.
|
| 39 |
+
|
| 40 |
+
Disentangled Representation. This notion dates back to [4], and henceforward becomes a highlevel goal of separating the factors of variations in the data [84, 79, 86, 58]. Several works aim to provide a more precise description [27, 29, 72] by adopting an information-theoretic view [17, 27] and measuring the properties of a disentangled representation explicitly [29, 72]. We adopt the recent group-theoretic definition from Higgins et al. [40], which not only unifies the existing, but also resolves the previous controversial points [78, 59]. Although supervised learning of disentangled representation is a well-studied field [100, 43, 10, 70, 49], unsupervised disentanglement based on GAN [17, 64, 57, 71] or VAE [39, 15, 99, 50] is still believed to be theoretically challenging [59]. Thanks to the Higgins’ definition, we prove that the proposed IP-IRM converges with full-semantic disentanglement using group representation theory. Notably, IP-IRM learns a disentangled representation with an inference process, without using generative models as in all the existing unsupervised methods, making IP-IRM applicable even on large-scale datasets.
|
| 41 |
+
|
| 42 |
+
Group Representation Learning. A group representation has two elements [47, 35]: 1) a homomorphism (e.g., a mapping function) from the group to its group action acting on a vector space, and 2) the vector space. Usually, when there is no ambiguity, we can use either element as the definition. Most existing works focus on learning the first element. They first define the group of interest, such as spherical rotations [24] or image scaling [89, 76], and then learn the parameters of the group actions [23, 46, 68]. In contrast, we focus on the second element; more specifically, we are interested in learning a map between two vector spaces: image pixel space and feature vector space. Our representation learning is flexible because it delays the group action learning to downstream tasks on demand. For example, in a classification task, a classifier can be seen as a group action that is invariant to class-agnostic groups but equivariant to class-specific groups (see Section 4).
|
| 43 |
+
|
| 44 |
+
# 3 IP-IRM Algorithm
|
| 45 |
+
|
| 46 |
+
Notations. Our goal is to learn the feature extractor $\phi$ in a self-supervised fashion. We define a partition matrix $\bar { \mathbf { P } } \in \{ 0 , 1 \} ^ { N \times 2 }$ that partitions $N$ training images into 2 disjoint subsets. $P _ { i , k } = 1$ if the $i$ -th image belongs to the $k$ -th subset and 0 otherwise. Suppose we have a pretext task loss
|
| 47 |
+
|
| 48 |
+
function $\mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } )$ defined on the samples in the $k$ -th subset, where $\theta = 1$ is a “dummy” parameter used to evaluate the invariance of the SSL loss across the subsets (later discussed in Step 1). For example, $\mathcal { L }$ can be defined as:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } ) = \sum _ { \mathbf { x } \in \mathcal { X } _ { k } } - \log \frac { \exp \left( \mathbf { x } ^ { T } \mathbf { x } ^ { * } \cdot \theta \right) } { \sum _ { \mathbf { x ^ { \prime } } \in \mathcal { X } _ { k } \cup \mathcal { X } ^ { * } \setminus \mathbf { x } } \exp \left( \mathbf { x } ^ { T } \mathbf { x } ^ { \prime } \cdot \theta \right) } ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\mathcal { X } _ { k } = \phi ( \{ I _ { i } | P _ { i , k } = 1 \} )$ , and $\mathbf { x } ^ { * } \in \mathcal { X } ^ { * }$ is the augmented view feature of $\mathbf { x } \in \mathcal { X } _ { k }$ .
|
| 55 |
+
|
| 56 |
+
Input. $N$ training images. Randomly initialized $\phi$ . A partition matrix $\mathbf { P }$ initialized such that the first column of $\mathbf { P }$ is 1, i.e., all samples belong to the first subset. Set $\mathcal { P } = \{ \bf P \}$ .
|
| 57 |
+
|
| 58 |
+
Output. Disentangled feature extractor $\phi$ .
|
| 59 |
+
|
| 60 |
+
Step 1 [Update $\phi ]$ . We update $\phi$ by:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\operatorname* { m i n } _ { \phi } \sum _ { \mathbf { P } \in \mathcal { P } } \sum _ { k = 1 } ^ { 2 } \left[ \mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } ) + \lambda _ { 1 } \left. \nabla _ { \theta = 1 } \mathcal { L } ( \phi , \theta = 1 , k , \mathbf { P } ) \right. ^ { 2 } \right] ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $\lambda _ { 1 }$ is a hyper-parameter. The second term delineates how far the contrast in one subset is from a constant baseline $\theta = 1$ . The minimization of both of them encourages $\phi$ in different subsets close to the same baseline, i.e., invariance across the subsets. See IRM [2] for more details. In particular, the first iteration corresponds to the standard SSL with $\mathcal { X } _ { 1 }$ in Eq. (1) containing all training images.
|
| 67 |
+
|
| 68 |
+
Step 2 [Update P]. We fix $\phi$ and find a new partition $\mathbf { P } ^ { * }$ by
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
{ \bf P } ^ { * } = \arg \operatorname* { m a x } _ { { \bf P } } \sum _ { { \bf k } = 1 } ^ { 2 } \left[ \mathcal { L } ( \phi , \theta = 1 , k , { \bf P } ) + \lambda _ { 2 } \| \nabla _ { \theta = 1 } \mathcal { L } ( \phi , \theta = 1 , k , { \bf P } ) \| ^ { 2 } \right] ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\lambda _ { 2 }$ is a hyper-parameter. In practice, we use a continuous partition matrix in $\mathbb { R } ^ { N \times 2 }$ during optimization and then threshold it to $\{ 0 , 1 \} ^ { N \times 2 }$ .
|
| 75 |
+
|
| 76 |
+
We update $\mathcal { P } \mathcal { P } \cup \mathbf { P ^ { * } }$ and iterate the above two steps until convergence.
|
| 77 |
+
|
| 78 |
+
# 4 Justification
|
| 79 |
+
|
| 80 |
+
Recall that IP-IRM uses training sample partitions to learn the disentangled representations w.r.t. $\textstyle \prod _ { i = 1 } ^ { m } g _ { i }$ . As we have a $\mathcal { G }$ -equivariant feature map between the sample space $\mathcal { T }$ and feature space $\mathcal { X }$ (the equivariance is later guaranteed by Lemma 1), we slightly abuse the notation by using to denote both spaces. Also, we assume that $\mathcal { X }$ is a homogeneous space of $\mathcal { G }$ , i.e., any sample $\mathbf { x } ^ { \prime } \in \mathcal { X }$ can be transited from another sample $\mathbf { x }$ by a group action $g \cdot { \bf x }$ . Intuitively, $\mathcal { G }$ is all you need to describe the diversity of the training set. It is worth noting that $g$ is any group element in $\mathcal { G }$ while $g _ { i }$ is a Cartesian “building block” of $\mathcal { G }$ , e.g., $g$ can be decomposed by $( g _ { 1 } , g _ { 2 } , . . . , g _ { m } )$ .
|
| 81 |
+
|
| 82 |
+
We show that partition and group are tightly connected by the concept of orbit. Given a sample $\mathbf { x } \in \mathcal { X }$ , its group orbit w.r.t. $\mathcal { G }$ is a sample set $\mathcal { G } ( \mathbf { x } ) = \{ g \cdot \mathbf { \dot { x } } \mid g \in \mathcal { G } \}$ . As shown in Figure 3 (a), if $\mathcal { G }$ is a set of attributes shared by classes, e.g., “color” and “pose ”, the orbit is the sample set of the class of $\mathbf { x }$ ; in Figure 3 (b), if $\mathcal { G }$ denotes augmentations, the orbit is the set of augmented images. In particular, we can see that the disjoint orbits in Figure 3 naturally form a partition. Formally, we have the following definition:
|
| 83 |
+
|
| 84 |
+
Definition 2. (Orbit & Partition [47]) Given a subgroup $\mathcal { D } \subset \mathcal { G }$ , it partitions $\mathcal { X }$ into the disjoint subsets: $\{ \mathcal { D } ( c _ { 1 } \cdot \mathbf { x } ) , . . . , D ( c _ { k } \cdot \mathbf { x } ) \}$ , where $k$ is the number of cosets $\{ c _ { 1 } \mathcal { D } , . . . , c _ { k } \mathcal { D } \}$ , and the cosets form a factor group1 $\mathcal { G } / \mathcal { D } = \{ c _ { i } \} _ { i = 1 } ^ { k }$ . In particular, $c _ { i } \cdot \mathbf { x }$ can be considered as a sample of the i-th class, transited from any sample $\mathbf { x } \in \mathcal { X }$ .
|
| 85 |
+
|
| 86 |
+
Interestingly, the partition offers a new perspective for the training data format in Supervised Learning (SL) and Self-Supervised Learning (SSL). In SL, as shown in Figure 3 (a), the data is labeled with $k$ classes, each of which is an orbit with $\mathcal { D } ( c _ { i } \cdot \mathbf { x } )$ training samples, whose variations are depicted by the class-sharing attribute group $\mathcal { D }$ . The cross-orbit group action, e.g., $c _ { \mathrm { d o g } } \cdot \mathbf { x }$ , can be read as “turn $\mathbf { x }$ into a dog” and such “turn” is always valid due to the assumption that $\mathcal { X }$ is a homogeneous space of $\mathcal { G }$ . In SSL, as shown in Figure 3 (b), each training sample $\mathbf { x }$ is augmented by the group $\mathcal { D }$ . So, $\mathcal { D } ( c _ { i } \cdot \mathbf { x } )$ consists of all the augmentations of the $i$ -th sample, where the cross-orbit group action $c _ { i } \cdot \mathbf { x }$ can be read as “turn $\mathbf { x }$ into the $i$ -th sample”.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 3: Each orbit only illustrates with 5 samples. (a) Orbit: the training samples of a class; $\mathcal { D }$ in-orbit actions: intra-class variations $\cdot { } 2$ :standing, $2 3$ :blacken, $3 { } 4$ :jumping, $4 { } 5$ :whiten, $5 { } 1$ :running); $\mathcal { G } / \mathcal { D }$ cross-orbit actions: inter-class variations. (b) Orbit: a sample and its augmented samples; $\mathcal { D }$ in-orbit actions: augmentations $1 \to 2$ :clock-wise rotation, $2 3$ :color jitter, $3 { } 4$ :gray scale, $4 { } 5$ :counterclockwise rotation, $5 { } 1$ :color); $\mathcal { G } / \mathcal { D }$ cross-orbit actions: inter-sample variations. (c) Step 2 in IP-IRM discovers 2 orbits, where the cross-orbit action corresponds to a group action “green to red” or “red to green”, which is yet disentangled.
|
| 90 |
+
|
| 91 |
+
Thanks to the orbit and partition view of training data, we are ready to revisit model generalization in a group-theoretic view by using invariance and equivariance—the two sides of the coin, whose name is disentanglement. For SL, we expect that a good feature is disentangled into a class-agnostic part and a class-specific part: the former (latter) is invariant (equivariant) to $\mathcal { G } / \mathcal { D }$ —cross-orbit traverse, but equivariant (invariant) to $\mathcal { D }$ —in-orbit traverse. By using such feature, a model can generalize to diverse testing samples (limited to $| \mathcal D |$ variations) by only keeping the class-specific feature. Formally, we prove that we can achieve such disentanglement by contrastive learning:
|
| 92 |
+
|
| 93 |
+
Lemma 1. (Disentanglement by Contrastive Learning) Training loss $\begin{array} { r } { - \log \frac { \exp ( \mathbf { x } _ { i } ^ { T } \mathbf { x } _ { j } ) } { \sum _ { \mathbf { x } \in \mathcal { X } } \exp ( \mathbf { x } _ { j } ^ { T } \mathbf { x } ) } } \end{array}$ disentangles $\mathcal { X }$ w.r.t. $( \mathcal { G } / \mathcal { D } ) \times \mathcal { D }$ , where $\mathbf { x } _ { i }$ and $\mathbf { x } _ { j }$ are from the same orbit.
|
| 94 |
+
|
| 95 |
+
We can draw the following interesting corollaries from Lemma 1 (details in Appendix):
|
| 96 |
+
|
| 97 |
+
1. If we use all the samples in the denominator of the loss, we can approximate to $\mathcal { G }$ -equivariant features given limited training samples. This is because the loss minimization guarantees $\forall ( \mathbf { x } _ { i } , \mathbf { x } _ { j } ) { \overset { - } { \in } } { \mathcal { X } } \times { \mathcal { X } } , i \neq j { \bar { \mathbf { x } } } _ { i } \neq { \bar { \mathbf { x } _ { j } } }$ , i.e., any pair corresponds to a group action.
|
| 98 |
+
2. Conventional cross-entropy loss in SL is a special case, if we define $\mathbf { x } \in \mathcal { X } = \{ \mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { k } \}$ as $k$ classifier weights. So, SL does not guarantee the disentanglement of $\mathcal { G } / \mathcal { D }$ , which causes generalization error if the class domain of downstream task is different from SL pre-training, e.g., a subset of $\mathcal { G } / \mathcal { D }$ .
|
| 99 |
+
3. In contrastive learning based SSL, $\mathcal { D } =$ “augmentations” (recall Figure 2), and the number of augmentations $| \mathcal { D } _ { \mathrm { a u g } } |$ is generally much smaller compared to the class-wise sample diversity $| \mathcal { D } _ { \mathrm { S L } } |$ in SL. This enables the SL model to generalize to more diverse testing samples $( | \mathcal { D } _ { \mathrm { S L } } | )$ by filtering out the class-agnostic features (e.g., background) and focusing on the class-specific ones (e.g., foreground), which explains why SSL is worse than SL in downstream classification.
|
| 100 |
+
4. In SL, if the number of training samples per orbit is not enough, i.e., smaller than $\left| \mathcal { D } ( c _ { i } \cdot \mathbf { x } ) \right|$ , the disentanglement between $\mathcal { D }$ and $\mathcal { G } / \mathcal { D }$ cannot be guaranteed, such as the challenges in few-shot learning [96]. Fortunately, in SSL, the number is enough as we always include all the augmented samples in training. Moreover, we conjecture that $\mathcal { D } _ { \mathrm { a u g } }$ only contains simple cyclic group elements such as rotation and colorization, which are easier for representation learning.
|
| 101 |
+
|
| 102 |
+
Lemma 1 does not guarantee the decomposability of each $d \in \mathcal { D }$ . Nonetheless, the downstream model can still generalize by keeping the class-specific features affected by $\mathcal { G } / \mathcal { D }$ . Therefore, the key to fill the gap or even let SSL surpass SL is to achieve the full disentanglement of $\mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ .
|
| 103 |
+
|
| 104 |
+
Table 1: Results on disentanglement metrics of existing unsupervised disentanglement methods, standard SSL (SimCLR [16]) and IP-IRM using CMNIST [2] and Shapes3D [50]. Note that IRS is based on intervening the semantics which requires access to the labels of all the semantics, and hence not applicable for CMNIST dataset. Results are averaged over 4 trails (mean $\pm$ std).
|
| 105 |
+
|
| 106 |
+
<table><tr><td></td><td>Method</td><td>DCI</td><td>IRS</td><td>MOD</td><td>EXP</td><td>LR</td><td>GBT</td><td>Average</td></tr><tr><td rowspan="6">CSINI</td><td>VAE [51]</td><td>0.948±0.004</td><td>1</td><td>0.664±0.121</td><td>0.968±0.007</td><td>0.824±0.019</td><td>0.948±0.004</td><td>0.849±0.057</td></tr><tr><td>β-VAE [41]</td><td>0.945±0.002</td><td>=</td><td>0.705±0.073</td><td>0.963±0.006</td><td>0.809±0.013</td><td>0.945±0.003</td><td>0.874±0.015</td></tr><tr><td>β-AnnealVAE [9]</td><td>0.911±0.002</td><td></td><td>0.790±0.075</td><td>0.965±0.007</td><td>0.821±0.022</td><td>0.911±0.002</td><td>0.880±0.016</td></tr><tr><td>β-TCVAE[15]</td><td>0.914±0.008</td><td></td><td>0.864±0.095</td><td>0.962±0.010</td><td>0.801±0.024</td><td>0.914±0.008</td><td>0.891±0.014</td></tr><tr><td>Factor-VAE [50]</td><td>0.916±0.004</td><td>=</td><td>0.893±0.056</td><td>0.947±0.011</td><td>0.770±0.025</td><td>0.916±0.005</td><td>0.888±0.014</td></tr><tr><td>SimCLR [16]</td><td>0.882±0.019</td><td></td><td>0.767±0.025</td><td>0.976±0.011</td><td>0.863±0.036</td><td>0.876±0.015</td><td>0.873±0.016</td></tr><tr><td rowspan="7">ssssder</td><td>IP-IRM (Ours)</td><td>0.917±0.008</td><td></td><td>0.785±0.031</td><td>0.990±0.002</td><td>0.921±0.009</td><td>0.916±0.007</td><td>0.906±0.011</td></tr><tr><td>VAE [51]</td><td>0.351±0.026</td><td>0.284±0.009</td><td>0.820±0.015</td><td>0.802±0.054</td><td>0.421±0.079</td><td>0.352±0.027</td><td>0.505±0.028</td></tr><tr><td>β-VAE [41]</td><td>0.369±0.021</td><td>0.283±0.012</td><td>0.782±0.034</td><td>0.807±0.018</td><td>0.427±0.025</td><td>0.368±0.023</td><td>0.506±0.011</td></tr><tr><td>β-AnnealVAE [9]</td><td>0.327±0.069</td><td>0.412±0.049</td><td>0.743±0.070</td><td>0.643±0.013</td><td>0.259±0.021</td><td>0.328±0.070</td><td>0.452±0.023</td></tr><tr><td>β-TCVAE[15]</td><td>0.470±0.035</td><td>0.291±0.023</td><td>0.777±0.031</td><td>0.821±0.054</td><td>0.439±0.084</td><td>0.469±0.034</td><td>0.545±0.032</td></tr><tr><td>Factor-VAE [50]</td><td>0.340±0.021</td><td>0.316±0.016</td><td>0.815±0.041</td><td>0.738±0.043</td><td>0.319±0.045</td><td>0.339±0.021</td><td>0.478±0.020</td></tr><tr><td>SimCLR[16]</td><td>0.535±0.016</td><td>0.439±0.030</td><td>0.678±0.050</td><td>0.949±0.005</td><td>0.733±0.055</td><td>0.536±0.015</td><td>0.645±0.026</td></tr><tr><td></td><td>IP-IRM (Ours)</td><td>0.565±0.023</td><td>0.420±0.014</td><td>0.766±0.036</td><td>0.959±0.007</td><td>0.757±0.025</td><td>0.565±0.023</td><td>0.672±0.017</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Theorem 1. The representation is fully disentangled w.r.t. $\mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ if and only $\vert f \forall c _ { i } \in \mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ , the contrastive loss in Eq. (1) is invariant to the 2 orbits of partition $\{ \mathcal { G } ^ { \prime } ( c _ { i } \cdot \mathbf { x } ) , \mathcal { G } ^ { \prime } ( c _ { i } ^ { - 1 } \cdot \mathbf { x } ) \}$ , where $\mathcal { G } ^ { \prime } = \mathcal { G } / c _ { i } = \mathcal { D } _ { \mathrm { a u g } } \times c _ { 1 } \times . . . \times c _ { i - 1 } \times c _ { i + 1 } \times . . . \times c _ { k }$ .
|
| 109 |
+
|
| 110 |
+
The maximization in Step 2 is based on the contra-position of the sufficient condition of Theorem 1. Denote the currently disentangled group as $\mathcal { D }$ (initially $\mathcal { D } _ { \mathrm { a u g . } }$ ). If we can find a partition $\mathbf { P } ^ { * }$ to maximize the loss in Eq. (3), i.e., SSL loss is variant across the orbits, then $\exists h \in { \mathcal { G } } / { \mathcal { D } }$ such that the representation of $h$ is entangled, i.e., $\mathbf { P ^ { * } } = \{ { \mathcal { D } } ( h \cdot \mathbf { x } ) , { \mathcal { D } } ( h ^ { - 1 } \cdot \mathbf { x } ) \}$ . Figure 3 (c) illustrates a discovered partition about color. The minimization in Step 1 is based on the necessary condition of Theorem 1. Based on the discovered $\mathbf { P } ^ { * }$ , if we minimize Eq. (2), we can further disentangle $h$ and update $\mathcal { D } \mathcal { D } \times h$ . Overall, IP-IRM converges as $\mathcal { G } / \mathcal { D } _ { \mathrm { a u g } }$ is finite. Note that an improved contrastive objective [92] can further disentangle each $d \in \mathcal { D } _ { \mathrm { a u g } }$ and achieve full disentanglement w.r.t. $\mathcal { G }$ .
|
| 111 |
+
|
| 112 |
+
# 5 Experiments
|
| 113 |
+
|
| 114 |
+
# 5.1 Unsupervised Disentanglement
|
| 115 |
+
|
| 116 |
+
Datasets. We used two datasets. CMNIST [2] has 60,000 digit images with semantic labels of digits (0-9) and colors (red and green). These images differ in other semantics (e.g., slant and font) that are not labeled. Moreover, there is a strong correlation between digits and colors (most 0-4 in red and 5-9 in green), increasing the difficulty to disentangle them. Shapes3D [50] contains 480,000 images with 6 labelled semantics, i.e., size, type, azimuth, as well as floor, wall and object color. Note that we only considered the first three semantics for evaluation, as the standard augmentations in SSL will contaminate any color-related semantics.
|
| 117 |
+
|
| 118 |
+
Settings. We adopted 6 representative disentanglement metrics: Disentangle Metric for Informativeness (DCI) [29], Interventional Robustness Score (IRS) [79], Explicitness Score (EXP) [72], Modularity Score (MOD) [72] and the accuracy of predicting the ground-truth semantic labels by two classification models called logistic regression (LR) and gradient boosted trees (GBT) [59]. Specifically, DCI and EXP measure the explicitness, i.e., the values of semantics can be decoded from the feature using a linear transformation. MOD and IRS measure the modularity, i.e., whether each feature dimension is equivariant to the shift of a single semantic. See Appendix for more detailed formula of the metrics. In evaluation, we trained CNN-based feature extractor backbones with comparable number of parameters for all the baselines and our IP-IRM. The full implementation details are in Appendix.
|
| 119 |
+
|
| 120 |
+
Results. In Table 1, we compared the proposed IP-IRM to the standard SSL method SimCLR [16] as well as several generative disentanglement methods [51, 41, 9, 15, 50]. On both CMNIST and Shapes3D dataset, IP-IRM outperforms SimCLR regarding all metrics except for only IRS where the most relative gain is $8 . 8 \%$ for MOD. For this MOD, we notice that VAE performs better than our IP-IRM by 6 points, i.e., 0.82 v.s. 0.76 for Shapes3D. This is because VAE explicitly pursues a high modularity score through regularizing the dimension-wise independence in the feature space. However, this regularization is adversarial to discriminative objectives [14, 95]. Indeed, we can observe from the column of LR (i.e., the performance of downstream linear classification) that VAE methods have clearly poor performance especially on the more challenging dataset Shapes3D. We can draw the same conclusion from the results of GBT. Different from VAE methods, our IP-IRM is optimized towards disentanglement without such regularization, and is thus able to outperform the others in downstream tasks while obtaining a competitive value of modularity.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4: The t-SNE [85] visualizations of learned feature spaces using SimCLR [16] and IP-IRM on CMNIST [2] and STL10 [22]. For CMIST in (a), we annotate the digit and color near each cluster. We annotate only half of the feature points for SimCLR to avoid clutter. For STL10 in (b), we show the labels of the classes.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 5: (a) Visualization of the obtained partitions $\mathbf { P } ^ { * }$ during training. Each partition has two subset and the displayed images are randomly sampled from each subset. (b) Visualization of the variance of each feature dimension when perturbing the semantic indicated on the left. The most equivariant dimensions are indicated by triangles and their corresponding indices.
|
| 127 |
+
|
| 128 |
+
What do IP-IRM features look like? Figure 4 visualizes the features learned by SimCLR and our IP-IRM on two datasets: CMNIST in Figure 4 (a) and STL10 dataset in Figure 4 (b). In the following, we use Figure 4 (a) as the example, and can easily draw the similar conclusions from Figure 4 (b). On the left-hand side of Figure 4 (a), it is obvious that there is no clear boundary to distinguish the semantic of color in the SimCLR feature space. Besides, the features of the same digit semantic are scattered in two regions. On the right-hand side of (a), we have 3 observations for IP-IRM. 1) The features are well clustered and each cluster corresponds to a specific semantic of either digit or color. This validates the equivariant property of IP-IRM representation that it responds to any changes of the existing semantics, e.g., digit and color on this dataset. 2) The feature space has the symmetrical structure for each individual semantic, validating the decomposable property of IP-IRM representation. More specifically, i) mirroring a feature (w.r.t. “\*” in the figure center) indicates the change on the only semantic of color, regardless of the other semantic (digit); and ii) a counterclockwise rotation (denoted by black arrows from same-colored 1 to 7) indicates the change on the only semantic of digit. 3) IP-IRM reveals the true distribution (similarity) of different classes. For example, digits 3, 5, 8 sharing sub-parts (curved bottoms and turnings) have closer feature points in the IP-IRM feature space.
|
| 129 |
+
|
| 130 |
+
How does IP-IRM disentangle features? 1) Discovered $\mathbf { P } ^ { * }$ : To visualize the discovered partitions $\mathbf { P } ^ { * }$ at each maximization step, we performed an experiment on a binary CMNIST (digit 0 and 1 in color red and green), and show the results in Figure 5 (a). Please kindly refer to Appendix for the full results on CMNIST. First, each partition tells apart a specific semantic into two subsets, e.g., in Partition #1, red and green digits are separated. Second, besides the obvious semantics—digit and color (labelled on the dataset), we can discover new semantics, e.g., the digit slant shown in Partition #3. 2) Disentangled Representation: In Figure 5 (b), we aim to visualize how equivariant each feature dimension is to the change of each semantic, i.e., a darker color shows that a dimension is more equivariant w.r.t. the semantic indicated on the left. We can see that SimCLR fails to learn the decomposable representation, e.g., the 8-th dimension captures azimuth, type and size in Shapes3D. In contrast, our IP-IRM achieves disentanglement by representing the semantics into interpretable dimensions, e.g., the 6-th and 7-th dimensions captures the size, the 4-th for type and the 2-nd and 9-th for azimuth on the Shapes3D. Overall, the results support the justification in Section 4, i.e., we discover a new semantic (affected by $h$ ) through the partition $\mathbf { P } ^ { * }$ at each iteration and IP-IRM eventually converges with a disentangled representation.
|
| 131 |
+
|
| 132 |
+
# 5.2 Self-Supervised Learning
|
| 133 |
+
|
| 134 |
+
Datasets and Settings. We conducted the SSL evaluations on 2 standard benchmarks following [88, 20, 48]. Cifar100 [54] contains 60,000 images in 100 classes and STL10 [22] has 113,000 images in 10 classes. We used SimCLR [16], DCL [20] and HCL [48] as baselines, and learned the representations for 400 and 1000 epochs. We evaluated both linear and $k$ -NN $k = 2 0 0$ ) accuracies for the downstream classification task. Implementation details are in appendix.
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">STL10</td><td colspan="2">Cifar100</td></tr><tr><td>k-NN</td><td>Linear</td><td>k-NN</td><td>Linear</td></tr><tr><td colspan="5">400 epoch training</td></tr><tr><td>SimCLR[16]</td><td>73.60</td><td>78.89</td><td>54.94</td><td>66.63</td></tr><tr><td>DCL [20]</td><td>78.82</td><td>82.56</td><td>57.29</td><td>68.59</td></tr><tr><td>HCL [48]</td><td>80.06</td><td>87.60</td><td>59.61</td><td>69.22</td></tr><tr><td>SimCLR+IP-IRM</td><td>79.66</td><td>84.44</td><td>59.10</td><td>69.55</td></tr><tr><td>DCL+IP-IRM</td><td>81.51</td><td>85.36</td><td>58.37</td><td>68.76</td></tr><tr><td>HCL+IP-IRM</td><td>84.29</td><td>87.81</td><td>60.05</td><td>69.95</td></tr><tr><td colspan="5">1,000 epoch training</td></tr><tr><td>SimCLR[16]</td><td>78.60</td><td>84.24</td><td>59.45</td><td>68.73</td></tr><tr><td>SimCLR† [55]</td><td>79.80</td><td>85.56</td><td>63.67</td><td>72.18</td></tr><tr><td>SimCLR+IP-IRM</td><td>85.08</td><td>89.91</td><td>65.82</td><td>73.99</td></tr><tr><td>Supervised*</td><td>=</td><td>=</td><td>=</td><td>73.72</td></tr><tr><td>Supervised*+MixUp [97]</td><td></td><td>=</td><td>=</td><td>74.19</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 2: Accuracy $( \% )$ of $k$ -NN and linear classifiers on STL10 [22] and Cifar100 [54] using the representations of SimCLR [16], DCL [20], HCL [48] and those after incorporating our IPIRM. ${ \bf S i m C L R } ^ { \dagger }$ denotes $\mathrm { S i m C L R }$ with MixUp regularization. Supervised∗ represents the supervised learning that keeps the same codebase, optimizer and parameters with SSL stage-2 fine-tuning while only adds the learning rate decay at 60 and 80 epoch.
|
| 139 |
+
|
| 140 |
+
Results. We demonstrate our results and compare with baselines in Table 2. Incorporating IP-IRM to the 3 baselines brings consistent performance boosts to downstream classification models in all settings, e.g., improving the linear models by $5 . 5 5 \%$ on STL10 and $2 . 9 2 \%$ on Cifar100. In particular, we observe that IP-IRM brings huge performance gain with $k$ -NN classifiers, e.g., $4 . 2 3 \%$ using $\mathrm { H C L + I P }$ -IRM on STL10, i.e., the distance metrics in the IP-IRM feature space more faithfully reflects the class semantic differences. This validates that our algorithm further disentangles compared to the standard SSL Moreover, by extending the training process to 1,000 epochs with MixUp [55], SimCLR+IP-IRM achieves further performance boost on both datasets, e.g., $5 . 2 8 \%$ for $k$ -NN and $4 . 3 5 \%$ for linear classifier over SimCLR baseline on STL10 dataset.
|
| 141 |
+
|
| 142 |
+
Notably, our SimCLR $^ +$ IP-IRM surpasses vanilla supervised learning on Cifar100 under the same evaluation setting. Still, the quality of disentanglement cannot be fully evaluated when the training and test samples are identically distributed—while the improved accuracy demonstrates that IP-IRM representation is more equivariant to class semantics, it does not reveal if the representation is decomposable. Hence we present an out-of-distribution (OOD) setting in Section 5.3 to further show this property.
|
| 143 |
+
|
| 144 |
+
Is IP-IRM sensitive to the values of hyper-parameters? 1) $\lambda _ { 1 }$ and $\lambda _ { 2 }$ in $E q$ . (2) and $E q$ . (3). In Figure 6 (a), we observe that the best performance is achieved with $\lambda _ { 1 }$ and $\lambda _ { 2 }$ taking values from 0.2 to 0.5 on both datasets. All accuracies drop sharply if using $\lambda _ { 1 } = 1 . 0$ . The reason is that a higher $\lambda _ { 1 }$ forces the model to push the $\phi$ -induced similarity to fixed baseline $\theta = 1$ , rather than decrease the loss $\mathcal { L }$ on the pretext task, leading to poor convergence. 2) The number of epochs. In Figure 6 (b), we plot the Top-1 accuracies of using $k$ -NN classifiers along the 700-epoch training of two kinds of SSL representations—SimCLR and IP-IRM. It is obvious that IP-IRM converges faster and achieves a higher accuracy than SimCLR. It is worth to highlight that on the STL10, the accuracy of SimCLR starts to oscillate and grow slowly after the 150-th epoch, while ours keeps on improving. This is an empirical evidence that IP-IRM keeps on disentangling more and more semantics in the feature space, and has the potential of improvement through long-term training.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: Our ablation study on the STL10 and Cifar100 datasets. (a) The Top-1 accuracy $( \% )$ of linear classifiers using different values of $\lambda _ { 1 }$ and $\lambda _ { 2 }$ (in Eq. (2) and Eq. (3)), by training for 200 epochs on two datasets. (b) The Top-1 accuracy $( \% )$ of $k$ -NN classifiers on two datasets, for which we trained the models for 700 epochs and updated $\mathbf { P }$ every 50 epochs.
|
| 148 |
+
|
| 149 |
+
# 5.3 Potential on Large-Scale Data
|
| 150 |
+
|
| 151 |
+
Datasets. We evaluated on the standard benchmark of supervised learning ImageNet ILSVRC2012 [25] which has in total 1,331,167 images in 1,000 classes. To further reveal if a representation is decomposable, we used NICO [37], which is a real-world image dataset designed for OOD evaluations. It contains 25,000 images in 19 classes, with a strong correlation between the foreground and background in the train split (e.g., most dogs on grass). We also studied the transferability of the learned representation following [30, 52]: FGVC Aircraft (Aircraft) [60], Caltech-101 (Caltech) [31], Stanford Cars (Cars) [93], Cifar10 [53], Cifar100 [53], DTD [21], Oxford 102 Flowers (Flowers) [62], Food-101 (Food) [6], Oxford-IIIT Pets (Pets) [67] and SUN397 (SUN) [91]. These datasets include coarse- to fine-grained classification tasks, and vary in the amount of training data (2,000-75,000 images) and classes (10-397 classes), representing a wide range of transfer learning settings.
|
| 152 |
+
|
| 153 |
+
Settings. For the ImageNet, all the representations were trained for 200 epochs due to limited computing resources. We followed the common setting [80, 36], using a linear classifier, and report Top-1 classification accuracies. For NICO, we fixed the ImageNet pre-trained ResNet-50 backbone and fine-tuned the classifier. See appendix for more training details. For the transfer learning, we followed [30, 52] to report the classification accuracies on Cars, Cifar-10, Cifar-100, DTD, Food, SUN and the average per-class accuracies on Aircraft, Caltech, Flowers, Pets. We call them uniformly as Accuracy. We used the few-shot $n$ -way- $k$ -shot setting for model evaluation. Specifically, we randomly sampled 2,000 episodes from the test splits of above datasets. An episode contains $n$ classes, each with $k$ training samples and 15 testing samples, where we fine-tuned the linear classifier (backbone weights frozen) for 100 epochs on the training samples, and evaluated the classifier on the testing samples. We evaluated with $n = k = 5$ (results of $n = 5 , k = 2 0$ in Appendix).
|
| 154 |
+
|
| 155 |
+
ImageNet and NICO. In Table 3 ImageNet accuracy, our IP-IRM achieves the best performance over all baseline models. Yet we believe that this does not show the full potential of IP-IRM, because ImageNet is a larger-scale dataset with many semantics, and it is hard to achieve a full disentanglement of all semantics within the limited 200 epochs. To evaluate the feature decomposability of IPIRM, we compared the performance on NICO with various SSL baselines in Table 3, where our approach significantly outperforms the baselines by $1 . 5 – 4 . 2 \%$ . This validates IP-IRM feature is more decomposable—if each semantic feature (e.g., background) is decomposed in some fixed dimensions and some classes vary with such semantic, then the classifier will recognize this as a non-discriminative variant feature and hence focus on other more discriminative features (i.e., foreground). In this way, even though some classes are confounded by those non-discriminative features (e.g., most of the “dog” images are with “grass” background), the fixed dimensions still help classifiers neglect those non-discriminative ones. We further visualized the CAM [98] on NICO in Figure 7, which indeed shows that IP-IRM helps the classifier focus on the foreground regions.
|
| 156 |
+
|
| 157 |
+
Table 3: ImageNet and NICO Top-1 Accuracy $( \% )$ of linear classifiers trained on the representations learnt with different SSL methods.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Method</td><td>ImageNet</td><td>NICO</td></tr><tr><td>InsDis [90]</td><td>56.5</td><td>65.6</td></tr><tr><td>PCL [56]</td><td>61.5</td><td>72.6</td></tr><tr><td>PIRL [61]</td><td>63.6</td><td>69.1</td></tr><tr><td>MoCo-v1 [36]</td><td>60.6</td><td>69.3</td></tr><tr><td>SimCLR (repro.) [16]</td><td>63.1</td><td>64.5</td></tr><tr><td>MoCo-v2 (repro.)[18]</td><td>67.3</td><td>78.0</td></tr><tr><td>SimSiam (repro.) [19]</td><td>68.8</td><td>66.7</td></tr><tr><td>SimCLR+IP-IRM</td><td>64.8</td><td>66.7</td></tr><tr><td>MoCo-v2+IP-IRM</td><td>67.6</td><td>79.5</td></tr><tr><td>SimSiam+IP-IRM</td><td>69.1</td><td></td></tr><tr><td></td><td></td><td>70.9</td></tr></table>
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 7: Visualization of CAM [98] on images from NICO [37] dataset using representations of the baseline MoCo-v2 [18] and our IP-IRM.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Method</td><td>Aircraft</td><td>Caltech</td><td>Cars</td><td>Cifar10</td><td>Cifar100</td><td>DTD</td><td>Flowers</td><td>Food</td><td>Pets</td><td>SUN</td><td>Average</td></tr><tr><td>InsDis [90]</td><td>35.07</td><td>75.97</td><td>37.49</td><td>51.49</td><td>57.61</td><td>69.38</td><td>77.35</td><td>50.01</td><td>66.38</td><td>74.97</td><td>59.57</td></tr><tr><td>PCL [56]</td><td>36.86</td><td>90.72</td><td>39.68</td><td>59.26</td><td>60.78</td><td>69.53</td><td>67.50</td><td>57.06</td><td>88.31</td><td>84.51</td><td>65.42</td></tr><tr><td>PIRL [61]</td><td>36.70</td><td>78.63</td><td>39.21</td><td>49.85</td><td>55.23</td><td>70.43</td><td>78.37</td><td>51.61</td><td>69.40</td><td>76.64</td><td>60.61</td></tr><tr><td>MoCo-v1 [36]</td><td>35.31</td><td>79.60</td><td>36.35</td><td>46.96</td><td>51.62</td><td>68.76</td><td>75.42</td><td>49.77</td><td>68.32</td><td>74.77</td><td>58.69</td></tr><tr><td>MoCo-v2[18]</td><td>31.98</td><td>92.32</td><td>41.47</td><td>56.50</td><td>63.33</td><td>78.00</td><td>80.05</td><td>57.25</td><td>83.23</td><td>88.10</td><td>67.22</td></tr><tr><td>IP-IRM (Ours)</td><td>32.98</td><td>93.16</td><td> 42.87</td><td>60.73</td><td>68.54</td><td>79.30</td><td>82.68</td><td>59.61</td><td>85.23</td><td>89.38</td><td>69.44</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 4: Accuracy $( \% )$ of 5-way-5-shot few-shot evaluation using the image representation learned on ImageNet [25]. More detailed results are given in Appendix.
|
| 167 |
+
|
| 168 |
+
Few-Shot Tasks. As shown in Table 4, our IP-IRM significantly improves the performance of 5-way-5-shot setting, e.g., we outperform the baseline MoCo-v2 by $2 . 2 \%$ . This is because IP-IRM can further disentangled $\mathcal { G } \backslash \mathcal { D } _ { \mathrm { a u g } }$ over SSL, which is essential for representations to generalize to different downstream class domains (recall Corollary 2 of Lemma 1). This is also in line with recent works [86] showing that a disentangled representation is especially beneficial in low-shot scenarios, and further demonstrates the importance of disentanglement in downstream tasks.
|
| 169 |
+
|
| 170 |
+
# 6 Conclusion
|
| 171 |
+
|
| 172 |
+
We presented an unsupervised disentangled representation learning method called Iterative Partitionbased Invariant Risk Minimization (IP-IRM), based on Self-Supervised Learning (SSL). IP-IRM iteratively partitions the dataset into semantic-related subsets, and learns a representation invariant across the subsets using SSL with an IRM loss. We show that with theoretical guarantee, IP-IRM converges with a disentangled representation under the group-theoretical view, which fundamentally surpasses the capabilities of existing SSL and fully-supervised learning. Our proposed theory is backed by strong empirical results in disentanglement metrics, SSL classification accuracy and transfer performance. IP-IRM achieves disentanglement without using generative models, making it widely applicable on large-scale visual tasks. As future directions, we will continue to explore the application of group theory in representation learning and seek additional forms of inductive bias for faster convergence.
|
| 173 |
+
|
| 174 |
+
# Acknowledgments and Disclosure of Funding
|
| 175 |
+
|
| 176 |
+
The authors would like to thank all reviewers for their constructive suggestions. This research is partly supported by the Alibaba-NTU Joint Research Institute, the A\*STAR under its AME YIRG Grant (Project No. A20E6c0101), and the Singapore Ministry of Education (MOE) Academic Research Fund (AcRF) Tier 2 grant.
|
| 177 |
+
|
| 178 |
+
References [1] Philip W Anderson. More is different. Science, 1972. [2] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. [3] Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. arXiv preprint arXiv:1906.00910, 2019. [4] Yoshua Bengio. Learning deep architectures for AI. Now Publishers Inc, 2009. [5] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013. [6] Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101–mining discriminative components with random forests. In European conference on computer vision, 2014. [7] Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a" siamese" time delay neural network. Advances in neural information processing systems, 6:737–744, 1993. [8] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D 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 Ziegler, Jeffrey Wu, Clemens Winter, Chris 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. In Advances in Neural Information Processing Systems, 2020. [9] Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in $\beta$ -vae. arXiv preprint arXiv:1804.03599, 2018.
|
| 179 |
+
[10] Ruichu Cai, Zijian Li, Pengfei Wei, Jie Qiao, Kun Zhang, and Zhifeng Hao. Learning disentangled semantic representation for domain adaptation. In IJCAI: proceedings of the conference, 2019.
|
| 180 |
+
[11] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 132–149, 2018.
|
| 181 |
+
[12] Mathilde Caron, Piotr Bojanowski, Julien Mairal, and Armand Joulin. Unsupervised pretraining of image features on non-curated data. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2959–2968, 2019.
|
| 182 |
+
[13] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020.
|
| 183 |
+
[14] Long Chen, Hanwang Zhang, Jun Xiao, Wei Liu, and Shih-Fu Chang. Zero-shot visual recognition using semantics-preserving adversarial embedding networks. In CVPR, 2018.
|
| 184 |
+
[15] Ricky TQ Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in neural information processing systems, 2018.
|
| 185 |
+
[16] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597–1607. PMLR, 2020.
|
| 186 |
+
[17] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in neural information processing systems, 2016.
|
| 187 |
+
[18] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020.
|
| 188 |
+
[19] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566, 2020.
|
| 189 |
+
[20] Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, and Stefanie Jegelka. Debiased contrastive learning. arXiv preprint arXiv:2007.00224, 2020.
|
| 190 |
+
[21] Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2014.
|
| 191 |
+
[22] Adam Coates, Andrew $\mathrm { N g }$ , and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pages 215–223. JMLR Workshop and Conference Proceedings, 2011.
|
| 192 |
+
[23] Taco Cohen and Max Welling. Learning the irreducible representations of commutative lie groups. In International Conference on Machine Learning, 2014.
|
| 193 |
+
[24] Taco S Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical cnns. In ICLR, 2018.
|
| 194 |
+
[25] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 195 |
+
[26] 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), 2019.
|
| 196 |
+
[27] Kien Do and Truyen Tran. Theory and evaluation metrics for learning disentangled representations. In International conference on learning representations, 2020.
|
| 197 |
+
[28] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE international conference on computer vision, pages 1422–1430, 2015.
|
| 198 |
+
[29] Cian Eastwood and Christopher KI Williams. A framework for the quantitative evaluation of disentangled representations. In International conference on learning representations, 2018.
|
| 199 |
+
[30] Linus Ericsson, Henry Gouk, and Timothy M. Hospedales. How Well Do Self-Supervised Models Transfer? In CVPR, 2021.
|
| 200 |
+
[31] Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In 2004 conference on computer vision and pattern recognition workshop, 2004.
|
| 201 |
+
[32] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 2016.
|
| 202 |
+
[33] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 203 |
+
[34] Jean-Bastien Grill, Florian Strub, Florent Altché, 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.
|
| 204 |
+
[35] W.F.J. Harris, W. Fulton, and J. Harris. Representation Theory: A First Course. 1991.
|
| 205 |
+
[36] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019.
|
| 206 |
+
|
| 207 |
+
[37] Yue He, Zheyan Shen, and Peng Cui. Towards non-iid image classification: A dataset and baselines. Pattern Recognition, 110:107383, 2021.
|
| 208 |
+
|
| 209 |
+
[38] Olivier Henaff. Data-efficient image recognition with contrastive predictive coding. In International Conference on Machine Learning, pages 4182–4192. PMLR, 2020.
|
| 210 |
+
|
| 211 |
+
[39] I. Higgins, Loïc Matthey, A. Pal, C. Burgess, Xavier Glorot, M. Botvinick, S. Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR, 2017.
|
| 212 |
+
|
| 213 |
+
[40] Irina Higgins, David Amos, David Pfau, Sebastien Racaniere, Loic Matthey, Danilo Rezende, and Alexander Lerchner. Towards a definition of disentangled representations. arXiv preprint arXiv:1812.02230, 2018.
|
| 214 |
+
|
| 215 |
+
[41] Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. International conference on learning representations, 2017.
|
| 216 |
+
|
| 217 |
+
[42] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
|
| 218 |
+
|
| 219 |
+
[43] Jun-Ting Hsieh, Bingbin Liu, De-An Huang, Li Fei-Fei, and Juan Carlos Niebles. Learning to decompose and disentangle representations for video prediction. In Advances in neural information processing systems, 2018.
|
| 220 |
+
|
| 221 |
+
[44] Qianjiang Hu, Xiao Wang, Wei Hu, and Guo-Jun Qi. Adco: Adversarial contrast for efficient learning of unsupervised representations from self-trained negative adversaries. arXiv preprint arXiv:2011.08435, 2020.
|
| 222 |
+
|
| 223 |
+
[45] Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Advances in Neural Information Processing Systems, 2019.
|
| 224 |
+
|
| 225 |
+
[46] Andrew Jaegle, Stephen Phillips, Daphne Ippolito, and Kostas Daniilidis. Understanding image motion with group representations. 2018.
|
| 226 |
+
|
| 227 |
+
[47] Thomas W. Judson. Abstract Algebra: Theory and Applications (The Prindle, Weber & Schmidt Series in Advanced Mathematics). Prindle Weber & Schmidt, 1994.
|
| 228 |
+
|
| 229 |
+
[48] Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. arXiv preprint arXiv:2010.01028, 2020.
|
| 230 |
+
|
| 231 |
+
[49] Theofanis Karaletsos, Serge Belongie, and Gunnar Rätsch. Bayesian representation learning with oracle constraints. International conference on learning representations, 2015.
|
| 232 |
+
|
| 233 |
+
[50] Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, 2018.
|
| 234 |
+
|
| 235 |
+
[51] Diederik Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
|
| 236 |
+
|
| 237 |
+
[52] Simon Kornblith, Jonathon Shlens, and Quoc V Le. Do better imagenet models transfer better? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019.
|
| 238 |
+
|
| 239 |
+
[53] Alex Krizhevsky. Learning multiple layers of features from tiny images. 2012.
|
| 240 |
+
|
| 241 |
+
[54] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 242 |
+
|
| 243 |
+
[55] Kibok Lee, Yian Zhu, Kihyuk Sohn, Chun-Liang Li, Jinwoo Shin, and Honglak Lee. i-mix: A domain-agnostic strategy for contrastive representation learning. In ICLR, 2021.
|
| 244 |
+
|
| 245 |
+
[56] Junnan Li, Pan Zhou, Caiming Xiong, Richard Socher, and Steven CH Hoi. Prototypical contrastive learning of unsupervised representations. arXiv preprint arXiv:2005.04966, 2020.
|
| 246 |
+
[57] Zinan Lin, Kiran Thekumparampil, Giulia Fanti, and Sewoong Oh. Infogan-cr and modelcentrality: Self-supervised model training and selection for disentangling gans. In International Conference on Machine Learning, 2020.
|
| 247 |
+
[58] F. Locatello, M. Tschannen, S. Bauer, G. Rätsch, B. Schölkopf, and O. Bachem. Disentangling factors of variations using few labels. In 8th International Conference on Learning Representations (ICLR), 2020.
|
| 248 |
+
[59] Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In international conference on machine learning, 2019.
|
| 249 |
+
[60] Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Finegrained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
|
| 250 |
+
[61] Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6707–6717, 2020.
|
| 251 |
+
[62] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, 2008.
|
| 252 |
+
[63] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European conference on computer vision, pages 69–84. Springer, 2016.
|
| 253 |
+
[64] Utkarsh Ojha, Krishna Kumar Singh, Cho-Jui Hsieh, and Yong Jae Lee. Elastic-infogan: Unsupervised disentangled representation learning in class-imbalanced data. In Advances in neural information processing systems, 2020.
|
| 254 |
+
[65] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 255 |
+
[66] Giambattista Parascandolo, Niki Kilbertus, Mateo Rojas-Carulla, and Bernhard Schölkopf. Learning independent causal mechanisms. In Proceedings of the 35th International Conference on Machine Learning, pages 4036–4044, 2018.
|
| 256 |
+
[67] Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, 2012.
|
| 257 |
+
[68] Robin Quessard, Thomas Barrett, and William Clements. Learning disentangled representations and group structure of dynamical environments. Advances in Neural Information Processing Systems, 2020.
|
| 258 |
+
[69] Rajesh PN Rao and Daniel L Ruderman. Learning lie groups for invariant visual perception. Advances in neural information processing systems, 1999.
|
| 259 |
+
[70] Scott Reed, Kihyuk Sohn, Yuting Zhang, and Honglak Lee. Learning to disentangle factors of variation with manifold interaction. In International conference on machine learning, 2014.
|
| 260 |
+
[71] Xuanchi Ren, Tao Yang, Yuwang Wang, and Wenjun Zeng. Do generative models know disentanglement? contrastive learning is all you need. arXiv preprint arXiv:2102.10543, 2021.
|
| 261 |
+
[72] Karl Ridgeway and Michael C Mozer. Learning deep disentangled embeddings with the f-statistic loss. In Advances in neural information processing systems, 2018.
|
| 262 |
+
[73] Joshua Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka. Contrastive learning with hard negative samples. arXiv preprint arXiv:2010.04592, 2020.
|
| 263 |
+
[74] Bernhard Schölkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. On causal and anticausal learning. In Proceedings of the 29th International Conference on Machine Learning, 2012.
|
| 264 |
+
[75] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In 3rd International Conference on Learning Representations, 2015.
|
| 265 |
+
[76] Ivan Sosnovik, Michał Szmaja, and Arnold Smeulders. Scale-equivariant steerable networks. 2020.
|
| 266 |
+
[77] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 267 |
+
[78] Raphael Suter, Djordje Miladinovic, Stefan Bauer, and Bernhard Schölkopf. Interventional robustness of deep latent variable models. arXiv, 2018.
|
| 268 |
+
[79] Raphael Suter, Djordje Miladinovic, Bernhard Schölkopf, and Stefan Bauer. Robustly disentangled causal mechanisms: Validating deep representations for interventional robustness. In International Conference on Machine Learning, 2019.
|
| 269 |
+
[80] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019.
|
| 270 |
+
[81] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Andrea Vedaldi, Horst Bischof, Thomas Brox, and Jan-Michael Frahm, editors, European conference on computer vision, 2020.
|
| 271 |
+
[82] Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020.
|
| 272 |
+
[83] Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. arXiv preprint arXiv:2102.06810, 2021.
|
| 273 |
+
[84] Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning gan for poseinvariant face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 274 |
+
[85] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
|
| 275 |
+
[86] Sjoerd Van Steenkiste, Francesco Locatello, Jürgen Schmidhuber, and Olivier Bachem. Are disentangled representations helpful for abstract visual reasoning? In Advances in neural information processing systems, 2019.
|
| 276 |
+
[87] Tan Wang, Chang Zhou, Qianru Sun, and Hanwang Zhang. Causal attention for unbiased visual recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
|
| 277 |
+
[88] Xudong Wang, Ziwei Liu, and Stella X Yu. Unsupervised feature learning by cross-level discrimination between instances and groups. arXiv preprint arXiv:2008.03813, 2020.
|
| 278 |
+
[89] Daniel E Worrall and Max Welling. Deep scale-spaces: Equivariance over scale. In NeurIPS, 2019.
|
| 279 |
+
[90] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3733–3742, 2018.
|
| 280 |
+
[91] Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE computer society conference on computer vision and pattern recognition, 2010.
|
| 281 |
+
[92] Tete Xiao, Xiaolong Wang, Alexei A Efros, and Trevor Darrell. What should not be contrastive in contrastive learning. In International Conference on Learning Representations, 2021.
|
| 282 |
+
[93] Linjie Yang, Ping Luo, Chen Change Loy, and Xiaoou Tang. A large-scale car dataset for fine-grained categorization and verification. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 283 |
+
[94] Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6210–6219, 2019.
|
| 284 |
+
[95] Zhongqi Yue, Tan Wang, Hanwang Zhang, Qianru Sun, and Xian-Sheng Hua. Counterfactual zero-shot and open-set visual recognition. In CVPR, 2021.
|
| 285 |
+
[96] Zhongqi Yue, Hanwang Zhang, Qianru Sun, and Xian-Sheng Hua. Interventional few-shot learning. In NeurIPS, 2020.
|
| 286 |
+
[97] Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018.
|
| 287 |
+
[98] 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, pages 2921–2929, 2016.
|
| 288 |
+
[99] Yizhe Zhu, Martin Renqiang Min, Asim Kadav, and Hans Peter Graf. S3vae: Self-supervised sequential vae for representation disentanglement and data generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020.
|
| 289 |
+
[100] Zhenyao Zhu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Multi-view perceptron: a deep model for learning face identity and view representations. Advances in Neural Information Processing Systems 27 (NIPS 2014), 2014.
|
md/train/RSU17UoKfJF/RSU17UoKfJF.md
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# R-GAP: RECURSIVE GRADIENT ATTACK ON PRIVACY
|
| 2 |
+
|
| 3 |
+
Junyi Zhu and Matthew Blaschko
|
| 4 |
+
|
| 5 |
+
Dept. ESAT, Center for Processing Speech and Images KU Leuven, Belgium {junyi.zhu,matthew.blaschko}@esat.kuleuven.be
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Federated learning frameworks have been regarded as a promising approach to break the dilemma between demands on privacy and the promise of learning from large collections of distributed data. Many such frameworks only ask collaborators to share their local update of a common model, i.e. gradients, instead of exposing their raw data to other collaborators. However, recent optimization-based gradient attacks show that raw data can often be accurately recovered from gradients. It has been shown that minimizing the Euclidean distance between true gradients and those calculated from estimated data is often effective in fully recovering private data. However, there is a fundamental lack of theoretical understanding of how and when gradients can lead to unique recovery of original data. Our research fills this gap by providing a closed-form recursive procedure to recover data from gradients in deep neural networks. We name it Recursive Gradient Attack on Privacy (R-GAP). Experimental results demonstrate that R-GAP works as well as or even better than optimization-based approaches at a fraction of the computation under certain conditions. Additionally, we propose a Rank Analysis method, which can be used to estimate the risk of gradient attacks inherent in certain network architectures, regardless of whether an optimization-based or closed-form-recursive attack is used. Experimental results demonstrate the utility of the rank analysis towards improving the network’s security. Source code is available for download from https://github.com/JunyiZhu-AI/R-GAP.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Distributed and federated learning have become common strategies for training neural networks without transferring data (Jochems et al., 2016; 2017; Konecnˇ y et al., 2016; McMahan et al., 2017). ´ Instead, model updates, often in the form of gradients, are exchanged between participating nodes. These are then used to update at each node a copy of the model. This has been widely applied for privacy purposes (Rigaki & Garcia, 2020; Cristofaro, 2020), including with medical data (Jochems et al., 2016; 2017). Recently, it has been demonstrated that this family of approaches is susceptible to attacks that can in some circumstances recover the training data from the gradient information exchanged in such federated learning approaches, calling into question their suitability for privacy preserving distributed machine learning (Phong et al., 2018; Wang et al., 2019; Zhu et al., 2019; Zhao et al., 2020; Geiping et al., 2020; Wei et al., 2020). To date these attack strategies have broadly fallen into two groups: (i) an analytical attack based on the use of gradients with respect to a bias term (Phong et al., 2018), and (ii) an optimization-based attack (Zhu et al., 2019) that can in some circumstances recover individual training samples in a batch, but that involves a difficult nonconvex optimization that doesn’t always converge to a correct solution (Geiping et al., 2020), and that provides comparatively little insights into the information that is being exploited in the attack.
|
| 14 |
+
|
| 15 |
+
The development of privacy attacks is most important because they inform strategies for protecting against them. This is achieved by perturbations to the transferred gradients, and the form of the attack can give insights into the type of perturbation that can effectively protect the data (Fan et al., 2020). As such, the development of novel closed-form attacks is essential to the analysis of privacy in federated learning. More broadly, the existence of model inversion attacks (He et al., 2019; Wang et al., 2019; Yang et al., 2019; Zhang et al., 2020) calls into question whether transferring a fully trained model can be considered privacy preserving. As the weights of a model trained by (stochastic) gradient descent are the summation of individual gradients, understanding gradient attacks can assist in the analysis of and protection against model inversion attacks in and outside of a federated learning setting.
|
| 16 |
+
|
| 17 |
+
In this work, we develop a novel third family of attacks, recursive gradient attack on privacy (RGAP), that is based on a recursive, depth-wise algorithm for recovering training data from gradient information. Different from the analytical attack using the bias term, R-GAP utilizes much more information and is the first closed-form algorithm that works on both convolutional networks and fully connected networks with or without bias term. Compared to optimization-based attacks, it is not susceptible to local optima, and is orders of magnitude faster to run with a deterministic running time. Furthermore, we show that under certain conditions our recursive attack can fully recover training data in cases where optimization attacks fail. Additionally, the insights gained from the closed form of our recursive attack have lead to a refined rank analysis that predicts which network architectures enable full recovery, and which lead to provable noisy recovery due to rankdeficiency. This explains well the performance of both closed-form and optimization-based attacks. We also demonstrate that using rank analysis we are able to make small modifications to network architectures to increase the network’s security without sacrificing its accuracy.
|
| 18 |
+
|
| 19 |
+
# 1.1 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Bias attacks: The original discovery of the existence of an analytical attack based on gradients with respect to the bias term is due to Phong et al. (2018). Fan et al. (2020) also analyzed the bias attack as a system of linear equations, and proposed a method of perturbing the gradients to protect against it. Their work considers convolutional and fully-connected networks as equivalent, but this ignores the aggregation of gradients in convolutional networks. Similar to our work, they also perform a rank analysis, but it considers fewer constraints than is included in our analysis (Section 4).
|
| 22 |
+
|
| 23 |
+
Optimization attacks: The first attack that utilized an optimization approach to minimize the distance between gradients appears to be due to Wang et al. (2019). In this work, optimization is adopted as a submodule in their GAN-style framework. Subsequently, Zhu et al. (2019) proposed a method called deep leakage from gradients (DLG) which relies entirely on minimization of the difference of gradients (Section 2). They propose the use of L-BFGS (Liu & Nocedal, 1989) to perform the optimization. Zhao et al. (2020) further analyzed label inference in this setting, proposing an analytic way to reconstruct the one-hot label of multi-class classification in terms of a single input. Wei et al. (2020) show that DLG is sensitive to initialization and proposed that the same class image is an optimal initialization. They proposed to use SSIM as image similarity metric, which can then be used to guide optimization by DLG. Geiping et al. (2020) point out that as DLG requires second-order derivatives, L-BFGS actually requires third-order derivatives, which leads to challenging optimzation for networks with activation functions such as ReLU and LeakyReLU. They therefore propose to replace L-BFGS with Adam (Kingma & Ba, 2015). Similar to the work of Wei et al. (2020), Geiping et al. (2020) propose to incorporate an image prior, in this case total variation, while using PSNR as a quality measurement.
|
| 24 |
+
|
| 25 |
+
# 2 OPTIMIZATION-BASED GRADIENT ATTACKS ON PRIVACY (O-GAP)
|
| 26 |
+
|
| 27 |
+
Optimization-based gradient attacks on privacy (O-GAP) take the real gradients as its ground-truth label and utilizes optimization to decrease the distance between the real gradients $\nabla { \mathbf W }$ and the dummy gradients $\nabla { \mathbf W } ^ { \prime }$ generated by a pair of randomly initialized dummy data and dummy label. The objective function of O-GAP can be generally expressed as:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\arg \operatorname* { m i n } _ { x ^ { \prime } , y ^ { \prime } } \| \nabla \mathbf { W } - \nabla \mathbf { W } ^ { \prime } \| ^ { 2 } = \arg \operatorname* { m i n } _ { x ^ { \prime } , y ^ { \prime } } \sum _ { i = 1 } ^ { d } \| \nabla \mathbf { W } _ { i } - \nabla \mathbf { W } _ { i } ^ { \prime } \| ^ { 2 } ,
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where the summation is taken over the layers of a network of depth $d$ , and $( x ^ { \prime } , y ^ { \prime } )$ is the dummy training data and label used to generate $\nabla W ^ { \prime }$ . The idea of O-GAP was proposed by Wang et al. (2019). However, they have adopted it as a part of their GAN-style framework and did not realize that O-GAP is able to preform a more accurate attack by itself. Later in the work of Zhu et al. (2019), O-GAP has been proposed as a stand alone approach, the framework has been named as Deep Leakage from Gradients (DLG).
|
| 34 |
+
|
| 35 |
+
The approach is intuitively simple, and in practice has been shown to give surprisingly good results (Zhu et al., 2019). However, it is sensitive to initialization and prone to fail (Zhao et al., 2020). The choice of optimizer is therefore important, and convergence can be very slow (Geiping et al., 2020). Perhaps most importantly, Equation 1 gives little insight into what information in the gradients is being exploited to recover the data. Analysis in Zhu et al. (2019) is limited to empirical insights, and fundamental open questions remain: What are sufficient conditions for arg $\begin{array} { r l } { { \bf \operatorname* { m i n } } _ { x ^ { \prime } , y ^ { \prime } } \sum _ { i = 1 } ^ { d ^ { - } } \| \nabla { \bf W } _ { i } - \nabla { \bf W } _ { i } ^ { \prime } \| ^ { 2 } } & { { } } \end{array}$ to have a unique minimizer? We address this question in Section 4, and subsequently validate our findings empirically.
|
| 36 |
+
|
| 37 |
+
# 3 CLOSED-FORM GRADIENT ATTACKS ON PRIVACY
|
| 38 |
+
|
| 39 |
+
The first attempt of closed-form GAP was proposed in a research of privacy-preserving deep learning by Phong et al. (2018).
|
| 40 |
+
|
| 41 |
+
Theorem 1 (Phong et al. (2018)). Assume a layer of a fully connected network with a bias term, expressed as:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
W x + b = z ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $W , b$ denote the weight matrix and bias vector, and $x , z$ denote the input vector and output vector of this layer. If the loss function $\ell$ of the network can be expressed as:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\ell = \ell ( f ( \pmb { x } ) , y )
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $f$ indicates a nested function of $\boldsymbol { x }$ including activation function and all subsequent layers, $y$ is the ground-truth label. Then $x$ can be derived from gradients w.r.t. $W$ and gradients w.r.t. $\pmb { b }$ , i.e.:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { l } { \displaystyle { \frac { \partial \ell } { \partial W } = \frac { \partial \ell } { \partial z } \pmb { x } ^ { \top } , \quad \frac { \partial \ell } { \partial \pmb { b } } = \frac { \partial \ell } { \partial z } } } \\ { \displaystyle { \boldsymbol { x } ^ { \top } = \frac { \partial \ell } { \partial W _ { j } } / \frac { \partial \ell } { \partial b _ { j } } } } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $j$ denotes the $j$ -th row, note that in fact from each row we can compute a copy of $\mathbf { \dot { x } } ^ { \top }$ .
|
| 60 |
+
|
| 61 |
+
When this layer is the first layer of a network, it is possible to reconstruct the data, i.e. $\mathbf { X }$ , using this approach. In the case of noisy gradients, we can make use of the redundancy in estimating $\mathbf { X }$ by averaging over noisy estimates: $\begin{array} { r } { \bar { \mathbf { x } } ^ { \top } = \sum _ { j } \frac { \partial \ell } { \partial \mathbf { W } _ { j } } / \frac { \partial \ell } { \partial \mathbf { b } _ { j } } } \end{array}$ \`W / ∂\`∂b . However, simply removing the bias term can disable this attack. Besides, this approach does not work on convolutional neural networks due to a dimension mismatch in Equation 3. Both of these two problems have been resolved in our approach.
|
| 62 |
+
|
| 63 |
+
# 3.1 RECURSIVE GRADIENT ATTACK ON PRIVACY (R-GAP)
|
| 64 |
+
|
| 65 |
+
For simplicity we derive the R-GAP in terms of binary classification with a single image as input. In this setting we can generally describe the network and loss function as:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r l } & { \mu = y \mathbf { w } _ { d } \sigma _ { d - 1 } \left( \mathbf { W } _ { d - 1 } \underbrace { \sigma _ { d - 1 } ( \mathbf { x } ) } _ { = : f _ { d - 2 } ( \mathbf { x } ) } \right) } \\ & { \ell = \log ( 1 + e ^ { - \mu } ) } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $y \in \{ - 1 , 1 \}$ , $d$ denotes the $d$ -th layer, $\phi$ represents all layers previous to $d - 2$ , and $\sigma$ denotes the activation function. Note that, although our notation omits the bias term in our approach, with an augmented matrix and augmented vector it is able to represent both of the linear map and the translation, e.g. Equation 2, using matrix multiplication as shown in Equation 4. So our formulation also includes the approach proposed by Phong et al. (2018). Moreover, if the $i$ -th layer is a convolutional layer, then $\mathbf { W } _ { i }$ is an extended circulant matrix representing the convolutional kernel (Golub & Van Loan, 1996), and data $\mathbf { X }$ as well as input of each layer are represented by a flattened vector in Equation 4.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
\`: Logistic loss
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
\`: Exponential loss
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
\`: Hinge loss
|
| 81 |
+
|
| 82 |
+
Figure 1: In consideration of logistic loss, exponential loss and hinge loss, $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ is not monotonic w.r.t. $\mu$ . It is equal to 0 at $\mu = 0$ , after that it either approximates $0 ^ { - }$ , or equals to 0 after decreasing to $\mu = 1$ .
|
| 83 |
+
|
| 84 |
+
# 3.1.1 RECOVERING DATA FROM GRADIENTS
|
| 85 |
+
|
| 86 |
+
From Equation 4 and Equation 5 we can derive following gradients:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r l } & { \quad \quad \displaystyle \frac { \partial \ell } { \partial \mathbf { w } _ { d } } = y \frac { \partial \ell } { \partial \mu } f _ { d - 1 } ^ { \top } } \\ & { \quad \quad \displaystyle \frac { \partial \ell } { \partial \mathbf { W } _ { d - 1 } } = \left( \left( \mathbf { w } _ { d } ^ { \top } \left( y \frac { \partial \ell } { \partial \mu } \right) \right) \odot \sigma _ { d - 1 } ^ { \prime } \right) f _ { d - 2 } ^ { \top } } \\ & { \quad \quad \displaystyle \frac { \partial \ell } { \partial \mathbf { W } _ { d - 2 } } = \left( \left( \mathbf { W } _ { d - 1 } ^ { \top } \left( \left( \mathbf { w } _ { d } ^ { \top } \left( y \frac { \partial \ell } { \partial \mu } \right) \right) \odot \sigma _ { d - 1 } ^ { \prime } \right) \right) \odot \sigma _ { d - 2 } ^ { \prime } \right) \phi ^ { \top } } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $\sigma ^ { \prime }$ denotes the derivative of $\sigma$ , for more details of deriving the gradients refer to Appendix $_ \mathrm { H }$ The first observation of these gradients is that:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\frac { \partial \ell } { \partial \mathbf { w } _ { d } } \cdot \mathbf { w } _ { d } = \frac { \partial \ell } { \partial \mu } \mu
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Additionally, if $\sigma _ { 1 } , \ldots , \sigma _ { d - 1 }$ are ReLU or LeakyRelu, the dot product of the gradients and weights of each layer will be the same, i.e.:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\frac { \partial \ell } { \partial \mathbf { w } _ { d } } \cdot \mathbf { w } _ { d } = \frac { \partial \ell } { \partial \mathbf { W } _ { d - 1 } } \cdot \mathbf { W } _ { d - 1 } = \ldots = \frac { \partial \ell } { \partial \mathbf { W } _ { 1 } } \cdot \mathbf { W } _ { 1 } = \frac { \partial \ell } { \partial \mu } \mu
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Since gradients and weights of each layer are known, we can obtain $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ . If loss function $\ell$ is logistic loss (Equation 5), we obtain:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\frac { \partial \ell } { \partial \mu } \mu = \frac { - \mu } { 1 + e ^ { \mu } } .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
In order to perform R-GAP, we need to derive $\mu$ from $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ . As we can see, $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ is non-monotonic, which means knowing $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ does not always allow us to uniquely recover $\mu$ . However, even in the case that we cannot uniquely recover $\mu$ , there are only two possible values to consider. Figure 1 illustrates $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ of logistic, exponential, and hinge losses, showing when we can uniquely recover $\mu$ from $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ . The non-uniqueness of $\mu$ inspires us to find a sort of data that can trigger exactly the same gradients as the real data, which we name twin data, denoted by $\tilde { \mathbf { x } }$ . The existence of twin data demonstrates that the objective function of DLG could have more than one global minimum, which explains at least in part why DLG is sensitive to initialization, for more information and experiments about the twin data refer to Appendix B.
|
| 111 |
+
|
| 112 |
+
The second observation on Equations 6-8 is that the gradients of each layer have a repeated format:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { r l r } { { \frac { \partial \ell } { \partial \mathbf { w } _ { d } } = \mathbf { k } _ { d } f _ { d - 1 } ^ { \top } ; \mathbf { k } _ { d } : = y \frac { \partial \ell } { \partial \mu } } } \\ & { } & { \frac { \partial \ell } { \partial \mathbf { W } _ { d - 1 } } = \mathbf { k } _ { d - 1 } f _ { d - 2 } ^ { \top } ; \mathbf { k } _ { d - 1 } : = ( \mathbf { w } _ { d } ^ { \top } \mathbf { k } _ { d } ) \odot \sigma _ { d - 1 } ^ { \prime } } \\ & { } & { \frac { \partial \ell } { \partial \mathbf { W } _ { d - 2 } } = \mathbf { k } _ { d - 2 } \boldsymbol { \phi } ^ { \top } ; \mathbf { k } _ { d - 2 } : = ( \mathbf { W } _ { d - 1 } ^ { \top } \mathbf { k } _ { d - 1 } ) \odot \sigma _ { d - 2 } ^ { \prime } } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
In Equation 12, the value of $y$ can be derived from the sign of the gradients at this layer if the activation function of previous layer is ReLU or Sigmoid, i.e. $f _ { d - 1 } > 0$ . For multi-class classification, $y$ can always be analytically derived as proved by Zhao et al. (2020). From Equations 12-14 we can see that gradients are actually linear constraints on the output of the previous layer, also the input of the current layer. We name these gradient constraints, which can be generally described as:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathbf { K } _ { i } \mathbf { x } _ { i } = \mathrm { f l a t t e n } ( \frac { \partial \ell } { \partial \mathbf { W } _ { i } } ) ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $i$ denotes $i$ -th layer, $\mathbf { x } _ { i }$ denotes the input and $\mathbf { K } _ { i }$ is a coefficient matrix containing all gradient constraints at the $i$ -th layer.
|
| 125 |
+
|
| 126 |
+
# 3.1.2 IMPLEMENTATION OF R-GAP
|
| 127 |
+
|
| 128 |
+
To reconstruct the input $\mathbf { x } _ { i }$ from the gradients $\frac { \partial \ell } { \partial \mathbf { W } _ { i } }$ at the $i$ -th layer, we need to determine $\mathbf { K } _ { i }$ or $\mathbf { k } _ { i }$ . The coefficient vector $\mathbf { k } _ { i }$ solely relies on the reconstruction of the subsequent layer. For example in Equation 13, $\mathbf { k } _ { d - 1 }$ consists of $\mathbf { w } _ { d } , \mathbf { k } _ { d } , \sigma _ { d - 1 } ^ { \prime }$ , where ${ \bf w } _ { d }$ is known, and $\mathbf { k } _ { d }$ and $\sigma _ { d - 1 } ^ { \prime }$ are products of the reconstruction at the $d$ -th layer. More specifically, $\mathbf { k } _ { d }$ can be calculated by deriving $y$ and $\mu$ as described in Section 3.1.1, $\sigma _ { d - 1 } ^ { \prime }$ can be derived from the reconstructed $f _ { d - 1 }$ . The condition for recovering $\mathbf { x } _ { i }$ under gradient constraints $\mathbf { k } _ { i }$ is that the rank of the coefficient matrix equals the number of entries of the input, $\mathrm { r a n k } ( \mathbf { K } _ { i } ) = | \mathbf { x } _ { i } |$ . Furthermore, if this rank condition holds for $i = 1 , . . . , d$ , we are able to reconstruct the input at each layer and do this recursively back to the input of the first layer.
|
| 129 |
+
|
| 130 |
+
The number of gradient constraints is the same as the number of weights, i.e. ro $\mathrm { v s } ( \mathbf { K } _ { i } ) = | \mathbf { W } _ { i } |$ ; $i =$ $1 , . . . , d$ . Specifically, in the case of a fully connected layer we always have $\mathrm { r a n k } ( \mathbf { K } _ { i } ) = \lvert \mathbf { x } _ { i } \rvert$ , which implies the reconstruction over FCNs is always feasible. However in the case of a convolutional layer the matrix could possibly be rank-deficient to derive $\mathbf { X }$ . Fortunately, from the view of recursive reconstruction and assuming we know the input of the subsequent layer, i.e. the output of the current layer, there is a new group of linear constraints which we name weight constraints:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\mathbf { W } _ { i } \mathbf { x } _ { i } = \mathbf { z } _ { i } ; \quad \mathbf { z } _ { i } \gets f _ { i }
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
For a convolution layer, the $\mathbf { W } _ { i }$ we use in this paper is the corresponding circulant matrix representing the convolutional kernel (Golub & Van Loan, 1996), so we can express the convolution in the form of Equation 16. In order to derive $\mathbf { z } _ { i }$ from $f _ { i }$ , the activation function $\sigma _ { i }$ should be monotonic. Commonly used activation functions satisfy this requirement. Note that for the ReLU activation function, a 0 value in $f _ { i }$ will remove a constraint in $\mathbf { W } _ { i }$ . Otherwise, the number of weights constraints is equal to the number of entries in output, i.e. $\mathrm { r o w s } ( \mathbf { W } _ { i } ) = | \mathbf { z } _ { i } | ; ~ i = 1 , . . . , d$ . In CNNs the number of weight constraints $\left| \mathbf { z } _ { i } \right|$ is much larger than the number of gradient constraints $| \mathbf { W } _ { i } |$ in bottom layers, and well compensate for the lack of gradient constraints in those layers. It is worth noting that, due to the transformation from a CNN to a FCN using the circulant matrix, a CNN has been regarded equivalent to a FCN in the parallel work of Fan et al. (2020). However, we would like to point out that in consideration of the gradients w.r.t. the circulant matrix, what we obtain from a CNN are the aggregated gradients. Therefore, the number of valid gradient constraints in a CNN are much smaller than its corresponding FCN. Therefore, the conclusion of a rank analysis derived from a FCN cannot be directly applied to a CNN.
|
| 137 |
+
|
| 138 |
+
Moreover, padding in the $i$ -th convolutional layer increases $\left| { { \bf { x } } _ { i } } \right|$ , but also involves the same number of constraints, so we omit this detail in the subsequent discussion. However, we have incorporated the corresponding constraints in our approach. Based on gradient constraints and weight constraints, we break the gradient attacks down to a recursive process of solving systems of linear equations, which we name R-GAP . The approach is detailed in Algorithm 1.
|
| 139 |
+
|
| 140 |
+
# 4 RANK ANALYSIS
|
| 141 |
+
|
| 142 |
+
For optimization-based gradient attacks such as DLG, it is hard to estimate whether it will converge to a unique solution given a network’s architecture other than performing an empirical test. An intuitive assumption would be that the more parameters in the model, the greater the chance of unique recovery, since there will be more terms in the objective function constraining the solution. We provide here an analytic approach, with which it is easy to estimate the feasibility of performing the recursive gradient attack, which in turn is a good proxy to estimate when DLG converges to a good solution (see Figure 2).
|
| 143 |
+
|
| 144 |
+
Algorithm 1: R-GAP (Notation is consistent with Equation 6 to Equation 15)
|
| 145 |
+
|
| 146 |
+
<table><tr><td colspan="2">Data: i: i-th layer; Wi: weights; VWi: gradients; Result: X1</td></tr><tr><td colspan="2">fori←d to1 do if i=d then</td></tr><tr><td colspan="2">μ = VWi·Wi; al μ↑ al</td></tr><tr><td colspan="2">比:</td></tr><tr><td colspan="2">y</td></tr><tr><td colspan="2">else /* Derive σ' and zi from fi. Note that Xi+1= fi. */</td></tr><tr><td colspan="2">←Xi+1;Zi←Xi+1;</td></tr><tr><td colspan="2">ki :=(Wi+1 ki+1) ① σ';</td></tr><tr><td colspan="2">end</td></tr><tr><td colspan="2">Ki ←ki; Vwi := flatten(VWi);</td></tr><tr><td colspan="2">[Wi] ; bi := Zi A:= K Vw i</td></tr></table>
|
| 147 |
+
|
| 148 |
+
Since R-GAP solves a sequence of linear equations, it is infeasible when the number of unknown parameters is more than the number of constraints at any $i$ -th layer, i.e. $\left| \mathbf { x } _ { i } \right| - \left| \mathbf { W } _ { i } \right| - \left| \mathbf { z } _ { i } \right| > 0 .$ . More precisely, R-GAP requires that the rank of $\mathbf { A } _ { i }$ , which consists of $\mathbf { W } _ { i }$ and $\mathbf { K } _ { i }$ as shown in Algorithm 1, is equal to the number of input entries $\left| { { \bf { x } } _ { i } } \right|$ . However, $\mathbf { A } _ { i } \mathbf { x } _ { i } = \mathbf { z } _ { i }$ does not include all effective constraints over $\mathbf { x } _ { i }$ . Because $\mathbf { x } _ { i }$ is unique to $\mathbf { z } _ { i - 1 }$ or partly unique in terms of the ReLU activation function, any constraint over $\mathbf { z } _ { i - 1 }$ will limit the possible value of $\mathbf { x } _ { i }$ . On that note, suppose $| { \bf x } _ { i - 1 } | =$ $m$ , $| { \bf z } _ { i - 1 } | = n$ and the weight constraints at the $i - 1$ layer is overdetermined, i.e. $\mathbf { W } _ { i - 1 } \mathbf { x } _ { i - 1 } =$ $\mathbf { z } _ { i - 1 }$ ; $m < n$ , $r a n k ( \mathbf { W } _ { i - 1 } ) = m$ . Without the loss of generality, let the first $m$ entries of $\mathbf { z } _ { i - 1 }$ be linearly independent, the $m + 1$ , . . . , $n$ entries of $\mathbf { z } _ { i - 1 }$ can be expressed as linear combination of the first $m$ entries, i.e. $\mathbf { M } \mathbf { z } _ { i - 1 } ^ { 1 , . . . , m } = \mathbf { z } _ { i - 1 } ^ { m + 1 , . . . , n }$ . In other words, if the previous layers are overdetermined by weight constraints, the subsequent layer will have additional constraints, not merely its local weight constraints and gradient constraints. Since this type of additional constraint is not derived from the parameters of the layer that under reconstruction, we name them virtual constraints denoted by $\nu$ . When the activation function is the identity function, the virtual constraints are linear and can be readily derived. For the derivative of the activation function not being a constant, the virtual constraints will become non-linear. For more details about deriving the virtual constraints, refer to Appendix C. Optimization based attacks such as DLG are iterative algorithms based on gradient descent, and are able to implicitly utilize the non-linear virtual constraints. Therefore to provide a comprehensive estimate of the data vulnerability under gradient attacks, we also have to count the number of virtual constraints. It is worth noticing that virtual constraints can be passed along through the linear equation systems chain, but only in one direction that is to the subsequent layers. Next, we will informally use $| \nu _ { i } |$ to denote the number of virtual constraints at the $i$ -th layer, which can be approximated by $\begin{array} { r } { \sum _ { n = 1 } ^ { i - 1 } m a x ( | \mathbf { z } _ { n } | - | \mathbf { x } _ { n } | , 0 ) - m a x ( | \mathbf { x } _ { n } | - | \mathbf { z } _ { n } | - | \mathbf { W } _ { n } | , 0 ) . } \end{array}$ . For more details refer to Appendix C. In practice, the real number of such constraints is dependent on the data, current weights, and choice of activation function.
|
| 149 |
+
|
| 150 |
+
These three types of constraints, gradient, weight and virtual constraints, are effective for predicting the risk of gradient attack. To conclude, we propose that $\left| \mathbf { x } _ { i } \right| - \left| \mathbf { W } _ { i } \right| - \left| \mathbf { z } _ { i } \right| - \left| \mathcal { V } _ { i } \right|$ is a good index to estimate the feasibility of fully recovering the input using gradient attacks at the $i$ -th layer. We denote this value rank analysis index $( R A - i )$ . Particularly, $| \mathbf { \bar { x } } _ { i } | - | \mathbf { W } _ { i } | - | \mathbf { z } _ { i } | - | \mathcal { V } _ { i } | > 0$ indicates it is not possible to perform a complete reconstruction of the input, and the larger this index is, the poorer the quality of reconstruction will be. If the constraints in a particular problem are linearly independent, $| \mathbf { x } _ { i } | - | \mathbf { W } _ { i } | - | \mathbf { z } _ { i } | - | \mathcal { V } _ { i } | < 0$ implies the ability to fully recover the input. The quality of reconstruction of data is well estimated by the maximal RA-i of all layers, as shown in Figure 2. In practice, the layers close to the data usually have smaller RA-i due to fewer virtual constraints.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 2: Estimating the privacy leakage of network through rank analysis. The critical layer for reconstruction has been red colored. First three columns show that even though bigger network has much more parameters denoted by $| \mathbf { W } |$ , which means we can collect more gradients to reconstruct the data, but if the layer close to data is rank-deficient, we are not able to fully recover the data. Despite that in the objective function of DLG, distance between all gradients will be reduced at the same time, redundant constraints in subsequent layer certainly cannot compensate the lack of constraints in previous layer. The fourth column shows that if rank-deficiency happens at the intermediate layer, redundant weight constraints in previous layer, i.e. virtual constraints, is able to compensate the deficiency at the intermediate layer. If a layer is rank-deficient after taking virtual constraints into account, fully recovery is again not possible as shown in the fifth column. However, as the rank analysis index of last column is smaller than the one of the second and third column, the reconstruction at the fifth column has a better quality. This figure demonstrates that rank analysis can correctly estimate the feasibility of performing DLG, for statistic result refer to Appendix A.
|
| 154 |
+
|
| 155 |
+
On top of that we analyse the residual block in ResNet, which shows some interesting traits of the skip connection in terms of the rank-deficiency, for more details refer to Appendix D.
|
| 156 |
+
|
| 157 |
+
A valuable observation we obtain through the rank analysis is that the architecture rather than the number of parameters is critical to gradient attacks, as shown in Figure 2. This observation is not obvious from simply specifying the DLG optimization problem(see Equation 1). Furthermore, since the data vulnerability of a network depends on the layer with maximal RA-i, we can design rank-deficiency into the architecture to improve the security of a network (see Figure 4).
|
| 158 |
+
|
| 159 |
+
# 5 RESULTS
|
| 160 |
+
|
| 161 |
+
Our novel approach R-GAP successfully extends the analytic gradient attack (Phong et al., 2018) from attacking a FCN with bias terms to attacking FCNs and $\mathrm { C N N s ^ { 1 } }$ with or without bias terms. To test its performance, we use a CNN6 network as shown in Figure 3, which is full-rank considering gradient constraints and weight constraints. Additionally, we report results using a CNN6-d network, which is rank-deficient without consideration of virtual constraints, in order to to fairly compare the performance of DLG and R-GAP. CNN6-d has a CNN6 backbone and just decreases the output channel of the second convolutional layer to 20. The activation function is a LeakyReLU except the last layer, which is a Sigmoid. We have randomly initialized the network, as DLG is prone to fail if the network is at a late stage of training (Geiping et al., 2020). Furthermore, as the label can be analytically recovered by R-GAP, we always provide DLG the ground-truth label and let it recover the image only. Therefore the experiment actually compares R-GAP with iDLG (Zhao et al., 2020). The experimental results show that, due to an analytic one-shot process, run-time of R-GAP is orders of magnitude shorter than DLG. Moreover, R-GAP can recover the data more accurately, while optimization-based methods like DLG recover the data with artifacts, as shown in Figure 3. The statistical results in Table 1 also show that the reconstruction of R-GAP has a much lower MSE than DLG on the CNN6 network. However, as R-GAP only considers gradient constraints and weight constraints in the current implementation, it does not work well on the CNN6-d network. Nonetheless, we find that it is easy to assess the quality of reconstruction of gradient attack without knowing the original image. As the better reconstruction has less salt-and-pepper type noise. We measure this by the difference of the image and its smoothed version (achieved by a simple $3 \mathrm { x } 3$ averaging) and select the output with the smaller norm. This hybrid approach which we name HGAP combines the strengths of R-GAP and DLG, and obtains the best results.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 3: Performance of our approach and DLG over a CNN6 architecture. The diagram on the left demonstrates the network architecture on which we perform attack. The activation functions are LeakyReLU, except the last one which is Sigmoid.
|
| 165 |
+
|
| 166 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>CNN6*</td><td rowspan=1 colspan=1>CNN6-d*</td><td rowspan=1 colspan=1>CNN6**</td><td rowspan=1 colspan=1>CNN6-d**</td></tr><tr><td rowspan=1 colspan=1>R-GAP</td><td rowspan=1 colspan=1>0.010± 0.0017</td><td rowspan=1 colspan=1>1.4 ± 0.073</td><td rowspan=1 colspan=1>1.9×10-4±7.0×10-5</td><td rowspan=1 colspan=1>0.0090±9.3×10-4</td></tr><tr><td rowspan=1 colspan=1>DLG</td><td rowspan=1 colspan=1>0.050±0.0014</td><td rowspan=1 colspan=1>0.053±0.0016</td><td rowspan=1 colspan=1>4.2×10 ±5.9×10-5</td><td rowspan=1 colspan=1>0.0012±1.8×10-4</td></tr><tr><td rowspan=1 colspan=1>H-GAP</td><td rowspan=1 colspan=1>0.0069±0.0012</td><td rowspan=1 colspan=1>0.053± 0.0016</td><td rowspan=1 colspan=1>1.4×10-4±2.3×10-5</td><td rowspan=1 colspan=1>0.0012±1.8×10</td></tr></table>
|
| 167 |
+
|
| 168 |
+
\*:CIFAR10 \*\*:MNIST
|
| 169 |
+
|
| 170 |
+
Table 1: Comparison of the performance of R-GAP, DLG and H-GAP. MSE has been used to measure the quality of the reconstruction.
|
| 171 |
+
|
| 172 |
+
Moreover, we compare R-GAP with DLG on LeNet which has been benchmarked in DLG(Zhu et al., 2019), the statistical results are shown in Table 2. Both DLG and R-GAP perform well on LeNet. Empirically, if the MSE is around or below $1 \times 1 0 ^ { - 4 }$ , the difference of the reconstruction will be visually undetectable. However, we surprisingly find that by replacing the Sigmoid function with the Leaky ReLU, the reconstruction of DLG becomes much poorer. The condition number of matrix A (from Algorithm 1) changes significantly in this case. Since the Sigmoid function leads to a higher condition number at each convolutional layer, reconstruction error in the subsequent layer could be amplified in the previous layer, therefore DLG is forced to converge to a better result. In contrast, R-GAP has an accumulated error and naturally performs much better on LeNet\*. Additionally, we find R-GAP could be a good initialization tool for DLG. As shown in the last column of Table 2, by initializing DLG with the reconstruction of R-GAP, and running $8 \%$ of the previous iterations, we achieve a visually indistinguishable result. However, for LeNet\*, we find that DLG reduces the reconstruction quality obtained by R-GAP, which further shows the instability of DLG.
|
| 173 |
+
|
| 174 |
+
Our rank analysis is a useful offline tool to understand the risk inherent in certain network architectures. More precisely, we can use the rank analysis to find out the critical layer for the success of
|
| 175 |
+
|
| 176 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=3>Condition number</td><td rowspan=1 colspan=3>MSE</td></tr><tr><td rowspan=1 colspan=1>conv1</td><td rowspan=1 colspan=1>conv2</td><td rowspan=1 colspan=1>conv3</td><td rowspan=1 colspan=1>DLG</td><td rowspan=1 colspan=1>R-GAP</td><td rowspan=1 colspan=1>R-GAP→DLG</td></tr><tr><td rowspan=1 colspan=1>LeNet</td><td rowspan=1 colspan=1>1.8×104±2.9</td><td rowspan=1 colspan=1>6.1×10±0.3</td><td rowspan=1 colspan=1>32.4±2.9×10-4</td><td rowspan=1 colspan=1>3.7×10-8±8.6×10-10</td><td rowspan=1 colspan=1>1.1×10-4±7.8× 10-6</td><td rowspan=1 colspan=1>1.1×10-6±1.1 ×10-6</td></tr><tr><td rowspan=1 colspan=1>LeNet*</td><td rowspan=1 colspan=1>1.2×10±19.7</td><td rowspan=1 colspan=1>1.3×10±22.5</td><td rowspan=1 colspan=1>14.2±0.05</td><td rowspan=1 colspan=1>5.2×10-2±2.9 ×10-3</td><td rowspan=1 colspan=1>1.5×10-10±2.5 × 10-11</td><td rowspan=1 colspan=1>4.8×10±9.1 × 10-5</td></tr></table>
|
| 177 |
+
|
| 178 |
+
LeNet\* is identical to LeNet but uses Leaky ReLU activation function instead of Sigmoid
|
| 179 |
+
|
| 180 |
+
Table 2: Comparison of R-GAP and DLG on LeNet benchmarked in DLG(Zhu et al., 2019).
|
| 181 |
+
|
| 182 |
+
gradient attacks and take precision measurements to improve the network’s defendability. We report results on the ResNet-18, where the third residual block is critical since by cutting its skip connection the RA-i increases substantially. To perform the experiments, we use the approach proposed by Geiping et al. (2020), which extends DLG to incorporate image priors and performs better on deep networks. As shown in Figure 4, by cutting the skip connection of the third residual block, reconstructions become significantly poorer and more unstable. As a control test, cutting the skip connection of a non-critical residual block does not increase defendability noticeably. Note that two variants have the same or even slightly better performance on the classification task compared with the backbone. In previous works (Zhu et al., 2019; Wei et al., 2020), trade-off between accuracy and defendability of adding noise to gradients has been discussed. We show that using the rank analysis we are able to increase the defendability of a network with no cost in accuracy.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: Left: Architectures of the ResNet18 with base width 16 and two variants. Variant 1 cuts the skip connection of the third residual block. Variant 2 cuts the skip connection of the eighth residual block. Upper right: Reconstruction examples of three networks. Lower right: Accuracy and reconstruction error of three networks. Training 200 epochs on CIFAR10 and saving the model with the best performance on the validation set, three networks achieve a close accuracy. Two variants perform even slightly better. In terms of gradient attacks, MSE of reconstructions from ResNet18 and Variant 2 are similar, since Variant 2 cut the skip connection of a non-critical layer and the RA-i does not change. Whereas, by cuting the skip connection of a critical layer, according to the rank analysis, increases RA-i substantially. MSE of the reconstructions from Variant 1 increases by nearly a factor of three with higher variance.
|
| 186 |
+
|
| 187 |
+
# 6 DISCUSSION AND CONCLUSIONS
|
| 188 |
+
|
| 189 |
+
R-GAP makes the first step towards a general analytic gradient attack and provides a framework to answer questions about the functioning of optimization-based attacks. It also opens new questions, such as how to analytically reconstruct a minibatch of images, especially considering nonuniqueness due to permutation of the image indices. Nonetheless, we believe that by studying these questions, we can gain deeper insights into gradient attacks and privacy secure federated learning.
|
| 190 |
+
|
| 191 |
+
In this paper, we propose a novel approach R-GAP, which has achieved an analytic gradient attack for CNNs for the first time. Through analysing the recursive reconstruction process, we propose a novel rank analysis to estimate the feasibility of performing gradient based privacy attacks given a network architecture. Our rank analysis can be applied to the analysis of both closed-form and optimization-based attacks such as DLG. Using our rank analysis, we are able to determine network modifications that maximally improve the network’s security, empirically without sacrificing its accuracy. Furthermore, we have analyzed the existence of twin data using R-GAP, which can explain at least in part why DLG is sensitive to initialization and what type of initialization is optimal. In summary, our work proposes a novel type of gradient attack, a risk estimation tool and advances the understanding of optimization-based gradient attacks.
|
| 192 |
+
|
| 193 |
+
# ACKNOWLEDGEMENTS
|
| 194 |
+
|
| 195 |
+
This research received funding from the Flemish Government (AI Research Program).
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Peter L Bartlett, Michael I Jordan, and Jon D McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156, 2006.
|
| 200 |
+
|
| 201 |
+
Emiliano De Cristofaro. An overview of privacy in machine learning. arXiv:2005.08679, 2020.
|
| 202 |
+
|
| 203 |
+
Lixin Fan, Kam Woh Ng, Ce Ju, Tianyu Zhang, Chang Liu, Chee Seng Chan, and Qiang Yang. Rethinking privacy preserving deep learning: How to evaluate and thwart privacy attacks. In Qiang Yang, Lixin Fan, and Han Yu (eds.), Federated Learning: Privacy and Incentive, pp. 32– 50. Springer, 2020.
|
| 204 |
+
|
| 205 |
+
Jonas Geiping, Hartmut Bauermeister, Hannah Droge, and Michael Moeller. Inverting gradients: ¨ How easy is it to break privacy in federated learning? In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33, 2020.
|
| 206 |
+
|
| 207 |
+
Gene H. Golub and Charles F. Van Loan. Matrix Computations. Johns Hopkins University Press, 1996.
|
| 208 |
+
|
| 209 |
+
Zecheng He, Tianwei Zhang, and Ruby B. Lee. Model inversion attacks against collaborative inference. In Proceedings of the 35th Annual Computer Security Applications Conference, ACSAC ’19, pp. 148–162, 2019.
|
| 210 |
+
|
| 211 |
+
Arthur Jochems, Timo M. Deist, Johan van Soest, Michael Eble, Paul Bulens, Philippe Coucke, Wim Dries, Philippe Lambin, and Andre Dekker. Distributed learning: Developing a predictive model based on data from multiple hospitals without data leaving the hospital – a real life proof of concept. Radiotherapy and Oncology, 121(3):459 – 467, 2016.
|
| 212 |
+
|
| 213 |
+
Arthur Jochems, Timo Deist, Issam El Naqa, Marc Kessler, Chuck Mayo, Jackson Reeves, Shruti Jolly, Martha Matuszak, Randall Ten Haken, Johan Soest, Cary Oberije, Corinne Faivre-Finn, Gareth Price, Dirk Ruysscher, Philippe Lambin, and Andre Dekker. Developing and validating ´ a survival prediction model for nsclc patients through distributed learning across three countries. International Journal of Radiation Oncology\*Biology\*Physics, 99, 04 2017.
|
| 214 |
+
|
| 215 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, 2015.
|
| 216 |
+
|
| 217 |
+
Jakub Konecnˇ y, H. Brendan McMahan, Felix X. Yu, Peter Richtarik, Ananda Theertha Suresh, and´ Dave Bacon. Federated learning: Strategies for improving communication efficiency. In NIPS Workshop on Private Multi-Party Machine Learning, 2016.
|
| 218 |
+
|
| 219 |
+
Dong C. Liu and Jorge Nocedal. On the limited memory BFGS method for large scale optimization. Math. Program., 45(1–3):503–528, August 1989.
|
| 220 |
+
|
| 221 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Aarti Singh and Jerry Zhu (eds.), Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume 54 of Proceedings of Machine Learning Research, pp. 1273–1282, 2017.
|
| 222 |
+
|
| 223 |
+
L. T. Phong, Y. Aono, T. Hayashi, L. Wang, and S. Moriai. Privacy-preserving deep learning via additively homomorphic encryption. IEEE Transactions on Information Forensics and Security, 13(5):1333–1345, 2018.
|
| 224 |
+
|
| 225 |
+
Maria Rigaki and Sebastian Garcia. A survey of privacy attacks in machine learning. CoRR, abs/2007.07646, 2020.
|
| 226 |
+
|
| 227 |
+
Z. Wang, M. Song, Z. Zhang, Y. Song, Q. Wang, and H. Qi. Beyond inferring class representatives: User-level privacy leakage from federated learning. In IEEE INFOCOM 2019 - IEEE Conference on Computer Communications, pp. 2512–2520, 2019.
|
| 228 |
+
|
| 229 |
+
Wenqi Wei, Ling Liu, Margaret Loper, Ka-Ho Chow, Mehmet Emre Gursoy, Stacey Truex, and Yanzhao Wu. A framework for evaluating client privacy leakages in federated learning. In Liqun Chen, Ninghui Li, Kaitai Liang, and Steve Schneider (eds.), Computer Security – ESORICS, pp. 545–566. Springer, 2020.
|
| 230 |
+
|
| 231 |
+
Ziqi Yang, Jiyi Zhang, Ee-Chien Chang, and Zhenkai Liang. Neural network inversion in adversarial setting via background knowledge alignment. In Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, pp. 225–240, 2019.
|
| 232 |
+
|
| 233 |
+
Yuheng Zhang, Ruoxi Jia, Hengzhi Pei, Wenxiao Wang, Bo Li, and Dawn Song. The secret revealer: Generative model-inversion attacks against deep neural networks. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 250–258, 2020.
|
| 234 |
+
|
| 235 |
+
Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. iDLG: Improved deep leakage from gradients. arXiv:2001.02610, 2020.
|
| 236 |
+
|
| 237 |
+
Ligeng Zhu, Zhijian Liu, and Song Han. Deep leakage from gradients. 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. 14774–14784, 2019.
|
| 238 |
+
|
| 239 |
+
# A QUANTITATIVE RESULTS OF RANK ANALYSIS
|
| 240 |
+
|
| 241 |
+
A quantitative analysis of the predictive performance of the rank analysis index for the mean squared error of reconstruction is shown in Table 3.
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
\frac { \mathrm { R A - i } } { \mathrm { M S E } } \| \begin{array} { c } { 4 8 4 } \\ { 4 . 2 \times 1 0 ^ { - 9 } } \\ { \pm 2 . 2 \times 1 0 ^ { - 9 } } \end{array} | \begin{array} { c } { 4 0 5 } \\ { 0 . 0 5 6 \pm 0 . 0 0 3 5 } \\ { 0 . 0 6 3 \pm 0 . 0 0 4 } \\ { \pm 2 . 0 \times 1 0 ^ { - 5 } } \end{array} \| \begin{array} { c } { 4 0 5 } \\ { 2 . 7 \times 1 0 ^ { - 4 } } \\ { 2 . 2 \times 1 0 ^ { - 5 } } \end{array} \frac { 3 1 6 } { \begin{array} { c } { 0 . 1 8 } \\ { 0 . 0 1 3 } \\ { \pm 7 . 2 \times 1 0 ^ { - 4 } } \end{array} } .
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
Table 3: Mean square error of the reconstruction over test set of CIFAR10. The corresponding network architecture has been shown in Figure 2 in the same order. Rank analysis index (RA-i) clearly predicts the reconstruction error. We can also regard RA-i as the security level of a network. A negative value indicates that the gradients of the network are able to fully expose the data, i.e. insecure, while a positive value indicates that completely recover the data from gradients is not possible. On top of that, higher RA-i indicate higher reconstruction error, therefore the network is more secure. According to our experiment, if the order of magnitude of MSE is equal to or less than $1 0 ^ { - 4 }$ , we could barely visually distinguish the recovered and real data, as shown in the fourth column of Figure 2. Note that, as the network gets deeper, DLG will become vulnerable, R-GAP will also be effected by numerical error. Besides that, DLG is sensitive to the initialization of dummy data, while R-GAP also needs to confirm the $\mu$ if it is not unique. Therefore, RA-i provides a reasonable upper bound of the privacy risk rather than quality prediction of one reconstruction.
|
| 248 |
+
|
| 249 |
+
# B TWIN DATA
|
| 250 |
+
|
| 251 |
+
As we know $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ is non-monotonic as shown in Figure 1, which means knowing $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ does not always allow us to uniquely recover $\mu$ . It is relatively straightforward to show that for monotonic convex losses (Bartlett et al., 2006), $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu$ is invertible for $\mu \ < \ 0$ , $\textstyle { \frac { \partial \ell } { \partial \mu } } \mu \ \leq \ 0$ for $\mu \geq 0$ , and $\begin{array} { r } { \operatorname* { l i m } _ { \mu \to \infty } \frac { \partial \ell } { \partial \mu } \mu = 0 . } \end{array}$ . Due to the non-uniqueness of $\mu$ w.r.t to ∂\`∂µ µ, we have:
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
\exists \mathrm { \bf ~ x } , \tilde { \bf x } \mathrm { s } . \mathrm { t } . \mu \neq \tilde { \mu } ; \frac { \partial \ell } { \partial \mu } \mu = \frac { \partial \ell } { \partial \tilde { \mu } } \tilde { \mu }
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
where $\mathbf { X }$ is the real data.
|
| 258 |
+
|
| 259 |
+
Taking the common setting that activation functions are ReLU or LeakyReLU, we can derive from Eq. 10 that:
|
| 260 |
+
|
| 261 |
+
$$
|
| 262 |
+
\frac { \partial \ell } { \partial \mathbf { W } _ { i } } \cdot \mathbf { W } _ { i } = \frac { \partial \ell } { \partial \tilde { \mathbf { W } } } \cdot \tilde { \mathbf { W } } _ { i } ; \quad i = 1 , \ldots , d
|
| 263 |
+
$$
|
| 264 |
+
|
| 265 |
+
if there is a $\tilde { \mathbf { W } } _ { i }$ is equal to $\mathbf { W } _ { i }$ , whereas the corresponding $\tilde { \mathbf { x } }$ is not same as $\mathbf { X }$ since $\mu \ne \tilde { \mu }$ , we can find a data point that differs from the true data but leads to the same gradients. We name such data twin data, denoted by $\tilde { \mathbf { x } }$ . As we know the gradients and $\mu$ of the twin data $\tilde { \mathbf { x } }$ , by just giving them to R-GAP, we are able to easily find out the twin data. As shown in in Figure 5, twin data is actually proportional to the real data and smaller than it, which can also be straightforwardly derived from Equation 6 to Equation 8. Since the twin data and the real data trigger the same gradients, by decreasing the distance of gradients as Equation 1, DLG is suppose to converge to either of these data. As shown in Figure 5, we initialize DLG with a data close to the twin data $\tilde { \mathbf { x } }$ , DLG converges to the twin data. In the work of Wei et al. (2020), the authors argue that using an image from the same class as the real data would be the optimal initialization and empirically prove that. We want to point out that twin data is one important factor why DLG is so sensitive to the initialization and prone to fail with random initialization of dummy data particularly after some training steps of the network. Since DLG converges either to the twin data or the real data depends on the distance between these two data and the initialization, an image of the same class is usually close to the real data, therefore, DLG works better with that. While, with respect to $\mu$ or the prediction of the network, a random initialization is close to the twin data, so DLG converges to the twin data. However, the twin data has extremely small value, so any noise that comes up with optimization process stands out in the last result as shown in Figure 5.
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 5: Twin data. The left figure demonstrates a twin data $\tilde { \mathbf { x } }$ , which will trigger exactly the same gradients as the real data $\mathbf { X }$ does. Therefore, from the perspective of DLG, these two data are global minimum for the objective function. The right figure shows that by adding noise to shift the twin data a little and using it as an initialization, DLG will converge to the twin data rather than real data.
|
| 269 |
+
|
| 270 |
+
It is worth noting that the twin data can be fully reconstructed only if $\mathrm { { R A } } \mathrm { { - i } } < 0$ . In other words, if complete reconstruction is feasible and the twin data exits, R-GAP and DLG can recover either the twin data or real data depend on the initialization. But both of them lead to privacy leakage.
|
| 271 |
+
|
| 272 |
+
# C VIRTUAL CONSTRAINTS
|
| 273 |
+
|
| 274 |
+
In this section we investigate the virtual constraints as proposed in the rank analysis. To the beginning, let us derive the explicit virtual constraints from the $i - 1$ layer at the reconstruction of the $i$ layer by assuming the activation function is an identity function. The weight constraints of the $i - 1$ layer can be expressed as:
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\mathbf { W } \mathbf { x } _ { i - 1 } = \mathbf { z } ;
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
Split $\mathbf { W } , \mathbf { z }$ into two parts coherently, i.e.:
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\begin{array} { r } { [ \mathbf { W } _ { + } ] _ { \mathbf { W } _ { - } } = [ \mathbf { z } _ { + } ] } \\ { \mathbf { W } _ { - } ] \mathbf { x } _ { i - 1 } = [ \mathbf { z } _ { - } ] } \end{array}
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
Assume the upper part of the weights ${ \bf W } _ { + }$ is already full rank, therefore:
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\begin{array} { c } { \mathbf { z } _ { + } = \mathbf { I } _ { + } \mathbf { z } } \\ { \mathbf { x } _ { i - 1 } = \mathbf { W } _ { + } ^ { - 1 } \mathbf { I } _ { + } \mathbf { z } } \\ { \mathbf { z } _ { - } = \mathbf { I } _ { - } \mathbf { z } } \\ { \mathbf { W } _ { - } \mathbf { x } _ { i - 1 } = \mathbf { I } _ { - } \mathbf { z } } \end{array}
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
Substituting Equation 21 into Equation 23, we can derive the following constraints over $\mathbf { z }$ after rearranging:
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
( \mathbf { W } _ { - } \mathbf { W } _ { + } ^ { - 1 } \mathbf { I } _ { + } - \mathbf { I } _ { - } ) \mathbf { z } = \mathbf { 0 }
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Since the activation function is the identity function, i.e. $\mathbf { z } = \mathbf { x } _ { i }$ , the virtual constraints $\nu$ that the $i$ -th layer has inherited from the weight constraints of $i - 1$ layer are:
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\mathcal { V } \mathbf { { x } } _ { i } = \mathbf { 0 } ; ~ \mathcal { V } = \mathbf { W } _ { - } \mathbf { W } _ { + } ^ { - 1 } \mathbf { I } _ { + } - \mathbf { I } _ { - }
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
Virtual constraints as external constraints are able to compensate the local rank-deficiency of an intermediate layer. For other strictly monotonic activation function like Leaky ReLU, Sigmoid, Tanh, the virtual constraints over $\mathbf { x } _ { i }$ can be expressed as:
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\gamma \sigma _ { i - 1 } ^ { - 1 } ( \mathbf { x } _ { i } ) = \mathbf { 0 }
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
This is not a linear equation system w.r.t. $\mathbf { x } _ { i }$ , therefore it is hard to be incorporated in R-GAP. In terms of ReLU the virtual constraints could become further more complicated which will reduce its efficacy. Nevertheless, the reconstruction of the $i$ -th layer must take the virtual constraints into account. Otherwise, it will trigger a non-negligible reconstruction error later on. From this perspective, we can see that iterative algorithms like optimization-based attacks can inherently utilize such virtual constraints, which is a strength of O-GAP.
|
| 311 |
+
|
| 312 |
+
We would like to point out that theoretically the gradient constraints also have the same effect as the weight constraints in the virtual constraints but in a more sophisticated way. Empirical results show that the gradient constraints of previous layers do not have an evident impact on the subsequent layer in the O-GAP, so we have not taken it into account. The number of virtual constraints at $i$ -th layer can therefore be approximated by $\begin{array} { r } { \sum _ { n = 1 } ^ { i - 1 } m a x ( | \mathbf { z } _ { n } | - | \mathbf { x } _ { n } | , 0 ) - m a x ( | \mathbf { x } _ { n } | - | \mathbf { z } _ { n } | - | \mathbf { W } _ { n } | , 0 ) , } \end{array}$ .
|
| 313 |
+
|
| 314 |
+
# D RANK ANALYSIS OF THE SKIP CONNECTION
|
| 315 |
+
|
| 316 |
+
If the skip connection skips one layer, for simplicity assuming the activation function is the identity function, then the layer can be expressed as:
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
f = \mathbf { W } ^ { * } \mathbf { x } ; \ \mathbf { W } ^ { * } = \mathbf { W } + \mathbf { I }
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
where $f$ is the output of this layer, the weight matrix $\mathbf { W } ^ { * }$ is clear and the number of weight constraints is equal to $| f |$ . While the expression of gradients are the same as without skip connection, since:
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\nabla \mathbf { W } ^ { * } = \nabla \mathbf { W }
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
Therefore the number of gradient constraints is equal to $| \mathbf { W } |$ . In other words, without consideration of the virtual constraints, if $| f | + | \mathbf { W } | < | x |$ this layer is locally rank-deficient, otherwise it is full rank. This is the same as removing the skip connection.
|
| 329 |
+
|
| 330 |
+
If the skip connection skips over two layers, for simplicity assuming the activation function is identity function, then the residual block can be expressed as:
|
| 331 |
+
|
| 332 |
+
$$
|
| 333 |
+
\mathbf { x } _ { 2 } = \mathbf { W } _ { 1 } \mathbf { x } _ { 1 } ; ~ f = \mathbf { W } _ { 2 } \mathbf { x } _ { 2 } + \mathbf { x } _ { 1 }
|
| 334 |
+
$$
|
| 335 |
+
|
| 336 |
+
Whereas, the residual block has its equivalent fully connected format, i.e.:
|
| 337 |
+
|
| 338 |
+
$$
|
| 339 |
+
\begin{array} { r l } & { \mathbf { W } _ { 1 } ^ { * } = \left[ \begin{array} { l } { \mathbf { W } _ { 1 } } \\ { \mathbf { I } } \end{array} \right] ; ~ \mathbf { W } _ { 2 } ^ { * } = [ \mathbf { W } _ { 2 } \quad \mathbf { I } ] } \\ & { ~ \mathbf { x } _ { 2 } ^ { * } = \mathbf { W } _ { 1 } ^ { * } \mathbf { x } _ { 1 } = \left[ \begin{array} { l } { \mathbf { W } _ { 1 } \mathbf { x } _ { 1 } } \\ { \mathbf { x } _ { 1 } } \end{array} \right] } \\ & { ~ \boldsymbol { f } = \mathbf { W } _ { 2 } ^ { * } \mathbf { W } _ { 1 } ^ { * } \mathbf { x } _ { 1 } } \end{array}
|
| 340 |
+
$$
|
| 341 |
+
|
| 342 |
+
From the perspective of a recursive reconstruction, $f$ is clear, so after the reconstruction of $\mathbf { X } _ { 2 }$ , the input of this block $\mathbf { X } _ { 1 }$ can be directly calculated by subtracting ${ \bf W } _ { \mathrm { 2 } } { \bf x } _ { \mathrm { 2 } }$ from $f$ as shown in Equation 29. Back to the Equation 31 that means only $\mathbf { x } _ { 2 } ^ { * }$ needs to be recovered. Similar to the analysis for one layer, in terms of the reconstruction of $\mathbf { x } _ { 2 } ^ { * }$ , the number of weight constraints is $| f |$ and the number of gradient constraints is $| \mathbf { W } _ { 2 } |$ . On top of that the upper part and lower part of $\mathbf { x } _ { 2 } ^ { * }$ are related, which actually represents the virtual constraints from the first layer. Taking these into account, there are $| \mathbf { W } _ { 2 } | + | f | + | \mathbf { x } _ { 2 } |$ constraints for the reconstruction of $\mathbf { x } _ { 2 } ^ { * }$ . However, $\mathbf { x } _ { 2 } ^ { * }$ is also augmented compared with $\mathbf { X } _ { 2 }$ and the number of entries is $| \mathbf { x } _ { 1 } | + | \mathbf { x } _ { 2 } |$ . To conclude, if $| f | + | \mathbf { \bar { W } } _ { 2 } | < | \mathbf { x } _ { 1 } |$ the residual block is locally rank-deficient, otherwise it is full rank. Seemingly, the constraints of the last layer have been used to reconstruct the input of the residual block due to the skip connection2. This is an interesting trait, because the skip connection is able to make the rank-deficient layers like bottlenecks again full rank, as shown in Figure 6. It is worth noticing that the bottlenecks have been commonly used for residual blocks. Further, downsampling residual blocks also have this characteristic of rank condition, as the gradient constraints in the last layer are much more than the first layer due to the number of channels.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 6: Comparison of optimization-based gradient attacks over architectures with or without the skip connection. The width of blue bars represents the number of features at each layer. The first row shows that there is no impact on the reconstruction if the skip connection skips one layer. The second row shows if the skip connection skips a bottleneck block, which is rank-deficient, the resulting network can still be full rank and enable full recovery of the data. The third row shows the reconstructions of two full-rank architectures. Since the skip connection aids in the optimization process, the quality of its reconstruction is marginally better.
|
| 346 |
+
|
| 347 |
+
# E IMPROVING DEFENDABILITY OF RESNET101
|
| 348 |
+
|
| 349 |
+
We also apply the rank analysis to ResNet101 and try to improve its defendability. However, we find that this network is too redundant. It is not possible to decrease the RA-i by cutting a single skip connection as was done in Figure 4. Nevertheless, we devise two variants, the first of which cuts the skip connection of the third residual block and generates a layer that is locally rank-deficient and requires a large number of virtual constraints. Additionally, we devise a second variant, which cuts the skip connection of the first residual block and reduces the redundancy of two layers. The accuracy and reconstruction error of these networks can be found in Table 4.
|
| 350 |
+
|
| 351 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>RA-i</td><td rowspan=1 colspan=1>Accuracy on val.</td><td rowspan=1 colspan=1>MSE of reconstructions</td></tr><tr><td rowspan=1 colspan=1>ResNet101</td><td rowspan=1 colspan=1>-1.4×104</td><td rowspan=1 colspan=1>91.04%</td><td rowspan=1 colspan=1>0.96 ± 0.091</td></tr><tr><td rowspan=1 colspan=1>Variant 1</td><td rowspan=1 colspan=1>-1.4 × 104</td><td rowspan=1 colspan=1>90.36%</td><td rowspan=1 colspan=1>1.8 ± 0.14</td></tr><tr><td rowspan=1 colspan=1>Variant 2</td><td rowspan=1 colspan=1>-1.4×104</td><td rowspan=1 colspan=1>90.16%</td><td rowspan=1 colspan=1>1.3 ± 0.14</td></tr></table>
|
| 352 |
+
|
| 353 |
+
Table 4: Training 200 epochs on CIFAR10 and saving the model with the best performance on the validation set, ResNet101 with base width 16 and its two variants achieve similar accuracy on the classification task. The two modified variants which are designed to introduce rank deficiency perform almost as well as the original, but better protect the training data. We conduct a gradient attack with the state-of-the-art approach proposed by Geiping et al. (2020). MSE of the reconstructions of the two rank-deficient variants is significantly higher, which indicates that for deep networks, we can also improve the defendability by decreasing local redundancy or even making layers locally rank-deficient.
|
| 354 |
+
|
| 355 |
+
# F R-GAP IN THE BATCH SETTING RETURNS A LINEAR COMBINATION OF TRAINING IMAGES
|
| 356 |
+
|
| 357 |
+
It can be verified straightforwardly that R-GAP in the batch setting will return a linear combination of the training data. This is due to the fact that in the batch setting the gradients are simply accumulated. The weighting coefficients of the data in this linear mixture are dependent on the various values of $\mu$ for the different training data (see Figure 1). Figures 7 and 8 illustrate the results vs. batch DLG (Zhu et al., 2019) on examples from MNIST.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 7: Reconstruction over a FCN3 network with batch-size equal to 2. For FCN network, RGAP is able to reconstruct sort of a linear combination of the input images. DLG will also works perfectly on such architecture.
|
| 361 |
+
|
| 362 |
+
# G ADDING NOISE TO THE GRADIENTS
|
| 363 |
+
|
| 364 |
+
The effect on reconstruction of adding noise to the gradients is illustrated in Figure 9.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 8: Reconstruction over a FCN3 network with batch-size equal to 5. Sometimes DLG will converge to a image similar to the one reconstructed by the R-GAP.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 9: In terms of least square as what we have used for R-GAP, overall increasing the width of the network will involve more constraints and hence enhance the denoising ability of the gradient attack. For O-GAP this also means a more stable optimization process and less noise in the reconstructed image, which has been empirically proven by Geiping et al. (2020). Increasing the width of every layer will definitely decrease the RA-i, so the quality of reconstruction has been improved. Whereas, increasing the width of some layers may not change RA-i of a network, since the RA-i of a network is equal to the largest RA-i among all the layers, i,e, the reconstruction will not get better. However, it is widely believed that more parameter means less secure.
|
| 371 |
+
|
| 372 |
+
# H DERIVING GRADIENTS
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\begin{array} { r l } & { \quad _ { 1 } - \kappa _ { 4 } \kappa _ { 1 } + \kappa _ { 1 } ^ { 2 } } \\ & { \quad _ { 2 } + \kappa _ { 2 } ^ { 3 } - \kappa _ { 3 } ^ { 3 } } \\ & { \quad _ { 3 } - \kappa _ { 1 } ^ { 3 } - \kappa _ { 2 } ^ { 3 } } \\ & { \quad _ { 4 } - \kappa _ { 3 } ^ { 3 } - \kappa _ { 3 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 2 } ^ { 3 } \kappa _ { 3 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 2 } ^ { 3 } } \\ & { \quad _ { 4 } - \kappa _ { 1 } ^ { 3 } \kappa _ { 2 } ^ { 3 } \kappa _ { 3 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } } \\ & { \quad _ { 4 } - \kappa _ { 2 } ^ { 3 } \kappa _ { 3 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } } \\ & { \quad _ { 4 } - \kappa _ { 4 } ^ { 3 } \kappa _ { 2 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ { 3 } } \\ & \quad \partial _ { t } \kappa _ { 1 } ^ { 3 } - \kappa _ { 1 } ^ { 3 } \kappa _ { 1 } ^ \end{array}
|
| 376 |
+
$$
|
md/train/RUQ1zwZR8_/RUQ1zwZR8_.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Differentially Private Learning with Adaptive Clipping
|
| 2 |
+
|
| 3 |
+
Galen Andrew galenandrew@google.com
|
| 4 |
+
|
| 5 |
+
Om Thakkar omthkkr@google.com
|
| 6 |
+
|
| 7 |
+
H. Brendan McMahan mcmahan@google.com
|
| 8 |
+
|
| 9 |
+
Swaroop Ramaswamy swaroopram@google.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Existing approaches for training neural networks with user-level differential privacy (e.g., DP Federated Averaging) in federated learning (FL) settings involve bounding the contribution of each user’s model update by clipping it to some constant value. However there is no good a priori setting of the clipping norm across tasks and learning settings: the update norm distribution depends on the model architecture and loss, the amount of data on each device, the client learning rate, and possibly various other parameters. We propose a method wherein instead of a fixed clipping norm, one clips to a value at a specified quantile of the update norm distribution, where the value at the quantile is itself estimated online, with differential privacy. The method tracks the quantile closely, uses a negligible amount of privacy budget, is compatible with other federated learning technologies such as compression and secure aggregation, and has a straightforward joint DP analysis with DP-FedAvg. Experiments demonstrate that adaptive clipping to the median update norm works well across a range of realistic federated learning tasks, sometimes outperforming even the best fixed clip chosen in hindsight, and without the need to tune any clipping hyperparameter.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Deep learning has become ubiquitous, with applications as diverse as image processing, natural language translation, and music generation [27, 13, 28, 7]. Deep models are able to perform well in part due to their ability to utilize vast amounts of data for training. However, recent work has shown that it is possible to extract information about individual training examples using only the parameters of a trained model [12, 30, 26, 8, 19]. When the training data potentially contains privacy-sensitive user information, it becomes imperative to use learning techniques that limit such memorization.
|
| 18 |
+
|
| 19 |
+
Differential privacy (DP) [10, 11] is widely considered a gold standard for bounding and quantifying the privacy leakage of sensitive data when performing learning tasks. Intuitively, DP prevents an adversary from confidently making any conclusions about whether some user’s data was used in training a model, even given access to arbitrary side information. The formal definition of DP depends on the notion of neighboring datasets: we will refer to a pair of datasets $D , D ^ { \prime } \in \mathcal { D }$ as neighbors if $D ^ { \prime }$ can be obtained from $D$ by adding or removing one element.
|
| 20 |
+
|
| 21 |
+
Definition 1.1 (Differential Privacy). A (randomized) algorithm $M : { \mathcal { D } } { \mathcal { R } }$ with input domain $\mathcal { D }$ and output range $\mathcal { R }$ is $( \varepsilon , \delta )$ -differentially private if for all pairs of neighboring datasets $D , D ^ { \prime } \in \mathcal { D }$ , and every measurable $S \subseteq \mathcal { R }$ , we have $\operatorname* { P r } \left( M ( D ) \in S \right) \leq e ^ { \varepsilon } \cdot \operatorname* { P r } \left( M ( D ^ { \prime } ) \in S \right) + \delta$ , where probabilities are with respect to the coin flips of $M$ .
|
| 22 |
+
|
| 23 |
+
Following McMahan et al. [18], we define two common settings of privacy corresponding to two different definitions of neighboring datasets. In example-level DP, datasets are considered neighbors when they differ by the addition or removal of a single example [9, 4, 2, 22, 31, 23, 15]. In user-level DP, neighboring datasets differ by the addition or removal of all of the data of one user [18]. Userlevel DP is the stronger form, and is preferred when one user may contribute many training examples to the learning task, as privacy is protected even if the same privacy-sensitive information occurs in all the examples from one user. In this paper, we will describe the technique and perform experiments in terms of the stronger user-level form, but we note that example-level DP can be achieved by simply giving each user a single example.
|
| 24 |
+
|
| 25 |
+
To achieve user-level DP, we employ the Federated Averaging algorithm [17], introduced as a decentralized approach to model training in which the training data is left distributed on user devices, and each training round aggregates updates that are computed locally. On each round, a sample of devices are selected for training, and then each selected device performs potentially many steps of local SGD over minibatches of its own data, sending back the model delta as its update.
|
| 26 |
+
|
| 27 |
+
Bounding the influence of any user in Federated Averaging is both necessary for privacy and often desirable for stability. One popular way to do this to cap the $L _ { 2 }$ norm of its model update by projecting larger updates back to the ball of norm $C$ . Since such clipping also effectively bounds the $L _ { 2 }$ sensitivity of the aggregate with respect to the addition or removal of any user’s data, adding Gaussian noise to the aggregate is sufficient to obtain a central differential privacy guarantee for the update [9, 4, 2]. Standard composition techniques can then be used to extend the per-update guarantee to the final model [20].
|
| 28 |
+
|
| 29 |
+
Setting an appropriate value for the clipping threshold $C$ is crucial for the utility of the private training mechanism. Setting it too low can result in high bias since we discard information contained in the magnitude of the gradient. However setting it too high entails the addition of more noise, because the amount of Gaussian noise necessary for a given level of privacy must be proportional to the norm bound (the $L _ { 2 }$ sensitivity), and this will eventually destroy model utility. The clipping bias-variance trade-off was observed empirically by McMahan et al. [18], and was theoretically analyzed and shown to be an inherent property of differentially private learning by Amin et al. [3].
|
| 30 |
+
|
| 31 |
+
Learning large models using the Federated Averaging/SGD algorithm [17, 18] can take thousands of rounds of interaction between the central server and the clients. The norms of the updates can vary as the rounds progress. Prior work [18] has shown that decreasing the value of the clipping threshold after training a language model for some initial number of rounds can improve model accuracy. However, the behavior of the norms can be difficult to predict without prior knowledge about the system, and if it is difficult to choose a fixed clipping norm for a given learning task, it is even more difficult to choose a parameterized clipping norm schedule.
|
| 32 |
+
|
| 33 |
+
While there has been substantial work on DP techniques for learning, almost every technique has hyperparameters which need to be set appropriately for obtaining good utility. Besides the clipping norm, learning techniques have other hyperparameters which might interact with privacy hyperparameters. For example, the server learning rate in DP SGD might need to be set to a high value if the clipping threshold is very low, and vice-versa. Such tuning for large networks can have an exorbitant cost in computation and efficiency, which can be a bottleneck for real-world systems that involve communicating with millions of samples for training a single network. Tuning may also incur an additional cost for privacy, which needs to be accounted for when providing a privacy guarantee for the released model with tuned hyperparameters (though in some cases, hyperparameters can be tuned using the same model and algorithm on a sufficiently-similar public proxy dataset).
|
| 34 |
+
|
| 35 |
+
Related Work The heuristic of clipping to the median update norm was suggested by Abadi et al. [1], but no method for doing so privately was proposed, nor was the heuristic empirically tested. One possibility would be to estimate the median unclipped update norm at each round privately by adding noise calibrated to the smooth sensitivity as defined by Nissim et al. [21]. However this approach has several drawbacks compared to the algorithm we will present. It would require the clients to send their unclipped updates to the server at each round,1 which is incompatible with the foundational principle of federated learning to transmit only focused, minimal updates, and precluding the use of secure aggregation [5] and certain forms of compression [16, 6]. Also, by incorporating information across multiple rounds, our method is able to track the underlying quantile closely, with less jitter associated with sampling at each round, and using only a negligible fraction of the privacy budget.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Loss functions to estimate the 0.01-, 0.5-, 0.75-, and 0.99-quantiles for a random variable $X$ that uniformly takes values in $\{ 1 5 , 2 5 , 2 8 , 4 0 , 4 5 , 4 8 \}$ . The loss function is the average of convex piecewise-linear functions, one for each value. For instance, for the median $( \gamma = 0 . 5 )$ , this is just $\begin{array} { r } { \dot { \ell } _ { \gamma } ( C ; X ) = \frac { 1 } { 2 } | X - C | } \end{array}$ , where $X$ is the random value, and $C$ is the estimate. When we average these functions, we arrive at the yellow function in the plot showing the average loss, which indeed is minimized by any value between the central two elements, i.e., in the interval [28, 40]. The function for $\gamma = 0 . 7 5$ is minimized at $C = 4 5$ because $\operatorname* { P r } ( X \leq C ) < 0 . 7 5$ for values $C$ in [40, 45), while $\operatorname* { P r } ( X \leq C ) > 0 . 7 5$ for values $C$ in (45, 48].
|
| 39 |
+
|
| 40 |
+
Contributions In this paper, we describe a method for adaptively and privately tuning the clipping threshold to track a given quantile of the update norm distribution during training. The method uses a negligible amount of privacy budget, and is compatible with other FL technologies such as compression and secure aggregation [5, 6]. We perform a careful empirical comparison of our adaptive clipping method to a highly optimized fixed-clip baseline on a suite of realistic and publicly available FL tasks to demonstrate that high-utility and high-privacy models—sometimes exceeding any fixed clipping norm in utility—can be trained using our method without the need to tune any clipping hyperparameter.
|
| 41 |
+
|
| 42 |
+
# 2 Private adaptive quantile clipping
|
| 43 |
+
|
| 44 |
+
In this section, we will describe the adaptive strategy that can be used for adjusting the clipping threshold so that it comes to approximate the value at a specified quantile.
|
| 45 |
+
|
| 46 |
+
Let $X \in \mathbb { R }$ be a random variable, let $\gamma \in [ 0 , 1 ]$ be a quantile to be matched. For any $C$ , define
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\ell _ { \gamma } ( C ; X ) = { \left\{ \begin{array} { l l } { ( 1 - \gamma ) ( C - X ) } & { { \mathrm { i f ~ } } X \leq C , } \\ { \gamma ( X - C ) } & { { \mathrm { o t h e r w i s e , } } } \end{array} \right. }
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
so
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\ell _ { \gamma } ^ { \prime } ( C ; X ) = { \left\{ \begin{array} { l l } { ( 1 - \gamma ) } & { { \mathrm { i f ~ } } X \leq C , } \\ { - \gamma } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right. }
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Hence, $\begin{array} { r } { \mathbb { E } [ \ell _ { \gamma } ^ { \prime } ( C ; X ) ] = ( 1 - \gamma ) \operatorname* { P r } [ X \leq C ] - \gamma \operatorname* { P r } [ X > C ] = \operatorname* { P r } [ X \leq C ] - \gamma } \end{array}$ . For $C ^ { * }$ such that $\mathbb { E } [ \ell _ { \gamma } ^ { \prime } ( C ^ { * } ; X ) ] = 0$ , we have $\operatorname* { P r } ( X \leq C ^ { * } ) = \gamma$ . Thus, $C ^ { * }$ is the $\gamma ^ { \mathrm { t h } }$ quantile of $X$ . Because the loss is convex and has gradients bounded by 1, we can get an online estimate of $C$ that converges to the $\gamma ^ { \mathrm { t h } }$ quantile of $X$ using online gradient descent (see, e.g., Shalev-Shwartz [25]). See Figure 1 for a plot of the loss for a random variable that takes six values with equal probability.
|
| 59 |
+
|
| 60 |
+
Suppose at some round we have $m$ samples of $X$ , with values $( x _ { 1 } , \ldots , x _ { m } )$ . The average derivative of the loss for that round is
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r l } & { \bar { \ell } _ { \gamma } ^ { \prime } ( C ; X ) = \displaystyle \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \{ \displaystyle { ( 1 - \gamma ) \quad \mathrm { i f } \ x _ { i } \le C } , } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad = \displaystyle \frac { 1 } { m } \bigg ( ( 1 - \gamma ) \sum _ { i \in [ m ] } \mathbb { I } _ { x _ { i } \le C } - \gamma \sum _ { i \in [ m ] } \mathbb { I } _ { x _ { i } > C } \bigg ) = \bar { b } - \gamma , } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $\begin{array} { r } { \bar { b } \triangleq \frac { 1 } { m } \sum _ { i \in [ m ] } \mathbb { I } _ { x _ { i } \leq C } } \end{array}$ is the empirical fraction of samples with value at most $C$ . For a given learning rate $\eta _ { C }$ , we can perform the update: $C \gets C - \eta _ { C } ( \bar { b } - \gamma )$ .
|
| 67 |
+
|
| 68 |
+
Geometric updates. Since $\bar { b }$ and $\gamma$ take values in $[ 0 , 1 ]$ , the linear update rule above changes $C$ by a maximum of $\eta _ { C }$ at each step. This can be slow if $C$ is on the wrong order of magnitude. At the other extreme, if the optimal value of $C$ is orders of magnitude smaller than $\eta _ { C }$ , the update can be very coarse, and may overshoot to become negative. To remedy such issues, we propose the following geometric update rule: $C \gets C \cdot \exp ( - \eta _ { C } ( \bar { b } - \gamma ) )$ . This update rule converges quickly to the true quantile even if the initial estimate is off by orders of magnitude. It also has the attractive property that the variance of the estimate around the true quantile at convergence is proportional to the value at that quantile. In our experiments, we use the geometric update rule with $\eta _ { C } = 0 . 2$ .
|
| 69 |
+
|
| 70 |
+
# 2.1 DP-FedAvg with adaptive quantile clipping
|
| 71 |
+
|
| 72 |
+
Let $m$ be the number of users in a round and let $\gamma \in [ 0 , 1 ]$ denote the target quantile of the norm distribution at which we want to clip. For iteration $t \in [ T ]$ , let $C ^ { t }$ be the clipping threshold, and $\eta _ { C }$ be the learning rate. Let $\mathcal { Q } ^ { t }$ be set of users sampled in round $t$ . Each user $i \in \mathcal { Q } ^ { t }$ will send the bit $b _ { i } ^ { t }$ along with the usual model delta update $\Delta _ { i } ^ { t }$ , where $b _ { i } ^ { t } = \mathbb { I } _ { | | \Delta _ { i } ^ { t } | | _ { 2 } \leq C ^ { t } }$ . Defining $\begin{array} { r } { \bar { b } ^ { t } = \frac { 1 } { m } \sum _ { i \in \mathcal { Q } ^ { t } } b _ { i } ^ { t } } \end{array}$ we would like to apply the update $C \gets C \cdot \exp ( - \eta _ { C } ( \bar { b } - \gamma ) )$ . However, we can’t use ${ \bar { b } } ^ { t }$ directly, since it may reveal private information about the magnitude of users’ updates. To remedy this, we add Gaussian noise to the sum: $\begin{array} { r } { \tilde { b } ^ { t } = \frac { 1 } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } \bar { b } _ { i } ^ { t } + \mathcal { N } ( O , \sigma _ { b } ^ { 2 } ) \right) } \end{array}$ . The DPFedAvg algorithm with adaptive clipping is shown in Algorithm 1. We augment basic federated averaging with server momentum, which improves convergence [14, 24].2
|
| 73 |
+
|
| 74 |
+
# Algorithm 1 DPFedAvg-M with adaptive clipping
|
| 75 |
+
|
| 76 |
+
function $\mathrm { T r a i n } ( m , \gamma , \eta _ { c } , \eta _ { s } , \eta _ { C } , z , \sigma _ { b } , \beta )$ Initialize model $\theta ^ { 0 }$ , clipping bound $C ^ { 0 }$ z∆ ← z−2 − (2σb)−2−1/2 for each round $t = 0 , 1 , 2 , \ldots { \dot { \mathbf { c } } }$ o ${ \mathcal { Q } } ^ { t } \gets$ (sample $m$ users uniformly) for each user $i \in \mathcal { Q } ^ { t }$ in parallel do $\begin{array} { r l } & { \quad ( \Delta _ { i } ^ { t } , b _ { i } ^ { t } ) \gets \mathrm { ~ F e d A v g } ( i , \theta ^ { t } , \eta _ { c } , C ^ { t } ) } \\ & { \sigma _ { \Delta } \gets z _ { \Delta } C ^ { t } } \\ & { \tilde { \Delta } ^ { t } = \frac { 1 } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } \Delta _ { i } ^ { t } + \mathcal { N } ( 0 , I \sigma _ { \Delta } ^ { 2 } ) \right) } \\ & { \bar { \Delta } ^ { t } = \beta \bar { \Delta } ^ { t - 1 } + ( 1 - \beta ) \tilde { \Delta } ^ { t } } \\ & { \theta ^ { t + 1 } \gets \theta ^ { t } + \eta _ { s } \bar { \Delta } ^ { t } } \\ & { \tilde { b } ^ { t } = \frac { 1 } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } b _ { i } ^ { t } + \mathcal { N } ( O , \sigma _ { b } ^ { 2 } ) \right) } \end{array}$
|
| 77 |
+
|
| 78 |
+
$C ^ { t + 1 } \gets C ^ { t } \cdot \exp \left( - \eta _ { C } ( \tilde { b } ^ { t } - \gamma ) \right)$ function FedAvg(i, θ0, η, C) θ ← θ0 $\mathcal { G } $ (user i’s local data split into batches) for batch $g \in { \mathcal { G } }$ do $\begin{array} { r l } & { \quad \theta \gets \theta - \eta \nabla \ell ( \theta ; g ) } \\ & { \Delta \gets \theta - \theta ^ { 0 } } \\ & { b \gets \mathbb { I } _ { | | \Delta | | \leq C } } \\ & { \Delta ^ { \prime } \gets \Delta \cdot \operatorname* { m i n } \left( 1 , \frac { C } { | | \Delta | | } \right) } \\ & { \mathrm { ~ r e t u r n } \left( \Delta ^ { \prime } , b \right) } \end{array}$
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: Evolution of the quantile estimate on data drawn from log-normal distributions. The three plots use data drawn from the exponential of $\mathcal { N } ( 0 . 0 , 1 . 0 )$ , $\mathcal { N } ( \bar { 0 . 0 } , 0 . 1 )$ , and $\mathcal { N } ( \log { 1 0 } , 1 . 0 )$ , respectively. Curves are shown for each of five quantiles: (0.1, 0.3, 0.5, 0.7, 0.9), and the dashed lines show the true value at each quantile. Hyperparameters are as discussed in the text and used in the experiments of Section 3: $\eta _ { C } = 0 . 2 , C ^ { 0 } \stackrel { \sim } { = } 0 . \dot { 1 } , m = 1 0 0 , \sigma _ { b } = m / 2 0$ . After an initial phase of exponential growth, the true quantile is fairly closely tracked. A smaller value of $\eta _ { C }$ would allow more accurate tracking at the cost of slower convergence, but since the quantile value is only used as a heuristic for clipping, a small amount of noise is tolerable. The entire sequence of values estimated for each target quantile satisfy $( 0 . 0 3 4 , n ^ { - 1 . 1 } )$ -differential privacy using RDP composition across the 200 rounds assuming fixed-size samples of $m = 1 0 0$ out of a total population of $\bar { n } = 1 0 ^ { 6 }$ [29].
|
| 82 |
+
|
| 83 |
+
Theorem 1. One step of $D P$ -FedAvg with adaptive clipping using $\sigma _ { b }$ noise standard deviation on the clipped counts $\sum b _ { i } ^ { t }$ and $z _ { \Delta }$ noise multiplier on the vector sums $\sum \Delta _ { i } ^ { t }$ is equivalent (so far as privacy accounting is concerned) to one step of non-adaptive $D P$ -FedAvg with noise multiplier $z$ if we set z∆ = z−2 − (2σb)−2−1/2.
|
| 84 |
+
|
| 85 |
+
Proof. We make a conceptual change to the algorithm that does not change the behavior or privacy properties but allows us to analyze each step as if it were a single private Gaussian sum. Instead of sending $( \Delta _ { i } ^ { t } , b _ { i } ^ { t } )$ , each user sends $( \hat { \Delta } _ { i } ^ { t } , \hat { b } _ { i } ^ { t } ) \triangleq \big ( \Delta _ { i } ^ { t } / \sigma _ { \Delta } , ( b _ { i } ^ { t } - \scriptscriptstyle 1 / 2 ) / \sigma _ { b } \big )$ . The server adds noise with covariance $I$ and averages, then reverses the transformation so $\begin{array} { r } { \tilde { \Delta } ^ { t } = \frac { \sigma _ { \Delta } } { m } \biggl ( \sum _ { i \in \mathcal { Q } ^ { t } } \hat { \Delta } _ { i } ^ { t } + \mathcal { N } ( 0 , I ) \biggr ) } \end{array}$ and $\begin{array} { r } { \tilde { b } ^ { t } = \frac { \sigma _ { b } } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } \hat { b } _ { i } ^ { t } + \mathcal { N } ( 0 , 1 ) \right) + 1 / 2 } \end{array}$ . Noting that $\vert \vert ( \hat { \Delta } _ { i } ^ { t } , \hat { b } _ { i } ^ { t } ) \vert \vert \leq S \triangleq \left( ( C ^ { t } / \sigma _ { \Delta } ) ^ { 2 } + \left( 1 / 2 \sigma _ { b } \right) ^ { 2 } \right) ^ { 1 / 2 }$ , it is clear that the two Gaussian sum queries of Algorithm 1 are equivalent to pre- and post-processing of a single query with sensitivity $S$ and covariance $I$ , or noise multiplier $z = { \overset { \cdot } { 1 } } / s = \overset { \cdot } { \left( z _ { \Delta } ^ { - 2 } + ( 2 \sigma _ { b } ) ^ { - 2 } \right) ^ { - 1 / 2 } }$ Rearranging yields the result.
|
| 86 |
+
|
| 87 |
+
In practice, we recommend using a value of $\sigma _ { b } = m / 2 0$ . Since the noise is Gaussian, this implies that the error $| \tilde { b } ^ { t } - \bar { b } ^ { t } |$ will be less than 0.1 with $9 5 . 4 \%$ probability, and will be no more than 0.15 with $9 9 . 7 \%$ probability. Even in this unlikely case, assuming a geometric update and a learning rate of $\eta _ { C } = 0 . 2$ , the error on the update would be a factor of $\exp ( 0 . 2 \times 0 . 1 5 ) = 1 . 0 3$ , a small deviation. So this default gives high privacy for an acceptable amount of noise in the quantile estimation process. Using Thm. 1, we can compute that to achieve an effective combined noise multiplier of $z = 1$ , with $m = 1 0 0$ clients per round, the noise multiplier $z _ { \Delta }$ is approximately 1.005. So we are paying only a factor of $0 . 5 \%$ more noise on the updates for adaptive clipping with the same privacy guarantee (a quantity which only gets smaller with increasing $m$ ). These constants $\zeta \sigma _ { b } = m / 2 0$ and $\eta _ { C } = 0 . 2 $ ) are what we use in the experiments of Section 3.
|
| 88 |
+
|
| 89 |
+
The clipping norm can be initialized to any value $C ^ { 0 }$ that is safely on the low end of the expected norm distribution. If it is too high and needs to adapt downward, a lot of noise may be added at the beginning of model training, which may swamp the model. However there is little danger in setting it quite low, since the geometric update will make it grow exponentially until it matches the true quantile. In our experiments we use an initial clip of 0.1 for all tasks. It is easy to compute that with a learning rate of $\eta _ { C } = 0 . 2$ and a target quantile of $\gamma = 0 . 5$ , if every update is clipped, the quantile estimate will increase by a factor of ten every 23 iterations. In order to show the effectiveness of the algorithm at tracking a known quantile, we ran it on simulated data for which we can compute the true quantile exactly. Figure 2 shows the result of this experiment.
|
| 90 |
+
|
| 91 |
+
<table><tr><td>Task</td><td>model</td><td>N</td><td>n</td><td>T</td><td>2</td><td>m</td><td>nc</td><td>ns</td><td>Cmin</td><td>Cmax</td></tr><tr><td>CIFAR-100</td><td>ResNet</td><td>11M</td><td>500</td><td>4000</td><td>0.669</td><td>2231</td><td>0.1</td><td>0.32</td><td>0.75</td><td>2.2</td></tr><tr><td>EMNIST-CR</td><td>CNN</td><td>1.2M</td><td>3400</td><td>1500</td><td>0.513</td><td>513</td><td>0.032</td><td>1.0</td><td>0.28</td><td>0.85</td></tr><tr><td>EMNIST-AE</td><td>Deep AE</td><td>2.8M</td><td>3400</td><td>3000</td><td>0.659</td><td>2197</td><td>3.2</td><td>1.78</td><td>0.22</td><td>0.95</td></tr><tr><td>SHAKESPEARE</td><td>C-LSTM</td><td>820k</td><td>715</td><td>1200</td><td>0.510</td><td>510</td><td>1.0</td><td>0.32</td><td>0.25</td><td>3.6</td></tr><tr><td>SO-NWP</td><td>W-LSTM</td><td>4.1M</td><td>342k</td><td>1500</td><td>1.396</td><td>13958</td><td>0.18</td><td>1.78</td><td>0.30</td><td>1.6</td></tr><tr><td>SO-LR</td><td>Multi-LR</td><td>5M</td><td>342k</td><td>1500</td><td>1.396</td><td>13958</td><td>320.0</td><td>1.78</td><td>16.0</td><td>135.0</td></tr></table>
|
| 92 |
+
|
| 93 |
+
Table 1: Dataset statistics and chosen hyperparameters. Left: model type, number of trainable parameters $N$ , number of training clients $n$ , and the number of training rounds $T$ used (following Reddi et al. [24]). Middle: the noise multiplier $z$ and number of clients per round $m$ necessary to achieve $( 5 , n ^ { - 1 . 1 } )$ -DP with less than $5 \%$ model performance loss if each task had a population of $n = 1 0 ^ { 6 }$ [29]. Right: the optimal unclipped baseline client and server learning rates (Sec. 3.1) for each task and chosen values of minimum and maximum fixed clips (Sec. 3.2).
|
| 94 |
+
|
| 95 |
+
# 3 Experiments
|
| 96 |
+
|
| 97 |
+
To empirically validate the approach, we examine the behavior of our algorithm on six of the public benchmark federated learning tasks defined by Reddi et al. [24], which are to our knowledge the most realistic and representative publicly available federated learning tasks that exist to date. All six tasks are non-i.i.d. with respect to user partitioning: indeed with the exception of CIFAR-100, the data is partitioned according to the actual human user who generated the data, for example the writer of the EMNIST characters or the Stack Overflow user who asked or answered a question. Table 1 (left) lists the characteristics of the datasets.
|
| 98 |
+
|
| 99 |
+
Two of the tasks derived from Stack Overflow data (SO-NWP and SO-LR) are ideal for DP research due to the very high number of users (342k) making it possible to train models with good user-level privacy without sacrificing accuracy. The other four tasks (CIFAR-100, EMNIST-AE, EMNISTCR, SHAKESPEARE) are representative learning tasks, but not representative population sizes for real world cross-device FL applications. Therefore we focus on establishing that adaptive clipping works well with 100 clients per round on these tasks in the regime where the noise is at a level such that utility is just beginning to degrade. Under the assumption that a larger population were available, one could increase $m$ , $\sigma _ { \Delta }$ , and $\sigma _ { b }$ proportionally to achieve comparable utility with high privacy. This should not significantly affect convergence (indeed, it might be beneficial) since the only effect is to increase the number of users in the average $\tilde { \Delta } ^ { t }$ , reducing the variance. Table 1 (middle) shows the number of clients per round with which our experiments indicate we could achieve $( 5 , n ^ { - 1 . 1 } )$ -DP for each dataset with acceptable model performance loss (less than $5 \%$ relative to non-private training, as discussed later) if each dataset had $n = 1 0 ^ { 6 }$ clients, using RDP composition with fixed-size subsampling [29].3
|
| 100 |
+
|
| 101 |
+
# 3.1 Baseline client and server learning rates
|
| 102 |
+
|
| 103 |
+
Reddi et al. [24] provide optimized client and server learning rates for federated averaging with momentum that serve as a starting point for our experimental setup. For almost all hyperparameters (model configuration, evaluation metrics, client batch size, total rounds, etc.) we replicate their experiments, but with two changes. First, we increase the number of clients per round to 100 for all tasks. This reduces the variance in the updates to a level where we can reasonably assume that adding more clients is unlikely to significantly change convergence properties [18]. Second, as shown in Algorithm 1 we use unweighted federated averaging, thus eliminating the need to set yet another difficult-to-fit hyperparameter: the expected total weight of clients in a round. Since these changes might require different settings, we reoptimize the client and server learning rates for our baseline with no clipping or noise. We ran a small grid of 25 configurations for each task jointly exploring client and server learning rates whose logarithm (base-10) differs from the values in Table 10 of Reddi et al. [24] by $\{ \ - \% , - \% , 0 , \% , \% \}$ . The optimal baseline client and server learning rates for our experimental setup are shown in Table 1 (right).
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: Impact of clipping without noise. Performance of the unclipped baseline compared to five settings of $\gamma$ , from $\gamma = 0 . 1$ (aggressive clipping) to $\gamma = 0 . 9$ (mild clipping). The values shown are the evaluation metrics on the validation set averaged over the last 100 rounds. Note that the $y$ -axes have been compressed to show small differences, and that for EMNIST-AE lower values are better.
|
| 107 |
+
|
| 108 |
+
Because clipping (whether fixed or adaptive) reduces the average norm of the client updates, it may be necessary to use a higher server learning rate to compensate. Therefore, for all approaches with clipping—fixed or adaptive—we search over a small grid of five server learning rates, scaling the values in Table 1 by $\{ 1 , \bar { 1 0 } ^ { 1 / 4 } , 1 0 ^ { 1 / 2 } , 1 0 ^ { 3 / 4 } , 1 0 \}$ . For all configurations, we report the best performing model whose server learning rate was chosen from this small grid on the validation set.4
|
| 109 |
+
|
| 110 |
+
We first examine the impact of adaptive clipping without noise to see how it affects model performance. Figure 3 compares baseline performance without clipping to adaptive clipping with five different quantiles. For each quantile, we show the best model after tuning over the five server learning rates mentioned above on the validation set. On three tasks (CIFAR-100, EMNIST-AE, SO-NWP), clipping improves performance relative to the unclipped baseline. On SHAKESPEARE and SO-LR performance is slightly worse, but we can conclude that adaptive clipping to the median generally fares well compared to not using clipping across tasks. Note that for our primary goal of training with DP, it is essential to limit the sensitivity one way or another, so the modest decrease in performance observed from clipping on some tasks may be part of the inevitable tension between privacy and utility.
|
| 111 |
+
|
| 112 |
+
# 3.2 Fixed-clip baselines
|
| 113 |
+
|
| 114 |
+
We would like to compare our adaptive clipping approach to a fixed clipping baseline, but comparing to just one fixed-clip baseline may not be enough to demonstrate that adaptive clipping consistently performs well. Instead, our strategy will be to show that quantile-based adaptive clipping performs as well or nearly as well as any fixed clip chosen in hindsight. If we can first identify clipping norms that span the range of normal values during training on each problem/configuration, we can compare adaptive clipping to fixed clipping with those norms.
|
| 115 |
+
|
| 116 |
+
To that end, we first use adaptive clipping without noise to discover the value of the update norm distribution at the following five quantiles: $\{ 0 . 1 , 0 . 3 , 0 . 5 , 0 . 7 , 0 . 9 \}$ . Then we choose as the minimum of our fixed clipping range the smallest value at the 0.1 quantile over the course of training, and as the maximum the largest value at the 0.9 quantile. Plots of the update norms during training on each of the tasks are shown in Figure 4.
|
| 117 |
+
|
| 118 |
+
On each task there is a ramp up period where the clipping norm, initialized to 0.1 for all tasks, catches up to the correct norm distribution. Thus we disregard norm values collected until the actual fraction of clipped counts ${ \bar { b } } ^ { t }$ on some round is within 0.05 of the target quantile $\gamma$ . The chosen values for the minimum and maximum fixed clips for each task are shown in Table 1 (right). Our fixed-clipping baseline uses five fixed clipping norms logarithmically spaced in that range. Here we are taking advantage of having already run adaptive clipping to minimize the number of fixed clip settings we need to explore for each task. If we had to explore over the entire range knowing only the endpoints across all tasks (0.22, 135.0) at the same resolution, we would need nearly four times as many clip values per task.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
0.10.3 0.10.3 0.10.3Figure 4: Evolution of the adaptive clipping norm at five different quantiles (0.1, 0.3, 0.5, 0.7, 0.9) 0.50.70.9 0.50.70.9 0.70.9on each task with no noise. The norms are estimated using geometric updates with $\eta _ { C } = 0 . 2$ and an initial value $C ^ { 0 } = 0 . 1$ . With the possible exception of SO-LR, the estimated quantiles appear to closely track an evolving update norm distribution. Note that each task has a unique shape to its update norm evolution, which further motivates an adaptive approach.
|
| 122 |
+
|
| 123 |
+
For each value of noise multiplier $z \in \{ 0 , 0 . 0 1 , 0 . 0 3 , 0 . 1 \}$ we trained using the five fixed clipping norms and compare to adaptive clipping with the five quantiles (0.1, 0.3, 0.5, 0.7, 0.9). Note that for the fixed clipping runs $z _ { \Delta } = z$ ; that is, for fixed clip $C$ , the noise applied to the the updates has standard deviation $z C$ . As discussed in section 2.1, on the adaptive clipping runs $z _ { \Delta }$ is slightly higher due to the need to account for privacy when estimating the clipped counts.
|
| 124 |
+
|
| 125 |
+
# 3.3 Comparison of fixed and adaptive clipping
|
| 126 |
+
|
| 127 |
+
Validation set results with adaptive clipping are shown in Figure 5 and with fixed clipping in Figure 6. These charts show that we have identified the noise regime in which performance is beginning to degrade. There is always a tension between privacy and utility: as the amount of noise increases, eventually performance will go down. For the purpose of this study we consider more than a $5 \%$ relative reduction in evaluation metric to be unacceptable. Therefore for each task, we look at the level of noise $z ^ { * }$ at which the evaluation metric on the validation set is still within $5 \%$ of the value with no noise, but adding more noise would degrade performance beyond $5 \%$ . Given $z ^ { * }$ for each task, we then choose $C ^ { * }$ to be the fixed clip value that gives best performance on the validation set. The values of $z ^ { * }$ and $C ^ { * }$ are shown in Figure 7 (left).
|
| 128 |
+
|
| 129 |
+
For our final test set evaluation, we compare adaptive clipping to the median to fixed clipping at $C ^ { * }$ . The results are in Figure 7 (right). We show the average test set performance and bootstrapped $9 5 \%$ confidence interval over 20 runs varying the random seed used for client selection and DP noise. On three of the tasks (CIFAR-100, EMNIST-AE, SHAKESPEARE), clipping to the median actually outperforms fixed clipping to the best fixed clip chosen in hindsight, and on two more (EMNIST-CR, SO-NWP), the performance is comparable. Only on SO-LR the best fixed clip does perform somewhat better. This task seems to be unusual in that best performance comes from aggressive clipping, so a small fixed clip fares better than adaptive clipping to the median. However, looking at Figure 6 (and noting the scale of the $y$ axis), on this task more than the others, getting the exact right fixed clip is important. The development set recall $\textcircled { \alpha } 5$ value of 55.1 corresponds to the optimal fixed clip of 16.0. The next larger fixed clip of 27.3 gave a recall of only 51.8, and larger clips fared even worse. So an expensive hyperparameter search may be necessary to even get close to this high-performing fixed clip value.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 5: Evaluation metric performance of adaptive clipping with five settings of $\gamma$ for each of four effective noise multipliers $z$ . Note that the $y$ -axes have been compressed to show small differences, and that for EMNIST-AE lower values are better.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 6: Evaluation metric performance of fixed clipping with five settings of $C$ for each of four noise multipliers $z$ . Note that the $y \cdot$ -axes have been compressed to show small differences, and that for EMNIST-AE lower values are better.
|
| 136 |
+
|
| 137 |
+
# 4 Conclusions and implications for practice
|
| 138 |
+
|
| 139 |
+
In our experiments, we started with a high-performing non-private baseline with optimized client and server learning rates. We then searched over a small grid of larger server learning rates for our experiments with clipping (adaptive or fixed). This is one way to proceed in practice, if such non-private baseline results are available. More often, such baseline learning rates are not available, which will necessitate a search over client learning rates as well. In that case, it would be beneficial to enable adaptive clipping to the median during that hyperparameter search. The advantage of clipping relative to the unclipped baseline observed on some tasks could only increase if the other hyperparameters such as client learning rate were also chosen conditioned on the presence of clipping.
|
| 140 |
+
|
| 141 |
+
Although the experiments indicate that adaptive clipping to the median yields generally good results, on some problems (like SO-LR in our study) there may be gains from tuning the target quantile. It would require adding another dimension to the hyperparameter grid, exponentially increasing the tuning effort, but even this would be preferable to tuning the fixed clipping norm from scratch, since the grid can be smaller: we obtained good results on all problems by exploring only five quantiles, but the update norms in the experiments range over four orders of magnitude, from 0.22 to 135.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 7: Left: for each task, the maximum noise possible before performance begins to significantly degrade $( z ^ { * } )$ , and the best fixed clip $( C ^ { * } )$ chosen on the development set. Right: average test set performance and bootstrapped $9 5 \%$ confidence interval over 20 runs. In practice, finding the best fixed clipping norm would require substantial additional hyperparameter tuning.
|
| 145 |
+
|
| 146 |
+
Combining our results with the lessons taken from [18] and [24], the following strategy emerges for training a high-performing model with user-level differential privacy. We assume some non-private proxy data is available that may have comparatively few users $n ^ { \prime }$ , as well as that the true private data has enough users $n$ that the desired level of privacy is achievable.
|
| 147 |
+
|
| 148 |
+
1. With adaptive clipping to the median enabled, using a relatively small number of clients per round $m \approx 1 0 0 ^ { \circ } ,$ ), and a small amount of noise $z = 0 . 0 1$ ), search over client and server learning rates on non-private proxy data.
|
| 149 |
+
2. Fix the client and server learning rates. Using the non-private data and low value of $m$ , train several models increasing the level of noise $z$ until model performance at convergence begins to degrade.
|
| 150 |
+
3. To train the final model on private data, if $( m , z )$ is too small for the desired level of privacy even given $n$ , set $( m , z ) \alpha \cdot ( m , z )$ for some $\alpha > 1$ such that the privacy target $( \epsilon , \delta )$ is achieved.5 Finally, train the private model using that value of $m$ and $z$ .
|
| 151 |
+
|
| 152 |
+
By eliminating the need to tune the fixed clipping norm hyperparameter which interacts significantly with the client and server learning rates, the adaptive clipping method proposed in this work exponentially reduces the work necessary to perform the expensive first step of this procedure.
|
| 153 |
+
|
| 154 |
+
# References
|
| 155 |
+
|
| 156 |
+
[1] Martin Abadi, Andy Chu, Ian Goodfellow, Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In 23rd ACM Conference on Computer and Communications Security (ACM CCS), 2016.
|
| 157 |
+
[2] Martin Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, CCS ’16, pages 308–318, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4139-4. doi: 10.1145/2976749.2978318.
|
| 158 |
+
[3] Kareem Amin, Alex Kulesza, Andres Munoz, and Sergei Vassilvtiskii. Bounding user contributions: A bias-variance trade-off in differential privacy. In International Conference on Machine Learning, pages 263–271. PMLR, 2019.
|
| 159 |
+
[4] Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pages 464–473. IEEE, 2014.
|
| 160 |
+
[5] Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for federated learning on user-held data. arXiv preprint arXiv:1611.04482, 2016. [6] Keith Bonawitz, Fariborz Salehi, Jakub Konecnˇ y, Brendan McMahan, and Marco Gruteser. \` Federated learning with autotuned communication-efficient secure aggregation. In 2019 53rd Asilomar Conference on Signals, Systems, and Computers, pages 1222–1226. IEEE, 2019.
|
| 161 |
+
[7] Jean-Pierre Briot, Gaëtan Hadjeres, and François-David Pachet. Deep Learning Techniques for Music Generation - A Survey. arXiv e-prints, art. arXiv:1709.01620, Sep 2017.
|
| 162 |
+
[8] Nicholas Carlini, Chang Liu, Jernej Kos, Úlfar Erlingsson, and Dawn Song. The secret sharer: Measuring unintended neural network memorization & extracting secrets. CoRR, abs/1802.08232, 2018. URL http://arxiv.org/abs/1802.08232.
|
| 163 |
+
[9] Kamalika Chaudhuri, Claire Monteleoni, and Anand D Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12(Mar):1069–1109, 2011.
|
| 164 |
+
[10] Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In EUROCRYPT, 2006.
|
| 165 |
+
[11] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography Conference, pages 265–284. Springer, 2006.
|
| 166 |
+
[12] Matt Fredrikson, Somesh Jha, and Thomas Ristenpart. Model inversion attacks that exploit confidence information and basic countermeasures. In Proceedings of the 22Nd ACM SIGSAC Conference on Computer and Communications Security, CCS ’15, pages 1322–1333, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3832-5. doi: 10.1145/2810103.2813677.
|
| 167 |
+
[13] K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In 2015 IEEE International Conference on Computer Vision (ICCV), pages 1026–1034, Dec 2015. doi: 10.1109/ICCV.2015.123.
|
| 168 |
+
[14] Tzu-Ming Harry Hsu, Hang Qi, and Matthew Brown. Measuring the effects of non-identical data distribution for federated visual classification, 2019.
|
| 169 |
+
[15] Roger Iyengar, Joseph P. Near, Dawn Song, Om Thakkar, Abhradeep Thakurta, and Lun Wang. Towards practical differentially private convex optimization. In S&P 2019, 2019.
|
| 170 |
+
[16] Jakub Konecnˇ y, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, \` and Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016.
|
| 171 |
+
|
| 172 |
+
[17] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Agüera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, AISTATS 2017, 20-22 April 2017, Fort Lauderdale, FL, USA, pages 1273–1282, 2017. URL http://proceedings.mlr. press/v54/mcmahan17a.html.
|
| 173 |
+
|
| 174 |
+
[18] H. Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. Learning differentially private recurrent language models. In ICLR 2018, 2018.
|
| 175 |
+
|
| 176 |
+
[19] Luca Melis, Congzheng Song, Emiliano De Cristofaro, and Vitaly Shmatikov. Exploiting Unintended Feature Leakage in Collaborative Learning. arXiv e-prints, art. arXiv:1805.04049, May 2018.
|
| 177 |
+
|
| 178 |
+
[20] Ilya Mironov. Rényi differential privacy. In 2017 IEEE 30th Computer Security Foundations Symposium (CSF), pages 263–275. IEEE, 2017.
|
| 179 |
+
|
| 180 |
+
[21] Kobbi Nissim, Sofya Raskhodnikova, and Adam Smith. Smooth sensitivity and sampling in private data analysis. In Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 75–84, 2007.
|
| 181 |
+
|
| 182 |
+
[22] Nicolas Papernot, Martın Abadi, Úlfar Erlingsson, Ian Goodfellow, and Kunal Talwar. Semisupervised knowledge transfer for deep learning from private training data. stat, 1050, 2017.
|
| 183 |
+
|
| 184 |
+
[23] Nicolas Papernot, Shuang Song, Ilya Mironov, Ananth Raghunathan, Kunal Talwar, and Úlfar Erlingsson. Scalable private learning with pate. arXiv preprint arXiv:1802.08908, 2018.
|
| 185 |
+
|
| 186 |
+
[24] Sashank Reddi, Zachary Charles, Manzil Zaheer, Zachary Garrett, Keith Rush, Jakub Konecný, ˇ Sanjiv Kumar, and H. Brendan McMahan. Adaptive federated optimization, 2020.
|
| 187 |
+
|
| 188 |
+
[25] Shai Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 2012.
|
| 189 |
+
|
| 190 |
+
[26] R. Shokri, M. Stronati, C. Song, and V. Shmatikov. Membership inference attacks against machine learning models. In 2017 IEEE Symposium on Security and Privacy (SP), pages 3–18, May 2017. doi: 10.1109/SP.2017.41.
|
| 191 |
+
|
| 192 |
+
[27] C. Szegedy, , , P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1–9, June 2015. doi: 10.1109/CVPR.2015.7298594.
|
| 193 |
+
|
| 194 |
+
[28] Oriol Vinyals, Lukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a foreign language. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pages 2773–2781, Cambridge, MA, USA, 2015. MIT Press. URL http://dl.acm.org/citation.cfm?id=2969442.2969550.
|
| 195 |
+
|
| 196 |
+
[29] Yu-Xiang Wang, Borja Balle, and Shiva Prasad 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.
|
| 197 |
+
|
| 198 |
+
[30] X. Wu, M. Fredrikson, S. Jha, and J. F. Naughton. A methodology for formalizing modelinversion attacks. In 2016 IEEE 29th Computer Security Foundations Symposium (CSF), pages 355–370, June 2016. doi: 10.1109/CSF.2016.32.
|
| 199 |
+
|
| 200 |
+
[31] Xi Wu, Fengan Li, Arun Kumar, Kamalika Chaudhuri, Somesh Jha, and Jeffrey Naughton. Bolton differential privacy for scalable stochastic gradient descent-based analytics. In Proceedings of the 2017 ACM International Conference on Management of Data, SIGMOD ’17, pages 1307–1322, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-4197-4. doi: 10.1145/ 3035918.3064047.
|
md/train/RYcgfqmAOHh/RYcgfqmAOHh.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep Learning with Label Differential Privacy
|
| 2 |
+
|
| 3 |
+
Badih Ghazi Google Research badihghazi@googe.com
|
| 4 |
+
|
| 5 |
+
Noah Golowich⇤ EECS, MIT nzg@mit.edu
|
| 6 |
+
|
| 7 |
+
Ravi Kumar Google Research ravi.k53@gmai.com
|
| 8 |
+
|
| 9 |
+
Pasin Manurangsi Google Research pasin@googe.com
|
| 10 |
+
|
| 11 |
+
Chiyuan Zhang Google Research chiyuan@googe.com
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
The Randomized Response (RR) algorithm $\left[ \left[ 9 6 \right] \right]$ is a classical technique to improve robustness in survey aggregation, and has been widely adopted in applications with differential privacy guarantees. We propose a novel algorithm, Randomized Response with Prior (RRWithPrior), which can provide more accurate results while maintaining the same level of privacy guaranteed by RR. We then apply RRWithPrior to learn neural networks with label differential privacy (LabeDP), and show that when only the label needs to be protected, the model performance can be significantly improved over the previous state-of-the-art private baselines. Moreover, we study different ways to obtain priors, which when used with RRWithPrior can additionally improve the model performance, further reducing the accuracy gap between private and non-private models. We complement the empirical results with theoretical analysis showing that LabeDP is provably easier than protecting both the inputs and labels.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
The widespread adoption of machine learning in recent years has increased the concerns about the privacy of individuals whose data is used during the model training. Differential privacy (DP) [34, 33] has emerged as a popular privacy notion that has been the basis of several practical deployments in industry $\boxed { 1 3 5 } \boxed { 8 2 } \boxed { 4 3 } \boxed { 9 } \boxed { 2 9 }$ and the U.S. Census [3].
|
| 20 |
+
|
| 21 |
+
A classical algorithm—that predates DP and was initially designed to eliminate evasive answer biases in survey aggregation—is Randomized Response (RR) $\dot { \textcircled { 9 6 } }$ : when the input is an element from a finite alphabet, the output is equal to the input with a certain probability, and is a uniform random other element from the alphabet with the remaining probability. This simple algorithm is shown to satisfy the strong notion of local DP [38, 58], whereby the response of each user is protected, in contrast with the so-called central DP setting where a curator has access to the raw user data, and only the output of the curator is required to be DP. We note that schemes building on RR have been studied in several previous works on DP estimation (e.g., [30, 57]), and have been deployed in practice $\pmb { \Vert 8 2 \Vert }$
|
| 22 |
+
|
| 23 |
+
Meanwhile, the large error incurred by RR (e.g., [17]) has stimulated significant research aiming to improve its accuracy, mostly by relaxing to weaker privacy models (e.g., [36, 24, 4]). In this work, we use a different approach and seek to improve RR by leveraging available prior information. (A recent work of Liu et al. $[ [ 6 3 ] ]$ also used priors to improve accuracy, but in the context of the DP multiplicative weights algorithm, which applies in the central DP setting.) The prior information can consist of domain-specific knowledge, (models trained on) publicly available data, or historical runs of a training algorithm. Our algorithm is presented in Section 3 (Algorithm 2). At a high level, given a prior distribution $\mathbf { p }$ on the alphabet, the algorithm uses $\mathbf { p }$ to prune the alphabet. If the prior is reliable and even if the alphabet is only minimally pruned, the probability that the output equals the input is larger than when RR is applied to the entire alphabet. On the other hand, if the prior is uniform over the entire alphabet, then our algorithm recovers the classical RR. To implement the above recipe, one needs to specify how to effect the pruning using p. It turns out that the magnitude of pruning can itself vary depending on $\mathbf { p }$ , but we can obtain a closed-form formula for determining this. Interestingly, by studying a suitable linear program, we show that the resulting RRWithPrior strategy is optimal in that among all $\varepsilon$ -DP algorithms, it maximizes the probability that the output equals the input when the latter is sampled from p (Theorem $3 )$
|
| 24 |
+
|
| 25 |
+
# 1.1 Applications to Learning with Label Differential Privacy
|
| 26 |
+
|
| 27 |
+
There have been a great number of papers over the last decade that developed DP machine learning algorithms (e.g., [19, 102, 88, 83–85, 78]). In the case of deep learning, the seminal work of Abadi et al. $\left[ \left[ 2 \right] \right]$ introduced a DP training framework (DP-SGD) that was integrated into TensorFlow $[ \textcircled { 8 0 } ]$ and PyTorch $\pmb { \Vert 9 2 \Vert }$ . Despite numerous followup works, including, e.g., [75–77, 67, 98, 71, 20, 93], and extensive efforts, the accuracy of models trained with DP-SGD remains significantly lower than that of models trained without DP constraints. Notably, for the widely considered CIFAR-10 dataset, the highest reported accuracy for DP models is $6 9 . { \dot { 3 } } \%$ $\underline { { \| 9 3 \| } }$ , which strikingly relies on handcrafted visual features despite that in non-private scenarios learned features long been shown to be superior. Even using pre-training with external (CIFAR-100) data, the best reported DP accuracy, $7 3 \%$ i s still far below the non-private baselines $( > 9 5 \% )$ ). The performance gap becomes a roadblocker for many real-world applications to adopt DP. In this paper, we focus on a more restricted, but important, special case where the DP guarantee is only required to hold with respect to the labels, as described next.
|
| 28 |
+
|
| 29 |
+
In the label differential privacy (LabeDP) setting, the labels are considered sensitive, and their privacy needs to be protected, while the input points are not sensitive. This notion has been studied in the PAC setting [18, 13] and for the particular case of sparse linear regression $\textcircled { 9 4 } \textcircled { 1 }$ , and it captures several practical scenarios. Examples include: (i) computational advertising where the impressions are known to the Ad Tech3, and thus considered non-sensitive, while the conversions reveal user interest and are thus private (see, e.g., Nalpas and Dutton $\mathbb { \ m }$ and $\pmb { \| \bigtriangledown \| }$ ), (ii) recommendation systems where the choices are known, e.g., to the streaming service provider, but the user ratings are considered sensitive, and (iii) user surveys and analytics where demographic information (e.g., age, gender) is non-sensitive but income is sensitive—in fact, this was the motivating reason for Warner $\boxed { \boxed { 9 6 } }$ t o propose RR many decades ago! We present a novel multi-stage algorithm (LP-MST) for training deep neural networks with LabeDP that builds on top of RRWithPrior (see Section 3 and Algorithm 3), and we benchmark its empirical performance (Section $\textcircled { 5 }$ on multiple datasets, domains, and architectures, including the following.
|
| 30 |
+
|
| 31 |
+
• On CIFAR-10, we show that it achieves $2 0 \%$ higher accuracy than DP-SGD4.
|
| 32 |
+
• On the more challenging CIFAR-100, we present the first non-trivial DP learning results.
|
| 33 |
+
• On MovieLens, which consists of user ratings of movies, we show improvements via LP-MST.
|
| 34 |
+
|
| 35 |
+
In some applications, domain specific algorithms can be used to obtain priors directly without going through multi-stage training. For image classification problems, we demonstrate how priors computed from a (non-private) self-supervised learning [22, 23, 44, 53, 16] phase on the input images can be used to achieve higher accuracy with a LabeDP guarantee with extremely small privacy budgets $\varepsilon \le 0 . 1$ , see Section $5 . 2$ for details).
|
| 36 |
+
|
| 37 |
+
We note that due to the requirement of DP-SGD to compute and clip per-instance gradient, it remains technically challenging to scale to larger models or mini-batch sizes, despite numerous attempts to minigate this problem [42, 5, 26, 90]. On the other hand, our formulation allows us to use state-ofthe-art deep learning architectures such as ResNet [51]. We also stress that our LP-MST algorithm goes beyond deep learning methods that are robust to label noise. (See $ { \mathbb { R } } 7 { \mathbb { I } }$ for a survey of the latter.)
|
| 38 |
+
|
| 39 |
+
Our empirical results suggest that protecting the privacy of labels can be significantly easier than protecting the privacy of both inputs and labels. We find further evidence to this by showing that for the special case of stochastic convex optimization (SCO), the sample complexity of algorithms privatizing the labels is much smaller than that of algorithms privatizing both labels and inputs; specifically, we achieve dimension-independent bounds for LabeDP (Section $\textcircled { 6 }$ . We also show that a good prior can ensure smaller population error for non-convex loss. (Details are in the Supplementary Material.)
|
| 40 |
+
|
| 41 |
+
# 2 Preliminaries
|
| 42 |
+
|
| 43 |
+
For any positive integer $K$ , let $[ K ] : = \{ 1 , \dots , K \}$ . Randomized response (RR) $\left[ \left[ 9 6 \right] \right]$ is the following: let $\varepsilon \geq 0$ be a parameter and let $y \in [ K ]$ be the true value known to $\mathsf { R R } _ { \varepsilon }$ . When an observer queries the value of $y$ , $\mathsf { R R } _ { \varepsilon }$ responds with a random draw $\tilde { y }$ from the following probability distribution:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\operatorname* { P r } [ \tilde { y } = \hat { y } ] = \left\{ \begin{array} { l l } { \frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + K - 1 } } & { \mathrm { ~ f o r ~ } \hat { y } = y , } \\ { \frac { 1 } { e ^ { \varepsilon } + K - 1 } } & { \mathrm { ~ o t h e r w i s e . } } \end{array} \right.
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
In this paper, we focus on the application of learning with label differential privacy. We recall the definition of differential privacy (DP), which is applicable to any notion of neighboring datasets. For a textbook reference, we refer the reader to Dwork and Roth $\pmb { \mathbb { B 2 } }$ .
|
| 50 |
+
|
| 51 |
+
Definition 2.1 (Differential Privacy (DP) $\textcircled { 1 3 3 } , \textcircled { 3 4 } $ ). Let $\varepsilon , \delta \in \mathbb { R } _ { \geq 0 }$ . A randomized algorithm A taking as input a dataset is said to be $( \varepsilon , \delta )$ -differentially private ( $( \varepsilon , { \bar { \delta } } )$ -DP) if for any two neighboring datasets $\mathbf { D }$ and $\mathbf { D ^ { \prime } }$ , and for any subset $S$ of outputs of A, it is the case that $\mathrm { P r } [ \mathsf { A } ( \mathbf { D } ) ] \ \in \ S ] \ \bar { \leq }$ $e ^ { \varepsilon } \cdot \operatorname* { P r } [ \mathsf { A } ( \mathbf { D } ^ { \prime } ) \in S ] + \delta$ . If $\delta = 0$ , then A is said to be $\varepsilon$ -differentially private ( $\varepsilon$ -DP).
|
| 52 |
+
|
| 53 |
+
When applied to machine learning methods in general and deep learning in particular, DP is usually enforced on the weights of the trained model [see, e.g., 19, 59, 2]. In this work, we focus on the notion of label differential privacy.
|
| 54 |
+
|
| 55 |
+
Definition 2.2 (Label Differential Privacy). Let $\varepsilon , \delta \in \mathbb { R } _ { \geq 0 }$ . A randomized training algorithm A taking as input a dataset is said to be $( \varepsilon , \delta )$ -label differentially private $( ( \varepsilon , \delta )$ -LabeDP) if for any two training datasets $\mathbf { D }$ and $\mathbf { D ^ { \prime } }$ that differ in the label of a single example, and for any subset $S$ of outputs of A, it is the case that $\operatorname* { P r } [ \mathsf { A } ( \mathbf { D } ) \in S ] \leq e ^ { \varepsilon } \cdot \operatorname* { P r } [ \mathsf { A } ( \mathbf { D } ^ { \prime } ) \in \bar { S } ] + \delta$ . If $\delta = 0$ , then A is said to be $\varepsilon$ -label differentially private ( $\dot { \varepsilon }$ -LabeDP).
|
| 56 |
+
|
| 57 |
+
All proofs skipped in the main body are given in the Supplementary Material.
|
| 58 |
+
|
| 59 |
+
# 3 Randomized Response with Prior
|
| 60 |
+
|
| 61 |
+
In many real world applications, a prior distribution about the labels could be publicly obtained from domain knowledge and help the learning process. In particular, we consider a setting where for each (private) label $y$ in the training set, there is an associated prior $\mathbf { p } = \left( p _ { 1 } , \ldots , p _ { K } \right)$ . The goal is to output a randomized label $\tilde { y }$ that maximizes the probability that the output is correct (or equivalently maximizes the signal-to-noise ratio), i.e., $\operatorname* { P r } [ y = \tilde { y } ]$ . The privacy constraint here is that the algorithm should be $\varepsilon$ -DP with respect to $y$ . (It need not be private with respect to the prior $\mathbf { p }$ .)
|
| 62 |
+
|
| 63 |
+
We first describe our algorithm RRWithPrior by assuming access to such priors.
|
| 64 |
+
|
| 65 |
+
# 3.1 Algorithm: RRWithPrior
|
| 66 |
+
|
| 67 |
+
We build our RRWithPrior algorithm with a subroutine called RRTop- $k$ , as shown in Algorithm 1, which is a modification of randomized response where we only consider the set of $k$ labels $i$ with largest $p _ { i }$ . Then, if the input label $y$ belongs to this set, we use standard randomized response on this set. Otherwise, we output a label from this set uniformly at random.
|
| 68 |
+
|
| 69 |
+
The main idea behind RRWithPrior is to dynamically estimate an optimal $k ^ { * }$ based on the prior $\mathbf { p }$ and run RRTop- $k$ with $k ^ { * }$ . Specifically, we choose $k ^ { * }$ by maximizing $\operatorname* { P r } [ \mathsf { R R T o p } \ – k ( y ) = y ]$ . It is not
|
| 70 |
+
|
| 71 |
+
# Algorithm 1 RRTop- $k$
|
| 72 |
+
|
| 73 |
+
Input: A label $y \in [ K ]$
|
| 74 |
+
|
| 75 |
+
Parameters: $k \in [ K ]$ , prior $\mathbf { p } = \left( p _ { 1 } , \ldots , p _ { K } \right)$
|
| 76 |
+
|
| 77 |
+
1. Let $Y _ { k }$ be the set of $k$ labels with maximum prior probability (with ties broken arbritrarily).
|
| 78 |
+
2. If $y \in Y _ { k }$ , then output $y$ with probabilit y e"e"+k 1 and output y0 2 Yk \ {y} with probability $\frac { 1 } { e ^ { \varepsilon } + k - 1 }$ .
|
| 79 |
+
3. If $y \notin Y _ { k }$ , output an element from $Y _ { k }$ uniformly at random.
|
| 80 |
+
|
| 81 |
+
hard to see that this expression is exactly equal to $\begin{array} { r } { \frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + k - 1 } \cdot \left( \sum _ { \tilde { y } \in Y _ { k } } p _ { \tilde { y } } \right) } \end{array}$ if $y \sim \mathbf { p }$ . RRWithPrior is presented in Algorithm 2.
|
| 82 |
+
|
| 83 |
+
# Algorithm 2 RRWithPrior
|
| 84 |
+
|
| 85 |
+
Input: A label $y \in [ K ]$ Parameters: prior $\mathbf { p } = \left( p _ { 1 } , \ldots , p _ { K } \right)$
|
| 86 |
+
|
| 87 |
+
1. For $k \in [ K ]$ : (a) Compute $\begin{array} { r } { w _ { k } : = \frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + k - 1 } \cdot \left( \sum _ { \tilde { y } \in Y _ { k } } p _ { \tilde { y } } \right) } \end{array}$ , where $Y _ { k }$ is the set of $k$ labels with maximum prior probability (ties broken arbritrarily).
|
| 88 |
+
|
| 89 |
+
2. Let $k ^ { * } = \arg \operatorname* { m a x } _ { k \in [ K ] } w _ { k }$ .
|
| 90 |
+
3. Return an output of RRTop- $k$ $( y )$ with $k = k ^ { * }$ .
|
| 91 |
+
|
| 92 |
+
# 3.1.1 Privacy Analysis
|
| 93 |
+
|
| 94 |
+
It is not hard to show that RRTop- $k$ is $\varepsilon$ -DP.
|
| 95 |
+
|
| 96 |
+
Lemma 1. RRTop- $k$ is $\varepsilon$ -DP.
|
| 97 |
+
|
| 98 |
+
The privacy guarantee of RRWithPrior follows immediately from that of RRTop- $k$ (Lemma 1) since our choice of $k$ does not depend on the label $y$ :
|
| 99 |
+
|
| 100 |
+
Corollary 2. RRWithPrior is $\varepsilon$ -DP.
|
| 101 |
+
|
| 102 |
+
For learning with a LabeDP guarantee, we first use RRWithPrior to query a randomized label for each example of the training set, and then apply a general learning algorithm that is robust to random label noise to this dataset. Note that unlike DP-SGD $\left[ \left[ 2 \right] \right]$ that makes new queries on the gradients in every training epoch, we query the randomized label once and reuse it in all the training epochs.
|
| 103 |
+
|
| 104 |
+
# 3.2 Optimality of RRWithPrior
|
| 105 |
+
|
| 106 |
+
In this section we will prove the optimality of RRWithPrior. For this, we will need additional notation. For any algorithm R that takes as input a label $y$ and outputs a randomized label $\tilde { y }$ , we let $\mathrm { O b j } _ { \mathbf { p } _ { \mathrm { . } } } ( \mathsf { R } )$ denote the probability that the output label is equal to the input label $y$ when $y$ is distributed as $\mathbf { p }$ ; i.e., $\mathrm { O b j } _ { \mathbf { p } } ( \mathsf { R } ) \stackrel { - } { = } \operatorname* { P r } _ { y \sim \mathbf { p } } [ \mathsf { \bar { R } } ( y ) = y ]$ , where the distribution of $y \sim \mathbf { p }$ is $\operatorname* { P r } [ y = i ] = p _ { i }$ for all $i \in [ K ]$ .
|
| 107 |
+
|
| 108 |
+
The main result of this section is that, among all $\varepsilon$ -DP algorithms, RRWithPrior maximizes $\mathrm { O b j } _ { \mathbf { p } } ( \mathsf { R } )$ , as stated more formally next.
|
| 109 |
+
|
| 110 |
+
Theorem 3. Let $\mathbf { p }$ be any probability distribution on $[ K ]$ and R be any $\varepsilon$ -DP algorithm that randomizes the input label given the prior $\mathbf { p }$ . We have that
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathrm { O b j } _ { \mathbf { p } } ( \mathsf { R R W i t h P r i o r } ) \geq \mathrm { O b j } _ { \mathbf { p } } ( \mathsf { R } ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Before we proceed to the proof, we remark that our proof employs a linear program (LP) to characterize the optimal mechanisms; a generic form of such LPs has been used before in $\mathbb { H } \ 8 \mathbb { H } \mathbb { H }$ . However, these works focus on different problems (linear queries) and their results do not apply here.
|
| 117 |
+
|
| 118 |
+
Proof of Theorem 3. Consider any $\varepsilon$ -DP algorithm R, and let $q _ { \tilde { y } | y }$ denote $\mathrm { P r } [ \mathsf { R } ( y ) = \tilde { y } ]$ . Observe that Objp(R) = P y [k] py · qy|y.
|
| 119 |
+
|
| 120 |
+
Since $q . | _ { y }$ is a probability distribution, we must have that
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\sum _ { \tilde { y } \in [ K ] } q _ { \tilde { y } | y } = 1 , \forall y \in [ K ] , \mathrm { ~ a n d ~ } q _ { \tilde { y } | y } \geq 0 , \forall \tilde { y } , y \in [ K ] .
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Finally, the $\varepsilon$ -DP guarantee of R implies that
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
q _ { \tilde { y } | y } \leq e ^ { \varepsilon } \cdot q _ { \tilde { y } | y ^ { \prime } } \qquad \forall \tilde { y } , y , y ^ { \prime } \in [ K ] .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Combining the above, $\mathrm { O b j } _ { \mathbf { p } } ( \mathsf { R } )$ is upper-bounded by the optimum of the following linear program (LP), which we refer to as LP1:
|
| 133 |
+
|
| 134 |
+
max
|
| 135 |
+
|
| 136 |
+
s.t.
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l r } { \displaystyle \sum _ { y \in [ k ] } p _ { y } \cdot q _ { y | y } } & { } & \\ { \displaystyle q _ { \tilde { y } | y } \leq e ^ { \varepsilon } \cdot q _ { \tilde { y } | y ^ { \prime } } } & { } & { \qquad \forall \tilde { y } , y , y ^ { \prime } \in [ K ] , } \\ { \displaystyle \sum _ { \tilde { y } \in [ K ] } q _ { \tilde { y } | y } = 1 } & { } & { \qquad \forall y \in [ K ] , } \\ { \displaystyle q _ { \tilde { y } | y } \geq 0 } & { } & { \qquad \forall \tilde { y } , y \in [ K ] . } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Notice that constraints $\textcircled{2}$ and $( 3 )$ together imply that:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
q _ { y | y } + e ^ { - \varepsilon } \cdot \sum _ { \tilde { y } \in [ K ] \backslash \{ y \} } q _ { \tilde { y } | \tilde { y } } \leq 1
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\forall y \in [ K ] .
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
In other words, the optimum of LP1 is at most the optimum of the following LP that we call LP2:
|
| 153 |
+
|
| 154 |
+
max
|
| 155 |
+
|
| 156 |
+
s.t.
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\begin{array} { r l r } { \displaystyle { \sum _ { y \in [ k ] } p _ { y } \cdot q _ { y | y } } } \\ { \displaystyle { q _ { y | y } + e ^ { - \varepsilon } \cdot \sum _ { \tilde { y } \in [ K ] \setminus \{ y \} } q _ { \tilde { y } | \tilde { y } } \leq 1 } } & { } & { \forall y \in [ K ] , } \\ { \displaystyle { q _ { y | y } \geq 0 } } & { } & { \forall y \in [ K ] . } \end{array}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
An optimal solution to LP2 must be a vertex (aka extreme point) of the polytope defined by and $( \hat { 5 } )$ . Recall that an extreme point of a $K$ -dimensional polytope must satisfy $K$ independent constraints with equality. In our case, this means that one of the following occurs:
|
| 163 |
+
|
| 164 |
+
• Inequality $( 5 )$ is satisfied with equality for all $y \in [ K ]$ resulting in the all-zero solution (whose objective is zero), or, • For some non-empty subset $Y \subseteq [ K ]$ , inequality $\textcircled{4}$ is satisfied with equality for all $y \in Y$ , and inequality $\textcircled{5}$ is satisfied with equality for all $y \in [ K ] \setminus Y$ . This results in
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
q _ { y | y } = { \left\{ \begin{array} { l l } { { \frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + | Y | - 1 } } } & { { \mathrm { ~ i f ~ } } y \in Y , } \\ { 0 } & { { \mathrm { ~ i f ~ } } y \not \in Y . } \end{array} \right. }
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
This yields an objective value of $\frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + | Y | - 1 } \cdot \sum _ { y \in Y } p _ { y }$
|
| 171 |
+
|
| 172 |
+
In conclusion, we have that
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\begin{array} { l } { { \mathrm { O b j } _ { \bf p } ( { \mathsf { R } } ) \leq \displaystyle \operatorname* { m a x } _ { \theta \neq Y \subseteq C [ K ] } \displaystyle \frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + | Y | - 1 } \cdot \sum _ { y \in Y } p _ { y } } } \\ { { \ = \displaystyle \operatorname* { m a x } _ { k \in [ K ] } \displaystyle \frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + k - 1 } \cdot \operatorname* { m a x } _ { Y \subseteq [ K ] , | Y | = k } \sum _ { y \in Y } p _ { y } } } \\ { { \ = \displaystyle \operatorname* { m a x } _ { k \in [ K ] } \displaystyle \frac { e ^ { \varepsilon } } { e ^ { \varepsilon } + k - 1 } \cdot \sum _ { y \in Y _ { k } } p _ { y } \ = \ \operatorname* { m a x } _ { k \in [ K ] } w _ { k } } , } \end{array}
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
where the last two equalities follow from our definitions of $Y _ { k }$ and $w _ { k }$ . Notice that $\operatorname { O b j } _ { \mathbf { p } } \left( { \mathsf { R R W i t h P r i o r } } \right) = \operatorname* { m a x } _ { k \in [ K ] } w _ { k }$ . Thus, we get that $\mathrm { O b j } _ { \mathbf { p } }$ (RRWithPrior) $\geq \mathrm { O b j } _ { \mathbf { p } } ( \mathsf { R } )$ as desired. □
|
| 179 |
+
|
| 180 |
+
# 4 Application of RRWithPrior: Multi-Stage Training
|
| 181 |
+
|
| 182 |
+
Our RRWithPrior algorithm requires publicly available priors, which could usually be obtained from domain specific knowledge. In this section, we describe a training framework that bootstraps from a uniform prior, and progressively learns refined priors via multi-stage training. This general framework can be applied to arbitrary domains even when no public prior distributions are available.
|
| 183 |
+
|
| 184 |
+
Specifically, we assume that we have a training algorithm A that outputs a probabilistic classifier which, on a given unlabeled sample $\mathbf { x }$ , can assign a probability $p _ { y }$ to each class $y \in [ K ]$ . We partition our dataset into subsets $S ^ { ( 1 ) } , \ldots , S ^ { ( T ) }$ , and we start with a trivial model $M ^ { ( 0 ) }$ that outputs equal probabilities for all classes. At each stage $t \in [ T ]$ , we use the most recent model $M ^ { ( t - 1 ) }$ to assign the probabilities $\left( p _ { 1 } , \ldots , p _ { K } \right)$ for each sample $\mathbf { x } _ { i }$ from $S ^ { ( t ) }$ . Applying RRWithPrior with this prior on the true label $y _ { i }$ , we get a randomized label $\tilde { y } _ { i }$ for $\mathbf { x } _ { i }$ . We then use all the samples with randomized labels obtained so far to train the model $M ^ { ( t ) }$ .
|
| 185 |
+
|
| 186 |
+
The full description of our LP-MST (Label Privacy Multi-Stage Training) method is presented in Algorithm $\textcircled { 3 }$ We remark here that the partition $S ^ { ( 1 ) } , \ldots , S ^ { ( T ) }$ can be arbitrarily chosen, as long as it does not depend on the labels $y _ { 1 } , \ldots , y _ { n }$ . We also stress that the training algorithm A need not be private. We use LP-1ST to denote our algorithm with one stage, ${ \mathsf { L P - } } 2 { \mathsf { S } } { \mathsf { T } }$ to denote our algorithm with two stages, and so on. We also note that LP-1ST is equivalent to using vanilla RR. The tth stage of a multi-stage algorithm is denoted stage- $\cdot t$ .
|
| 187 |
+
|
| 188 |
+
# Algorithm 3 Muti-Stage Training (LP-MST)
|
| 189 |
+
|
| 190 |
+
Input: Dataset $S = \{ ( \mathbf { x } _ { 1 } , y _ { 1 } ) , \dotsc , ( \mathbf { x } _ { n } , y _ { n } ) \}$
|
| 191 |
+
|
| 192 |
+
Parameters: Number $T$ of stages, training algorithm A
|
| 193 |
+
|
| 194 |
+
1. Partition $S$ into $S ^ { ( 1 ) } , \ldots , S ^ { ( T ) }$
|
| 195 |
+
|
| 196 |
+
2. Let $M ^ { ( 0 ) }$ be the trivial model that always assigns equal probability to each class.
|
| 197 |
+
|
| 198 |
+
For $t = 1$ to $T$ :
|
| 199 |
+
(a) Let $\tilde { S } ^ { ( t ) } = \emptyset$ .
|
| 200 |
+
(b) For each $( \mathbf { x } _ { i } , y _ { i } ) \in S ^ { ( t ) }$ : i. Let $\mathbf { p } = \left( p _ { 1 } , \ldots , p _ { K } \right)$ be the probabilities predicted by $M ^ { ( t ) }$ on $\mathbf { x } _ { i }$ . ii. Let $\tilde { y } _ { i } = \mathsf { R R W i t h P r i o r } _ { \mathbf { p } } ( y _ { i } )$ . iii. Add $\left( \mathbf { x } _ { i } , \tilde { y } _ { i } \right)$ to $\tilde { S } ^ { ( t ) }$ .
|
| 201 |
+
(c) Let $M ^ { ( t ) }$ be the model resulting from training on $\tilde { S } ^ { ( 1 ) } \cup \cdots \cup \tilde { S } ^ { ( t ) }$ using A.
|
| 202 |
+
|
| 203 |
+
4. Output $M ^ { ( T ) }$
|
| 204 |
+
|
| 205 |
+
The privacy guarantee of LP-MST is given by the following:
|
| 206 |
+
|
| 207 |
+
Observation 4. For any $\varepsilon > 0$ , $i f$ RRWithPrior is $\varepsilon$ -DP, then LP-MST is $\varepsilon$ -LabeDP.
|
| 208 |
+
|
| 209 |
+
Proof. We will in fact prove a stronger statement that the algorithm is $\varepsilon$ -DP even when we output all the $T$ models $M ^ { ( 1 ) } , \ldots , M ^ { ( T ) }$ together with all the randomized labels $\tilde { y } _ { 1 } , \ldots , \tilde { y } _ { n }$ . For any possible output models $m ^ { ( 1 ) } , \ldots , m ^ { ( T ) }$ and output labels $z _ { 1 } , \ldots , z _ { n }$ , we have
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\begin{array} { l } { { \mathrm { P r } [ { \cal M } ^ { ( 1 ) } = m ^ { ( 1 ) } , \ldots , { \cal M } ^ { ( T ) } = m ^ { ( T ) } , \tilde { y } _ { 1 } = z _ { 1 } , \ldots , \tilde { y } _ { n } = z _ { n } ] } } \\ { { \displaystyle = \prod _ { t = 1 } ^ { T } \left( \mathrm { P r } \left[ { \cal M } ^ { ( t ) } = m ^ { ( t ) } \left| \prod _ { i \in S ^ { ( 1 ) } \cup \ldots \cup S ^ { ( t ) } } \tilde { y } _ { i } = z _ { i } \right. \right] : \prod _ { i \in S ^ { ( t ) } } \mathrm { P r } \left[ \tilde { y } _ { i } = z _ { i } \Big | { \cal M } ^ { ( t - 1 ) } = m ^ { ( t - 1 ) } \right] \right) . } } \end{array}
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
Consider any two datasets $\mathbf { D } , \mathbf { D ^ { \prime } }$ that differ on a single user’s label; suppose this user is $j$ and that the user belongs to partition $\ell \in [ T ]$ . Then, the above expression for $\mathbf { D }$ and that for $\mathbf { D ^ { \prime } }$ are the same in all but one term: $\operatorname* { P r } \left[ \tilde { y } _ { j } = z _ { j } \middle | M ^ { ( \ell - 1 ) } = m ^ { ( \ell - 1 ) } \right]$ , which is the probability that RRWithPrior $\underset { . } { m } ^ { ( \ell - 1 ) } \bigl ( \underset { . } { x } _ { i } \bigr )$ outputs $z _ { i }$ . Since RRWithPrior is $\varepsilon$ -DP, we can conclude that the ratio between the two probabilities is at most $e ^ { \varepsilon }$ as desired. □
|
| 216 |
+
|
| 217 |
+
We stress that this observation holds because each sensitive label $y _ { i }$ is only used once in Line $\boxed { 3 ( \mathrm { b } ) \ddot { \mathrm { u } } }$ of Algorithm $\bigtriangledown$ as the dataset $S$ is partitioned at the beginning of the algorithm. As a result, since each stage is $\varepsilon$ -LabeDP, the entire algorithm is also $\varepsilon$ -LabeDP. This is known as (an adaptive version of a) parallel composition $\pmb { \Vert 6 8 \Vert }$ .
|
| 218 |
+
|
| 219 |
+
Table 1: Test accuracy $( \% )$ on CIFAR-10. The baseline performances taken from previously published results correspond to $( \varepsilon , \delta )$ -DP with $\delta = 1 0 ^ { - 5 }$ . The star? indicates the use of CIFAR-100 pre-trained representations.
|
| 220 |
+
|
| 221 |
+
<table><tr><td>Algorithm</td><td>ε=1</td><td>ε=2</td><td>ε=3</td><td>ε=4</td><td>m=6</td><td>m=8</td><td>m=8</td></tr><tr><td>DP-SGD w/ pre-train* [2] DP-SGD □</td><td></td><td>67</td><td></td><td>70</td><td></td><td>73</td><td>80</td></tr><tr><td>Tempered Sigmoid [77]</td><td></td><td></td><td></td><td></td><td>66.2(ε=7.53)</td><td>61.6(=7.53)</td><td>76.6</td></tr><tr><td>Yu et al. [98]</td><td></td><td></td><td></td><td></td><td>44.3(ε=6.78)</td><td></td><td></td></tr><tr><td>Nasr et al. [71]</td><td></td><td></td><td>55</td><td></td><td></td><td></td><td></td></tr><tr><td>Chen and Lee [ 四0 ScatterNet+CNN [93]</td><td></td><td></td><td>69.3</td><td></td><td></td><td>53</td><td></td></tr><tr><td>LP-1ST</td><td>59.96</td><td>82.38</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LP-2ST</td><td>63.67</td><td>86.05</td><td>89.89 92.19</td><td>92.58 93.37</td><td>93.58 94.26</td><td>94.70 94.52</td><td>94.96</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1</td></tr><tr><td>LP-1ST w/ pre-train* LP-2ST w/ pre-train*</td><td>67.64 70.16</td><td>83.99 87.22</td><td>90.24 92.12</td><td>92.83 93.53</td><td>94.02 94.41</td><td>94.96 94.59</td><td>95.25</td></tr></table>
|
| 222 |
+
|
| 223 |
+
Table 2: Experiments on CIFAR-100. The non-private baseline $\varepsilon = \infty$ ) is $7 6 . 3 8 \%$ test accuracy.
|
| 224 |
+
|
| 225 |
+
<table><tr><td>Algorithm </td><td>ε=3</td><td>ε=4</td><td>ε=5</td><td>ε=6</td><td>6ε=8</td></tr><tr><td>LP-1ST</td><td>20.96</td><td>46.28</td><td>61.38</td><td>68.34</td><td>73.59</td></tr><tr><td>LP-2ST</td><td>28.74</td><td>50.15</td><td>63.51</td><td>70.58</td><td>74.14</td></tr></table>
|
| 226 |
+
|
| 227 |
+
Finally, we point out that the running time of our RRWithPrior algorithm is quasi-linear in $K$ (the time needed to sort the prior). This is essentially optimal within multistage training, since $O ( K )$ time will be required to write down the prior after each stage. Moreover, for reasonable values of $K$ , the running time will be dominated by back-propagation for gradient estimation. Moreover, the focus of the current work is on small to modest label spaces (i.e., values of $K$ ).
|
| 228 |
+
|
| 229 |
+
# 5 Empirical Evaluation
|
| 230 |
+
|
| 231 |
+
We evaluate RRWithPrior on standard benchmark datasets that have been widely used in previous works on private machine learning. Specifically, in the first part, we study our general multi-stage training algorithm that boostraps from a uniform prior. We evaluate it on image classification and collaborative filtering tasks. In the second part, we focus on image classification only and use domainspecific techniques to obtain priors for RRWithPrior. We use modern neural network architectures (e.g., ResNets ${ \| \dot { \ 5 } \| } ,$ ) and the mixup $\mathbb { I m }$ regularization for learning with noisy labels. Please see the Supplementary Material for full details on the datasets and the experimental setup.
|
| 232 |
+
|
| 233 |
+
# 5.1 Evaluation with Multi-Stage Training
|
| 234 |
+
|
| 235 |
+
CIFAR-10 $\pmb { \| 6 0 \| }$ is a 10-class image classification benchmark dataset. We evaluate our algorithm and compare it to previously reported DP baselines in Table $\nsupseteq$ Due to scalability issues, previous DP algorithms could only use simplified architectures with non-private accuracy significantly below the state-of-the-art. Moreover, even when compared to those weaker non-private baselines, a large performance drop is observed in the private models. In contrast, we use ResNet18 with $9 5 \%$ nonprivate accuracy. Overall, our algorithms improve the previous state-of-the-art by a margin of $20 \%$ across all $\varepsilon$ ’s. Abadi et al. $\left[ \left[ 2 \right] \right]$ treated CIFAR-100 as public data and use it to pre-train a representation to boost the performance of DP-SGD. We also observe performance improvements with CIFAR-100 pre-training (Table $\mathbb { L }$ bottom 2 rows). But even without pre-training, our results are significantly better than DP-SGD even with pre-training.
|
| 236 |
+
|
| 237 |
+
Table 3: Experiments on MovieLens-1M. The numbers show the test RMSE.
|
| 238 |
+
|
| 239 |
+
<table><tr><td>Algorithm</td><td>ε=1</td><td>ε=2</td><td>ε=3</td><td>ε=4</td><td>m=8</td><td>m=8</td></tr><tr><td>LP-1ST</td><td>1.122</td><td>0.981</td><td>0.902</td><td>0.877</td><td>0.867</td><td>0.868</td></tr><tr><td>LP-2ST</td><td>1.034</td><td>0.928</td><td>0.891</td><td>0.874</td><td>0.865</td><td></td></tr><tr><td>Gaussian DP 园</td><td></td><td></td><td></td><td></td><td colspan="2">0.915 (ε ≥ 10)</td></tr></table>
|
| 240 |
+
|
| 241 |
+
In Table $\bigtriangledown$ we also show results on CIFAR-100, which is a more challenging variant with $1 0 \times$ more classes. To the best of our knowledge, these are the first non-trivial reported results on CIFAR-100 for DP learning. For $\varepsilon = 8$ , our algorithm is only $2 \%$ below the non-private baseline.
|
| 242 |
+
|
| 243 |
+
In addition, we also evaluate on MovieLens-1M [49], which contains 1 million anonymous ratings of approximately 3, 900 movies, made by 6,040 MovieLens users. Following $[ [ 1 5 ] ]$ , we randomly split the data into $8 0 \%$ train and $2 0 \%$ test, and show the test Root Mean Square Error (RMSE) in Table 3.
|
| 244 |
+
|
| 245 |
+
Results on MNIST $\mathbb { \left[ 6 1 \right] }$ , Fashion MNIST $\boldsymbol { \mathbb { P 7 } }$ , and KMNIST $\mathbb { \left[ \left. 2 5 \right] \right. }$ , and comparison to more baselines can be found in the Supplementary Material. In all the datasets we evaluated, our algorithms not only significantly outperform the previous methods, but also greatly shrink the performance gap between private and non-private models. The latter is critical for applications of deep learning systems in real-world tasks with privacy concerns.
|
| 246 |
+
|
| 247 |
+
Beyond Two Stages. In Figure $^ { 1 ( \mathrm { a ) } }$ , we report results on LP-MST with $T > 2$ . For the cases we tried, we consistently observe $1 - 2 \%$ improvements on test accuracy when going from ${ \mathsf { L P - } } 2 { \mathsf { S } } { \mathsf { T } }$ to $\mathsf { L P - } 3 \mathsf { S } \mathsf { T }$ . In our preliminary experiments, going beyond $T > 4$ stages leads to diminishing returns on some datasets.
|
| 248 |
+
|
| 249 |
+
# 5.2 Evaluation with Domain-Specific Priors
|
| 250 |
+
|
| 251 |
+
The multi-stage training framework evaluated in the previous section is a general domain-agnostic algorithm that bootstraps itself from uniform priors. In some cases, domain-specific priors can be obtained to further improve the learning performance. In this section, we focus on image classification applications, where new advances in self-supervised learning (SSL) [22, 23, 44, 53, 16] show that high-quality image representations could be learned on large image datasets without using the class labels. In the setting of LabeDP, the unlabeled images are considered public data, so we design an algorithm to use SSL to obtain priors, which is then fed to RRWithPrior for discriminative learning.
|
| 252 |
+
|
| 253 |
+
Specifically, we partition the training examples into groups by clustering using their representations extracted from SSL models. We then query a histogram of labels for each group via discrete Laplace mechanism (aka Geometric Mechanism) $\dot { \left[ \left| 4 1 \right| \right] }$ . If the groups are largely homogeneous, consisting of mostly examples from the same class, then we can make the histogram queries with minimum privacy budget. The queried histograms are used as label priors for all the points in the group. Figure 1(b) shows the results on two different SSL representations: BYOL $\pm \ddagger { 4 } \rVert$ , trained on unlabeled CIFAR-10 images and DINO [16], trained on ImageNet $\mathbb { \left[ \left[ 2 7 \right] \right] }$ images. Comparing to the baseline, the SSL-based priors significantly improves the model performance with small privacy budgets. Note that since the SSL priors are not true priors, with large privacy budget $\varepsilon = 8$ ), it actually underperforms the uniform prior. But in most real world applications, small $\varepsilon$ ’s are generally more useful.
|
| 254 |
+
|
| 255 |
+
# 6 Theoretical Analysis
|
| 256 |
+
|
| 257 |
+
Previous works have shown that LabeDP can be provably easier than DP in certain settings; specifically, in the PAC learning setting, Beimel et al. $\mathbb { \lVert 1 3 \rVert }$ proved that finite VC dimension implies learnability by LabeDP algorithms, whereas it is known that this is not sufficient for DP algorithms [7].
|
| 258 |
+
|
| 259 |
+
We extend the theoretical understanding of this phenomenon to the stochastic convex optimization (SCO) setting. Specifically, we show that, by applying RR on the labels and running SGD on top of the resulting noisy dataset with an appropriate debiasing of the noise, one can arrive at the following dimension-independent excess population loss.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 1: (a) Test accuracy $( \% )$ on various datasets with LP-MST for $T > 2$ . The curve “CIFAR-10 w/ pre-train” is using CIFAR-100 as public data to pre-train the model. (b) RRWithPrior with priors obtained from histogram query based on clustering in various SSL representations. We also plot recent results (ClusterRR) from Esfandiari et al. $\pmb { \Vert 3 7 } \Vert$ , which is a clustering based LabeDP algorithm.
|
| 263 |
+
|
| 264 |
+
Theorem 5 (Informal). For any $\varepsilon \in ( 0 , 1 )$ , there is an $\varepsilon$ -LabeDP algorithm for stochastic convex optimization with excess population loss ${ \tilde { O } } \left( D L \cdot { \frac { K } { \varepsilon { \sqrt { n } } } } \right)$ where $D$ denotes the diameter of the parameter space and L denotes the Lipschitz constant of the loss function.
|
| 265 |
+
|
| 266 |
+
The above excess population loss can be compared to that of Bassily et al. $\mathbb { \lVert 1 2 \rVert }$ , who gave an $( \varepsilon , \delta )$ - DP algorithm with excess population loss $\begin{array} { r } { O _ { D , L } \left( \frac { 1 } { \sqrt { n } } + \frac { \sqrt { p } } { \varepsilon n } \right) } \end{array}$ , where $p$ denote the dimension of the parameter space; this bound is also known to be tight in the standard DP setting. The main advantage of our guarantee in Theorem $5$ is that it is independent of the dimension $p$ . Furthermore, we show that our bound is tight up to polylogarithmic factors and the dependency on the number of classes $K$ .
|
| 267 |
+
|
| 268 |
+
The above result provides theoretical evidence that running RR on the labels and then training on this noisy dataset can be effective. We can further extend this to the setting where, instead of running RR, we run RRTop- $k$ before running the aforementioned (debiased) SGD, although—perhaps as expected—our bound on the population loss now depends on the quality of the priors.
|
| 269 |
+
|
| 270 |
+
Corollary 6 (Informal). Suppose that we are given a prior $\mathbf { p } _ { x }$ for every $x$ and let $Y _ { k } ^ { x }$ denote the set of top- $k$ labels with respect to $\mathbf { p } _ { x }$ . Then, for any $\varepsilon \in ( 0 , 1 )$ , there is an $\varepsilon$ -LabeDP algorithm for stochastic convex optimization with excess population loss $\begin{array} { r } { \tilde { O } \left( D L \cdot \left( \frac { k } { \varepsilon \sqrt { n } } + \operatorname* { P r } _ { ( x , y ) \sim \mathcal { D } } [ y \notin Y _ { k } ^ { x } ] \right) \right) } \end{array}$ where $D , L$ are as defined in Theorem 5 and $\mathcal { D }$ is the data distribution.
|
| 271 |
+
|
| 272 |
+
When our top- $k$ set is perfect (i.e., $y$ always belongs to $Y _ { k } ^ { x }$ ), the bound reduces to that of Theorem 5, but with the smaller $k$ instead of $K$ . Moreover, the second term is, in some sense, a penalty we pay in the excess population loss for the inaccuracy of the top- $k$ prior. We defer the formal treatment and the proofs to the Supplementary Material, in which we also present additional generalization results for non-convex settings.
|
| 273 |
+
|
| 274 |
+
Note that Corollary $6$ is not in the exact setup we run in experiments, where we dynamically calculate an optimal $k$ for each $x$ given generic priors (via RRWithPrior), and for which the utility is much more complicated to analyze mathematically. Nonetheless, the above corollary corroborates the intuition that a good prior helps with training.
|
| 275 |
+
|
| 276 |
+
# 7 Conclusions and Future Directions
|
| 277 |
+
|
| 278 |
+
In this work, we introduced a novel algorithm RRWithPrior (which can be used to improve on the traditional RR mechanism), and applied it to LabeDP problems. We showed that prior information can be incorporated to the randomized label querying framework while maintaining privacy constraints. We demonstrated two frameworks to apply RRWithPrior: (i) a general multi-stage training algorithm LP-MST that bootstraps from uniform priors and (ii) an algorithm that build priors from clustering with
|
| 279 |
+
|
| 280 |
+
SSL-based representations. The former is general purpose and can be applied to tasks even when no domain-specific priors are available, while the latter uses a domain-specific algorithm to extract priors and performs well even with very small privacy budget. As summarized by the figure on the right, in both cases, by focusing on LabeDP, our RRWithPrior significantly improved the model performance of previous state-of-the-art DP models that aimed to protect both the inputs and outputs. We note that, following up on our work, additional results on deep learning with LabeDP were obtained $[ 6 6 , 1 0 0 ]$ . The narrowed performance gap between private and non-private models is vital for adding DP to real world deep learning models. We nevertheless stress that our algorithms only protect the labels but not the input points, which might not constitute a sufficient privacy protection in all settings.
|
| 281 |
+
|
| 282 |
+
Our work opens up several interesting questions. Firstly, note that our multi-stage training procedure uses very different ingredients than those of Abadi et al. $[ \left[ 2 \right] ]$ (which employ DP-SGD, privacy amplification by subsampling, and Renyi accounting); can these tools be used to further improve LabeDP? Secondly, while our procedure can be implemented in the most stringent local DP setting5 $\left[ \left[ 5 8 \right] \right]$ , can it be improved in the weaker central (aka trusted curator) DP model, assuming the curator knows the prior? Thirdly, while our algorithm achieves pure DP (i.e., $\delta = 0$ ), is higher accuracy possible for approximate DP (i.e., $\delta > 0$ )?
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
|
| 286 |
+
# Acknowledgements
|
| 287 |
+
|
| 288 |
+
The authors would like to thank Sami Torbey for very helpful feedback on an early version of this work. At MIT, Noah Golowich was supported by a Fannie and John Hertz Foundation Fellowship and an NSF Graduate Fellowship.
|
| 289 |
+
|
| 290 |
+
# References
|
| 291 |
+
|
| 292 |
+
[1] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Mané, R. Monga, S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Viégas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. Software available from tensorfow.org.
|
| 293 |
+
[2] M. Abadi, A. Chu, I. Goodfellow, H. B. McMahan, I. Mironov, K. Talwar, and L. Zhang. Deep learning with differential privacy. In CCS, pages 308–318, 2016.
|
| 294 |
+
[3] J. M. Abowd. The US Census Bureau adopts differential privacy. In KDD, pages 2867–2867, 2018.
|
| 295 |
+
[4] J. Acharya, K. Bonawitz, P. Kairouz, D. Ramage, and Z. Sun. Context aware local differential privacy. In ICML, pages 52–62, 2020.
|
| 296 |
+
[5] A. Agarwal and I. Ganichev. Auto-vectorizing tensorflow graphs: Jacobians, auto-batching and beyond. arXiv:1903.04243, 2019.
|
| 297 |
+
[6] A. Agarwal, P. Bartlett, P. Ravikumar, and M. J. Wainwright. Information-theoretic lower bounds on the oracle complexity of convex optimization. In NIPS, page 1–9, 2009.
|
| 298 |
+
[7] N. Alon, R. Livni, M. Malliaris, and S. Moran. Private PAC learning implies finite Littlestone dimension. In STOC, pages 852–860, 2019.
|
| 299 |
+
[8] E. Anderson. Masked learning, aggregation and reporting workflow (masked lark). https: //github.com/WICG/privacy-preserving-ads/bob/main/MaskedLARK.md, 2021.
|
| 300 |
+
[9] Apple Differential Privacy Team. Learning with privacy at scale. Apple Machine Learning Journal, 2017.
|
| 301 |
+
[10] R. Bassily, A. Smith, and A. Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In FOCS, pages 464–473, 2014.
|
| 302 |
+
[11] R. Bassily, V. Feldman, K. Talwar, and A. Thakurta. Private stochastic convex optimization with optimal rates. arXiv:1908.09970, 2019.
|
| 303 |
+
[12] R. Bassily, V. Feldman, K. Talwar, and A. G. Thakurta. Private stochastic convex optimization with optimal rates. In NeurIPS, pages 11279–11288, 2019.
|
| 304 |
+
[13] A. Beimel, K. Nissim, and U. Stemmer. Private learning and sanitization: Pure vs. approximate differential privacy. ToC, 12(1):1–61, 2016.
|
| 305 |
+
[14] O. Bousquet, S. Boucheron, and G. Lugosi. Introduction to statistical learning theory. In Summer School on Machine Learning, pages 169–207. Springer, 2003.
|
| 306 |
+
[15] Z. Bu, J. Dong, Q. Long, and W. J. Su. Deep learning with Gaussian differential privacy. Harvard Data Science Review, 2020(23), 2020.
|
| 307 |
+
[16] M. Caron, H. Touvron, I. Misra, H. Jégou, J. Mairal, P. Bojanowski, and A. Joulin. Emerging properties in self-supervised vision transformers. arXiv:2104.14294, 2021.
|
| 308 |
+
[17] T. H. Chan, E. Shi, and D. Song. Optimal lower bound for differentially private multi-party aggregation. In ESA, pages 277–288, 2012.
|
| 309 |
+
[18] K. Chaudhuri and D. Hsu. Sample complexity bounds for differentially private learning. In COLT, pages 155–186, 2011.
|
| 310 |
+
[19] K. Chaudhuri, C. Monteleoni, and A. D. Sarwate. Differentially private empirical risk minimization. JMLR, 12(3), 2011.
|
| 311 |
+
[20] C. Chen and J. Lee. Stochastic adaptive line search for differentially private optimization. In Big Data, pages 1011–1020, 2020.
|
| 312 |
+
[21] P. Chen, B. Liao, G. Chen, and S. Zhang. Understanding and utilizing deep neural networks trained with noisy labels. In ICML, pages 1062–1070, 2019.
|
| 313 |
+
[22] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. In ICML, pages 1597–1607, 2020.
|
| 314 |
+
[23] T. Chen, S. Kornblith, K. Swersky, M. Norouzi, and G. Hinton. Big self-supervised models are strong semi-supervised learners. In NeurIPS, 2020.
|
| 315 |
+
[24] A. Cheu, A. Smith, J. Ullman, D. Zeber, and M. Zhilyaev. Distributed differential privacy via shuffling. In EUROCRYPT, pages 375–403, 2019.
|
| 316 |
+
[25] T. Clanuwat, M. Bober-Irizar, A. Kitamoto, A. Lamb, K. Yamamoto, and D. Ha. Deep learning for classical Japanese literature. arXiv:1812.01718, 2018.
|
| 317 |
+
[26] F. Dangel, F. Kunstner, and P. Hennig. Backpack: Packing more into backprop. arXiv:1912.10985, 2019.
|
| 318 |
+
[27] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255, 2009.
|
| 319 |
+
[28] T. DeVries and G. W. Taylor. Improved regularization of convolutional neural networks with cutout. arXiv:1708.04552, 2017.
|
| 320 |
+
[29] B. Ding, J. Kulkarni, and S. Yekhanin. Collecting telemetry data privately. In NIPS, pages 3571–3580, 2017.
|
| 321 |
+
[30] J. C. Duchi, M. I. Jordan, and M. J. Wainwright. Local privacy and minimax bounds: sharp rates for probability estimation. In NIPS, pages 1529–1537, 2013.
|
| 322 |
+
[31] J. C. Duchi, M. I. Jordan, and M. J. Wainwright. Minimax optimal procedures for locally private estimation. JASA, 113(521):182–201, 2018.
|
| 323 |
+
[32] C. Dwork and A. Roth. The algorithmic foundations of differential privacy. Foundations and Trends in Theoretical Computer Science, 9(3-4):211–407, 2014.
|
| 324 |
+
[33] C. Dwork, K. Kenthapadi, F. McSherry, I. Mironov, and M. Naor. Our data, ourselves: Privacy via distributed noise generation. In EUROCRYPT, pages 486–503, 2006.
|
| 325 |
+
[34] C. Dwork, F. McSherry, K. Nissim, and A. D. Smith. Calibrating noise to sensitivity in private data analysis. In TCC, pages 265–284, 2006.
|
| 326 |
+
[35] Ú. Erlingsson, V. Pihur, and A. Korolova. Rappor: Randomized aggregatable privacypreserving ordinal response. In CCS, pages 1054–1067, 2014.
|
| 327 |
+
[36] Ú. Erlingsson, V. Feldman, I. Mironov, A. Raghunathan, K. Talwar, and A. Thakurta. Amplification by shuffling: From local to central differential privacy via anonymity. In SODA, pages 2468–2479, 2019.
|
| 328 |
+
[37] H. Esfandiari, V. Mirrokni, U. Syed, and S. Vassilvitskii. Label differential privacy via clustering. arXiv:2110.02159, 2021.
|
| 329 |
+
[38] A. Evfimievski, J. Gehrke, and R. Srikant. Limiting privacy breaches in privacy preserving data mining. In PODS, pages 211–222, 2003.
|
| 330 |
+
[39] V. Feldman and T. Zrnic. Individual privacy accounting via a Rényi filter. arXiv:2008.11193, 2020.
|
| 331 |
+
[40] V. Feldman, T. Koren, and K. Talwar. Private stochastic convex optimization: Optimal rates in linear time. In STOC, page 439–449, 2020.
|
| 332 |
+
[41] A. Ghosh, T. Roughgarden, and M. Sundararajan. Universally utility-maximizing privacy mechanisms. SICOMP, 41(6):1673–1693, 2012.
|
| 333 |
+
[42] I. Goodfellow. Efficient per-example gradient computations. arXiv:1510.01799, 2015.
|
| 334 |
+
[43] A. Greenberg. Apple’s “differential privacy” is about collecting your data – but not your data. Wired, June, 13, 2016.
|
| 335 |
+
[44] J.-B. Grill, F. Strub, F. Altché, C. Tallec, P. H. Richemond, E. Buchatskaya, C. Doersch, B. A. Pires, Z. D. Guo, M. G. Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. In NeurIPS, 2020.
|
| 336 |
+
[45] A. Gupta, K. Ligett, F. McSherry, A. Roth, and K. Talwar. Differentially private combinatorial optimization. In SODA, pages 1106–1125, 2010.
|
| 337 |
+
[46] B. Han, Q. Yao, X. Yu, G. Niu, M. Xu, W. Hu, I. Tsang, and M. Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, pages 8527–8537, 2018.
|
| 338 |
+
[47] B. Han, G. Niu, X. Yu, Q. Yao, M. Xu, I. W. Tsang, and M. Sugiyama. Sigua: Forgetting may make learning with noisy labels more robust. In ICML, pages 4006–4016, 2020.
|
| 339 |
+
[48] M. Hardt and K. Talwar. On the geometry of differential privacy. In STOC, pages 705–714, 2010.
|
| 340 |
+
[49] F. M. Harper and J. A. Konstan. The MovieLens datasets: History and context. ACM Trans. Interact. Intell. Syst., 5(4), 2015.
|
| 341 |
+
[50] H. Harutyunyan, K. Reing, G. V. Steeg, and A. Galstyan. Improving generalization by controlling label-noise information in neural network weights. In ICML, pages 4071–4081, 2020.
|
| 342 |
+
[51] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
|
| 343 |
+
[52] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In ECCV, pages 630–645, 2016.
|
| 344 |
+
[53] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, pages 9729–9738, 2020.
|
| 345 |
+
[54] X. He, L. Liao, H. Zhang, L. Nie, X. Hu, and T.-S. Chua. Neural collaborative filtering. In WWW, pages 173–182, 2017.
|
| 346 |
+
[55] W. Hu, Z. Li, and D. Yu. Simple and effective regularization methods for training on noisily labeled data with generalization guarantee. In ICLR, 2020.
|
| 347 |
+
[56] L. Jiang, D. Huang, M. Liu, and W. Yang. Beyond synthetic noise: Deep learning on controlled noisy labels. In ICML, pages 4804–4815, 2020.
|
| 348 |
+
[57] P. Kairouz, K. Bonawitz, and D. Ramage. Discrete distribution estimation under local privacy. In ICML, pages 2436–2444, 2016.
|
| 349 |
+
[58] S. P. Kasiviswanathan, H. K. Lee, K. Nissim, S. Raskhodnikova, and A. Smith. What can we learn privately? SICOMP, 40(3):793–826, 2011.
|
| 350 |
+
[59] D. Kifer, A. Smith, and A. Thakurta. Private convex empirical risk minimization and highdimensional regression. In COLT, pages 25.1–25.40, 2012.
|
| 351 |
+
[60] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical Report TR-2009, University of Toronto, 2009.
|
| 352 |
+
[61] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 353 |
+
[62] M. Ledoux and M. Talagrand. Probability in Banach Spaces: Isoperimetry and Processes. Springer Science & Business Media, 2013.
|
| 354 |
+
[63] T. Liu, G. Vietri, T. Steinke, J. Ullman, and Z. S. Wu. Leveraging public data for practical private query release. In ICML, 2021.
|
| 355 |
+
[64] M. Lukasik, S. Bhojanapalli, A. K. Menon, and S. Kumar. Does label smoothing mitigate label noise? In ICML, pages 6448–6458, 2020.
|
| 356 |
+
[65] X. Ma, H. Huang, Y. Wang, S. Romano, S. Erfani, and J. Bailey. Normalized loss functions for deep learning with noisy labels. In ICML, pages 6543–6553, 2020.
|
| 357 |
+
[66] M. Malek, I. Mironov, K. Prasad, I. Shilov, and F. Tramèr. Antipodes of label differential privacy: PATE and ALIBI. In NeurIPS, 2021.
|
| 358 |
+
[67] H. B. McMahan, D. Ramage, K. Talwar, and L. Zhang. Learning differentially private recurrent language models. In ICLR, 2018.
|
| 359 |
+
[68] F. McSherry. Privacy integrated queries: an extensible platform for privacy-preserving data analysis. CACM, 53(9):89–97, 2010.
|
| 360 |
+
[69] A. K. Menon, A. S. Rawat, S. J. Reddi, and S. Kumar. Can gradient clipping mitigate label noise? In ICLR, 2019.
|
| 361 |
+
[70] M. Nalpas and S. Dutton. A more private way to measure ad conversions, the Event Conversion Measurement API, October 2020. https://web.dev/conversion-measurement/ #how-this-api-preserves-user-privacy.
|
| 362 |
+
[71] M. Nasr, R. Shokri, et al. Improving deep learning with differential privacy using gradient encoding and denoising. arXiv:2007.11524, 2020.
|
| 363 |
+
[72] N. Natarajan, I. S. Dhillon, P. Ravikumar, and A. Tewari. Learning with noisy labels. In NIPS, volume 26, pages 1196–1204, 2013.
|
| 364 |
+
[73] A. S. Nemirovsky and D. B. Yudin. Problem Complexity and Method Efficiency in Optimization. Wiley, Chichester, 1983.
|
| 365 |
+
[74] D. T. Nguyen, C. K. Mummadi, T. P. N. Ngo, T. H. P. Nguyen, L. Beggel, and T. Brox. Self: Learning to filter noisy labels with self-ensembling. In ICLR, 2019.
|
| 366 |
+
[75] N. Papernot, M. Abadi, U. Erlingsson, I. Goodfellow, and K. Talwar. Semi-supervised knowledge transfer for deep learning from private training data. In ICLR, 2017.
|
| 367 |
+
[76] N. Papernot, S. Song, I. Mironov, A. Raghunathan, K. Talwar, and Ú. Erlingsson. Scalable private learning with PATE. In ICLR, 2018.
|
| 368 |
+
[77] N. Papernot, A. Thakurta, S. Song, S. Chien, and Ú. Erlingsson. Tempered sigmoid activations for deep learning with differential privacy. In AAAI, 2021.
|
| 369 |
+
[78] H. Phan, M. T. Thai, H. Hu, R. Jin, T. Sun, and D. Dou. Scalable differential privacy with certified robustness in adversarial learning. In ICML, pages 7683–7694, 2020.
|
| 370 |
+
[79] G. Pleiss, T. Zhang, E. R. Elenberg, and K. Q. Weinberger. Identifying mislabeled data using the area under the margin ranking. In ICML, 2020.
|
| 371 |
+
[80] C. Radebaugh and U. Erlingsson. Introducing TensorFlow Privacy: Learning with Differential Privacy for Training Data, March 2019. bog.tensorfow.org.
|
| 372 |
+
[81] O. Shamir and T. Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In ICML, page I–71–I–79, 2013.
|
| 373 |
+
[82] S. Shankland. How Google tricks itself to protect Chrome user privacy. CNET, October, 2014.
|
| 374 |
+
[83] R. Shokri and V. Shmatikov. Privacy-preserving deep learning. In CCS, pages 1310–1321, 2015.
|
| 375 |
+
[84] M. T. Smith, M. A. Álvarez, M. Zwiessele, and N. Lawrence. Differentially private regression with Gaussian processes. In AISTATS, 2018.
|
| 376 |
+
[85] M. T. Smith, M. A. Álvarez, and N. Lawrence. Differentially private regression and classification with sparse Gaussian processes. arXiv:1909.09147, 2019.
|
| 377 |
+
[86] H. Song, M. Kim, D. Park, and J.-G. Lee. Prestopping: How does early stopping help generalization against label noise? arXiv:1911.08059, 2019.
|
| 378 |
+
[87] H. Song, M. Kim, D. Park, and J.-G. Lee. Learning from noisy labels with deep neural networks: A survey. arXiv:2007.08199, 2020.
|
| 379 |
+
[88] S. Song, K. Chaudhuri, and A. D. Sarwate. Stochastic gradient descent with differentially private updates. In GlobalSIP, pages 245–248, 2013.
|
| 380 |
+
[89] T. Steinke and J. Ullman. Between pure and approximate differential privacy. J. Priv. Confidentiality, 7(2), 2016.
|
| 381 |
+
[90] P. Subramani, N. Vadivelu, and G. Kamath. Enabling fast differentially private SGD via just-in-time compilation and vectorization. In PPML, 2020.
|
| 382 |
+
[91] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In CVPR, pages 1–9, 2015.
|
| 383 |
+
[92] D. Testuggine and I. Mironov. PyTorch Differential Privacy Series Part 1: DP-SGD Algorithm Explained, August 2020. medium.com.
|
| 384 |
+
[93] F. Tramèr and D. Boneh. Differentially private learning needs better features (or much more data). In ICLR, 2021.
|
| 385 |
+
[94] D. Wang and J. Xu. On sparse linear regression in the local differential privacy model. In ICML, pages 6628–6637, 2019.
|
| 386 |
+
[95] D. Wang, M. Ye, and J. Xu. Differentially private empirical risk minimization revisited: Faster and more general. In NIPS, pages 2719–2728, 2017.
|
| 387 |
+
[96] S. L. Warner. Randomized response: A survey technique for eliminating evasive answer bias. JASA, 60(309):63–69, 1965.
|
| 388 |
+
[97] H. Xiao, K. Rasul, and R. Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. arXiv:1708.07747, 2017.
|
| 389 |
+
[98] L. Yu, L. Liu, C. Pu, M. E. Gursoy, and S. Truex. Differentially private model publishing for deep learning. In S & P, pages 332–349, 2019.
|
| 390 |
+
[99] X. Yu, B. Han, J. Yao, G. Niu, I. W. Tsang, and M. Sugiyama. How does disagreement help generalization against label corruption? In ICML, pages 7164–7173, 2019.
|
| 391 |
+
[100] S. Yuan, M. Shen, I. Mironov, and A. C. Nascimento. Practical, label private deep learning training based on secure multiparty computation and differential privacy. Cryptology ePrint Archive, 2021.
|
| 392 |
+
[101] H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz. Mixup: Beyond empirical risk minimization. In ICLR, 2018.
|
| 393 |
+
[102] J. Zhang, Z. Zhang, X. Xiao, Y. Yang, and M. Winslett. Functional mechanism: regression analysis under differential privacy. VLDB, 5(11):1364–1375, 2012.
|
| 394 |
+
[103] J. Zhang, K. Zheng, W. Mou, and L. Wang. Efficient private ERM for smooth objectives. In IJCAI, pages 3922–3928, 2017.
|
| 395 |
+
[104] Z. Zhang and M. Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In NeurIPS, pages 8778–8788, 2018.
|
| 396 |
+
[105] S. Zheng, P. Wu, A. Goswami, M. Goswami, D. Metaxas, and C. Chen. Error-bounded correction of noisy labels. In ICML, pages 11447–11457, 2020.
|
md/train/Rcmk0xxIQV/Rcmk0xxIQV.md
ADDED
|
@@ -0,0 +1,553 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# QPLEX: DUPLEX DUELING MULTI-AGENTQ-LEARNING
|
| 2 |
+
|
| 3 |
+
Jianhao Wang∗1, Zhizhou $\mathbf { R e n } ^ { * 1 }$ , Terry $\mathbf { L i u ^ { 1 } }$ , Yang $\mathbf { Y u } ^ { 2 }$ , Chongjie Zhang1
|
| 4 |
+
|
| 5 |
+
1Institute for Interdisciplinary Information Sciences, Tsinghua University, China
|
| 6 |
+
2Polixir Technologies, China
|
| 7 |
+
{wjh19, rzz16, liudr18}@mails.tsinghua.edu.cn
|
| 8 |
+
yuy@nju.edu.cn
|
| 9 |
+
chongjie@tsinghua.edu.cn
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
We explore value-based multi-agent reinforcement learning (MARL) in the popular paradigm of centralized training with decentralized execution (CTDE). CTDE has an important concept, Individual-Global-Max (IGM) principle, which requires the consistency between joint and local action selections to support efficient local decision-making. However, in order to achieve scalability, existing MARL methods either limit representation expressiveness of their value function classes or relax the IGM consistency, which may suffer from instability risk or may not perform well in complex domains. This paper presents a novel MARL approach, called duPLEX dueling multi-agent $Q$ -learning (QPLEX), which takes a duplex dueling network architecture to factorize the joint value function. This duplex dueling structure encodes the IGM principle into the neural network architecture and thus enables efficient value function learning. Theoretical analysis shows that QPLEX achieves a complete IGM function class. Empirical experiments on StarCraft II micromanagement tasks demonstrate that QPLEX significantly outperforms stateof-the-art baselines in both online and offline data collection settings, and also reveal that QPLEX achieves high sample efficiency and can benefit from offline datasets without additional online exploration1.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Cooperative multi-agent reinforcement learning (MARL) has broad prospects for addressing many complex real-world problems, such as sensor networks (Zhang & Lesser, 2011), coordination of robot swarms (Hüttenrauch et al., 2017), and autonomous cars (Cao et al., 2012). However, cooperative MARL encounters two major challenges of scalability and partial observability in practical applications. The joint state-action space grows exponentially as the number of agents increases. The partial observability and communication constraints of the environment require each agent to make its individual decisions based on local action-observation histories. To address these challenges, a popular MARL paradigm, called centralized training with decentralized execution (CTDE) (Oliehoek et al., 2008; Kraemer & Banerjee, 2016), has recently attracted great attention, where agents’ policies are trained with access to global information in a centralized way and executed only based on local histories in a decentralized way.
|
| 18 |
+
|
| 19 |
+
Many CTDE learning approaches have been proposed recently, among which value-based MARL algorithms (Sunehag et al., 2018; Rashid et al., 2018; Son et al., 2019; Wang et al., 2019b) have shown state-of-the-art performance on challenging tasks, e.g., unit micromanagement in StarCraft II (Samvelyan et al., 2019). To enable effective CTDE for multi-agent Q-learning, it is critical that the joint greedy action should be equivalent to the collection of individual greedy actions of agents, which is called the IGM (Individual-Global-Max) principle (Son et al., 2019). This IGM principle provides two advantages: 1) ensuring the policy consistency during centralized training (learning the joint Q-function) and decentralized execution (using individual Q-functions) and 2) enabling scalable centralized training of computing one-step TD target of the joint Q-function (deriving joint greedy action selection from individual Q-functions). To realize this principle, VDN (Sunehag et al., 2018) and QMIX (Rashid et al., 2018) propose two sufficient conditions of IGM to factorize the joint action-value function. However, these two decomposition methods suffer from structural constraints and limit the joint action-value function class they can represent. As shown by Wang et al. (2020a), the incompleteness of the joint value function class may lead to poor performance or potential risk of training instability in the offline setting (Levine et al., 2020). Several methods have been proposed to address this structural limitation. QTRAN (Son et al., 2019) constructs two soft regularizations to align the greedy action selections between the joint and individual value functions. WQMIX (Rashid et al., 2020) considers a weighted projection that places more importance on better joint actions. However, due to computational considerations, both their implementations are approximate and based on heuristics, which cannot guarantee the IGM consistency exactly. Therefore, achieving the complete expressiveness of the IGM function class with effective scalability remains an open problem for cooperative MARL.
|
| 20 |
+
|
| 21 |
+
To address this challenge, this paper presents a novel MARL approach, called duPLEX dueling multiagent $Q$ -learning (QPLEX), that takes a duplex dueling network architecture to factorize the joint action-value function into individual action-value functions. QPLEX introduces the dueling structure $Q = V + A$ (Wang et al., 2016) for representing both joint and individual (duplex) action-value functions and then reformalizes the IGM principle as an advantage-based IGM. This reformulation transforms the IGM consistency into the constraints on the value range of the advantage functions and thus facilitates the action-value function learning with linear decomposition structure. Different from QTRAN and WQMIX (Son et al., 2019; Rashid et al., 2020) losing the guarantee of exact IGM consistency due to approximation, QPLEX takes advantage of a duplex dueling architecture to encode it into the neural network structure and provide a guaranteed IGM consistency. To our best knowledge, QPLEX is the first multi-agent Q-learning algorithm that effectively achieves high scalability with a full realization of the IGM principle.
|
| 22 |
+
|
| 23 |
+
We evaluate the performance of QPLEX in both didactic problems proposed by prior work (Son et al., 2019; Wang et al., 2020a) and a range of unit micromanagement benchmark tasks in StarCraft II (Samvelyan et al., 2019). In these didactic problems, QPLEX demonstrates its full representation expressiveness, thereby learning the optimal policy and avoiding the potential risk of training instability. Empirical results on more challenging StarCraft II tasks show that QPLEX significantly outperforms other multi-agent Q-learning baselines in online and offline data collections. It is particularly interesting that QPLEX shows the ability to support offline training, which is not possessed by other baselines. This ability not only provides QPLEX with high stability and sample efficiency but also with opportunities to efficiently utilize multi-source offline data without additional online exploration (Fujimoto et al., 2019; Fu et al., 2020; Levine et al., 2020; Yu et al., 2020).
|
| 24 |
+
|
| 25 |
+
# 2 PRELIMINARIES
|
| 26 |
+
|
| 27 |
+
# 2.1 DECENTRALIZED PARTIALLY OBSERVABLE MDP (DEC-POMDP)
|
| 28 |
+
|
| 29 |
+
We model a fully cooperative multi-agent task as a Dec-POMDP (Oliehoek et al., 2016) defined by a tuple $\mathcal { M } = \langle \mathcal { N } , \mathcal { S } , \mathcal { A } , P , \mathcal { Q } , O , r , \gamma \rangle$ , where $\mathcal { N } \equiv \{ 1 , 2 , \dots , n \}$ is a finite set of agents and $s \in { \mathcal { S } }$ is a finite set of global states. At each time step, every agent $i \in \mathcal N$ chooses an action $a _ { i } \in \mathcal { A } \equiv \{ \mathcal { A } ^ { ( 1 ) } , \dots , \mathcal { A } ^ { ( | \bar { \mathcal { A } } | ) } \}$ on a global state $s$ , which forms a joint action $\pmb { a } \equiv [ a _ { i } ] _ { i = 1 } ^ { n } \in \pmb { A } \equiv \pmb { A } ^ { n }$ It results in a joint reward $r ( s , { \pmb a } )$ and a transition to the next global state $s ^ { \prime } \sim P ( \cdot | s , \pmb { a } ) . \gamma \in [ 0 , 1 )$ is a discount factor. We consider a partially observable setting, where each agent $i$ receives an individual partial observation $o _ { i } \in \varOmega$ according to the observation probability function $O ( o _ { i } | s , a _ { i } )$ . Each agent $i$ has an action-observation history $\bar { \tau } _ { i } \in \mathcal { T } \equiv ( \varOmega \times \mathcal { A } ) ^ { * }$ and constructs its individual policy $\pi _ { i } ( \bar { a } | \tau _ { i } )$ to jointly maximize team performance. We use $\tau \in \mathcal { T } \equiv \mathcal { T } ^ { n }$ to denote joint action-observation history. The formajoint value function is the joint action-v $\begin{array} { r } { V ^ { \mathcal { \bar { \pi } } } ( s ) = \mathbb { E } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } \vert s _ { 0 } = \bar { s , \pi } \right] } \end{array}$ $\pi = \langle \pi _ { 1 } , \ldots , \pi _ { n } \rangle$ that maximizes ast in policy search $Q ^ { \dot { \pi } } ( \bar { s } , \pmb { a } ) = r ( s , \pmb { a } ) + \gamma \mathbb { E } _ { s ^ { \prime } } [ V ^ { \pi } ( s ^ { \prime } ) ]$
|
| 30 |
+
|
| 31 |
+
# 2.2 DEEP MULTI-AGENT Q-LEARNING IN DEC-POMDP
|
| 32 |
+
|
| 33 |
+
Q-learning algorithms is a popular algorithm to find the optimal joint action-value function $Q ^ { * } ( s , \pmb { a } ) \bar { = } r ( \bar { s } , \pmb { a } ) + \gamma \mathbb { E } _ { s ^ { \prime } } [ \bar { \operatorname* { m a x } _ { \pmb { a } ^ { \prime } } } Q ^ { * } ( s ^ { \prime } , \pmb { a } ^ { \prime } ) ] .$ . Deep Q-learning represents the action-value function with a deep neural network parameterized by $\pmb \theta$ . Mutli-agent Q-learning algorithms (Sunehag et al., 2018; Rashid et al., 2018; Son et al., 2019; Yang et al., 2020) use a replay memory $D$ to store the transition tuple $( \tau , a , r , \tau ^ { \prime } )$ , where $r$ is the reward for taking action $\textbf { \em a }$ at joint action-observation history $\tau$ with a transition to $\tau ^ { \prime }$ . Due to partial observability, $Q \left( \tau , a ; \theta \right)$ is used in place of $Q \left( s , \pmb { a } ; \pmb { \theta } \right)$ . Thus, parameters $\pmb \theta$ are learnt by minimizing the following expected TD error:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\mathcal { L } ( \pmb { \theta } ) = \mathbb { E } _ { ( \pmb { \tau } , \mathbf { a } , \mathbf { r } , \pmb { \tau } ^ { \prime } ) \in D } \left[ \left( \boldsymbol { r } + \gamma V \left( \pmb { \tau ^ { \prime } } ; \pmb { \theta } ^ { - } \right) - Q \left( \pmb { \tau } , \mathbf { a } ; \pmb { \theta } \right) \right) ^ { 2 } \right] ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $V \left( \pmb { \tau } ^ { \prime } ; \pmb { \theta } ^ { - } \right) = \operatorname* { m a x } _ { \pmb { a } ^ { \prime } } Q \left( \pmb { \tau } ^ { \prime } , \pmb { a } ^ { \prime } ; \pmb { \theta } ^ { - } \right)$ is the one-step expected future return of the TD target and $\pmb { \theta } ^ { - }$ are the parameters of the target network, which will be periodically updated with $\pmb { \theta }$ .
|
| 40 |
+
|
| 41 |
+
# 2.3 CENTRALIZED TRAINING WITH DECENTRALIZED EXECUTION (CTDE)
|
| 42 |
+
|
| 43 |
+
CTDE is a popular paradigm of cooperative multi-agent deep reinforcement learning (Sunehag et al., 2018; Rashid et al., 2018; Wang et al., 2019a; 2020b;c;d). Agents are trained in a centralized way and granted access to other agents’ information or the global states during the centralized training process. However, due to partial observability and communication constraints, each agent makes its own decision based on its local action-observation history during the decentralized execution phase. IGM (Individual-Global-Max; Son et al., 2019) is a popular principle to realize effective value-based CTDE, which asserts the consistency between joint and local greedy action selections in the joint action-value $Q _ { t o t } ( \tau , a )$ and individual action-values $[ Q _ { i } ( \tau _ { i } , a _ { i } ) ] _ { i = 1 } ^ { n }$ :
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\forall \pmb { \tau } \in \mathcal { T } , \underset { \mathbf { a } \in \mathcal { A } } { \operatorname { a r g m a x } } Q _ { t o t } ( \pmb { \tau } , \mathbf { a } ) = \left( \underset { \mathbf { a } _ { 1 } \in \mathcal { A } } { \operatorname { a r g m a x } } Q _ { 1 } ( \tau _ { 1 } , \mathbf { a } _ { 1 } ) , \dots , \underset { \mathbf { a } _ { n } \in \mathcal { A } } { \operatorname { a r g m a x } } Q _ { n } ( \tau _ { n } , \mathbf { a } _ { n } ) \right) .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
Two factorization structures, additivity and monotonicity, has been proposed by VDN (Suneha et al., 2018) and QMIX (Rashid et al., 2018), respectively, as shown below:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
Q _ { t o t } ^ { \mathrm { V D N } } ( \tau , a ) = \sum _ { i = 1 } ^ { n } Q _ { i } ( \tau _ { i } , a _ { i } ) \quad \mathrm { ~ a n d ~ } \quad \forall i \in \mathcal { N } , \frac { \partial Q _ { t o t } ^ { \mathrm { Q M N } } ( \tau , a ) } { \partial Q _ { i } ( \tau _ { i } , a _ { i } ) } > 0 .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Qatten (Yang et al., 2020) is a variant of VDN, which supplements global information through a multi-head attention structure. It is known that, these structures implement sufficient but not necessary conditions for the IGM constraint, which limit the representation expressiveness of joint action-value functions (Mahajan et al., 2019). There exist tasks whose factorizable joint action-value functions can not be represented by these decomposition methods, as shown in Section 4. In contrast, QTRAN (Son et al., 2019) transforms IGM into a linear constraint and uses it as soft regularization constraints. WQMIX (Rashid et al., 2020) introduces a weighting mechanism into the projection of monotonic value factorization, in order to place more importance on better joint actions. However, these relaxations may violate the exact IGM consistency and may not perform well in complex problems.
|
| 56 |
+
|
| 57 |
+
# 3 QPLEX: DUPLEX DUELING MULTI-AGENT Q-LEARNING
|
| 58 |
+
|
| 59 |
+
In this section, we will first introduce advantage-based IGM, equivalent to the regular IGM principle, and, with this new definition, convert the IGM consistency of greedy action selection to simple constraints on advantage functions. We then present a novel deep MARL model, called duPLEX dueling multi-agent $Q$ -learning algorithm (QPLEX), that directly realizes these constraints by a scalable neural network architecture.
|
| 60 |
+
|
| 61 |
+
# 3.1 ADVANTAGE-BASED IGM
|
| 62 |
+
|
| 63 |
+
To ensure the consistency of greedy action selection on the joint and local action-value functions, the IGM principle constrains the relative order of Q-values over actions. From the perspective of dueling decomposition structure $Q = V + A$ proposed by Dueling DQN (Wang et al., 2016), this consistency should only constrain the action-dependent advantage term $A$ and be free of the state-value function $V$ . This observation naturally motivates us to reformalize the IGM principle as advantage-based IGM, which transforms the consistency constraint onto advantage functions.
|
| 64 |
+
|
| 65 |
+
Definition 1 (Advantage-based IGM). For a joint action-value function $Q _ { t o t }$ : $\pmb { \tau } \times \pmb { A } \mapsto \mathbb { R }$ and individual action-value functions $[ Q _ { i } : \mathcal { T } \times \mathcal { A } \mapsto \mathbb { R } ] _ { i = 1 } ^ { n }$ , where ${ \bf \prime } \in \mathcal { T } , \forall { \bf a } \in \mathcal { \bf A } , \forall i \in \mathcal { N } _ { }$ ,
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 1: (a) The dueling mixing network structure. (b) The overall QPLEX architecture. (c) Agent network structure (bottom) and Transformation network structure (top).
|
| 69 |
+
|
| 70 |
+
such that the following holds
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\underset { a \in \mathcal { A } } { \arg \operatorname* { m a x } } A _ { t o t } ( \tau , a ) = \left( \underset { a _ { 1 } \in \mathcal { A } } { \arg \operatorname* { m a x } } A _ { 1 } ( \tau _ { 1 } , a _ { 1 } ) , \dots , \underset { a _ { n } \in \mathcal { A } } { \arg \operatorname* { m a x } } A _ { n } ( \tau _ { n } , a _ { n } ) \right) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
then, we can say that $[ Q _ { i } ] _ { i = 1 } ^ { n }$ satisfies advantage-based IGM for $Q _ { t o t }$
|
| 77 |
+
|
| 78 |
+
As specified in Definition 1, advantage-based IGM takes a duplex dueling architecture, Joint Dueling and Individual Dueling, which induces the joint and local (duplex) advantage functions by $A = Q - V$ . Compared with regular IGM, advantage-based IGM transfers the consistency constraint on actionvalue functions stated in Eq. (2) to that on advantage functions. This change is an equivalent transformation because the state-value terms $V$ do not affect the action selection, as shown by Proposition 1.
|
| 79 |
+
|
| 80 |
+
Proposition 1. The advantage-based IGM and IGM function classes are equivalent.
|
| 81 |
+
|
| 82 |
+
One key benefit of using advantage-based IGM is that its consistency constraint can be directly realized by limiting the value range of advantage functions, as indicated by the following fact.
|
| 83 |
+
|
| 84 |
+
Fact 1. The constraint of advantage-based IGM stated in Eq. (5) is equivalent to that when $\forall \tau \in \tau$ , $\forall \pmb { a } ^ { * } \in \pmb { A } ^ { * } ( \pmb { \tau } ) , \forall \pmb { a } \in \pmb { A } \backslash \pmb { A } ^ { * } ( \pmb { \tau } ) , \forall i \in \mathcal { I }$ ,
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { c l c r } { { } } & { { A _ { t o t } ( \tau , a ^ { * } ) = A _ { i } ( \tau _ { i } , a _ { i } ^ { * } ) = 0 } } & { { a n d } } & { { A _ { t o t } ( \tau , a ) < 0 , A _ { i } ( \tau _ { i } , a _ { i } ) \leq 0 , } } \\ { { } } & { { } } & { { { \bf 4 } ^ { * } ( \tau ) = \{ a | a \in { \bf \cal A } , Q _ { t o t } ( \tau , a ) = V _ { t o t } ( \tau ) \} . } } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
To achieve a full expressiveness power of advantage-based IGM or IGM, Fact 1 enables us to develop an efficient MARL algorithm that allows the joint state-value function learning with any scalable decomposition structure and just imposes simple constraints limiting value ranges of advantage functions. The next subsection will describe such a MARL algorithm.
|
| 91 |
+
|
| 92 |
+
# 3.2 THE QPLEX ARCHITECTURE
|
| 93 |
+
|
| 94 |
+
In this subsection, we present a novel multi-agent Q-learning algorithm with a duplex dueling architecture, called QPLEX, which exploits Fact 1 and realizes the advantage-based IGM constraint. The overall architecture of QPLEX is illustrated in Figure 1, which consists of two main components as follows: (i) an Individual Action-Value Function for each agent, and (ii) a Duplex Dueling component that composes individual action-value functions into a joint action-value function under the advantage-based IGM constraint. During the centralized training, the whole network is learned in an end-to-end fashion to minimize the TD loss as specified in Eq. (1). During the decentralized execution, the duplex dueling component will be removed, and each agent will select actions using its individual Q-function based on local action-observation history.
|
| 95 |
+
|
| 96 |
+
Individual Action-Value Function is represented by a recurrent Q-network for each agent $i$ , which takes previous hidden state $h _ { i } ^ { t - 1 }$ , current local observations $o _ { i } ^ { t }$ , and previous action $a _ { i } ^ { \tau - 1 }$ as inputs and outputs local $Q _ { i } ( \tau _ { i } , a _ { i } )$ .
|
| 97 |
+
|
| 98 |
+
Duplex Dueling component connects local and joint action-value functions via two modules: (i) a Transformation network module that incorporates the information of global state or joint history into individual action-value functions during the centralized training process, and (ii) a Dueling Mixing network module that composes separate action-value functions from Transformation into a joint action-value function. Duplex Dueling first derives the individual dueling structure for each agent $i$ by computing its value function $\begin{array} { r } { \bar { V _ { i } } ( \tau _ { i } ) = \operatorname* { m a x } _ { a _ { i } } Q _ { i } ( \tau _ { i } , a _ { i } ) } \end{array}$ and its advantage function $A _ { i } ( \tau _ { i } , a _ { i } ) = Q _ { i } ( \tau _ { i } , a _ { i } ) - V _ { i } ( \tau _ { i } )$ , and then computes the joint dueling structure by using individual dueling structures.
|
| 99 |
+
|
| 100 |
+
Transformation network module uses the centralized information to transform local dueling structure $[ V _ { i } ( \tau _ { i } ) , A _ { i } ( \tau _ { i } , a _ { i } ) ] _ { i = 1 } ^ { n }$ to $[ V _ { i } ( \tau ) , A _ { i } ( \tau , a _ { i } ) ] _ { i = 1 } ^ { n }$ conditioned on the joint action-observation history, as shown below, for any agent $i$ , i.e., $\begin{array} { r } { \dot { Q _ { i } } ( \pmb { \tau } , \tilde { a _ { i } } ) = w _ { i } ( \pmb { \tau } ) Q _ { i } ( \tau _ { i } , a _ { i } ) + b _ { i } ( \pmb { \tau } ) } \end{array}$ , thus,
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
V _ { i } ( \tau ) = w _ { i } ( \tau ) V _ { i } ( \tau _ { i } ) + b _ { i } ( \tau ) , \quad \mathrm { a n d } \quad A _ { i } ( \tau , a _ { i } ) = Q _ { i } ( \tau , a _ { i } ) - V _ { i } ( \tau ) = w _ { i } ( \tau ) A _ { i } ( \tau _ { i } , a _ { i } ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $w _ { i } ( \pmb { \tau } ) > 0$ is a positive weight. This positive linear transformation maintains the consistency of the greedy action selection and alleviates partial observability in Dec-POMDP (Son et al., 2019; Yang et al., 2020). As used by QMIX (Rashid et al., 2018), QTRAN (Son et al., 2019), and Qatten (Yang et al., 2020), the centralized information can be the global state $s$ , if available, or the joint action-observation history $\tau$ .
|
| 107 |
+
|
| 108 |
+
Dueling Mixing network module takes the outputs of the transformation network as input, e.g., $[ V _ { i } , A _ { i } ] _ { i = 1 } ^ { n }$ , and produces the values of joint $Q _ { t o t }$ , as shown in Figure 1a. This dueling mixing network uses individual dueling structure transformed by Transformation to compute the joint value $V _ { t o t } ( \tau )$ and the joint advantage $A _ { t o t } ( \tau , a )$ , respectively, and finally outputs $\mathbf { \bar { \phi } } _ { Q _ { t o t } } ( \tau , \bar { a } ) =$ $V _ { t o t } ( \tau ) + A _ { t o t } ( \tau , \pmb { a } )$ by using the joint dueling structure.
|
| 109 |
+
|
| 110 |
+
Based on Fact 1, the advantage-based IGM principle imposes no constraints on value functions. Therefore, to enable efficient learning, we use a simple sum structure to compose the joint value:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
V _ { t o t } ( \tau ) = \sum _ { i = 1 } ^ { n } V _ { i } ( \tau )
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
To enforce the IGM consistency of the joint advantage and individual advantages, as specified by Eq. (6), QPLEX computes the joint advantage function as follows:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
A _ { t o t } ( \pmb { \tau } , \pmb { a } ) = \sum _ { i = 1 } ^ { n } \lambda _ { i } ( \pmb { \tau } , \pmb { a } ) A _ { i } ( \pmb { \tau } , \pmb { a } _ { i } ) , \mathrm { w h e r e } \lambda _ { i } ( \pmb { \tau } , \pmb { a } ) > 0 .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
The joint advantage function $A _ { t o t }$ is the dot product of advantage functions $[ A _ { i } ] _ { i = 1 } ^ { t }$ and positive importance weights $[ \lambda _ { i } ] _ { i = 1 } ^ { n }$ with joint history and action. The positivity induced by $\lambda _ { i }$ will continue to maintain the consistency flow of the greedy action selection and the joint information of $\lambda _ { i }$ provides the full expressiveness power for value factorization. To enable efficient learning of importance weights $\lambda _ { i }$ with joint history and action, QPLEX uses a scalable multi-head attention module (Vaswani et al., 2017):
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\lambda _ { i } ( \pmb { \tau } , \pmb { a } ) = \sum _ { k = 1 } ^ { K } \lambda _ { i , k } ( \pmb { \tau } , \pmb { a } ) \phi _ { i , k } ( \pmb { \tau } ) v _ { k } ( \pmb { \tau } ) ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $K$ is the number of attention heads, $\lambda _ { i , k } ( \tau , a )$ and $\phi _ { i , k } ( \tau )$ are attention weights activated by a sigmoid regularizer, and $v _ { k } ( \tau ) > 0$ is a positive key of each head. This sigmoid activation of $\lambda _ { i }$ brings sparsity to the credit assignment of the joint advantage function to individuals, which enables efficient multi-agent learning (Wang et al., 2019b).
|
| 129 |
+
|
| 130 |
+
With Eq. (8) and (9), the joint action-value function $Q _ { t o t }$ can be reformulated as follows:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
Q _ { t o t } ( \tau , a ) = V _ { t o t } ( \tau ) + A _ { t o t } ( \tau , a ) = \sum _ { i = 1 } ^ { n } Q _ { i } ( \tau , a _ { i } ) + \sum _ { i = 1 } ^ { n } \left( \lambda _ { i } ( \tau , a ) - 1 \right) A _ { i } ( \tau , a _ { i } ) .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
It can be seen that $Q _ { t o t }$ consists of two terms. The first term is the sum of action-value functions $[ Q _ { i } ] _ { i = 1 } ^ { n }$ , which is the joint action-value function $Q _ { t o t } ^ { \mathrm { Q a t t e n } }$ of Qatten (Yang et al., 2020) (which is the $Q _ { t o t }$ of VDN (Sunehag et al., 2018) with global information). The second term corrects for the discrepancy between the centralized joint action-value function and $Q _ { t o t } ^ { \mathrm { Q a t t e n } }$ , which is the main
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan=1 colspan=1>a1a2</td><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>A(3)</td></tr><tr><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>-12</td><td rowspan=1 colspan=1>-12</td></tr><tr><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>-12</td><td rowspan=1 colspan=1>06</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>A3)</td><td rowspan=1 colspan=1>-12</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>6</td></tr></table>
|
| 139 |
+
|
| 140 |
+
(a) Payoff of a harder matrix game
|
| 141 |
+
|
| 142 |
+
Proposition 2. Given the universal function approximation of neural networks, the action-value function class that QPLEX can realize is equivalent to what is induced by the IGM principle.
|
| 143 |
+
|
| 144 |
+
In practice, QPLEX can utilize common neural network structures (e.g., multi-head attention modules) to achieve superior performance by approximating the universal approximation theorem (Csáji et al., 2001). We will discuss the effects of QPLEX’s duplex dueling network with different configurations in Section 4.1. As introduced by Son et al. (2019) and Wang et al. (2020a), the completeness of value factorization is very critical for multi-agent Q-learning and we will illustrate the stability and state-of-the-art performance of QPLEX in online and offline data collections in the next section.
|
| 145 |
+
|
| 146 |
+
# 4 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
In this section, we first study didactic examples proposed by prior work (Son et al., 2019; Wang et al., 2020a) to investigate the effects of QPLEX’s complete IGM expressiveness on learning optimality and stability. To demonstrate scalability on complex MARL domains, we also evaluate the performance of QPLEX on a range of StarCraft II benchmark tasks (Samvelyan et al., 2019). The completeness of the IGM function class can express richer joint action-value function classes induced by large and diverse datasets or training buffers. This expressiveness can provide QPLEX with higher sample efficiency to achieve state-of-the-art performance in online and offline data collections. We compare QPLEX with state-of-the-art baselines: QTRAN (Son et al., 2019), QMIX (Rashid et al., 2018), VDN (Sunehag et al., 2018), Qatten (Yang et al., 2020), and WQMIX (OW-QMIX and CW-QMIX; Rashid et al., 2020). In particular, the second term of Eq. (11) is the main difference between QPLEX and Qatten. Thus, Qatten provides a natural ablation baseline of QPLEX to demonstrate the effectiveness of this discrepancy term. The implementation details of these algorithms and experimental settings are deferred to Appendix B. We also conduct two ablation studies to study the influence of the attention structure of dueling architecture and the number of parameters on QPLEX, which are deferred to be discussed in Appendix E. Towards fair evaluation, all experimental results are illustrated with the median performance and $2 5 - 7 5 \%$ percentiles over 6 random seeds.
|
| 149 |
+
|
| 150 |
+
# 4.1 MATRIX GAMES
|
| 151 |
+
|
| 152 |
+
QTRAN (Son et al., 2019) proposes a hard matrix game, as shown in Table 4a of Appendix C. In this subsection, we consider a harder matrix game in Table 2a, which also describes a simple cooperative multi-agent task with considerable miscoordination penalties, and its local optimum is more difficult to jump out. The optimal joint strategy of these two games is to perform action $\boldsymbol { \mathcal { A } } ^ { ( 1 ) }$ simultaneously. To ensure sufficient data collection in the joint action space, we adopt uniform data distribution. With this fixed dataset, we can study the optimality of multi-agent Q-learning from an optimization perspective, ignoring the challenge of exploration and sample complexity.
|
| 153 |
+
|
| 154 |
+
As shown in Figure 2b, QPLEX, QTRAN, and WQMIX, which possess a richer expressiveness power of value factorization can achieve optimal performance, while other algorithms with limited expressiveness (e.g., QMIX, VDN, and Qatten) fall into a local optimum induced by miscoordination penalties. In the original matrix proposed by QTRAN, QPLEX and QTRAN can also successfully converge to optimal joint action-value functions. These results are deferred to Appendix C. QTRAN achieves superior performance in the matrix games but suffers from its relaxation of IGM consistency in complex domains (such as StarCraft II) shown in Section 4.3.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 3: (a) A special two-state MMDP used to demonstrate the training stability of the multi-agent Q-learning algorithms. $r$ is a shorthand for $r ( s , { \pmb a } )$ . (b) The learning curves of $\| Q _ { t o t } \| _ { \infty }$ in a specific two-state MMDP.
|
| 158 |
+
|
| 159 |
+
In the theoretical analysis of QPLEX, Proposition 2 exploits the universal function approximation of neural networks. QPLEX allows the scalable implementations with various neural network capacities (different layers and heads of attention module) for learning importance weights $\lambda _ { i }$ (see Eq. (9) and (10)). As shown in Figure 2c, by increasing the neural network size for learning $\lambda _ { i }$ (e.g., QPLEX-3L10H), QPLEX possesses more expressiveness of value factorization and converges faster. However, learning efficiency becomes challenging for complex neural networks. To effectively perform StarCraft II tasks ranging from 2 to 27 agents, we use a small multi-head attention module (i.e., QPLEX-1L4H) in complex domains (see Section 4.3). Please refer to Appendix B for more detailed configurations.
|
| 160 |
+
|
| 161 |
+
# 4.2 TWO-STATE MMDP
|
| 162 |
+
|
| 163 |
+
In this subsection, we focus on a Multi-agent Markov Decision Process (MMDP) (Boutilier, 1996) which is a fully cooperative multi-agent setting with full observability. Consider a two-state MMDP proposed by Wang et al. (2020a) with two agents, two actions, and a single reward (see Figure 3a). Two agents start at state $s _ { 2 }$ and explore extrinsic rewards for 100 environment steps. The optimal policy of this MMDP is simply executing the action $\boldsymbol { \mathcal { A } } ^ { ( 1 ) }$ at state $s _ { 2 }$ , which is the only coordination pattern to obtain the positive reward. To approximate the uniform data distribution, we adopt a uniform exploration strategy (i.e., $\epsilon$ -greedy exploration with $\epsilon = 1$ ). We consider the training stability of multi-agent Q-learning algorithms with uniform data distribution in this special MMDP task. As shown in Figure 3b, the joint state-value function $Q _ { t o t }$ learned by baseline algorithms using limited function classes, including QMIX, VDN, and Qatten, will diverge. This instability phenomenon of VDN has been theoretically investigated by Wang et al. (2020a). By utilizing richer function classes, QPLEX, QTRAN, and WQMIX can address this numerical instability issue and converge to the optimal joint state-value function.
|
| 164 |
+
|
| 165 |
+
# 4.3 DECENTRALIZED STARCRAFT II MICROMANAGEMENT BENCHMARK
|
| 166 |
+
|
| 167 |
+
A more challenging set of empirical experiments are based on StarCraft Multi-Agent Challenge (SMAC) benchmark (Samvelyan et al., 2019). We first investigate empirical performance in a popular experimental setting with $\epsilon$ -greedy exploration and a limited first-in-first-out (FIFO) buffer (Samvelyan et al., 2019), named online data collection setting. To demonstrate the offline training potential of QPLEX, we also adopt the offline data collection setting proposed by Levine et al. (2020), which can be granted access to a given dataset without additional online exploration.
|
| 168 |
+
|
| 169 |
+
# 4.3.1 TRAINING WITH ONLINE DATA COLLECTION
|
| 170 |
+
|
| 171 |
+
We evaluate QPLEX in 17 benchmark tasks of StarCraft II, which contains 14 popular tasks proposed by SMAC (Samvelyan et al., 2019) and three new super hard cooperative tasks. To demonstrate the overall performance of each algorithm, Figure 4 plots the averaged median test win rate across all 17 scenarios and the number of scenarios in which the algorithm outperforms, respectively. Figure 4a shows that, compared with other baselines, QPLEX constantly and significantly outperforms baselines over the whole training process and exceeds at least $10 \%$ median test win rate averaged across all 17 scenarios. Moreover, Figure 4b illustrates that, among all 17 tasks, QPLEX is the best performer on up to eight tasks, underperforms on just two tasks, and ties for the best performer on the rest tasks. After $0 . 8 { \bf M }$ timesteps, the number of tasks that QPLEX achieves the best performance gradually decreases to five, because, in several easy tasks, other baselines also reach almost $100 \%$ test win rate as shown in Figure 5. The overall evaluation diagram of the original SMAC benchmark (14 tasks) corresponding to Figure 4 is deferred to Figure 8 in Appendix D.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 4: (a) The median test win $\%$ , averaged across all 17 scenarios. (b) The number of scenarios in which the algorithms’ median test win $\%$ is the highest by at least 1/32 (smoothed).
|
| 175 |
+
|
| 176 |
+
Figure 5 shows the learning curves on nine tasks in the online data collection setting and the results of other eight maps are deferred to Figure 7 in Appendix D. From Figure 5, we can observe that QPLEX significantly outperforms other baselines with higher sample efficiency. On the super hard map $5 \mathrm { s } 1 0 \mathrm { z }$ , the performance gap between QPLEX and other baselines exceeds $30 \%$ in test win rate, and the visualized strategies of QPLEX and QMIX in this map are deferred to Appendix F. Most multi-agent Q-learning baselines including QMIX, VDN, and Qatten achieve reasonable performance (see Figure 5). However, as Figure 4 suggests, QTRAN performs the worst in these comparative experiments, even though it performs well in the didactic games. From a theoretical perspective, the online data collection process utilizes an $\epsilon$ -greedy exploration process, which requires individual greedy action selections to build an effective training buffer. QTRAN may suffer from its relaxation of IGM consistency (soft constraints of IGM) in the online data collection phase, while the duplex dueling architecture of QPLEX (hard constraint of IGM) provides effective individual greedy action selections, making it suitable for data collection with $\epsilon$ -greedy exploration.
|
| 177 |
+
|
| 178 |
+
Moreover, although WQMIX (OW-QMIX and CW-QMIX) outperforms QMIX in some tasks (illustrated in Figure 5, e.g., 2c_vs_ $6 4 \mathrm { z g }$ and bane_vs_bane), WQMIX show very similar overall performance as QMIX across 17 StarCraft II benchmark tasks. In contrast, QPLEX achieves significant improvement in convergence performance in a lot of hard and super hard maps and demonstrates high sample efficiency across most scenarios (see Figure 5).
|
| 179 |
+
|
| 180 |
+
# 4.3.2 TRAINING WITH OFFLINE DATA COLLECTION
|
| 181 |
+
|
| 182 |
+
Recently, offline reinforcement learning has been regarded as a key step for real-world RL applications (Dulac-Arnold et al., 2019; Levine et al., 2020). Agarwal et al. (2020) presents an optimistic perspective of offline Q-learning that DQN and its variants can achieve superior performance in Atari 2600 games (Bellemare et al., 2013) with sufficiently large and diverse datasets. In MARL, StarCraft II benchmark has the same discrete action space as Atari. We conduct a lot of experiments on the StarCraft II benchmark tasks to study offline multi-agent Q-learning in this subsection. We adopt a large and diverse dataset to make the expressiveness power of value factorization become the dominant factor to investigate. We train a behavior policy of QMIX and collect all its experienced transitions throughout the training process (see the details in Appendix C). As shown in Figure 13 in Appendix G, QPLEX significantly outperforms other multi-agent Q-learning baselines and possesses the state-of-the-art value factorization structure for offline multi-agent Q-learning. QMIX and Qatten cannot always maintain stable learning performance, and VDN suffers from offline data collection and leads to weak empirical results. QTRAN may perform well in certain cases when its soft constraints, two $\ell _ { 2 }$ -penalty terms, are well minimized. With offline data collection, individual greedy action selections do not need to build a training buffer, but they still need to compute the one-step TD target for centralized training. Therefore, compared with QTRAN, QPLEX still has theoretical advantages regarding the IGM principle in the offline data collection setting.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 5: Learning curves of StarCraft II with online data collection.
|
| 186 |
+
|
| 187 |
+
# 5 CONCLUSION
|
| 188 |
+
|
| 189 |
+
In this paper, we introduced QPLEX, a novel multi-agent Q-learning framework that allows centralized end-to-end training and learns to factorize a joint action-value function to enable decentralized execution. QPLEX takes advantage of a duplex dueling architecture that efficiently encodes the IGM consistency constraint on joint and individual greedy action selections. Our theoretical analysis shows that QPLEX achieves a complete IGM function class. Empirical results demonstrate that it significantly outperforms state-of-the-art baselines in both online and offline data collection settings. In particular, QPLEX possesses strong ability of supporting offline training. This ability provides QPLEX with high sample efficiency and opportunities of utilizing offline multi-source datasets. It will be an interesting and valuable direction to study offline multi-agent reinforcement learning in continuous action spaces (such as MuJoCo (Todorov et al., 2012)) with QPLEX’s value factorization.
|
| 190 |
+
|
| 191 |
+
# ACKNOWLEDGEMENTS
|
| 192 |
+
|
| 193 |
+
We would like to thank the anonymous reviewers for their insightful comments and helpful suggestions. This work is supported in part by Science and Technology Innovation 2030 – “New Generation Artificial Intelligence” Major Project (No. 2018AAA0100904), and a grant from the Institute of Guo Qiang, Tsinghua University.
|
| 194 |
+
|
| 195 |
+
# REFERENCES
|
| 196 |
+
|
| 197 |
+
Rishabh Agarwal, Dale Schuurmans, and Mohammad Norouzi. An optimistic perspective on offline reinforcement learning. In International Conference on Machine Learning, 2020.
|
| 198 |
+
|
| 199 |
+
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.
|
| 200 |
+
|
| 201 |
+
Craig Boutilier. Planning, learning and coordination in multiagent decision processes. In Proceedings of the 6th Conference on Theoretical Aspects of Rationality and Knowledge, pp. 195–210. Morgan Kaufmann Publishers Inc., 1996.
|
| 202 |
+
|
| 203 |
+
Yongcan Cao, Wenwu Yu, Wei Ren, and Guanrong Chen. An overview of recent progress in the study of distributed multi-agent coordination. IEEE Transactions on Industrial Informatics, 9(1): 427–438, 2012.
|
| 204 |
+
|
| 205 |
+
Balázs Csanád Csáji et al. Approximation with artificial neural networks. Faculty of Sciences, Etvs Lornd University, Hungary, 24(48):7, 2001.
|
| 206 |
+
|
| 207 |
+
Gabriel Dulac-Arnold, Daniel Mankowitz, and Todd Hester. Challenges of real-world reinforcement learning. arXiv preprint arXiv:1904.12901, 2019.
|
| 208 |
+
|
| 209 |
+
Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020.
|
| 210 |
+
|
| 211 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pp. 2052–2062, 2019.
|
| 212 |
+
|
| 213 |
+
Maximilian Hüttenrauch, Adrian Šošic, and Gerhard Neumann. Guided deep reinforcement learning ´ for swarm systems. arXiv preprint arXiv:1709.06011, 2017.
|
| 214 |
+
|
| 215 |
+
Landon Kraemer and Bikramjit Banerjee. Multi-agent reinforcement learning as a rehearsal for decentralized planning. Neurocomputing, 190:82–94, 2016.
|
| 216 |
+
|
| 217 |
+
Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
|
| 218 |
+
|
| 219 |
+
Anuj Mahajan, Tabish Rashid, Mikayel Samvelyan, and Shimon Whiteson. Maven: Multi-agent variational exploration. In Advances in Neural Information Processing Systems, pp. 7611–7622, 2019.
|
| 220 |
+
|
| 221 |
+
Frans A Oliehoek, Matthijs TJ Spaan, and Nikos Vlassis. Optimal and approximate q-value functions for decentralized pomdps. Journal of Artificial Intelligence Research, 32:289–353, 2008.
|
| 222 |
+
|
| 223 |
+
Frans A Oliehoek, Christopher Amato, et al. A concise introduction to decentralized POMDPs, volume 1. Springer, 2016.
|
| 224 |
+
|
| 225 |
+
Tabish Rashid, Mikayel Samvelyan, Christian Schroeder Witt, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. Qmix: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 4292–4301, 2018.
|
| 226 |
+
|
| 227 |
+
Tabish Rashid, Gregory Farquhar, Bei Peng, and Shimon Whiteson. Weighted qmix: Expanding monotonic value function factorisation for deep multi-agent reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020.
|
| 228 |
+
|
| 229 |
+
Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Philip HS Torr, Jakob Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, pp. 2186–2188. International Foundation for Autonomous Agents and Multiagent Systems, 2019.
|
| 230 |
+
|
| 231 |
+
Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 5887–5896, 2019.
|
| 232 |
+
|
| 233 |
+
Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Value-decomposition networks for cooperative multi-agent learning based on team reward. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pp. 2085–2087, 2018.
|
| 234 |
+
|
| 235 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 236 |
+
|
| 237 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
|
| 238 |
+
|
| 239 |
+
Jianhao Wang, Zhizhou Ren, Beining Han, and Chongjie Zhang. Towards understanding linear value decomposition in cooperative multi-agent q-learning. arXiv preprint arXiv:2006.00587, 2020a.
|
| 240 |
+
|
| 241 |
+
Tonghan Wang, Jianhao Wang, Yi Wu, and Chongjie Zhang. Influence-based multi-agent exploration. arXiv preprint arXiv:1910.05512, 2019a.
|
| 242 |
+
|
| 243 |
+
Tonghan Wang, Jianhao Wang, Chongyi Zheng, and Chongjie Zhang. Learning nearly decomposable value functions via communication minimization. arXiv preprint arXiv:1910.05366, 2019b.
|
| 244 |
+
|
| 245 |
+
Tonghan Wang, Heng Dong, Victor Lesser, and Chongjie Zhang. Multi-agent reinforcement learning with emergent roles. arXiv preprint arXiv:2003.08039, 2020b.
|
| 246 |
+
|
| 247 |
+
Tonghan Wang, Tarun Gupta, Anuj Mahajan, Bei Peng, Shimon Whiteson, and Chongjie Zhang. Rode: Learning roles to decompose multi-agent tasks. arXiv preprint arXiv:2010.01523, 2020c.
|
| 248 |
+
|
| 249 |
+
Yihan Wang, Beining Han, Tonghan Wang, Heng Dong, and Chongjie Zhang. Off-policy multi-agent decomposed policy gradients. arXiv preprint arXiv:2007.12322, 2020d.
|
| 250 |
+
|
| 251 |
+
Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Hasselt, Marc Lanctot, and Nando Freitas. Dueling network architectures for deep reinforcement learning. In International Conference on Machine Learning, pp. 1995–2003, 2016.
|
| 252 |
+
|
| 253 |
+
Yaodong Yang, Jianye Hao, Ben Liao, Kun Shao, Guangyong Chen, Wulong Liu, and Hongyao Tang. Qatten: A general framework for cooperative multiagent reinforcement learning. arXiv preprint arXiv:2002.03939, 2020.
|
| 254 |
+
|
| 255 |
+
Tianhe Yu, Garrett Thomas, Lantao Yu, Stefano Ermon, James Zou, Sergey Levine, Chelsea Finn, and Tengyu Ma. Mopo: Model-based offline policy optimization. arXiv preprint arXiv:2005.13239, 2020.
|
| 256 |
+
|
| 257 |
+
Chongjie Zhang and Victor Lesser. Coordinated multi-agent reinforcement learning in networked distributed pomdps. In Twenty-Fifth AAAI Conference on Artificial Intelligence, 2011.
|
| 258 |
+
|
| 259 |
+
# A OMITTED PROOFS IN SECTION 3
|
| 260 |
+
|
| 261 |
+
Definition 1 (Advantage-based IGM). For a joint action-value function $Q _ { t o t }$ : $\pmb { \tau } \times \pmb { A } \mapsto \mathbb { R }$ and individual action-value functions $[ Q _ { i } : \mathcal { T } \times \mathcal { A } \mapsto \mathbb { R } ] _ { i = 1 } ^ { n }$ , where $\forall \tau \in \tau$ , $\forall a \in A$ , $\forall i \in \mathcal N$ ,
|
| 262 |
+
|
| 263 |
+
such that the following holds
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
\underset { a \in \mathcal { A } } { \arg \operatorname* { m a x } } A _ { t o t } ( \tau , a ) = \left( \underset { a _ { 1 } \in \mathcal { A } } { \arg \operatorname* { m a x } } A _ { 1 } ( \tau _ { 1 } , a _ { 1 } ) , \dots , \underset { a _ { n } \in \mathcal { A } } { \arg \operatorname* { m a x } } A _ { n } ( \tau _ { n } , a _ { n } ) \right) ,
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
then, we can say that $[ Q _ { i } ] _ { i = 1 } ^ { n }$ satisfies advantage-based IGM for $Q _ { t o t }$ .
|
| 270 |
+
|
| 271 |
+
Let the action-value function class derived from IGM is denoted by
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
\begin{array} { r } { \widetilde { \mathcal { Q } } = \left\{ \left( \widetilde { Q } _ { t o t } \in \mathbb { R } ^ { | \mathcal { T } | | A | ^ { n } } , \left[ \widetilde { Q } _ { i } \in \mathbb { R } ^ { | \mathcal { T } | | A | } \right] _ { i = 1 } ^ { n } \right) \Big | \mathrm { E q . ~ ( 2 ) ~ i s ~ s a t i s f i e d } \right\} , } \end{array}
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
where $\widetilde { Q } _ { t o t }$ and $\left[ \widetilde { Q } _ { i } \right] _ { i = 1 } ^ { n }$ denote the joint and individual action-value functions induced by IGM, respectively. Similarly, let
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
\begin{array} { r } { \widehat { \mathcal { Q } } = \left\{ \left( \widehat { Q } _ { t o t } \in \mathbb R ^ { | T | | A | ^ { n } } , \left[ \widehat { Q } _ { i } \in \mathbb R ^ { | T | | A | } \right] _ { i = 1 } ^ { n } \right) \Big | \operatorname { E q . } \left( 3 \right) , ( 4 ) , ( 5 ) \mathrm { ~ a r e ~ s a t i s f i e d } \right\} } \end{array}
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
denote the action-value function class derived from advantage-based IGM. $\widetilde { V } _ { t o t }$ and $\widetilde { A } _ { t o t }$ denote the joint state-value and advantage functions, respectively. $\left[ \widetilde { V } _ { i } \right] _ { i = 1 } ^ { n }$ and $\left[ \widetilde { A } _ { i } \right] _ { i = 1 } ^ { n }$ denote the individual state-value and advantage functions induced by advantage-IGM, respectively. According to the duplex dueling architecture $Q = V + A$ stated in advantage-based IGM (see Definition 1), we derive the joint and individual action-value functions as following: $\forall \pmb { \tau } \in \mathcal { T } , \forall \pmb { a } \in \pmb { A } , \forall i \in \mathcal { N }$ ,
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
\widehat { Q } _ { t o t } ( \tau , \boldsymbol { a } ) = \widehat { V } _ { t o t } ( \tau ) + \widehat { A } _ { t o t } ( \tau , \boldsymbol { a } ) \quad \mathrm { a n d } \quad \widehat { Q } _ { i } ( \tau _ { i } , \boldsymbol { a } _ { i } ) = \widehat { V } _ { i } ( \tau _ { i } ) + \widehat { A } _ { i } ( \tau _ { i } , \boldsymbol { a } _ { i } ) .
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
roposition 1. The advantage-based IGM and IGM function classes are equivalent.
|
| 290 |
+
|
| 291 |
+
Proof. We will prove $\widetilde { \mathcal { Q } } \equiv \widehat { \mathcal { Q } }$ in the following two directions.
|
| 292 |
+
|
| 293 |
+
$\widetilde { \mathcal { Q } } \subseteq \widehat { \mathcal { Q } }$ For any $\left( \widetilde { Q } _ { t o t } , \left[ \widetilde { Q } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \widetilde { \mathcal { Q } }$ , we construct $\widehat { Q } _ { t o t } = \widetilde { Q } _ { t o t }$ and $\left[ \widehat { Q } _ { i } \right] _ { i = 1 } ^ { n } = \left[ \widetilde { Q } _ { i } \right] _ { i = 1 } ^ { n }$ . The joint and individual state-value/advantage functions induced by advantage-IGM
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\begin{array} { r l } { \widehat { V } _ { t o t } ( \tau ) = \displaystyle \operatorname* { m a x } _ { a ^ { \prime } } \widehat { Q } _ { t o t } ( \tau , a ^ { \prime } ) \quad \mathrm { a n d } \quad \widehat { A } _ { t o t } ( \tau , a ) = \widehat { Q } _ { t o t } ( \tau , a ) - \widehat { V } _ { t o t } ( \tau ) , } & { } \\ { \widehat { V } _ { i } ( \tau _ { i } ) = \displaystyle \operatorname* { m a x } _ { a _ { i } ^ { \prime } } \widehat { Q } _ { i } ( \tau _ { i } , a _ { i } ^ { \prime } ) \quad \mathrm { a n d } \quad \widehat { A } _ { i } ( \tau _ { i } , a _ { i } ) = \widehat { Q } _ { i } ( \tau _ { i } , a _ { i } ^ { \prime } ) - \widehat { V } _ { i } ( \tau _ { i } ) , \quad \forall i \in \mathcal { N } , } & { } \end{array}
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
are derived by Eq. (3) and Eq. (4), respectively. Because state-value functions do not affect the greedy action selection, $\forall \pmb { \tau } \in \pmb { \mathcal { T } } , \forall \pmb { a } \in \pmb { \mathcal { A } }$ ,
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\begin{array} { r l } & { \quad \underset { a \in \mathcal { A } } { \mathrm { a r g } } \underset { \bar { Q } \ t o t } { \mathrm { m a x } } \left( \tau , a \right) = \left( \underset { a _ { 1 } \in A } { \mathrm { a r g } } \underset { \bar { Q } _ { 1 } } { \mathrm { m a x } } \widehat { Q } _ { 1 } ( \tau _ { 1 } , a _ { 1 } ) , \dots , \underset { a _ { n } \in A } { \mathrm { a r g } } \underset { \bar { Q } _ { n } } { \mathrm { m a x } } \widehat { Q } _ { n } ( \tau _ { n } , a _ { n } ) \right) } \\ & { \Rightarrow \underset { a \in \mathcal { A } } { \mathrm { a r g } } \underset { \bar { Q } \ t o t } { \mathrm { m a x } } ( \tau , a ) = \left( \underset { a _ { 1 } \in A } { \mathrm { a r g } } \underset { \bar { Q } _ { 1 } } { \mathrm { m a x } } \widehat { Q } _ { 1 } ( \tau _ { 1 } , a _ { 1 } ) , \dots , \underset { a _ { n } \in A } { \mathrm { a r g } } \underset { \bar { Q } _ { n } \in A } { \mathrm { m a x } } \widehat { Q } _ { n } ( \tau _ { n } , a _ { n } ) \right) } \\ & { \Rightarrow \underset { a \in \mathcal { A } } { \mathrm { a r g } } \underset { \bar { Q } \ t o t } { \mathrm { m a x } } \left( \widehat { Q } _ { t o t } ( \tau , a ) - \widehat { V } _ { t o t } ( \tau ) \right) = } \\ & { \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 \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 \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 \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 \quad \quad \quad \quad \quad \quad \quad \ \end{array}
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
Thus, $\left( \widehat { Q } _ { t o t } , \left[ \widehat { Q } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \widehat { \mathcal { Q } }$ , which means that $\widetilde { \mathcal { Q } } \subseteq \widehat { \mathcal { Q } }$
|
| 306 |
+
|
| 307 |
+
$\widehat { \mathfrak { Q } } \subseteq \widetilde { \mathfrak { Q } }$ We will prove this direction in the same way. For any $\left( \widehat { Q } _ { t o t } , \left[ \widehat { Q } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \widehat { \mathcal { Q } }$ , we construct $\widetilde { Q } _ { t o t } = \widehat { Q } _ { t o t }$ and $\left[ \widetilde { Q } _ { i } \right] _ { i = 1 } ^ { n } = \left[ \widehat { Q } _ { i } \right] _ { i = 1 } ^ { n }$ . Because state-value functions do not affect the greedy action selection, $\forall \tau \in \tau$ , $\forall a \in A$ ,
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
\begin{array} { r l } & { \quad \underset { a \in A } { \mathrm { a r g ~ m a x ~ } } \widehat { A } _ { t o t } ( \tau , a ) = \left( \underset { a _ { 1 } \in A } { \mathrm { a r g ~ m a x ~ } } \widehat { A } _ { 1 } ( \tau _ { 1 } , a _ { 1 } ) , \dots , \underset { a _ { n } \in A } { \mathrm { a r g ~ m a x ~ } } \widehat { A } _ { n } ( \tau _ { n } , a _ { n } ) \right) } \\ & { \Rightarrow \underset { a \in A } { \mathrm { a r g ~ m a x ~ } } \left( \widehat { A } _ { t o t } ( \tau , a ) + \widehat { V } _ { t o t } ( \tau ) \right) = } \\ & { \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 \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 \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 \quad \quad \quad \quad \quad } \\ & { \Rightarrow \underset { a \in A } { \mathrm { a r g ~ m a x ~ } } \widehat { A } _ { t o t } ( \tau , a ) = \left( \underset { a _ { 1 } \in A } { \mathrm { a r g ~ m a x ~ } } \widehat { Q } _ { 1 } ( \tau _ { 1 } , a _ { 1 } ) , \dots , \underset { a _ { n } \in A } { \mathrm { a r g ~ m a x ~ } } \widehat { Q } _ { n } ( \tau _ { n } , a _ { n } ) \right) } \\ & { \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 \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 \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & \quad \quad \quad \quad \quad \end{array}
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
Thus, $\left( \widetilde { Q } _ { t o t } , \left[ \widetilde { Q } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \widetilde { \mathcal { Q } } _ { }$ , which means that $\widehat { \mathfrak { Q } } \subseteq \widetilde { \mathfrak { Q } }$ . The action-value function classes derived from advantage-based IGM and IGM are equivalent.
|
| 314 |
+
|
| 315 |
+
Fact 1. The constraint of advantage-based IGM stated in Eq. (5) is equivalent to that when $\forall \tau \in \tau$ , $\forall \pmb { a } ^ { * } \in \pmb { A } ^ { * } ( \pmb { \tau } ) , \forall \pmb { a } \in \pmb { A } \backslash \pmb { A } ^ { * } ( \pmb { \tau } ) , \forall i \in \mathcal { N } ,$
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { c l c r } { { } } & { { A _ { t o t } ( \tau , a ^ { * } ) = A _ { i } ( \tau _ { i } , a _ { i } ^ { * } ) = 0 } } & { { a n d } } & { { A _ { t o t } ( \tau , a ) < 0 , A _ { i } ( \tau _ { i } , a _ { i } ) \leq 0 , } } \\ { { } } & { { } } & { { \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } } } \\ { { } } & { { \mathrm { } } } & \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm { } \mathrm \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
Proof. We derive that $\forall \tau \in \tau$ , $\forall a \in A$ , $\forall i \in \mathcal N$ , $\widehat { A } _ { t o t } ( \pmb { \tau } , \pmb { a } ) \leq 0$ and $\widehat { A } _ { i } ( \tau _ { i } , a _ { i } ) \leq 0$ from Eq. (3) and Eq. (4) of Definition 1, respectively. According to the definition of arg max operator, Eq. (3), and Eq. (4), $\forall \tau \in \tau$ , let $\hat { \boldsymbol { A } } ^ { * } ( \tau )$ denote arg $\operatorname* { m a x } _ { \substack { \mathbf { a } \in \mathcal { A } } } \widehat { A } _ { t o t } ( \tau , \mathbf { a } )$ as follows:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { r l } & { \hat { \boldsymbol { \mathcal { A } } } ^ { * } ( \tau ) = \underset { a \in \boldsymbol { \mathcal { A } } } { \mathrm { a r g } \mathrm { m a x } } \ \widehat { \boldsymbol { A } } _ { t o t } ( \tau , a ) = \underset { a \in \boldsymbol { \mathcal { A } } } { \mathrm { a r g } \mathrm { m a x } } \ \widehat { \boldsymbol { Q } } _ { t o t } ( \tau , a ) } \\ & { \quad \quad \quad = \left. a | a \in \boldsymbol { \mathcal { A } } , \widehat { \boldsymbol { Q } } _ { t o t } ( \tau , a ) = \widehat { V } _ { t o t } ( \tau ) \right. } \\ & { \quad \quad \quad = \left. a | a \in \boldsymbol { \mathcal { A } } , \widehat { \boldsymbol { Q } } _ { t o t } ( \tau , a ) - \widehat { V } _ { t o t } ( \tau ) = 0 \right. } \\ & { \quad \quad \quad = \left. a | a \in \boldsymbol { \mathcal { A } } , \widehat { \boldsymbol { A } } _ { t o t } ( \tau , a ) = 0 \right. . } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
Similarly, $\forall \pmb { \tau } \in \pmb { \mathcal { T } } , \forall i \in \mathcal { N }$ , let $\widehat { A } _ { i } ^ { * } ( \tau _ { i } )$ denote a $\operatorname { r g m a x } _ { a _ { i } \in A } \widehat { A } _ { i } ( \tau _ { i } , a _ { i } )$ as follows:
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\begin{array} { r l } & { \widehat { A } _ { i } ^ { * } ( \tau _ { i } ) = \underset { a _ { i } \in \cal { A } } { \arg \operatorname* { m a x } } \widehat { A } _ { i } ( \tau _ { i } , a _ { i } ) = \underset { a _ { i } \in \cal { A } } { \arg \operatorname* { m a x } } \widehat { Q } _ { i } ( \tau _ { i } , a _ { i } ) } \\ & { \quad \quad \quad = \left\{ a _ { i } | a _ { i } \in \cal { A } , \widehat { Q } _ { i } ( \tau _ { i } , a _ { i } ) = \widehat { V } _ { i } ( \tau _ { i } ) \right\} } \\ & { \quad \quad \quad = \left\{ a _ { i } | a _ { i } \in \cal { A } , \widehat { A } _ { i } ( \tau _ { i } , a _ { i } ) = 0 \right\} . } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
Thus, $\forall \pmb { \tau } \in \pmb { \mathcal { T } } , \forall \pmb { a } ^ { * } \in \widehat { \pmb { \mathcal { A } } } ^ { * } ( \pmb { \tau } ) , \forall \pmb { a } \in \pmb { \mathcal { A } } \backslash \widehat { \pmb { A } } ^ { * } ( \pmb { \tau } ) .$ ,
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
\widehat { A } _ { t o t } ( \tau , a ^ { * } ) = 0 \quad \mathrm { a n d } \quad \widehat { A } _ { t o t } ( \tau , a ) < 0 ;
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\forall \pmb { \tau } \in \pmb { \mathcal { T } } , \forall i \in \mathcal { N } , \forall a _ { i } ^ { * } \in \widehat { \mathcal { A } } ^ { * } ( \tau _ { i } ) , \forall a _ { i } \in \mathcal { A } \backslash \widehat { \mathcal { A } } ^ { * } ( \tau _ { i } ) ,
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\widehat { A } _ { i } ( \tau _ { i } , a _ { i } ^ { * } ) = 0 \quad \mathrm { a n d } \quad \widehat { A } _ { i } ( \tau _ { i } , a _ { i } ) < 0 .
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Recall the constraint stated in Eq. (5), $\forall \tau \in \tau$ ,
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\underset { a \in \mathcal { A } } { \arg \operatorname* { m a x } } \ \widehat { A } _ { t o t } ( \tau , a ) = \left( \underset { a _ { 1 } \in \mathcal { A } } { \arg \operatorname* { m a x } } \widehat { A } _ { 1 } ( \tau _ { 1 } , a _ { 1 } ) , \dots , \underset { a _ { n } \in \mathcal { A } } { \arg \operatorname* { m a x } } \widehat { A } _ { n } ( \tau _ { n } , a _ { n } ) \right) .
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
We can rewrite the constraint of advantage-based IGM stated in Eq. (5) as $\forall \tau \in \tau$ ,
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\begin{array} { r } { \widehat { \pmb { \mathscr { A } } } ^ { * } ( \pmb { \tau } ) = \left\{ \langle a _ { 1 } , \ldots , a _ { n } \rangle \big | a _ { i } \in \widehat { \mathscr { A } } _ { i } ^ { * } ( \tau _ { i } ) , \forall i \in \mathcal { N } \right\} . } \end{array}
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
Therefore, combining Eq. (14), Eq. (15), and Eq. (16), we can derive $\forall \tau \in \tau$ , $\forall a ^ { * } \in \widehat { \pmb { A } } ^ { * } ( \tau )$ , $\forall \pmb { a } \in \pmb { A } \ \backslash \ \hat { \pmb { A } } ^ { * } ( \pmb { \tau } ) , \forall i \in \mathcal { N } ,$ ,
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\widehat { A } _ { t o t } ( \pmb { \tau } , \pmb { a } ^ { * } ) = \widehat { A } _ { i } ( \tau _ { i } , \pmb { a } _ { i } ^ { * } ) = 0 \quad \mathrm { a n d } \quad \widehat { A } _ { t o t } ( \pmb { \tau } , \pmb { a } ) < 0 , \widehat { A } _ { i } ( \tau _ { i } , \pmb { a } _ { i } ) \leq 0 .
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
In another way, combining Eq. (14), Eq. (15), and Eq. (17), we can derive Eq. (16) by the definition of $\hat { \boldsymbol { A } } ^ { * }$ and $\left[ \stackrel { \cdot } { \mathcal { A } } ^ { * } \right] _ { i = 1 } ^ { n }$ (see Eq. (12) and Eq. (13)). In more detail, the closed set property of Cartesian product of $\left[ a _ { i } ^ { * } \right] _ { i = 1 } ^ { n }$ 1 has been encoded into the Eq. (16) and Eq. (17) simultaneously. □
|
| 366 |
+
|
| 367 |
+
Proposition 2. Given the universal function approximation of neural networks, the action-value function class that QPLEX can realize is equivalent to what is induced by the IGM principle.
|
| 368 |
+
|
| 369 |
+
Proof. We assume that the neural network of QPLEX can be large enough to achieve the universal function approximation by corresponding theorem (Csáji et al., 2001). Let the action-value function class that QPLEX can realize is denoted by
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\overline { { \mathscr { Q } } } = \left\{ \left( \overline { { Q } } _ { t o t } \in \mathbb R ^ { | T | | \mathcal { A } | ^ { n } } , \left[ \overline { { Q } } _ { i } \in \mathbb R ^ { | T | | \mathcal { A } | } \right] _ { i = 1 } ^ { n } \right) \Big | \mathrm { E q . } \left( 7 \right) , ( 8 ) , ( 9 ) , ( 1 0 ) , ( 1 1 ) \mathrm { ~ a r e ~ s a t i s f i e d } \right\} .
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
In addition, $\overline { { Q } } _ { t o t }$ , $\overline { { V } } _ { t o t }$ , $\overline { { A } } _ { t o t }$ , $\left[ \overline { { Q } } _ { i } ^ { \prime } \right] _ { i = 1 } ^ { n } , \left[ \overline { { V } } _ { i } ^ { \prime } \right] _ { i = 1 } ^ { n } , \left[ \overline { { A } } _ { i } ^ { \prime } \right] _ { i = 1 } ^ { n } , \left[ \overline { { Q } } _ { i } \right] _ { i = 1 } ^ { n } , \left[ \overline { { V } } _ { i } \right] _ { i = 1 } ^ { n } :$ and $\textstyle \left[ { \overline { { A } } } _ { i } \right] _ { i = 1 } ^ { n }$ denote the corresponding (joint, transformed, and individual) (action-value, state-value, and advantage) functions, respectively. In the implementation of QPLEX, we ensure the positivity of important weights of Transformation and joint advantage function, $\left[ w _ { i } \right] _ { i = 1 } ^ { n }$ and $[ \lambda _ { i } ] _ { i = 1 } ^ { n }$ , which maintains the greedy action selection flow and rules out these non-interesting points (zeros) on optimization. We will prove $\widehat { \mathcal { Q } } \equiv \overline { { \mathcal { Q } } }$ in the following two directions.
|
| 376 |
+
|
| 377 |
+
$\widehat { \mathcal { Q } } \subseteq \overline { { \mathcal { Q } } }$ For any $\left( \widehat { Q } _ { t o t } , \left[ \widehat { Q } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \widehat { \mathcal { Q } }$ , we construct $\overline { { Q } } _ { t o t } = \widehat { Q } _ { t o t }$ and $\left[ \overline { { { Q } } } _ { i } \right] _ { i = 1 } ^ { n } = \left[ \widehat { Q } _ { i } \right] _ { i = 1 } ^ { n }$ and derive $\overline { { V } } _ { t o t }$ , $\overline { { A } } _ { t o t }$ , $\left[ \overline { { V } } _ { i } \right] _ { i = 1 } ^ { n }$ i=1, and $\left[ \overline { { A } } _ { i } \right] _ { i = 1 } ^ { n }$ i=1by Eq.(3) and Eq. (4), respectively. Note that in the
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
V _ { i } ( \pmb { \tau } ) = w _ { i } ( \pmb { \tau } ) V _ { i } ( \tau _ { i } ) + b _ { i } ( \pmb { \tau } ) \quad \mathrm { a n d } \quad A _ { i } ( \pmb { \tau } , a _ { i } ) = w _ { i } ( \pmb { \tau } ) A _ { i } ( \tau _ { i } , a _ { i } )
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
and
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
Q _ { t o t } ( \tau , a ) = V _ { t o t } ( \tau ) + A _ { t o t } ( \tau , a ) = \sum _ { i = 1 } ^ { n } V _ { i } ( \tau ) + \sum _ { i = 1 } ^ { n } \lambda _ { i } ( \tau , a ) A _ { i } ( \tau , a _ { i } ) .
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
In addition, we construct transformed functions connecting joint and individual functions as follows: $\forall \pmb { \tau } \in \mathcal { T } , \forall \pmb { a } \in \pmb { A } , \forall i \in \mathcal { N }$ ,
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\overline { { Q } } _ { i } ^ { \prime } ( \tau , a ) = \frac { \overline { { Q } } _ { t o t } ( \tau , a ) } { n } , ~ \overline { { V } } _ { i } ^ { \prime } ( \tau ) = \underset { a \in A } { \mathrm { a r g } \operatorname* { m a x } } \overline { { Q } } _ { i } ^ { \prime } ( \tau , a ) , ~ \mathrm { a n d } ~ \overline { { A } } _ { i } ^ { \prime } ( \tau , a ) = \overline { { Q } } _ { i } ^ { \prime } ( \tau , a ) - \overline { { V } } _ { i } ^ { \prime } ( \tau ) ,
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
which means that according to Fact 1,
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
w _ { i } ( \tau ) = 1 , b _ { i } ( \tau ) = \overline { { V } } _ { i } ^ { \prime } ( \tau ) - \overline { { V } } _ { i } ( \tau _ { i } ) , \mathrm { ~ a n d ~ } \lambda _ { i } ( \tau _ { i } , a ) = \left\{ \begin{array} { l l } { \overline { { \frac { A _ { i } ^ { \prime } } { A _ { i } } ( \tau _ { i } , a ) } } > 0 , } & { \mathrm { ~ w h e n ~ } \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } ) < 0 , } \\ { \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } ) } & { \mathrm { ~ w h e n ~ } \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } ) = 0 . } \end{array} \right.
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
Thus, $\left( \overline { { Q } } _ { t o t } , \left[ \overline { { Q } } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \overline { { \mathcal { Q } } }$ , which means that $\widehat { \mathfrak { Q } } \subseteq \overline { { \mathfrak { Q } } }$
|
| 402 |
+
|
| 403 |
+
$\overline { { \mathcal { Q } } } \subseteq \widehat { \mathcal { Q } }$ For any $\left( \overline { { Q } } _ { t o t } , \left[ \overline { { Q } } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \overline { { \mathcal { Q } } }$ , with the similar discussion of Fact 1, $\forall \tau \in \tau$ , $\forall i \in \mathcal N$ , let $\overline { { \mathcal { A } } } _ { i } ^ { * } ( \tau _ { i } )$ denote a $\operatorname { r g m a x } _ { a _ { i } \in \mathcal { A } } \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } )$ , where
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\begin{array} { r } { \overline { { \mathcal { A } } } _ { i } ^ { * } ( \tau _ { i } ) = \left\{ a _ { i } | a _ { i } \in \mathcal { A } , \overline { { \mathcal { A } } } _ { i } ( \tau _ { i } , a _ { i } ) = 0 \right\} . } \end{array}
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
Combining the positivity of $\left[ w _ { i } \right] _ { i = 1 } ^ { n }$ and $\left[ \lambda _ { i } \right] _ { i = 1 } ^ { n }$ with Eq. (7), (8), (9), and (11), we can derive $\forall \pmb { \tau } \in \pmb { \mathcal { T } } , \forall i \in \mathcal { N } , \forall a _ { i } ^ { * } \in \overline { { \mathcal { A } } } ^ { * } ( \tau _ { i } ) , \forall a _ { i } \in \mathcal { A } \backslash \overline { { \mathcal { A } } } ^ { * } ( \tau _ { i } ) .$ ,
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\begin{array} { r l } & { \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } ^ { * } ) = 0 \quad \mathrm { a n d } \quad \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } ) < 0 } \\ { \Rightarrow \quad \overline { { A } } _ { i } ^ { \prime } ( \tau , a _ { i } ^ { * } ) = w _ { i } ( \tau ) \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } ^ { * } ) = 0 \quad \mathrm { a n d } \quad \overline { { A } } _ { i } ^ { \prime } ( \tau , a _ { i } ) = w _ { i } ( \tau ) \overline { { A } } _ { i } ( \tau _ { i } , a _ { i } ) < 0 } \\ { \Rightarrow \quad \overline { { A } } _ { t o t } ( \tau , a ^ { * } ) = \lambda _ { i } ( \tau , a ^ { * } ) \overline { { A } } _ { i } ^ { \prime } ( \tau _ { i } , a _ { i } ^ { * } ) = 0 \quad \mathrm { a n d } \quad \overline { { A } } _ { t o t } ( \tau , a ) = \lambda _ { i } ( \tau , a ) \overline { { A } } _ { i } ^ { \prime } ( \tau _ { i } , a _ { i } ^ { * } ) < 0 , } \end{array}
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
where $\pmb { a } ^ { * } = \langle a _ { 1 } ^ { * } , \ldots , a _ { n } ^ { * } \rangle$ and $\pmb { a } = \langle a _ { 1 } , \ldots , a _ { n } \rangle$ . Notably, these $\mathbf { \delta } \mathbf { \textit { a } } ^ { * }$ forms
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\begin{array} { r } { \overline { { \mathcal { A } } } ^ { * } ( \tau ) = \left\{ \langle a _ { 1 } , \ldots , a _ { n } \rangle \big | a _ { i } \in \overline { { \mathcal { A } } } _ { i } ^ { * } ( \tau _ { i } ) , \forall i \in \mathcal { N } \right\} , } \end{array}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
which is similar to Eq. (16) in the proof of Fact 1. We construct $\widehat { Q } _ { t o t } = \overline { { Q } } _ { t o t }$ and $\left[ \widehat { Q } _ { i } \right] _ { i = 1 } ^ { n } = \left[ \overline { { { Q } } } _ { i } \right] _ { i = 1 } ^ { n }$ According to Eq. (18), the constraints of advantage-based IGM stated in Fact 1 (Eq. (3), Eq. (4), and Eq. (6)) are satisfied, which means that $\left( \widehat { Q } _ { t o t } , \left[ \widehat { \widehat { Q } } _ { i } \right] _ { i = 1 } ^ { n } \right) \in \widehat { \mathcal { Q } }$ and $\overline { { \mathcal { Q } } } \subseteq \widehat { \mathcal { Q } }$ .
|
| 422 |
+
|
| 423 |
+
Thus, when assuming neural networks provide universal function approximation, the joint action-value function class that QPLEX can realize is equivalent to what is induced by the IGM principle. □
|
| 424 |
+
|
| 425 |
+
# B EXPERIMENT SETTINGS AND IMPLEMENTATION DETAILS
|
| 426 |
+
|
| 427 |
+
# B.1 STARCRAFT II
|
| 428 |
+
|
| 429 |
+
We consider the combat scenario of StarCraft II unit micromanagement tasks, where the enemy units are controlled by the built-in AI, and each ally unit is controlled by the reinforcement learning agent. The units of the two groups can be asymmetric, but the units of each group should belong to the same race. At each timestep, every agent takes action from the discrete action space, which includes the following actions: no-op, move [direction], attack [enemy id], and stop. Under the control of these actions, agents move and attack in continuous maps. At each time step, MARL agents will get a global reward equal to the total damage done to enemy units. Killing each enemy unit and winning the combat will bring additional bonuses of 10 and 200, respectively. We briefly introduce the SMAC challenges of our paper in Table 1.
|
| 430 |
+
|
| 431 |
+
# B.2 IMPLEMENTATION DETAILS
|
| 432 |
+
|
| 433 |
+
We adopt the PyMARL (Samvelyan et al., 2019) implementation of state-of-the-art baselines: QTRAN (Son et al., 2019), QMIX (Rashid et al., 2018), VDN (Sunehag et al., 2018), Qatten (Yang et al., 2020), and WQMIX (OW-QMIX and CW-QMIX; Rashid et al., 2020). The hyper-parameters of these algorithms are the same as that in SMAC (Samvelyan et al., 2019) and referred in their source codes. QPLEX is also based on PyMARL, whose special hyper-parameters are illustrated in Table 2 and other common hyper-parameters are adopted by the default implementation of PyMARL (Samvelyan et al., 2019). Especially in the online data collection, we take the advanced implementation of Transformation of Qatten in QPLEX. To ensure the positivity of important weights of Transformation and joint advantage function, we add a sufficiently small amount $\dot { \epsilon ^ { \prime } } = 1 0 ^ { - 1 0 }$ on $\boldsymbol { \left[ w _ { i } \right] } _ { i = 1 } ^ { n }$ and $\left[ \lambda _ { i } \right] _ { i = 1 } ^ { n }$ . In addition, we stop gradients of local advantage function $A _ { i }$ to increase the optimization stability of the max operator of dueling structure. This instability consideration due to max operator has been justified by Dueling DQN (Wang et al., 2016). We approximate the joint action-value function as
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
Q _ { t o t } ( \pmb { \tau } , \pmb { a } ) \approx \sum _ { i = 1 } ^ { n } Q _ { i } ( \pmb { \tau } , \pmb { a } _ { i } ) + \sum _ { i = 1 } ^ { n } \left( \lambda _ { i } ( \pmb { \tau } , \pmb { a } ) - 1 \right) \widetilde { A } _ { i } ( \pmb { \tau } , \pmb { a } _ { i } ) ,
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
where $\widetilde { A } _ { i }$ denotes a variant of the local advantage function $A _ { i }$ by stoping gradients.
|
| 440 |
+
|
| 441 |
+
Table 1: The StarCraft multi-Agent challenge (SMAC; Samvelyan et al., 2019) benchmark.
|
| 442 |
+
|
| 443 |
+
<table><tr><td>Map Name</td><td>Ally Units</td><td>Enemy Units</td></tr><tr><td>2s3z</td><td>2 Stalkers&3Zealots</td><td>2 Stalkers&3Zealots</td></tr><tr><td>3s5z</td><td>3 Stalkers&5Zealots</td><td>3 Stalkers&5 Zealots</td></tr><tr><td>1c3s5z</td><td>1 Colossus,3 Stalkers & 5 Zealots</td><td>1 Colossus,3 Stalkers&5 Zealots</td></tr><tr><td>5m_vs_6m</td><td>5Marines</td><td>6Marines</td></tr><tr><td>10m_vs_11m</td><td>10 Marines</td><td>11 Marines</td></tr><tr><td>27m_vs_30m</td><td>27 Marines</td><td>30 Marines</td></tr><tr><td>3s5z_vs_3s6z</td><td>3 Stalkers&5Zealots</td><td>3 Stalkers & 6 Zealots</td></tr><tr><td>MMM2</td><td>1Medivac,2Marauders&7Marines</td><td>1Medivac,2Marauders&8Marines</td></tr><tr><td>2s_vs_1sc</td><td>2 Stalkers</td><td>1 Spine Crawler</td></tr><tr><td>3s_vs_5z</td><td>3 Stalkers</td><td>5 Zealots</td></tr><tr><td>6h_vs_8z</td><td>6 Hydralisks</td><td>8 Zealots</td></tr><tr><td>bane_vs_bane</td><td>20 Zerglings & 4Banelings</td><td>20 Zerglings & 4 Banelings</td></tr><tr><td>2c_vs_64zg</td><td>2 Colossi</td><td>64 Zerglings</td></tr><tr><td>corridor</td><td>6 Zealots</td><td>24 Zerglings</td></tr><tr><td>5s10z</td><td>5Stalkers&10 Zealots</td><td>5Stalkers&10 Zealots</td></tr><tr><td>7sz</td><td>7 Stalkers &7 Zealots</td><td>7 Stalkers&7Zealots</td></tr><tr><td>1c3s8z_vs_1c3s9z</td><td>1 Colossus,3 Stalkers &8 Zealots</td><td>1 Colossus,3 Stalkers &9 Zealots</td></tr></table>
|
| 444 |
+
|
| 445 |
+
Table 2: The network configurations of QPLEX’s architecture.
|
| 446 |
+
|
| 447 |
+
<table><tr><td>QPLEX's architecuture configurations</td><td>Didactic Examples</td><td>StarCraft II</td></tr><tr><td>The number of layers in w,b,入,,U</td><td>2or3</td><td>1</td></tr><tr><td>The number of heads in the attention module</td><td>4 or 10</td><td>4</td></tr><tr><td>Unit number in middle layers of w,b,入,,U</td><td>64</td><td>Q</td></tr><tr><td>Activation in the middle layers of w,U</td><td>Relu</td><td>Q</td></tr><tr><td>Activation in the last layer of w, U</td><td>Absolute</td><td>Absolute</td></tr><tr><td>Activation in the middle layers of b</td><td>Relu</td><td>Q</td></tr><tr><td>Activation in the last layer of b</td><td>None</td><td>None</td></tr><tr><td>Activation in the middle layers of 入,</td><td>Relu</td><td>Q</td></tr><tr><td>Activation in the last layer of 入,Φ</td><td>Sigmoid</td><td>Sigmoid</td></tr></table>
|
| 448 |
+
|
| 449 |
+
Our training time on an NVIDIA RTX 2080TI GPU of each task is about 6 hours to 20 hours, depending on the agent number and the episode length limit of each map. The percentage of episodes in which MARL agents defeat all enemy units within the time limit is called test win rate. We pause training every 10k timesteps and evaluate 32 episodes with decentralized greedy action selection to measure test win rate of each algorithm. After training every 200 episodes, the target network will be updated once. We call this update period an Iteration for didactic tasks. In the two-state MMDP, Optimal line of Figure 3b is approximately $\textstyle \sum _ { i = 0 } ^ { 9 9 } \gamma ^ { i } = 6 3 . 4$ in one episode of 100 timesteps.
|
| 450 |
+
|
| 451 |
+
Training with Online Data Collection We have collected a total of 2 million timestep data for each task and test the model every 10 thousand steps. We use $\epsilon$ -greedy exploration and a limited first-in-first-out (FIFO) replay buffer of size 5000 episodes, where $\epsilon$ is linearly annealed from 1.0 to 0.05 over 50k timesteps and keep it constant for the rest training process. To utilize the training buffer more efficiently, we perform gradient updates twice with a batch of 32 episodes after collecting every episode for each algorithm.
|
| 452 |
+
|
| 453 |
+
Training with Offline Data Collection To construct a diverse dataset, we train a behavior policy of QMIX (Rashid et al., 2018) or VDN (Sunehag et al., 2018) and collect its 20k or 50k experienced episodes throughout the training process. The dataset configurations are shown in Table 3. We evaluate QPLEX and four baselines over six random seeds, which includes three different datasets and tests two seeds on each dataset. We train 300 epochs to demonstrate our learning performance, where each epoch trains 160k transitions with a batch of 32 episodes. Moreover, the training process of behavior policy is the same as that discussed in PyMARL (Samvelyan et al., 2019).
|
| 454 |
+
|
| 455 |
+
C OMITTED FIGURES AND TABLES IN SECTION 4.1 AND 4.2
|
| 456 |
+
|
| 457 |
+
<table><tr><td>Map Name</td><td>Replay Buffer Size</td><td>Behaviour TestWinRate</td><td>Behaviour Policy</td></tr><tr><td>2s3z</td><td>20k episodes</td><td>95.8%</td><td>QMIX</td></tr><tr><td>3s5z</td><td>20k episodes</td><td>92.0%</td><td>QMIX</td></tr><tr><td>1c3s5z</td><td>20k episodes</td><td>90.2%</td><td>QMIX</td></tr><tr><td>2s_vs_1sc</td><td>20k episodes</td><td>98.1%</td><td>QMIX</td></tr><tr><td>3s_vs_5z</td><td>20k episodes</td><td>94.4%</td><td>VDN</td></tr><tr><td>2c_vs_64zg</td><td>50k episodes</td><td>80.9%</td><td>QMIX</td></tr></table>
|
| 458 |
+
|
| 459 |
+
Table 3: The dataset configurations of the offline data collection setting.
|
| 460 |
+
|
| 461 |
+
<table><tr><td rowspan=1 colspan=1>a1a2</td><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>A(3)</td></tr><tr><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>-12</td><td rowspan=1 colspan=1>-12</td></tr><tr><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>-12</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>A3</td><td rowspan=1 colspan=1>-12</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td></tr></table>
|
| 462 |
+
|
| 463 |
+
<table><tr><td rowspan=1 colspan=1>a1a2</td><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>A(3)</td></tr><tr><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>8.0</td><td rowspan=1 colspan=1>-12.0</td><td rowspan=1 colspan=1>-12.0</td></tr><tr><td rowspan=1 colspan=1>A2</td><td rowspan=1 colspan=1>-12.0</td><td rowspan=1 colspan=1>-0.0</td><td rowspan=1 colspan=1>0.0</td></tr><tr><td rowspan=1 colspan=1>A(3)</td><td rowspan=1 colspan=1>-12.0</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>0.0</td></tr></table>
|
| 464 |
+
|
| 465 |
+
(b) $Q _ { t o t }$ of QPLEX
|
| 466 |
+
|
| 467 |
+
<table><tr><td rowspan=1 colspan=1>a1a2</td><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>A(3)</td></tr><tr><td rowspan=1 colspan=1>A1</td><td rowspan=1 colspan=1>8.0</td><td rowspan=1 colspan=1>-12.1</td><td rowspan=1 colspan=1>-12.1</td></tr><tr><td rowspan=1 colspan=1>A(②</td><td rowspan=1 colspan=1>-12.2</td><td rowspan=1 colspan=1>-0.0</td><td rowspan=1 colspan=1>-0.0</td></tr><tr><td rowspan=1 colspan=1>A(3)</td><td rowspan=1 colspan=1>-12.1</td><td rowspan=1 colspan=1>-0.0</td><td rowspan=1 colspan=1>-0.0</td></tr></table>
|
| 468 |
+
|
| 469 |
+
(a) Payoff of matrix game (c) $Q _ { t o t }$ of QTRAN
|
| 470 |
+
|
| 471 |
+
<table><tr><td rowspan=1 colspan=1>a1a2</td><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>A(3)</td></tr><tr><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>-8.0</td><td rowspan=1 colspan=1>-8.0</td><td rowspan=1 colspan=1>-8.0</td></tr><tr><td rowspan=1 colspan=1>A2</td><td rowspan=1 colspan=1>-8.0</td><td rowspan=1 colspan=1>-0.0</td><td rowspan=1 colspan=1>-0.0</td></tr><tr><td rowspan=1 colspan=1>A3</td><td rowspan=1 colspan=1>-8.0</td><td rowspan=1 colspan=1>-0.0</td><td rowspan=1 colspan=1>-0.0</td></tr></table>
|
| 472 |
+
|
| 473 |
+
<table><tr><td rowspan=1 colspan=1>a1a2</td><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>A(3)</td></tr><tr><td rowspan=1 colspan=1>A1)</td><td rowspan=1 colspan=1>-6.2</td><td rowspan=1 colspan=1>-4.9</td><td rowspan=1 colspan=1>-4.9</td></tr><tr><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>-4.9</td><td rowspan=1 colspan=1>-3.6</td><td rowspan=1 colspan=1>-3.6</td></tr><tr><td rowspan=1 colspan=1>A3)</td><td rowspan=1 colspan=1>-4.9</td><td rowspan=1 colspan=1>-3.6</td><td rowspan=1 colspan=1>-3.6</td></tr></table>
|
| 474 |
+
|
| 475 |
+
<table><tr><td rowspan=1 colspan=1>a1a2</td><td rowspan=1 colspan=1>A(1)</td><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>A(3)</td></tr><tr><td rowspan=1 colspan=1>A1</td><td rowspan=1 colspan=1>-6.2</td><td rowspan=1 colspan=1>-4.9</td><td rowspan=1 colspan=1>-4.9</td></tr><tr><td rowspan=1 colspan=1>A(2)</td><td rowspan=1 colspan=1>-4.9</td><td rowspan=1 colspan=1>-3.5</td><td rowspan=1 colspan=1>-3.5</td></tr><tr><td rowspan=1 colspan=1>A3</td><td rowspan=1 colspan=1>-4.9</td><td rowspan=1 colspan=1>-3.5</td><td rowspan=1 colspan=1>-3.5</td></tr></table>
|
| 476 |
+
|
| 477 |
+
(d) $Q _ { t o t }$ of QMIX (e) $Q _ { t o t }$ of VDN (f) $Q _ { t o t }$ of Qatten
|
| 478 |
+
|
| 479 |
+
Table 4: (a) Payoff matrix of the one-step game. Boldface means the optimal joint action selection from payoff matrix. (b-f) The joint action-value functions $Q _ { t o t }$ of QPLEX, QTRAN, QMIX, VDN, and Qatten. Boldface means greedy joint action selection from joint action-value functions.
|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
Figure 6: The learning curves of QPLEX and other baselines on the origin matrix game.
|
| 483 |
+
|
| 484 |
+
# D EXPERIMENTS ON STARCRAFT II WITH ONLINE DATA COLLECTION
|
| 485 |
+
|
| 486 |
+

|
| 487 |
+
Figure 7: The learning curves of StarCraft II with online data collection on remaining scenarios.
|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
Figure 8: (a) The median test win $\%$ , averaged across all 14 scenarios proposed by SMAC (Samvelyan et al., 2019). (b) The number of scenarios in which the algorithms’ median test win $\%$ is the highest by at least 1/32 (smoothed).
|
| 491 |
+
|
| 492 |
+
# E ABLATION STUDIES WITH ONLINE DATA COLLECTION
|
| 493 |
+
|
| 494 |
+
In this section, we conduct two ablation studies to investigate why QPLEX works, which includes: (i) QPLEX without the multi-head attention structure of dueling architecture, and (ii) QMIX with the same number of parameters as QPLEX. For these studies, Figure 9 plots the averaged median test win rate $\%$ over the tasks of the StarCraft II benchmark mentioned in Section 4.3.1. Detailed learning curves on each task are shown in Figure 10 and 11, respectively.
|
| 495 |
+
|
| 496 |
+
Multi-head attention structure of importance weights $\lambda _ { i }$ (see Eq. (9) and (10)) allows QPLEX to adapt its scalable implementation to different scenarios, e.g., didactic games or StarCraft II benchmark tasks. Section 4.1 demonstrates the importance of this attention structure, which can provide QPLEX more expressiveness of value factorization to perform better on the didactic matrix games. In this ablation study, we aim to test whether this multi-head attention is necessary for this StarCraft II domain. Specifically, we use a one-layer forward model instead of this multi-head attention structure in QPLEX, which is called QPLEX-wo-duel-atten. Figure 9a shows that QPLEX-wo-duel-atten achieves similar performance as QPLEX, which indicates that the the superiority of QPLEX over other MARL methods is largely due to the duplex dueling architecture (see Figure 1), instead of the multi-head attention trick.
|
| 497 |
+
|
| 498 |
+

|
| 499 |
+
Figure 9: Ablation studies on QPLEX with the median test win $\%$ , averaged benchmark scenarios.
|
| 500 |
+
|
| 501 |
+
QPLEX uses more parameters in the value factorization architecture of neural networks due to its multi-head attention structure. We introduce Large QMIX with a similar number of parameters with QPLEX, to investigate whether the superiority of QPLEX over QMIX is due to the increase in the number of parameters. Figure 9b shows that QMIX with a larger network cannot fundamentally improve its performance, and QPLEX still significantly outperforms Large QMIX by a large margin. This result also confirms that the main effect of QPLEX comes from its novel value factorization structure (duplex dueling architecture) rather than the number of parameters.
|
| 502 |
+
|
| 503 |
+

|
| 504 |
+
Figure 10: The learning curves of median test win rate $\%$ for QPLEX, QPLEX’s ablation QPLEXwo-duel-atten, QMIX, and Qatten with online data collection.
|
| 505 |
+
|
| 506 |
+

|
| 507 |
+
Figure 11: Learning curves of median test win rate $\%$ for QPLEX, QMIX, and Large QMIX with online data collection.
|
| 508 |
+
|
| 509 |
+

|
| 510 |
+
Figure 12: Visualized strategies of QPLEX and QMIX on $5 \mathrm { s } 1 0 \mathrm { z }$ map of StarCraft II benchmark. Red marks represent learning agents, and blue marks represent build-in AI agents.
|
| 511 |
+
|
| 512 |
+
As shown in Figure 12, both MARL agents and opponents contain 5 ranged soldiers (denoted by a circle) and 10 melee soldiers (denoted by line) on $5 s 1 0 z$ map. The ranged soldiers have stronger combat capabilities and need to be protected strategically. QPLEX uses 10 melee soldiers to build lines of defense against the enemy, while QMIX fails to coordinate melee soldiers such that ranged soldiers have to fight against the enemy directly.
|
| 513 |
+
|
| 514 |
+

|
| 515 |
+
G EXPERIMENTS ON STARCRAFT II WITH OFFLINE DATA COLLECTION
|
| 516 |
+
Figure 13: Deferred learning curves of StarCraft II with offline data collection on tested scenarios.
|
| 517 |
+
|
| 518 |
+
# H ABLATION STUDIES ABOUT QPLEX WITH DIFFERENT NETWORK CAPACITIES IN STARCRAFT II
|
| 519 |
+
|
| 520 |
+
We trade off the expressiveness and learning efficiency of the multi-head attention network module for estimating importance weights $\lambda _ { i }$ (see Eq. (9) and (10) in Section 3.2). It is generally sufficient for QPLEX to use a simple multi-head attention with a small number of heads and layers (as evaluated in StarCraft II tasks) to achieve the state-of-the-art performance shown in Figure 4. However, in some didactic corner-cases with an adequate and uniform dataset, a harder matrix game illustrated in Figure 2a requires very high precision in estimating the action-value function in order to differentiate the optimal solution from the sub-optimal solutions. For this matrix game, a multi-head attention structure with more layers and heads has a more representational capacity and results in better performance, as demonstrated by the ablation study illustrated in Figure 2c in Section 4.1.
|
| 521 |
+
|
| 522 |
+
In contrast, StarCraft II micromanagement benchmark tasks contain much more complicated agents with large state-action spaces and range from 2 to 27 agents. To support the superior training scalability of QPLEX, we used a multi-head attention with just one layer and four heads. To evaluate the effect of the choice of layer and the number of heads, we conducted an ablation study in Starcraft II benchmark tasks. For simplicity, we follow the notation of Figure 2, i.e., use QPLEX-aLbH to denote QPLEX with $a$ layers and $b$ heads of importance weights $\lambda _ { i }$ . As shown in Figure 14, using more heads, QPLEX-1L10H, does not change the performance, but using more layers, QPLEX-2L4H, may slightly degenerate the learning efficiency of QPLEX in this complex domain. Detailed learning curves on these tasks are shown in Figure 15. This is because using more layers significantly increase the number of parameters and requires more samples for learning, which may offset the benefits of higher expressiveness it brings. This ablation study shows that a simple attention neural network with just one layer and four heads has enough expressiveness to handle these complex StarCraft II tasks.
|
| 523 |
+
|
| 524 |
+

|
| 525 |
+
Figure 14: Ablation study about QPLEX with different network capacities in StarCraft II.
|
| 526 |
+
|
| 527 |
+

|
| 528 |
+
Figure 15: Deferred figures of median test win rate $\%$ for QPLEX-1L4H, QPLEX-1L10H, and QPLEX-2L4H with online data collection.
|
| 529 |
+
|
| 530 |
+
# I ABLATION STUDIES ABOUT QTRAN
|
| 531 |
+
|
| 532 |
+
Both QPLEX and QTRAN aim to provide a richer factorized acton-value function class. The main difference between QPLEX and QTRAN is that QPLEX uses a duplex dueling architecture to realize the IGM principle (a hard constraint). In contrast, QTRAN uses two penalties as soft constraints to approximate the IGM principle. Moreover, from the perspective of implementation, QTRAN does not have a Transformation module (see Section 3.2) on the individual Q-functions and cannot utilize a multi-head attention module on the joint Q-function directly (because QTRAN does not take the duplex dueling architecture as QPLEX).
|
| 533 |
+
|
| 534 |
+
To test whether QPLEX outperforms QTRAN because of these factors, we conducted an ablation study by removing the Transformation module and replacing the multi-head attention module with a simple one-layer forward model in the QPLEX’s dueling architecture, which is denoted as QPLEX-wo-trans-atten. In addition, we also introduce a variant of QTRAN, which also uses the Transformation module for individual Qfunctions, denoted as QTRAN- $w$ -trans. Our experiments are evaluated on the tasks of the StarCraft II benchmark mentioned in Section 4.3.1.
|
| 535 |
+
|
| 536 |
+
Figure 16 illustrates the averaged median test win rate $\%$ over all tested scenarios. Detailed learning curves on these tasks are shown in Figure 17. These empirical results show that QPLEX-wo-trans-atten significantly outperforms QTRAN and QTRAN-w-trans, which implies that the outperformance of QPLEX over QTRAN is largely due to its duplex dueling architecture. It can also be seen that QTRAN-w-trans cannot significantly improve the performance of QTRAN, which implies that QTRAN cannot benefit a lot from an extra Transformation module empirically.
|
| 537 |
+
|
| 538 |
+

|
| 539 |
+
Figure 16: Ablation study about QTRAN with online data collection.
|
| 540 |
+
|
| 541 |
+
As discussed in Section E, Figure 9a can be regarded as an ablation study of QPLEX-wo-atten, which just removes the multi-head attention module from dueling architecture. That ablation study shows that a simple neural network implementation of QPLEX’s dueling structure has enough expressiveness to handle these StarCraft II tasks in the online data collection setting, even if this structure can provide QPLEX with excellent performance in didactic matrix games using an adequate and uniform dataset (see Section 4.1). Thus, compared with QPLEX-wo-atten in Figure 9a, Figure 16 shows that Transformation (abbreviated as -trans) is a useful module for QPLEX empirically, which indicates an another QPLEX’s advantage, i.e., QPLEX can equip a Transformation module to improve QPLEX’s empirical performance, whereas QTRAN may not by directly using it. Moreover, we would like to emphasize that, unlike the multi-head attention module, the Transformation module is actually a necessary module for QPLEX to realize IGM, as shown in Figure 1 and by the proof of Proposition 2. Therefore, it is actually fair to evaluate QPLEX with the Transformation module.
|
| 542 |
+
|
| 543 |
+

|
| 544 |
+
Figure 17: Figures of median test win rate $\%$ for QPLEX, QPLEX’s ablation QPLEX-wo-trans-atten, QTRAN, and QTRAN-w-trans with online data collection.
|
| 545 |
+
|
| 546 |
+
# J A COMPARISON TO WQMIX IN PREDATOR-PREY
|
| 547 |
+
|
| 548 |
+
WQMIX (Rashid et al., 2020) is a recent advanced multi-agent Q-learning algorithm. We compare QPLEX with WQMIX in a toy game, predator-prey, which is introduced by WQMIX and aims to test coordination between agents in a partially-observable setting.
|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
Figure 18: Learning curves of median test return for QPLEX, QTRAN, QMIX, and WQMIX (OW-QMIX and CW-QMIX) in the toy predator-prey task.
|
| 552 |
+
|
| 553 |
+
Predator-prey is a multi-agent coordinated game used by WQMIX (Rashid et al., 2020) with miscoordination penalties. In order to collect the experience with the positive reward of agents’ coordinated actions, extensive exploration can benefit multi-agent Q-learning algorithms to solve this kind of tasks. WQMIX shapes the data distribution with an importance weight to boost efficient learning, which can also be regarded as a type of biased exploration. To support QPLEX with effective exploration, we use an $\epsilon$ -greedy strategy which is also discussed in the paper of WQMIX. This strategy’s $\epsilon$ is linearly annealed from 1 to 0.05 over 1 million timesteps, increased from the 50k used in SMAC (Samvelyan et al., 2019). As shown in Figure 18, besides WQMIX and QTRAN, QPLEX can solve this task by using the introduced $\epsilon$ -greedy exploration strategy. Moreover, QMIX can also solve this task by using the same $\epsilon$ -greedy strategy as QPLEX, but QPLEX enjoys higher sample efficiency.
|
md/train/Rd138pWXMvG/Rd138pWXMvG.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A STATISTICAL THEORY OF COLD POSTERIORS IN DEEP NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Laurence Aitchison
|
| 4 |
+
Department of Computer Science,
|
| 5 |
+
University of Bristol,
|
| 6 |
+
Bristol, UK, F94W 9Q
|
| 7 |
+
laurence.aitchison@bristol.ac.uk
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
To get Bayesian neural networks to perform comparably to standard neural networks it is usually necessary to artificially reduce uncertainty using a “tempered” or “cold” posterior. This is extremely concerning: if the generative model is accurate, Bayesian inference/decision theory is optimal, and any artificial changes to the posterior should harm performance. While this suggests that the prior may be at fault, here we argue that in fact, BNNs for image classification use the wrong likelihood. In particular, standard image benchmark datasets such as CIFAR-10 are carefully curated. We develop a generative model describing curation which gives a principled Bayesian account of cold posteriors, because the likelihood under this new generative model closely matches the tempered likelihoods used in past work.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Recent work has highlighted that Bayesian neural networks (BNNs) typically have better predictive performance when we “sharpen” the posterior (Wenzel et al., 2020). In stochastic gradient Langevin dynamics (SGLD) (Welling & Teh, 2011), this can be achieved by multiplying the log-posterior by $1 \dot { / } T$ , where the “temperature”, $T$ is smaller than 1 (Wenzel et al., 2020). Broadly the same effect can be achieved in variational inference by “tempering”, i.e. downweighting the KL term. As noted in Wenzel et al. (2020), this approach has been used in many recent papers to obtain good performance, albeit without always emphasising the importance of this factor (Zhang et al., 2017; Bae et al., 2018; Osawa et al., 2019; Ashukha et al., 2020).
|
| 16 |
+
|
| 17 |
+
These results are puzzling if we take the usual Bayesian viewpoint, which says that the Bayesian posterior, used with the right prior, and in combination with Bayes decision theory should give optimal performance (Jaynes, 2003). Thus, these results may suggest we are using the wrong prior. While new priors have been suggested (e.g. Ober & Aitchison, 2020), they give only minor improvements in performance — certainly nothing like enough to close the gap to carefully trained non-Bayesian networks. In contrast, tempered posteriors directly give performance comparable to a carefully trained finite network.
|
| 18 |
+
|
| 19 |
+
The failure to develop an effective prior suggests that we should consider alternative explanations for the effectiveness of tempering. Here, we consider the possibility that it is predominantly (but not entirely) the likelihood, and not the prior that is at fault. In particular, we note that standard image benchmark datasets such as ImageNet and CIFAR-10 are carefully curated, and that it is important to consider this curation as part of our generative model. We develop a simplified generative model describing dataset curation which assumes that a datapoint is included in the dataset only if there is unanimous agreement on the class amongst multiple labellers. This model naturally multiplies the effect of each datapoint, and hence gives posteriors that closely match tempered or cold posteriors. We show that toy data drawn from our generative model of curation can give rise to optimal temperatures being smaller than 1. Our model predicts that cold posteriors will not be helpful when the original underlying labels from all labellers are available. While these are not available for standard datasets such as CIFAR-10, we found a good proxy: the CIFAR-10H dataset (Peterson et al., 2019), in which $\sim 5 0$ humans annotators labelled the CIFAR-10 test-set (we use these as our training set, and use the standard CIFAR-10 training set for test-data). As expected, we find strong cold-posterior effects when using the original single-label, which are almost entirely eliminated when using the 50 labels from CIFAR-10H. In addition, curation implies that each label is almost certain to be correct, which is one way to understand the statistical patterns exploited by cold posteriors. As such, if we destroy this pattern by adding noise to the labels, the cold posterior effect should disappear. We confirmed that with increasing label noise, the cold posterior effect disappears and eventually reverses (giving better performance at temperatures close to 1).
|
| 20 |
+
|
| 21 |
+
# 2 BACKGROUND: COLD AND TEMPERED POSTERIORS
|
| 22 |
+
|
| 23 |
+
Tempered (e.g. Zhang et al., 2017) and cold (Wenzel et al., 2020) posteriors differ slightly in how they apply the temperature parameter. For cold posteriors, we scale the whole posterior, whereas tempering is a method typically applied in variational inference, and corresponds to scaling the likelihood but not the prior,
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
{ \begin{array} { r } { \log \operatorname { P } _ { \mathrm { c o l d } } \left( \theta | X , Y \right) = { \frac { 1 } { T } } \log \operatorname { P } \left( X , Y | \theta \right) + { \frac { 1 } { T } } \log \operatorname { P } \left( \theta \right) + { \mathrm { c o n s t } } } \\ { \log \operatorname { P } _ { \mathrm { t e m p e r e d } } \left( \theta | X , Y \right) = { \frac { 1 } { \lambda } } \log \operatorname { P } \left( X , Y | \theta \right) + \ \log \operatorname { P } \left( \theta \right) + { \mathrm { c o n s t } } . } \end{array} }
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
While cold posteriors are typically used in SGLD, tempered posteriors are usually targeted by variational methods. In particular, variational methods apply temperature scaling to the KL-divergence between the approximate posterior, $\mathrm { ~ Q ~ } ( \theta )$ and prior,
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\mathcal { L } = \mathbb { E } _ { \mathrm { Q } ( \theta ) } \left[ \log \mathrm { P } \left( X , Y | \theta \right) \right] - \lambda \operatorname { D } _ { \mathrm { K L } } \left( \mathrm { Q } \left( \theta \right) | | \mathrm { P } \left( \theta \right) \right) .
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Note that the only difference between cold and tempered posteriors is whether we scale the prior, and if we have Gaussian priors over the parameters (the usual case in Bayesian neural networks), this scaling can be absorbed into the prior variance,
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\textstyle \frac { 1 } { T } \log \mathrm { P } _ { \mathrm { c o l d } } \left( \theta \right) = - \frac { 1 } { 2 T \sigma _ { \mathrm { c o l d } } ^ { 2 } } \sum _ { i } \theta _ { i } ^ { 2 } + \mathrm { c o n s t } = - \frac { 1 } { 2 \sigma _ { \mathrm { t e n p r e d } } ^ { 2 } } \sum _ { i } \theta _ { i } ^ { 2 } + \mathrm { c o n s t } = \log \mathrm { P } _ { \mathrm { c o l d } } \left( \theta \right) .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
in which case, $\sigma _ { \mathrm { c o l d } } ^ { 2 } = \sigma _ { \mathrm { t e m p e r e d } } ^ { 2 } / T$ , so the tempered posteriors we discuss are equivalent to cold posteriors with rescaled prior variances.
|
| 42 |
+
|
| 43 |
+
# 3 METHODS: A GENERATIVE MODEL FOR CURATED DATASETS
|
| 44 |
+
|
| 45 |
+
Standard image datasets such as CIFAR-10 and ImageNet are carefully curated to include only unambiguous examples of each class. For instance, in CIFAR-10, student labellers were paid per hour (rather than per image), were instructed that “It’s worse to include one that shouldn’t be included than to exclude one”, and then Krizhevsky (2009) “personally verified every label submitted by the labellers”. For ImageNet, Deng et al. (2009) required the consensus of a number of Amazon Mechanical Turk labellers before including an image in the dataset.
|
| 46 |
+
|
| 47 |
+
To understand the statistical patterns that might emerge in these curated datasets, we consider a highly simplified generative model of consensus-formation. In particular, we draw a random image $X$ from some underlying distribution over images, P $( X )$ , and ask $S$ humans to assign a label, $\{ { \check { Y _ { s } } } \} _ { s = 1 } ^ { S }$ (e.g. using Mechanical Turk). We force every labeller to label every image and if the image is ambiguous they are instructed to give a random label. If all the labellers agree, $Y _ { 1 } = Y _ { 2 } = \cdot \cdot \cdot = Y _ { S }$ , consensus is reached and we include the datapoint in the dataset. If any of the labellers disagree consensus is not reached, and we exclude the datapoint (Fig. 1), Formally, the observed random variable, $Y$ , is taken to be the usual label if consensus was reached and None if consensus was not reached (Fig. 2B),
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
Y | \{ Y _ { s } \} _ { s = 1 } ^ { S } = { \left\{ \begin{array} { l l } { Y _ { 1 } } & { { \mathrm { i f ~ } } Y _ { 1 } = Y _ { 2 } = \cdots = Y _ { S } } \\ { { \mathrm { N o n e } } } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Taking the human labels, $Y _ { s }$ , to come from the set $\mathcal { V }$ , so $Y _ { s } \in \mathcal { V }$ , the consensus label, $Y$ , could be any of the underlying labels in $\mathcal { V }$ , or None if no consensus is reached, so $Y \in \mathcal { Y } \cup \{ \mathrm { N o n e } \}$ . When consensus was reached, the likelihood is,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathrm { ~ P ~ } ( Y = y | X , \theta ) = \mathrm { P ~ } \big ( \{ Y _ { s } = y \} _ { s = 1 } ^ { S } | X , \theta \big ) = \prod _ { s = 1 } ^ { S } \mathrm { ~ P ~ } ( Y _ { s } = y | X , \theta ) = \mathrm { P ~ } ( Y _ { s } = y | X , \theta ) ^ { S }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: A simple example of our generative process describing dataset curation, with $S = 3$ . Labellers have the task of classifying images as cats or dogs. The first image is unambiguously a cat, so the three labellers agree, consensus is reached, and the image is included in the dataset. The second image is unambiguously a dog, the labellers agree, consensus is reached, and the image is included in the dataset. However, the third image is ambiguous: the labellers disagree, consensus is not reached, and the image may be excluded from the dataset.
|
| 61 |
+
|
| 62 |
+
where we have assumed labellers are IID. This would appear to directly give an account of tempering, as we have taken the single-labeller likelihood to the power $S$ , which is equivalent to setting $\lambda = 1 / S$ . However, to see how the full generative model functions we need to go on to consider the case in which consensus was not reached,
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathrm { P } \left( \boldsymbol { Y } = \mathrm { N o n e } | \boldsymbol { X } , \theta \right) = 1 - \sum _ { y \in \mathcal { Y } } \mathrm { P } \left( \boldsymbol { Y } = y | \boldsymbol { X } , \theta \right) = 1 - \sum _ { y \in \mathcal { Y } } \mathrm { P } \left( Y _ { s } = y | \boldsymbol { X } , \theta \right) ^ { \boldsymbol { S } } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
To understand the impact of our model of consensus formation, note that the probability of a particular class-label can be separated into two terms, a probability of consensus, and the probability of a particular class given that consensus was reached,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathrm { P } \left( Y = y | X , \theta \right) = \mathrm { P } \left( Y = y | Y \neq \mathrm { N o n e } , X , \theta \right) \mathrm { P } \left( Y \neq \mathrm { N o n e } | X , \theta \right) .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Remarkably, knowing there was consensus gives us information about the weights, even in the absence of the class label,
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathrm { P } \left( \boldsymbol { Y } \neq \mathrm { N o n e } | \boldsymbol { X } , \boldsymbol { \theta } \right) = \sum _ { \boldsymbol { y } \in \mathcal { V } } \mathrm { P } \left( Y _ { s } = \boldsymbol { y } | \boldsymbol { X } , \boldsymbol { \theta } \right) ^ { S } ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
in essence, telling us that the output probability was close to 1 for one of the class labels, without telling us which one. Schematically (Fig. 3), we see that the datapoints with a consensus class-label, “cat” or “dog”, lie far from the decision boundary where the class is unambiguous, and consensus is easily reached. In contrast, in regions close to the decision boundary the inputs are ambiguous, which tends to produce disagreement in the labellers, leading to noconsensus. Thus, the existence of one or more consensus points in a region implies that decision boundaries do not go through that region, giving us information about the decision boundary location, even if the label is not known. Concurrent work has shown that this likelihood can be used to explain classical semi-supervised likelihoods (Aitchison, 2020), so this term really does give information about the neural network parameters. Finally, the label probability, conditioned on consensus,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathrm { \ P } \left( \boldsymbol { Y } = y | \boldsymbol { Y } \neq \mathrm { \ " { N o n e } } , \boldsymbol { X } , \theta \right) = \frac { \mathrm { \ P } \left( \boldsymbol { Y } = y | \boldsymbol { X } , \theta \right) } { \mathrm { \ P } \left( \boldsymbol { Y } \neq \mathrm { \ " { N o n e } } | \boldsymbol { X } , \theta \right) } = \frac { \mathrm { \ P } \left( Y _ { s } = y | \boldsymbol { X } , \theta \right) ^ { S } } { \sum _ { y \in \mathcal { Y } } \mathrm { \ P } \left( Y _ { s } = y | \boldsymbol { X } , \theta \right) ^ { S } }
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
simply represents a “reparameterised” softmax.
|
| 87 |
+
|
| 88 |
+
In datasets where the noconsensus inputs are known it is clear we should use the full likelihood, (Eq. 6 and 7). The question is: in real-world datasets, where we only know the consensus inputs and the noconsensus inputs have been thrown away (Fig. 2C), can we use Eq. (10), a reparameterisation of the softmax-categorical probabilities, for the known consensus points? The answer is no because in Bayesian inference, we do not get to just pick a sensible-looking conditional probability distribution, such as Eq. 10, to use as the likelihood. Instead, we need to write down the full generative model,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r } { \begin{array} { l } { \mathbf { A } \quad ^ { X } \sum _ { \substack { Y } } \qquad \mathbf { B } \quad ^ { X } \sum _ { \substack { \left\{ Y _ { s } \right\} _ { s = 1 } ^ { S } \longrightarrow Y } } \mathbf { C } \quad ^ { X } \sum _ { \substack { \left\{ Y _ { s } \right\} _ { s = 1 } ^ { S } \longrightarrow Y } } Z } \end{array} } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Figure 2: A The standard generative model for supervised tasks, assuming no data curation. B Generative model of data curation, where the consensus and noconsensus images are known. C Generative model of data curation, where the noconsensus images are unknown. The underlying images, $X$ are no longer observed. Instead, we observe $Z$ , where $Z = X$ if consensus is reached $( Y _ { 1 } = Y _ { 2 } = \cdot \cdot \cdot = Y _ { S } ) $ ) and $Z =$ None otherwise.
|
| 95 |
+
|
| 96 |
+
and marginalise over unknown latents. To write down the generative model in the case of unknown noconsensus images (Fig. 2C), we need to take $X$ to be an unobserved latent variable, and take $Z$ to be an observed random variable,
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
Z | X , \{ Y _ { s } \} _ { s = 1 } ^ { S } = { \left\{ \begin{array} { l l } { X } & { { \mathrm { i f ~ } } Y _ { 1 } = Y _ { 2 } = \cdots = Y _ { s } } \\ { { \mathrm { N o n e } } } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
which is the underlying image, $X$ , if consensus is reached, and None otherwise. As $Z$ depends on $\theta$ (Fig. 2C), we cannot take the usual shortcut of using P $( Y | Z , \theta )$ ; we must instead use the full likelihood, P $( Y , Z | \theta )$ ,
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { l } { { \displaystyle { \mathrm { ~ P ~ } } ( Y , Z | \theta ) = \sum _ { \{ Y _ { s } \} _ { s = 1 } ^ { s } } \int d X { \mathrm { ~ P ~ } } ( X , Y , \{ Y _ { s } \} _ { s = 1 } ^ { S } , Z | \theta ) } \ ~ } \\ { { \displaystyle ~ = \sum _ { \{ Y _ { s } } \} _ { s = 1 } ^ { s } \int d X { \mathrm { ~ P ~ } } ( X ) \left[ \prod _ { s = 1 } ^ { s } { \mathrm { ~ P ~ } } ( Y _ { s } | X , \theta ) \right] { \mathrm { ~ P ~ } } \left( Y | \{ Y _ { s } \} _ { s = 1 } ^ { S } \right) { \mathrm { ~ P ~ } } \left( Z | X , \{ Y _ { s } \} _ { s = 1 } ^ { S } \right) . } } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
for $y$ not None,
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\mathrm { P } \left( Y = y | \{ Y _ { s } \} _ { s = 1 } ^ { S } \right) = \{ 1 \quad \mathrm { i f } \ Y _ { s } = y \ \mathrm { f o r } \ a l l \ s \in \{ 1 , \ldots , S \} \nonumber
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
and,
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathrm { P } \left( Z | X , \{ Y _ { s } \} _ { s = 1 } ^ { S } \right) = \left\{ { \begin{array} { l l } { \delta ( Z - X ) } & { { \mathrm { i f } } \ Y _ { 1 } = Y _ { 2 } = \cdots = Y _ { S } } \\ { \mathbb { I } _ { Z = \mathrm { N o n e } } } & { { \mathrm { o t h e r w i s e } } } \end{array} } \right.
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $\delta$ is the Dirac-delta function, and where the indicator function, $\mathbb { I } _ { Z = \mathrm { N o n e } }$ is 1 if $Z = { \mathrm { N o n e } }$ and 0 otherwise. Substituting Eq. (13) and Eq. (14) into Eq. (12),
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\mathrm { P } \left( Y = y , Z | \theta \right) = \mathrm { P } \left( X \right) \prod _ { s = 1 } ^ { S } \mathrm { P } \left( Y _ { s } = y | X , \theta \right) \propto \mathrm { P } \left( Y _ { s } = y | X , \theta \right) ^ { S } ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where the proportionality arises because $\mathrm { ~ P ~ } ( X )$ does not depend on the parameters of interest, $\theta$ . Note that this is proportional to Eq. (6) above, and not Eq. (10), so this does not just represent a reparameterisation of the softmax.
|
| 127 |
+
|
| 128 |
+
Finally, this explanation for the cold posterior effect would suggest that we would see cold posteriors even in maximum a-posteriori (MAP) inference, as we confirm in Appendix A. This is expected as it is “common knowledge” (but we do not know of a good reference) that while weight-decay is closely related to MAP inference with Gaussian priors, the best performing value of the weight decay coefficient tend to be lower than those suggested by untempered MAP inference.
|
| 129 |
+
|
| 130 |
+
# 4 DIFFERENCES BETWEEN COLD POSTERIOR AND DATASET CURATION SETUPS
|
| 131 |
+
|
| 132 |
+
Our model of data curation provides a direct explanation for the effectiveness of cold posteriors, as Eq. (6) takes the underlying likelihoods, P $( Y _ { s } | X , \theta )$ to the power $S$ , which has exactly the same
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 3: Illustrative example of artificial clustering induced in the dataset by rejection of ambiguous no-consensus points. The input points for “cat” and “dog” classes are generated from separate 2D Gaussian distributions, and the classifier (and decision boundary) comes from the ratio of the Gaussian probability density functions. For the consensus processes, we used $S = 7$ (we used a relatively large value to make the effects unambiguous).
|
| 136 |
+
|
| 137 |
+
effect as $1 / \lambda$ in tempered posteriors (Eq. 2). However, it is important to note two differences between the cold posterior setup and the ideal setup for our generative model. First, our generative model assumes that the noconsensus points are known, or if they are unknown, we can compute the integral,
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\mathrm { P } \left( Y = \mathrm { N o n e } , Z = \mathrm { N o n e } | \theta \right) = \int d X \mathrm { ~ P ~ } ( X ) \left( 1 - \sum _ { y \in \mathcal { Y } } \mathrm { P } \left( Y _ { s } = y | X , \theta \right) ^ { S } \right)
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
which is obtained by evaluating Eq. (12) in the case where $Y { = } \mathrm { N o n e }$ , and substituting Eq. (7). Of course, in reality it is not possible to compute this integral because we do not know the underlying $\mathrm { ~ P ~ } ( X )$ (and usually, we do not even have samples from this distribution). In contrast, the standard cold-posterior setup entirely ignores these terms. Second, in the usual setting, the test data is also subject to the same consensus-formation process, in which case, we should use Eq. (10) for prediction. In contrast, in the standard cold-posterior setting, we use the single-labeller distribution, P $( Y _ { s } | X , \theta )$ . (Note that if the test-set was drawn “from the wild”, without dataset curation, and labelled by a single labeller, then we should use $\mathrm { P }$ $( Y _ { s } | X , \theta )$ for prediction). Overall then, while our model of data curation offers a potential explanation of the benefits of tempering, the differences in setup imply that we cannot expect $\lambda ^ { * } = \bar { 1 } / S$ , to hold exactly, where $\lambda ^ { * }$ is the optimal temperature, and this is confirmed in our results on toy data below.
|
| 144 |
+
|
| 145 |
+
# 5 RESULTS
|
| 146 |
+
|
| 147 |
+
# 5.1 DATA SAMPLED FROM A KNOWN GAUSSIAN PROCESS MODEL
|
| 148 |
+
|
| 149 |
+
In the introduction, we took it as given that if the prior is correct, the optimal approach is to use the true Bayesian posterior, avoiding either tempering or cold posteriors. To check that this is indeed the case, we tested the performance, measured as test-log-likelihood for tempered posteriors using data generated from a known Gaussian process model. We uniformly generated 50 input points on the 1D interval [-10, 10], and used a Gaussian process with squared exponential kernel with a standard deviation of 4, and kernel bandwidth of 1. For inference, we used reparameterised VI, with an approximate posterior given by multiplying the prior by a single Gaussian factor for each datapoint (Ober & Aitchison, 2020).
|
| 150 |
+
|
| 151 |
+
In particular, we used a Gaussian process prior for the function values, $\mathbf { u }$ , at the training inputs (Williams & Rasmussen, 2006),
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\mathrm { P } \left( \mathbf { f } | \mathbf { x } \right) = \mathcal { N } \left( \mathbf { f } ; \mathbf { 0 } , \mathbf { K } ( \mathbf { x } ) \right)
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
and we use an approximate posterior (Hensman et al., 2015; Matthews et al., 2016; Ober & Aitchison, 2020) defined by multiplying the prior by a Gaussian with diagonal covariance, where we treat $\mathbf { v }$ and
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 4: Tempering with data generated from a toy Gaussian process model. A Performance of tempered posteriors on GP regression. The green dashed line highlights $\lambda = 1$ . The black line represents the mean of 20 runs (translucent blue lines). B GP classification. C GP classification with our model of consensus formation. We train and test using our exact log-likelihood, and we include knowledge of the no-consensus input datapoints in the datasets. D Data generated from our model of consensus formation, with $S = 4$ . Training uses $\mathrm { ~ P ~ } ( Y _ { s } | X , \theta )$ log-likelihood (excluding noconsensus points), but testing uses the exact test-log-likelihood (Eq. 6 and 7). The red dashed line lies at $\lambda = 1 / S = 1 / 4$ . E Data generated from our model of consensus formation, with $S = 4$ . Training and testing follow the standard cold-posterior setup, excluding noconsensus points and using $\mathrm { ~ P ~ } ( Y _ { s } | \bar { X } , \theta )$ . The $\mathbf { X }$ -axis gives the number of labellers in the underlying generative process, and the y-axis gives the reciprocal of the optimal temperature. F Plots underlying $\mathbf { E }$ . The red dashed lines indicate $\lambda = 1 / S$ .
|
| 161 |
+
|
| 162 |
+
$\Lambda ^ { - 1 }$ as variational parameters.
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\mathrm ~ Q ( \mathbf { f } ) \propto \mathrm { P ( \mathbf { f } | x ) } \mathcal { N } ( \mathbf { v } ; \mathbf { f } , \mathbf { A } ^ { - 1 } ) = \mathcal { N } ( \mathbf { f } ; \Sigma \mathbf { A } \mathbf { v } , \Sigma ) \quad \mathrm { ~ w h e r e ~ } \quad \Sigma = ( \mathbf { K } ^ { - 1 } ( \mathbf { x } ) + \mathbf { A } ) ^ { - 1 }
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
Note that this captures the true posterior in the case of regression (where $\mathbf { v }$ is set to $\mathbf { y }$ and $\Lambda ^ { - 1 }$ is the output noise covariance; Ober & Aitchison, 2020). We then optimize the tempered ELBO (e.g. Zhang et al., 2017),
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\mathcal { L } = \mathbb { E } _ { \mathrm { Q } ( \mathbf { f } ) } \left[ \log \mathrm { P } \left( \mathbf { y } | \mathbf { f } \right) + \lambda \left( \log \mathrm { P } \left( \mathbf { f } | \mathbf { x } \right) - \log \mathrm { Q } \left( \mathbf { f } \right) \right) \right] .
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
And we used the standard GP approach for prediction at test points (Williams & Rasmussen, 2006).
|
| 175 |
+
|
| 176 |
+
Initially, we tried using standard regression and classification generative models, without including our model of consensus formation. Unsurprisingly, $\lambda = 1$ , corresponding to the Bayesian posterior, is optimal for GP regression (Fig. 4A) and classification (Fig. 4B). For GP regression, we use a Gaussian likelihood with standard deviation 1, and for classification, we use a standard sigmoid probability with a Bernoulli likelihood.
|
| 177 |
+
|
| 178 |
+
Next, we confirmed that even under our new, more complex generative model of dataset curation $\lambda = 1$ was still optimal (Fig. 4C), if we trained and tested using the correct form for the loglikelihood. In particular, we considered no-consensus inputs as known and used Eq. 7 to incorporate their likelihood. However, in standard benchmarks, only the consensus inputs are known. As such, next we generated curated data, trained using $\mathrm { ~ P ~ } ( Y _ { s } | X , \theta )$ and ignoring noconsensus points, but tested on the correct likelihood, including noconsensus points (Fig. 4D); the optimal temperature remains around 1. Finally, we considered the standard cold/tempered posterior setup, where we use P $( Y _ { s } | X , \theta )$ , excluding noconsensus points, for training and testing. The optimal $\lambda$ indeed fell with $S$ (Fig. 4EF), giving a potential explanation for the cold posterior effect. As expected, we have $S \approx 1 / \lambda ^ { * }$ , but the relation does not appear to hold exactly due to the mismatches discussed in Sec. 4. Finally, we show in Appendix B that the same patterns emerge in a Bayesian neural network, using Langevin sampling for inference.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 5: A Test log-likelihood with tempering. B Change in test log-likelihoods from the baseline at $\lambda = 1$ . We see standard cold posterior effects at low noise levels, which reverse at higher noies levels. C, D As A, B but for test accuracy.
|
| 182 |
+
|
| 183 |
+
# 5.2 CURATED AND UNCURATED GALAXY ZOO DATASETS
|
| 184 |
+
|
| 185 |
+
The most direct test of our theory is to evaluate the cold-posterior effect on real-world curated and uncurated datasets. To this end, we used the Galazy Zoo 2 dataset (Willett et al., 2013), as the original dataset is not “curated” in our sense (the criteria for inclusion were e.g. brightness) and the dataset gives classifications from $\sim 5 0$ labellers. We used a reduced label set for simplicity (see Appendix C). For the uncurated dataset, we selected 12500 points at random from the full dataset, and for the curated dataset, we selected the 12500 most confident points (defined in terms of labeller agreement), such that the correct class-balance was maintained. These datasets were split at random into 2500 training points and 10000 test points. Note that using our generative model directly would lead to drastically different class-balance in the curated and uncurated datasets, due to different levels of certainty for different classes. To perform probabilistic inference, we used SGLD with code adapted from (Zhang et al., 2019). In particular, we used their standard settings of a ResNet18, momentum of 0.9, and a cyclic cosine learning rate schedule. Due to the smaller size of our training set, we used longer cycles (600 epochs rather than 50), and more cycles (8 rather than 4).
|
| 186 |
+
|
| 187 |
+
As expected, we found that performance on curated data was far better than that on uncurated data, both in terms of test log-likelihood and test accuracy (Fig. 5AC). We found some cold-posterior effects in uncurated data, which is not surprising because there may be other causes of cold-posteriors such as model-mismatch or biases in SGLD. Critically though, we found much stronger cold-posterior effects for curated data than for uncurated data (Fig. 5BD). Moreover, these plots tend to understate the differences between curated and uncurated data. In particular, the proportional changes to the test-log-likelihood (which has an upper bound of zero) and the test error is for curated data is very large, with both changing by a factor of $\sim 3$ as temperature falls. In contrast, proportional changes for test-log-likelihood and test-error are much smaller (only $\sim 2 0 \%$ ).
|
| 188 |
+
|
| 189 |
+
# 5.3 CIFAR-10H
|
| 190 |
+
|
| 191 |
+
One prediction made by our framework is that if we had access to the original underlying human labels on the full dataset, including images that were rejected because consensus was not reached, then tempering should not be necessary. Obviously, all this additional information is not available for standard datasets such as CIFAR-10. However, we are able to get close by considering the CIFAR-10H dataset (Peterson et al., 2019). The authors of this work asked around 50 human labellers to label the CIFAR-10 test-set. As we might expect given the careful curation that went in to creating the original CIFAR-10 dataset (Krizhevsky, 2009), for almost half of the datapoints, all $\sim 5 0$ labellers agreed, and more than three-quarters of images had 2 or fewer disagreements (corresponding to $4 \%$ ) of labellers (Fig. 6A). While it is not possible to estimate $S$ without having information about the unknown image distribution, the high level of agreement would indicate that the effective value of $S$ is large — potentially even larger than 10.
|
| 192 |
+
|
| 193 |
+
Next, we trained a neural network on the $\sim 5 0$ labels provided by the CIFAR-10H dataset. As these labels are provided for the test-set with 10,000 images, this required us to swap the identities of the test and training sets (so that our training set consisted of 10,000 points, each with around 50 labels, and the test set consists of 50,000 points, with the single label from the original CIFAR-10 dataset). We compared against training with the standard CIFAR-10 test set, containing the same images but only with a single label. To perform probabilistic inference, we used SGLD with code adapted from (Zhang et al., 2019). In particular, we used their standard settings of a ResNet18, momentum of 0.9, and a cyclic cosine learning rate schedule. Due to the smaller size of our training set, we used longer cycles (150 epochs rather than 50), and more cycles (8 rather than 4). Importantly, we kept all the parameters of the learning algorithm the same for CIFAR-10H and our CIFAR-10 comparison. The only complication was that to keep the same effective learning rate for CIFAR-10H we need to take into account the number of labellers per datapoint (if we have 50 labels for a datapoint, the loss and the gradients of the loss are 50 times larger, resulting in step-sizes that are also 50 times larger). As such, to keep the same step-sizes, we divided the actual learning rate by 50. An alternative way to look at this is that we use the average log-likelihood per labeller (rather than per-image). Importantly, this change in learning rate, leaves the stationary distribution was unchanged, as changing the learning rate is not equivalent to tempering. All other parameters were left at the values specified by Zhang et al. (2019).
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 6: A The number of errors (defined as labellers who disagree with the most popular category) out of around 50 labels. B The test log-likelihood for different values of $\lambda$ for training with the standard single-labels provided by CIFAR-10 and the 50 labels provided by CIFAR-10H. Note that here we have swapped the identities of the train and test set. C As in B, but for accuracy.
|
| 197 |
+
|
| 198 |
+
As expected, when training on the single-label from the original CIFAR-10 testset (blue lines Fig. 6BC), there are very large tempering effects. In contrast, when training on the $\sim 5 0$ labels provided CIFAR-10H (orange), the effects of tempering are far smaller. In a sense, this is not surprising — using 50 labellers in effect makes the likelihood 50 times stronger, which is very similar to applying tempering. But this simplicity is the point: in the Bayesian setting we need to condition on all data — in our case all the labels, and once we do that, the cold posterior effect disappears.
|
| 199 |
+
|
| 200 |
+
Note that while tempering-effects are dramatically reduced, they have not been eliminated entirely. This is expected in our setting, both because of the mismatch between this setup and the exact setup (Sec. 4), but also because the inference method, SGLD, becomes more accurate as the minibatch-size increases, but we can never use full-batch in practical settings due to the large size of datasets such as CIFAR-10 (Welling & Teh, 2011). In SGLD minibatch gradients are used as a proxy for the gradient for the full dataset, but these minibatch gradients contain additional noise, and there is a potential that reducing the temperature may partially compensate for this additional noise. This is particularly evident if we consider (Wenzel et al., 2020, Fig. 6), which showed that cold-posterior effects can be amplified by using very small minibatch sizes — smaller minibatches imply larger variance in gradient estimates, and hence more potential for lower temperatures to compensate for that additional noise. That said, these effects do not appear to be significant for CIFAR-10 (Wenzel et al., 2020, Fig. 5), so we are in agreement with Wenzel et al. (2020) that minibatch noise are unlikely to be the primary source of tempering effects.
|
| 201 |
+
|
| 202 |
+
# 5.4 CIFAR-10 WITH NOISY LABELS
|
| 203 |
+
|
| 204 |
+
Curated labels are almost certain to represent the true class, and this is one way to understand the statistical patterns induced by curation that are exploited by tempered posteriors. We therefore considered disrupting this property by adding noise to the labels. In the standard classification setting, this should have very little effect (except to shrink the logit outputs somewhat to give more uncertain outputs). However, and as expected under our theory, we find that adding noise destroys and eventually reverses the cold-posterior effect (Fig. 7). This confirms that cold-posteriors are exploiting specific properties of the labels that are destroyed by adding noise. As such, cold posteriors are not likely to arise e.g. from failing to capture the prior over neural network weights (in which case adding noise to the outputs should have little effect). We suspect that the small improvement in performance at the first value of $\lambda$ below 1 might be due to partial compensation for additional noise introduced by minibatch estimates of the gradient.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 7: A Test log-likelihood with tempering for different probabilities of using a noisy label, $p$ . Noiser labels mean test-log-likelihoods are lower. B Change in test log-likelihoods from the baseline at $\lambda = 1$ . We see standard cold posterior effects at low noise levels, which reverse at higher noies levels. C, D As A, B but for test accuracy.
|
| 208 |
+
|
| 209 |
+
# 6 RELATED WORK
|
| 210 |
+
|
| 211 |
+
Wenzel et al. (2020) introduced the cold-posterior effect in the context of neural networks, and proposed and dismissed multiple potential explanations (although none like the one we propose here).
|
| 212 |
+
|
| 213 |
+
Other past work, though not in the neural network context, argues that tempering may be important in the context of model misspecification (Grünwald, 2012; Grünwald et al., 2017). Critically, we believe that there may be many causes of cold-posterior like effects, including but not limited to curation, model misspecification and artifacts from SGLD. Ultimately, the contribution of each of these factors in any given setting will depend on the exact dataset and inference method in question. Importantly, this also means we do not necessarily expect there to be no tempering in uncurated data, merely that we should see less tempering in the case of uncurated data.
|
| 214 |
+
|
| 215 |
+
Finally, the closest paper is concurrent work (Adlam et al., 2020) raising the possibility that BNNs overestimate aleatoric uncertainty, in part because of high-quality labels available in benchmark datasets. However, they concluded that while cold posteriors might help us to capture our priors, they do not correspond to an exact inference procedure. In contrast, here we give a generative model of dataset curation in which tempered likelihoods emerge naturally even under exact inference methods.
|
| 216 |
+
|
| 217 |
+
# 7 DISCUSSION AND CONCLUSIONS
|
| 218 |
+
|
| 219 |
+
We showed that modelling the process of data-curation can explain the improved performance of tempering or cold posteriors in Bayesian neural networks. While this work does provide a justification for future practitioners to use tempering in their Bayesian neural networks, we would urge caution. Importantly, and as we confirmed in Fig. 5, there may be other causes of the cold-posterior effect, e.g. because inference is inaccurate (compensating for additional noise added in SGLD), or may compensate for issues arising from model mispecification (Grünwald, 2012; Grünwald et al., 2017). As such, we urge practitioners to regard tempering with caution: if a very large amount of tempering is necessary to achieve good performance, it may indicate issues with either inference or the prior, and fixing these issues is of the utmost importance to obtaining accurate uncertainty estimation. More importantly, we hope that our work will prompt more careful dataset design, and further study of how data curation might impact downstream analyses in machine learning. Indeed, there are initial suggestions that semi-supervised learning methods are also exploiting the artificial clustering (Fig. 3) induced by data curation (Aitchison, 2020).
|
| 220 |
+
|
| 221 |
+
# ACKNOWLEDGEMENTS
|
| 222 |
+
|
| 223 |
+
I would like to thank Adrià Garriga-Alonso and Sebastian Ober for insightful discussions, Stoil Ganev for the GZ2 analyses which sadly came in only during the ICLR review period at which point author changes are banned (which is odd, given that revising the paper during the review period is allowed) and to Mike Walmsley and Sotiria Fotopoulou for getting us set up with GZ2. I would also like to thank Bristol’s Advanced Computing Research Centre (ACRC) for providing invaluable compute infrastructure that was used for all the experiments in this paper.
|
| 224 |
+
|
| 225 |
+
# REFERENCES
|
| 226 |
+
|
| 227 |
+
Ben Adlam, Jasper Snoek, and Samuel L Smith. Cold posteriors and aleatoric uncertainty. arXiv preprint arXiv:2008.00029, 2020.
|
| 228 |
+
|
| 229 |
+
Laurence Aitchison. A statistical theory of semi-supervised learning. arXiv preprint, 2020.
|
| 230 |
+
|
| 231 |
+
Arsenii Ashukha, Alexander Lyzhov, Dmitry Molchanov, and Dmitry Vetrov. Pitfalls of in-domain uncertainty estimation and ensembling in deep learning. arXiv preprint arXiv:2002.06470, 2020.
|
| 232 |
+
|
| 233 |
+
Juhan Bae, Guodong Zhang, and Roger Grosse. Eigenvalue corrected noisy natural gradient. arXiv preprint arXiv:1811.12565, 2018.
|
| 234 |
+
|
| 235 |
+
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.
|
| 236 |
+
|
| 237 |
+
Peter Grünwald. The safe bayesian. In International Conference on Algorithmic Learning Theory, pp. 169–183. Springer, 2012.
|
| 238 |
+
|
| 239 |
+
Peter Grünwald, Thijs Van Ommen, et al. Inconsistency of bayesian inference for misspecified linear models, and a proposal for repairing it. Bayesian Analysis, 12(4):1069–1103, 2017.
|
| 240 |
+
|
| 241 |
+
James Hensman, Alexander Matthews, and Zoubin Ghahramani. Scalable variational gaussian process classification. JMLR, 2015.
|
| 242 |
+
|
| 243 |
+
Edwin T Jaynes. Probability theory: The logic of science. Cambridge university press, 2003.
|
| 244 |
+
|
| 245 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, Toronto, 2009.
|
| 246 |
+
|
| 247 |
+
Alexander G de G Matthews, James Hensman, Richard Turner, and Zoubin Ghahramani. On sparse variational methods and the kullback-leibler divergence between stochastic processes. Journal of Machine Learning Research, 51:231–239, 2016.
|
| 248 |
+
|
| 249 |
+
Sebastian W Ober and Laurence Aitchison. Global inducing point variational posteriors for bayesian neural networks and deep gaussian processes. arXiv preprint arXiv:2005.08140, 2020.
|
| 250 |
+
|
| 251 |
+
Kazuki Osawa, Siddharth Swaroop, Mohammad Emtiyaz E Khan, Anirudh Jain, Runa Eschenhagen, Richard E Turner, and Rio Yokota. Practical deep learning with bayesian principles. In Advances in Neural Information Processing Systems, pp. 4289–4301, 2019.
|
| 252 |
+
|
| 253 |
+
Joshua C Peterson, Ruairidh M Battleday, Thomas L Griffiths, and Olga Russakovsky. Human uncertainty makes classification more robust. In Proceedings of the IEEE International Conference on Computer Vision, pp. 9617–9626, 2019.
|
| 254 |
+
|
| 255 |
+
Twan Van Laarhoven. L2 regularization versus batch and weight normalization. arXiv preprint arXiv:1706.05350, 2017.
|
| 256 |
+
|
| 257 |
+
Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 681–688, 2011.
|
| 258 |
+
|
| 259 |
+
Florian Wenzel, Kevin Roth, Bastiaan S Veeling, Jakub Swi ˛atkowski, 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.
|
| 260 |
+
|
| 261 |
+
Kyle W Willett, Chris J Lintott, Steven P Bamford, Karen L Masters, Brooke D Simmons, Kevin RV Casteels, Edward M Edmondson, Lucy F Fortson, Sugata Kaviraj, William C Keel, et al. Galaxy zoo 2: detailed morphological classifications for 304 122 galaxies from the sloan digital sky survey. Monthly Notices of the Royal Astronomical Society, 435(4):2835–2860, 2013.
|
| 262 |
+
|
| 263 |
+
Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes for machine learning. MIT press Cambridge, MA, 2006.
|
| 264 |
+
|
| 265 |
+
Guodong Zhang, Shengyang Sun, David Duvenaud, and Roger Grosse. Noisy natural gradient as variational inference. arXiv preprint arXiv:1712.02390, 2017.
|
| 266 |
+
|
| 267 |
+
Ruqi Zhang, Chunyuan Li, Jianyi Zhang, Changyou Chen, and Andrew Gordon Wilson. Cyclical stochastic gradient mcmc for bayesian deep learning. arXiv preprint arXiv:1902.03932, 2019.
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 8: SGD in a ResNet18 with batchnorm removed with a tempered maximum a-posteriori loss. A Test log-likelihood. B Accuracy.
|
| 271 |
+
|
| 272 |
+
# A COLD POSTERIORS IN MAXIMUM A-POSTERIORI INFERENCE
|
| 273 |
+
|
| 274 |
+
Our explanation for the cold posterior effect suggests that it is not just due to the stochasticity of the posterior, but should also arise in e.g. maximum a-posteriori (MAP) inference. However, MAP inference causes serious issues in networks with batchnorm. In particular, with batchnorm, the outputs become invariant to the scale of the weights, so the weights can continually decay towards zero (Van Laarhoven, 2017). Note that these considerations are not relevant when we are doing full approximate inference, as the product of the prior and likelihood is a static quantity with a well-defined scale that cannot e.g. decay towards zero. As such, we considered tempering in our usual ResNet18, but where we have deleted the batchnorm layers. We used a standard protocol for these types of network: SGD with momentum of 0.9 and an initial learning rate of 0.1, followed by decays to 0.01 and 0.001 at epochs 150 and 200. We read off performance at the final epoch (250) and used a batch size of 128. We use a standard prior over the weights, with variance 2/fan-in, to keep the scale of the inputs and outputs similar.
|
| 275 |
+
|
| 276 |
+
Remarkably, we found extremely strong cold-posterior effects (Fig. 8). These are perhaps expected as it is common-knowledge (but difficult to find a reference for) that while weight-decay is closely related to MAP inference with a Gaussian prior, good settings for the weight-decay coefficient are much smaller than those suggested by MAP inference with a sensible prior. Interestingly, these results suggest that the robustness of standard models to very low temperatures might arise due to batchnorm, and not be a fundamental property (e.g. having very large amounts of data).
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 9: Toy BNN model. A Test log-likelihood vs $\lambda$ for different settings of $S$ . B The optimal $\lambda$ , plotted against $S$ .
|
| 280 |
+
|
| 281 |
+
# B TOY BAYESIAN NEURAL NETWORK EXAMPLE
|
| 282 |
+
|
| 283 |
+
To confirm the results in the Gaussian processes toy example in the main text, we did the same exercise with a toy Bayesian neural network. In particular, we considered 100 training examples, drawn IID from standard Gaussians, each with 5 input dimensions and 2 class outputs. We generated the “true” or target outputs from a one hidden layer ReLU network, with 30 hidden units, drawn from the prior. We trained the same network, using Langevin dynamics (full batch, but no rejection step; initialized randomly from the prior). As in the GP example, we applied our generative model of dataset curation with different settings for $S$ in the generative model. For test and training, we used the standard single-labeller log-likelihood, which ignores rejected noconsensus inputs. We implemented a highly parallelised Langevin sampling algorithm, which allowed us to draw 500 different datasets, and run one chain for each dataset (and each setting of $\lambda$ in parallel). The large number of chains allowed us to obtain very accurate results, but did mean that it was not possible to plot lines for individual datasets. We used a learning rate of 0.01 and burn in of 4,000 steps; to compute performance, we averaged over 50 samples of neural-network parameters, which were taken from a chain that was 20,000 steps long in total.
|
| 284 |
+
|
| 285 |
+
In Fig. 9A, we plot the test-log-likelihood for different settings of $\lambda$ . There is a clear trend that as $S$ increases, the optimal temperature falls, and at the same time, the curves become flatter. Notably, these curves become flatter at the top for larger settings of $S$ , making it difficult to identify the optimal setting for $\lambda$ at higher values of $S$ . We then plotted the optimal setting of $\lambda$ against $S$ (Fig 9B). Initially, $S = 1$ is equivalent to the standard classification setup, as consensus is always reached, and as such, we find that the optimal temperature was 1. As in Fig. 4E, we found that $\lambda ^ { * } = 1 / S$ held only approximately. Nonetheless, these results suggest that we might need more tempering than suggested by $\lambda ^ { * } = 1 / S$ , which supports our proposed explanation of the cold posterior effect. Finally, it should be noted that these results depend sensitively on the accuracy of the inference algorithm, so it is difficult to say as yet the degree to which mismatch between $\lambda ^ { * }$ and $1 / S$ arises due to inaccuracy in inference or would emerge in the intractable true-posterior.
|
| 286 |
+
|
| 287 |
+
# C GALAXY ZOO 2 DETAILS
|
| 288 |
+
|
| 289 |
+
The Galaxy Zoo 2 data set (Willett et al., 2013) was constructed by presenting images of galaxies to volunteers, who were asked to answer a questionnaire about the morphological features of the presented galaxy. These questions are not independent from each other but are part of a decision tree. As such, the questions a volunteer gets asked depends on their answers to earlier questions. For each galaxy, answers from multiple volunteers were collect. The raw data is recorded as counts of how many times each answer was picked across all volunteers.
|
| 290 |
+
|
| 291 |
+
From this data we wanted to derive classes in such a way that the classification performed by each volunteer was equivalent to a vote towards one of our classes. The most straightforward approach is to consider each unique path in the decision tree to be a unique class. Given that a volunteer fills in the questionnaire only once, their classification is equivalent to a single vote towards a specific class. The problem with this approach is that there are 1265 possible paths in the original decision tree. The number of volunteers per galaxy is less than a hundred, which means that the majority of these paths would receive 0 votes.
|
| 292 |
+
|
| 293 |
+
In order to address this, we simplified the tree to one where there are only 9 possible paths. The simplifications was performed by manually pruning branches of the decision tree. This way each path in the original tree could be mapped to a path in the simplified one, while maintaining specific aspects of its meaning. The simplified tree can be seen in (modified_graph.png). The following pruning operations were performed in order to create this simplified tree. Here we refer to each question using its task number, as given in the original paper.
|
| 294 |
+
|
| 295 |
+
• Task 02, Answer ’no’: leads directly to Task 05, skipping Task 03, Task 04, Task 10 and Task 11
|
| 296 |
+
• Task 05, Answers ’dominant’ and ’obvious’: merged together becoming a combined category labelled ’obvious’
|
| 297 |
+
• Task 05, all answers: lead directly to the end of the graph, becoming exit points
|
| 298 |
+
• Task 07, all answers: lead directly to the end of the graph, becoming exit points Task 09, Answers ’rounded’ and ’boxy’: merged together becoming a combined category labelled ’with bulge’
|
| 299 |
+
• Task 09, all answers: lead directly to the end of the graph, becoming exit points
|
| 300 |
+
• As a consequence of the above pathing changes Task 03, Task 04, Task 06, Task 08, Task 10 and Task 11 are no longer reachable and thus removed from the graph
|
| 301 |
+
|
| 302 |
+
If we are to take each of the 9 paths in the simplified tree to form a class, then the resulting 9 classes would have the following meanings:
|
| 303 |
+
|
| 304 |
+
• smooth galaxy, completely round shape
|
| 305 |
+
• smooth galaxy, in-between round and cigar shaped
|
| 306 |
+
• smooth galaxy, cigar shaped
|
| 307 |
+
• edge-on disk galaxy, with central bulge
|
| 308 |
+
• edge-on disk galaxy, no central bulge
|
| 309 |
+
• face-on disk galaxy, obvious central bulge
|
| 310 |
+
• face-on disk galaxy, just noticeable central bulge
|
| 311 |
+
• face-on disk galaxy, no central bulge
|
| 312 |
+
• star or artifact
|
| 313 |
+
|
| 314 |
+
Using the simplified decision tree, we can decompose the data into votes for each path. The Galaxy Zoo data was recorded as counts for each specific answer, thus losing the information about which route a specific volunteer took in the tree. However, with the help of network flow algorithms it is possible to translate the data into counts of how many volunteers took a specific path. This way, by taking each path to be a class and the number of volunteers that followed a path to be the number of votes toward a class, we have a data set where each data point has received multiple classification over a fixed range of classes.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 10: Modified decision tree from Willett et al. (2013) showing how we truncated the decision tree. Images in the same box are viewed as the same class.
|
| 318 |
+
|
| 319 |
+
For each galaxy in the Galaxy ${ \bf Z } _ { 0 0 } \mathrm { ~ } 2$ data set we also have the image that was presented to the volunteers. As such, we can use our derived classes in an image classification task. In order to do this, we performed certain pre-processing. The original images have a resolution of $4 2 4 \mathrm { x } 4 2 4$ with the galaxy being at the center of the image. Thus, we performed a center crop of size $2 1 2 \mathbf { x } 2 1 2$ and then resized the images down to 32x32. For data augmentation, we used full 360 degree continuous rotations.
|
md/train/Re_VXFOyyO/Re_VXFOyyO.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On the Convergence and Sample Efficiency of Variance-Reduced Policy Gradient Method
|
| 2 |
+
|
| 3 |
+
Junyu Zhang Department of Industrial Systems Engineering and Management National University of Singapore Singapore, 119077 junyuz@nus.edu.sg
|
| 4 |
+
|
| 5 |
+
Chengzhuo Ni Department of Electrical and Computer Engineering Princeton University Princeton, NJ, 08544 chengzhuo.ni@princeton.edu
|
| 6 |
+
|
| 7 |
+
Zheng Yu Department of Electrical and Computer Engineering Princeton University Princeton, NJ, 08544 zhengy@princeton.edu
|
| 8 |
+
|
| 9 |
+
Csaba Szepesvari Department of Computer Science University of Alberta Edmonton, Alberta, Canada T6G 2E8 szepesva@ualberta.ca
|
| 10 |
+
|
| 11 |
+
Mengdi Wang Department of Electrical and Computer Engineering Princeton University Princeton, NJ, 08544 mengdiw@princeton.edu
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Policy gradient (PG) gives rise to a rich class of reinforcement learning (RL) methods. Recently, there has been an emerging trend to accelerate the existing PG methods such as REINFORCE by the variance reduction techniques. However, all existing variance-reduced PG methods heavily rely on an uncheckable importance weight assumption made for every single iteration of the algorithms. In this paper, a simple gradient truncation mechanism is proposed to address this issue. Moreover, we design a Truncated Stochastic Incremental Variance-Reduced Policy Gradient (TSIVR-PG) method, which is able to maximize not only a cumulative sum of rewards but also a general utility function over a policy’s long-term visiting distribution. We show an $\tilde { \mathcal { O } } ( \epsilon ^ { - 3 } )$ sample complexity for TSIVR-PG to find an $\epsilon$ -stationary policy. By assuming the overparameterization of policy and exploiting the hidden convexity of the problem, we further show that TSIVR-PG converges to global $\epsilon$ -optimal policy with $\tilde { \mathcal { O } } ( \epsilon ^ { - 2 } )$ samples.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
In this paper, we investigate the theoretical properties of Policy Gradient (PG) methods for Reinforcement Learning (RL) [43]. In view of RL as a policy optimization problem, the PG method
|
| 20 |
+
|
| 21 |
+
parameterizes the policy function and conduct gradient ascent search to improve the policy. In this paper, we consider the soft-max policy parameterization
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
\pi _ { \theta } ( a | s ) = \frac { \exp \{ \psi ( s , a ; \theta ) \} } { \sum _ { a ^ { \prime } } \exp \{ \psi ( s , a ^ { \prime } ; \theta ) \} }
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
where $( s , a )$ is a state-action pair and $\psi$ is some smooth function. Potentially, one can set the function $\psi$ to be some deep neural network with weights $\theta$ and input $( s , a )$ . The main problem considered in this paper is the policy optimization for a general utility function:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\operatorname* { m a x } _ { \theta } R ( \pi _ { \theta } ) : = F ( \lambda ^ { \pi _ { \theta } } ) ,
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $F$ is a general smooth function, and $\lambda ^ { \pi _ { \theta } }$ denotes the unnormalized state-action occupancy measure (also referred to as the visitation measure). For any policy $\pi$ and initial state distribution $\xi$ ,
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\lambda ^ { \pi } ( s , a ) : = \sum _ { t = 0 } ^ { + \infty } \gamma ^ { t } \cdot \mathbb { P } \Big ( s _ { t } = s , a _ { t } = a \big | \pi , s _ { 0 } \sim \xi \Big ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\gamma$ stands for the discount factor and $\mathbb { P }$ denotes the probability of a certain event. When $F$ is linear, the problem reduces to the standard policy optimization problem where the objective is to maximize a cumulative sum of rewards. When $F$ is nonlinear, problem (2) goes beyond standard Markov decision problems: examples include the max-entropy exploration [16], risk-sensitive RL [50], certain set constrained RL [27], and so on.
|
| 40 |
+
|
| 41 |
+
In the standard cumulative-return case (i.e., $F$ is linear), numerous works have studied PG methods in various scenarios, see e.g. [47, 5, 58, 22, 21, 37, 38, 23]. When directly optimizing over the policy space without any parameterization, the policy mirror descent (PMD) method [23] achieves an $\bar { \mathcal { O } } ( \epsilon ^ { - 2 } )$ sample complexity to find an $\mathcal { O } ( \epsilon )$ -optimal solution. However, for the more practical parameterized policy optimization, to the authors’ best knowledge, the most recent variant of PG methods, using the SARAH/Spider stochastic variance reduction technique [13, 29], find a local $\epsilon$ -stationary policy using $\mathcal { O } ( \epsilon ^ { - 3 } )$ samples [48, 33]. This poses a contrast with the known $\tilde { O } ( \epsilon ^ { - 2 } )$ sample complexity results that can be achieved by various value-based methods [4, 42, 41] and are provably matching information-theoretic lower bounds [12, 3, 4]. In this paper, we attempt to close this gap and prove an $\tilde { \mathcal { O } } ( \epsilon ^ { - 2 } )$ sample complexity bound for a PG method. Most importantly, when it comes to PG estimation, the application of the variance reduction technique typically relies on certain off-policy PG estimator, resulting in the difficulty of distribution shift. We notice that none of the existing variance-reduced PG methods attempt to address this challenge. Instead, they directly make an uncheckable assumption that the variance of the importance weight is bounded for every policy pair encountered in running the algorithm, see e.g. [31, 48, 49, 33]. In this paper, we propose a simple gradient truncation mechanism to fix this issue.
|
| 42 |
+
|
| 43 |
+
Next, let us go beyond cumulative return and consider policy optimization for a general utility where $F$ may be nonlinear. However, much less is known in this setting. The nonlinearity of $F$ invalidates the concept of Q-function and value function, leading to the failure of policy gradient theorem [44]. To overcome such difficulty, [51] showed that the policy gradient for the general utilities is the solution to a min-max problem. However, estimating a single PG is highly nontrivial in this case. It is still unclear how to make PG methods to use samples in a most efficient way.
|
| 44 |
+
|
| 45 |
+
In this paper, we aim to investigate the convergence and sample efficiency of the PG method, using episodic sampling, for both linear $F$ (i.e., cumulative rewards) and nonlinear $F$ (i.e., general utility). Observe that problem (2) is an instance of the Stochastic Composite Optimization (SCO) problem [45, 46]: $\mathrm { m i n } _ { x } ^ { - } f ( \mathbb { E } _ { \nu } [ g _ { \nu } ( x ) ] )$ , which involves an inner expectation that corresponds to the occupancy measure $\lambda ^ { \pi }$ . Motivated by this view point, we attempt to develop stochastic policy gradient method with provable finite-sample efficiency bounds.
|
| 46 |
+
|
| 47 |
+
Main results. Our main results are summarized below.
|
| 48 |
+
|
| 49 |
+
• We propose the TSIVR-PG algorithm to solve problem (2) via episodic sampling. It provides a conceptually simple stochastic gradient approach for solving general utility RL. • We provide a gradient truncation mechanism to address the distribution shift difficulty in variance-reduced PG methods. Such difficulty has never been addressed in previous works.
|
| 50 |
+
|
| 51 |
+
• We show that TSIVR-PG finds an $\epsilon$ -stationary policy using $\tilde { O } ( \epsilon ^ { - 3 } )$ samples if $F$ and $\psi$ are general smooth functions. When $F$ is concave and $\psi$ satisfies certain overparameterization condition, we show that TSIVR-PG obtains a gloal $\epsilon$ -optimal policy using $\bar { O } ( \epsilon ^ { - 2 } )$ samples.
|
| 52 |
+
|
| 53 |
+
Technical contribution. Our analysis technique is also of independent interest in the relating areas.
|
| 54 |
+
|
| 55 |
+
• For stochastic composite optimization (SCO), most existing algorithms require estimating the Jacobian matrix of the inner mapping, which corresponds to $\nabla _ { \boldsymbol { \theta } } \lambda ^ { \pi _ { \boldsymbol { \theta } } }$ in our setting. This is in practice prohibitive if the Jacobian matrix has high dimensions, which is exactly the case in our problem. Unlike SCO algorithms such as [24, 54, 53, etc.], our analysis enables us to avoid the Jacobian matrix estimation.
|
| 56 |
+
For the stochastic variance-reduced gradient methods, our analysis implies a convergence of SARAH/Spider methods to global optimality and a new $\mathcal { O } ( \epsilon ^ { - 2 } )$ sample complexity for nonconvex problems with “hidden convexity” structure, which has not been studied in the optimization community yet.
|
| 57 |
+
|
| 58 |
+
# 2 Related Works
|
| 59 |
+
|
| 60 |
+
Policy gradient gives rises to a rich family of RL algorithms, such as REINFORCE and many of its variants [47, 5, 58], as well as extensions such as the natural policy gradient methods [20, 32], the actor-critic methods [22, 21, 28], the trust-region policy optimization [37, 57, 39], and the proximal policy optimization method [38, 25], etc. In this paper we mainly focus on REINFORCE-type methods, where many of them need $\tilde { \mathcal { O } } ( \epsilon ^ { - 4 } )$ samples to find an $\epsilon$ -stationary solution, including the vanilla REINFORCE [47], as well as its variants with baseline [58, 43] and GPOMDP [5], etc. By incorporating the stochastic variance reduction techniques, the sample efficiency of PG methods can be further improved. In [31], the SVRG [19] variance reduction scheme is adopted and an $\mathcal { O } ( \epsilon ^ { - 4 } )$ sample complexity is achieved, which is later improved to $\mathcal { O } ( \epsilon ^ { - 1 0 / 3 } )$ by [48]. With additional Hessian information, [40] achieved an $\mathcal { O } ( \epsilon ^ { - 3 } )$ complexity. By utilizing a more efficient SARAH/Spider [29, 13] variance reduction scheme, people are able to achieve $\mathcal { O } ( \epsilon ^ { - 3 } )$ sample complexity without second-order information [48, 33]. We would like to comment that these results are only for finding $\epsilon$ -stationary (rather than near-optimal) solutions, and all of them requires an uncheckable condition on the importance weights in every iteration.
|
| 61 |
+
|
| 62 |
+
Recently, for cumulative reward, a series of works have started to study the convergence of policy gradient method to global optimal solutions [1, 14, 56, 6, 26, 7, 9, 55]. In particular, [51] exploited the hidden convexity property of the MDP problem and established the convergence to global optimality for general utility RL problem, as long as the policy gradient can be computed exactly.
|
| 63 |
+
|
| 64 |
+
Our approach is related to the stochastic composite optimization (SCO) [45, 46]. For the general composition problem, there have been numerous developments, including momentum-based and multi-time-scale algorithms [45, 46, 15], and various composite stochastic variance-reduced algorithms [24, 17, 52, 54]. Our approach is also inspired by variance reduction techniques that were initially used for stochastic convex optimization, see [19, 36, 11, 29]; and were later on extended to the stochastic nonconvex optimization problems [2, 34, 18, 35, 13, 30]. In particular, we will utilize the SARAH/Spider scheme [13, 30].
|
| 65 |
+
|
| 66 |
+
# 3 Problem Formulation
|
| 67 |
+
|
| 68 |
+
Consider an MDP with a general utility function, denoted as $\mathbf { M D P } ( S , { \mathcal { A } } , { \mathcal { P } } , \gamma , F )$ , where $s$ is a finite state space, $\mathcal { A }$ is a finite action space, $\gamma \in ( 0 , 1 )$ is a discount factor, and $F$ is some general utility function. For each state $s \in S$ , a transition to state $s ^ { \prime } \in \varDelta$ occurs when selecting an action $a \in { \mathcal { A } }$ following the distribution $\textstyle { \mathcal { P } } ( \cdot | a , s )$ . For each state $s \in S$ , a policy $\pi$ gives a distribution $\pi ( \cdot | s )$ over the action space $\mathcal { A }$ . Let $\xi$ be the initial state distribution and let the unnormalized state-action occupancy measure $\lambda ^ { \pi }$ be defined by (3), we define the general utility function $F$ as a smooth function of the occupancy measure, and the goal of the general utility MDP is to maximize $F ( \lambda ^ { \pi } )$ . With the policy $\pi _ { \theta }$ being parameterized by (1), we propose to solve problem (2), which is
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\operatorname* { m a x } _ { \theta } R ( \pi _ { \theta } ) : = F \left( \lambda ^ { \pi _ { \theta } } \right) .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
For notational convenience, we often write $\lambda ( \theta )$ instead of $\lambda ^ { \pi _ { \theta } }$ . Such utility function is very general and includes many important problems in RL. We provide a few examples where $F$ are concave.
|
| 75 |
+
|
| 76 |
+
Example 3.1 (Cumulative reward). When $F \left( \lambda ^ { \pi _ { \theta } } \right) = \left. r , \lambda ^ { \pi _ { \theta } } \right.$ , for some $r \in \mathbb { R } ^ { | S | | \mathcal { A } | }$ . Then we recover the standard cumulative sum of rewards: $\begin{array} { r } { R ( \pi _ { \theta } ) = \mathbb { E } \big [ \sum _ { t = 0 } ^ { + \infty } \gamma ^ { t } \cdot r ( s _ { t } , a _ { t } ) \big | \pi _ { \theta } , s _ { 0 } \sim \xi \big ] } \end{array}$ .
|
| 77 |
+
|
| 78 |
+
Example 3.2 (Maximal entropy exploration). Let $\begin{array} { r } { \mu ^ { \pi _ { \theta } } ( s ) = ( 1 - \gamma ) \sum _ { a } \lambda ^ { \pi _ { \theta } } ( s , a ) } \end{array}$ , $\forall s \in S$ be the state occupancy measure, which is the margin of $\lambda ^ { \pi _ { \theta } }$ over $s$ . Let $F ( \cdot )$ be the entropy function, then we recover the objective for maximal entropy exploration $\begin{array} { r } { \left[ { I 6 } \right] : R ( \pi _ { \theta } ) = - \sum _ { s \in \mathcal { S } } \mu ^ { \bar { \pi _ { \theta } } } ( s ) \log \mu ^ { \pi _ { \theta } } ( s ) } \end{array}$ .
|
| 79 |
+
|
| 80 |
+
Example 3.3 (RL with Set Constraint). Let $\mathbf { z } ( s _ { t } , a _ { t } ) \in \mathbb { R } ^ { d }$ be a vector feedback received in each step. The cumulative feedback is $\begin{array} { r } { \mathbf { u } ( \pi _ { \theta } ) : = \mathbb { E } \big [ \sum _ { t = 0 } ^ { + \infty } \gamma ^ { t } \cdot \mathbf { z } ( s _ { t } , a _ { t } ) | s _ { 0 } \sim \xi , \pi _ { \theta } \big ] = M \lambda ^ { \pi _ { \theta } } } \end{array}$ for some matrix $M \in \mathbb { R } ^ { d \times | S | | A | }$ . [27] proposed a set-constrained RL problem which aims to find a policy $\pi$ s.t. $u ( \pi ) \in U$ for some convex set $U$ . This problem can be formulated as an instance of (2) by letting $F ( \cdot )$ be the negative squared distance: $\begin{array} { r } { R ( \pi _ { \theta } ) = - \operatorname* { m i n } _ { \mathbf { u } ^ { \prime } \in U } \| \mathbf { u } ^ { \prime } - \mathbf { u } ( \pi _ { \theta } ) \| ^ { 2 } } \end{array}$ .
|
| 81 |
+
|
| 82 |
+
# 4 The TSIVR-PG Algorithm
|
| 83 |
+
|
| 84 |
+
In this section, we propose a Truncated Stochastic Incremental Variance-Reduced Policy Gradient (TSIVR-PG) method, which is inspired by techniques of variance reduction and off-policy estimation. A gradient truncation mechanism is proposed to provably control the importance weights in off-policy sampling.
|
| 85 |
+
|
| 86 |
+
# 4.1 Off-Policy PG Estimation
|
| 87 |
+
|
| 88 |
+
Policy Gradient First, let us derive the policy gradient of the general utility. Let $V ^ { \pi _ { \theta } } ( r )$ be the cumulative reward under policy $\pi _ { \theta }$ , initial distribution $\xi$ and reward function $r$ . By Example 3.1, $V ^ { \pi _ { \theta } } ( r ) = \langle \lambda ( \theta ) , r \rangle$ , the chain rule and policy gradient theorem [44] indicates that
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\nabla _ { \theta } V ^ { \pi _ { \theta } } ( r ) = \left[ \nabla _ { \theta } \lambda ( \theta ) \right] ^ { \top } r = \mathbb { E } _ { \xi , \pi _ { \theta } } \Big [ \sum _ { t = 0 } ^ { + \infty } \gamma ^ { t } \cdot r ( s _ { t } , a _ { t } ) \cdot \Big ( \sum _ { t ^ { \prime } = 0 } ^ { t } \nabla _ { \theta } \log \pi _ { \theta } ( a _ { t ^ { \prime } } | s _ { t ^ { \prime } } ) \Big ) \Big ] ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\nabla _ { \boldsymbol { \theta } } \lambda ( \boldsymbol { \theta } )$ is the Jacobian matrix of the vector mapping $\lambda ( \theta )$ . That is, policy gradient theorem actually provides a way for computing the Jacobian-vector product for the occupancy measure. Following the above observation and the chain rule, we have
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\nabla _ { \boldsymbol { \theta } } R ( \pi _ { \boldsymbol { \theta } } ) = \left[ \nabla _ { \boldsymbol { \theta } } \lambda ( \boldsymbol { \theta } ) \right] ^ { \top } \nabla _ { \lambda } F ( \lambda ( \boldsymbol { \theta } ) ) = \nabla _ { \boldsymbol { \theta } } V ^ { \pi _ { \boldsymbol { \theta } } } ( r ) \vert _ { r = \nabla _ { \lambda } F ( \lambda ( \boldsymbol { \theta } ) ) } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Therefore, we can estimate the policy gradient using the typical REINFORCE as long as we pick the “quasi-reward function" as $r : = \nabla _ { \lambda } F ( \lambda ( \theta ) )$ . To find this quasi-reward, we need to estimate the state-action occupancy measure $\lambda ( \theta )$ (unless $F$ is linear).
|
| 101 |
+
|
| 102 |
+
Importance Sampling Weight Let $\tau = \left\{ s _ { 0 } , a _ { 0 } , s _ { 1 } , a _ { 1 } , \cdot \cdot \cdot , s _ { H - 1 } , a _ { H - 1 } \right\}$ be a length- $H$ trajectory generated under the initial distribution $\xi$ and the behavioral policy $\pi _ { \theta _ { 1 } }$ . For any target policy $\pi _ { \boldsymbol { \theta } _ { 2 } }$ , we define the importance sampling weight as
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) = \frac { \Pi _ { h = 0 } ^ { t } \pi _ { \theta _ { 2 } } ( a _ { h } | s _ { h } ) } { \Pi _ { t = 0 } ^ { h } \pi _ { \theta _ { 1 } } ( a _ { h } | s _ { h } ) } , \qquad 0 \le t \le H - 1 .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
It is worth noting that such importance sampling weight is inevitable in the stochastic variance reduced policy gradient methods, see [31, 48, 49, 33, 25]. In these works, the authors usually directly assume $\mathrm { \bar { V a r } } ( \bar { \omega _ { H - 1 } } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) ) \leq W$ for all the policy pairs encountered in every iteration of their algorithms. However, such assumption is too strong and is uncheckable.
|
| 109 |
+
|
| 110 |
+
Based on the above notation of behavioral and target policies, as long as the importance sampling weights, we present the following off-policy occupancy and policy gradient estimators.
|
| 111 |
+
|
| 112 |
+
Off-Policy Occupancy Measure Estimator Denote $\mathbf { e } _ { s a }$ the vector with $( s , a )$ -th entry being 1 while other entries being 0. We define the following estimator for $\lambda ( \theta _ { 2 } )$
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\widehat { \lambda } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) : = \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } \cdot \omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) \cdot \mathbf { e } _ { s _ { t } a _ { t } } .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
When $\theta _ { 2 } = \theta _ { 1 }$ , $\omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) \equiv 1$ and $\widehat { \lambda } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } )$ becomes the on-policy (discounted) empirical distribution, for which we use the simplified notion $\widehat { \lambda } ( \tau | \theta _ { 2 } ) : = \widehat { \lambda } _ { \omega } ( \tau | \mathbf { \bar { \theta } } _ { 2 } , \mathbf { \bar { \theta } } _ { 2 } )$ .
|
| 119 |
+
|
| 120 |
+
Off-Policy Policy Gradient Estimator Let $r \in \mathbb { R } ^ { | S | | A | }$ be any quasi-reward vector. We aim to estimate the Jacobian-vector product $[ \nabla _ { \boldsymbol { \theta } } \lambda ( \boldsymbol { \theta } _ { 2 } ) ] ^ { \top } r$ for target policy $\pi _ { \theta _ { 2 } }$ by
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\widehat { g } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } , r ) : = \sum _ { t = 0 } ^ { H - 1 } \gamma ^ { t } \cdot \omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) \cdot r ( s _ { t } , a _ { t } ) \cdot \Big ( \sum _ { t ^ { \prime } = 0 } ^ { t } \nabla _ { \theta } \log \pi _ { \theta _ { 2 } } ( a _ { t ^ { \prime } } | s _ { t ^ { \prime } } ) \Big ) .
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
When $\theta _ { 2 } = \theta _ { 1 }$ , $\omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) \equiv 1$ and $\widehat { g } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } , r )$ becomes the on-policy REINFORCE estimator with quasi-reward function $r$ b. In this case, we use the simplified notion $\widehat { g } ( \tau | \theta _ { 2 } , r ) : = \widehat { g } _ { \omega } ( \tau | \theta _ { 2 } , \theta _ { 2 } , r )$ . Estimators $\widehat { \lambda } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } )$ and $\widehat { g } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } , r )$ are almost unbiased. In details, $\| \mathbb { E } _ { \tau \sim \pi _ { \theta _ { 1 } } } [ \widehat { \lambda } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) ] -$ $\lambda ( \theta _ { 2 } ) \lVert \leq \mathcal { O } ( \gamma ^ { H } )$ and $\begin{array} { r } { \big \| \mathbb { E } _ { \tau \sim \pi _ { \theta _ { 1 } } } \big [ \widehat { g } _ { \omega } ( \tau | \theta _ { 1 } , \theta _ { 2 } , r ) \big ] - \big [ \nabla _ { \theta } \lambda ( \theta _ { 2 } ) \big ] ^ { \top } r \big \| \leq \mathcal { O } ( H \cdot \gamma ^ { H } ) } \end{array}$ ; see details in Appendix 1 bE. Therefore the bias due to truncation is almost negligible if $H$ is properly selected.
|
| 127 |
+
|
| 128 |
+
# 4.2 The TSIVR-PG Algorithm
|
| 129 |
+
|
| 130 |
+
To achieve the $\tilde { \mathcal { O } } ( \epsilon ^ { - 2 } )$ sample complexity, we propose an epoch-wise algorithm called Truncated Stochastic Incremental Variance-Reduced PG (TSIVR-PG) Algorithm. Let ${ \bf { \bar { \boldsymbol { \theta } } } } _ { 0 } ^ { i }$ be the starting point of the $i$ -th epoch, TSIVR-PG constructs the estimators for $\lambda ( \theta _ { 0 } ^ { i } )$ , quasi-reward $\nabla _ { \lambda } F ( \lambda ( \theta _ { 0 } ^ { i } ) { \bar { ) } }$ and the policy gradient $\nabla _ { \theta } F ( \lambda ( \theta _ { 0 } ^ { i } ) )$ by
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\lambda _ { 0 } ^ { i } = \frac { 1 } { N } \sum _ { \tau \in \mathcal { N } _ { i } } \widehat { \lambda } ( \tau | \theta _ { 0 } ^ { i } ) , ~ r _ { 0 } ^ { i } = \nabla _ { \lambda } F ( \lambda _ { 0 } ^ { i } ) ~ \mathrm { a n d } ~ g _ { 0 } ^ { i } = \frac { 1 } { N } \sum _ { \tau \in \mathcal { N } _ { i } } \widehat { g } ( \tau | \theta _ { 0 } ^ { i } , r _ { 0 } ^ { i } ) .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where ${ \mathcal { N } } _ { i }$ is a set of $N$ independent length- $H$ trajectories sampled under $\pi _ { \theta _ { 0 } ^ { i } }$ . When $j \geq 1$
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\lambda _ { j } ^ { i } = \frac { 1 } { B } \sum _ { \tau \in \mathscr { B } _ { j } ^ { i } } \left( \widehat { \lambda } ( \tau | \theta _ { j } ^ { i } ) - \widehat { \lambda } _ { \omega } ( \tau | \theta _ { j } ^ { i } , \theta _ { j - 1 } ^ { i } ) \right) + \lambda _ { j - 1 } ^ { i } , \qquad r _ { j } ^ { i } = \nabla _ { \lambda } F ( \lambda _ { j } ^ { i } )
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
g _ { j } ^ { i } = \frac { 1 } { B } \sum _ { \tau \in B _ { j } ^ { i } } \left( \widehat { g } \left( \tau | \theta _ { j } ^ { i } , r _ { j - 1 } ^ { i } \right) - \widehat { g } _ { \omega } \left( \tau | \theta _ { j } ^ { i } , \theta _ { j - 1 } ^ { i } , r _ { j - 2 } ^ { i } \right) \right) + g _ { j - 1 } ^ { i } ,
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where $B _ { j } ^ { i }$ is a set of $B$ independent length- $H$ trajectories sampled under $\pi _ { \theta _ { j } ^ { i } }$ , and we default $r _ { - 1 } ^ { i } : = r _ { 0 } ^ { i }$ . Specifically, $\widehat { g } _ { \omega } ( \tau | \theta _ { j } ^ { i } , \theta _ { j - 1 } ^ { i } , r _ { j - 2 } ^ { i } )$ is used instead of $\widehat { g } _ { \omega } ( \tau | \theta _ { j } ^ { i } , \theta _ { j - 1 } ^ { i } , r _ { j - 1 } ^ { i } )$ for independence issue. The b bdetails of the TSIVR-PG algorithm are stated in Algorithm 1.
|
| 147 |
+
|
| 148 |
+
# Algorithm 1: The TSIVR-PG Algorithm
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
|
| 152 |
+
It is worth noting that the truncated gradient step (11) is equivalent to a trust region subproblem:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\theta _ { j + 1 } ^ { i } = \underset { \| \theta - \theta _ { j } ^ { i } \| \leq \delta } { \operatorname { a r g m a x } } ~ { F } ( \lambda ( \theta _ { j } ^ { i } ) ) + \langle g _ { j } ^ { i } , \theta - \theta _ { j } ^ { i } \rangle + \frac { 1 } { 2 \eta } \| \theta - \theta _ { j } ^ { i } \| ^ { 2 }
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
where the approximate Hessian matrix is simply chosen as $( \eta ) ^ { - 1 } \cdot I$ .
|
| 159 |
+
|
| 160 |
+
# 5 Sample Efficiency of TSIVR-PG
|
| 161 |
+
|
| 162 |
+
In this section, we analyze the finite-sample performance of TSIVR-PG. We first show that TSIVR-PG finds an $\epsilon$ -stationary solution with $\bar { \mathcal { O } } ( \bar { \epsilon } ^ { - 3 } )$ samples. Given additional assumptions, we show that TSIVR-PG finds a global $\epsilon$ -optimal solution with $\tilde { \mathcal { O } } ( \epsilon ^ { - 2 } )$ samples .
|
| 163 |
+
|
| 164 |
+
# 5.1 Convergence Towards Stationary Points
|
| 165 |
+
|
| 166 |
+
Since we focus on the soft-max policy parameterization where $\begin{array} { r } { \pi _ { \theta } ( a | s ) = \frac { \exp \{ \psi ( s , a ; \theta ) \} } { \sum _ { a ^ { \prime } } \exp \{ \psi ( s , a ^ { \prime } ; \theta ) \} } } \end{array}$ P a0 exp{ψ(s,a0;θ)} , we make the following assumptions on the parameterization function $\psi$ and the utility $F$ .
|
| 167 |
+
|
| 168 |
+
Assumption 5.1. $\psi ( s , a ; \cdot )$ is twice differentiable for all s and $a$ . There $\exists \ell _ { \psi } , L _ { \psi } > 0$ s.t.
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\operatorname* { m a x } _ { s \in S , a \in A } \operatorname* { s u p } _ { \theta } \| \nabla _ { \theta } \psi ( s , a ; \theta ) \| \leq \ell _ { \psi } \quad a n d \quad \operatorname* { m a x } _ { s \in S , a \in A } \operatorname* { s u p } _ { \theta } \| \nabla _ { \theta } ^ { 2 } \psi ( s , a ; \theta ) \| \leq L _ { h } ,
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
where $\| \cdot \|$ stands for $L _ { 2 }$ norm and spectral norm for vector and matrix respectively.
|
| 175 |
+
|
| 176 |
+
Assumption 5.2. $F$ is a smooth and possibly nonconvex function. There exists $\ell _ { \lambda , \infty } > 0$ such that $\| \nabla _ { \lambda } F ( \lambda ) \| _ { \infty } \leq \ell _ { \lambda , \infty } .$ . And there exist constants $L _ { \lambda , \infty } , L _ { \lambda } > 0$ s.t. it holds for $\forall \lambda , \lambda ^ { \prime }$ that
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\begin{array} { r } { \| \nabla _ { \lambda } F ( \lambda ) - \nabla _ { \lambda } F ( \lambda ^ { \prime } ) \| _ { \infty } \leq L _ { \lambda } \| \lambda - \lambda ^ { \prime } \| _ { 2 } \quad a n d \quad \| \nabla _ { \lambda } F ( \lambda ) - \nabla _ { \lambda } F ( \lambda ^ { \prime } ) \| _ { \infty } \leq L _ { \lambda , \infty } \| \lambda - \lambda ^ { \prime } \| _ { 1 } . } \end{array}
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
Based on the above assumptions, we have the following supporting lemmas.
|
| 183 |
+
|
| 184 |
+
Lemma 5.3. Given Assumption 5.1 and 5.2, the following results hold: (i). For any policy parameter $\theta$ and any state-action pair $( s , a )$ , the following inequalities hold: $\| \nabla _ { \theta } \log \pi _ { \theta } ( a | s ) \| \le 2 \ell _ { \psi }$ , $\| \nabla _ { \theta } ^ { 2 } \log \pi _ { \theta } ( a | s ) \| \le 2 ( L _ { \psi } + \ell _ { \psi } ^ { 2 } )$ , and $\begin{array} { r } { \| \nabla _ { \theta } F ( \lambda ( \theta ) ) \| \le \frac { 2 \ell _ { \psi } \cdot \ell _ { \lambda , \infty } } { ( 1 - \gamma ) ^ { 2 } } } \end{array}$ (ii). For any policy parameters $\theta _ { 1 }$ and $\theta _ { 2 }$ , it holds that $\begin{array} { r } { \left. \lambda ^ { \pi _ { \theta _ { 1 } } } - \lambda ^ { \pi _ { \theta _ { 2 } } } \right. _ { 1 } \leq \frac { 2 \ell _ { \psi } } { ( 1 - \gamma ) ^ { 2 } } \cdot \left. \theta _ { 1 } - \theta _ { 2 } \right. } \end{array}$ . (iii). The objective function $F \circ \lambda ( \cdot )$ is $L _ { \theta }$ -smooth, with $\begin{array} { r } { L _ { \theta } = \frac { 4 L _ { \lambda , \infty } \cdot \ell _ { \psi } ^ { 2 } } { ( 1 - \gamma ) ^ { 4 } } + \frac { 8 \ell _ { \psi } ^ { 2 } \cdot \ell _ { \lambda , \infty } } { ( 1 - \gamma ) ^ { 3 } } + \frac { 2 \ell _ { \lambda , \infty } \cdot ( L _ { \psi } + \ell _ { \psi } ^ { 2 } ) } { ( 1 - \gamma ) ^ { 2 } } , } \end{array}$ .
|
| 185 |
+
|
| 186 |
+
To measure the convergence, we propose to use the gradient mapping defined as follows:
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\mathcal { G } _ { \eta } ( \theta ) = \frac { \theta _ { + } - \theta } { \eta } , \quad \mathrm { w h e r e } \quad \theta _ { + } = \left\{ \begin{array} { l l } { \theta + \eta \cdot g } & { , \mathrm { ~ i f ~ } \eta \| g \| \le \delta , } \\ { \theta + \delta \cdot g / \| g \| } & { , \mathrm { ~ o t h e r w i s e } } \end{array} \right.
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
where $g = \nabla _ { \boldsymbol { \theta } } F ( \lambda ( \boldsymbol { \theta } ) )$ . We remark that, $\mathbb { E } [ \| \mathcal { G } _ { \eta } ( \theta _ { j } ^ { i } ) \| ^ { 2 } ]$ is more suitable for the ascent analysis of the truncated gradient updates, compared with the commonly used $\mathbb { E } [ \| \nabla _ { \theta } F ( \lambda ( \theta _ { j } ^ { i } ) ) \| ^ { 2 } ]$ . Note that ${ \mathcal G } _ { \boldsymbol \eta } ( \boldsymbol \theta ) = \nabla F ( \lambda ( { \boldsymbol \theta } ) )$ if $\lVert \mathcal { G } _ { \eta } ( { \boldsymbol { \theta } } ) \rVert \leq \delta$ and $\| \nabla F ( \lambda ( \theta ) ) \|$ is bounded for any $\theta$ . Based on such observation, we have the following lemma to validate the choice of the proposed stationarity measure.
|
| 193 |
+
|
| 194 |
+
Lemma 5.4. For any random vector $\theta$ , $\mathbb { E } [ \lVert \mathcal { G } _ { \eta } ( \theta ) \rVert ] \le \epsilon$ implies $\mathbb { E } [ \| \nabla _ { \theta } F ( \lambda ( \theta ) ) \| ] \le \mathcal { O } ( \delta ^ { - 1 } \cdot \epsilon ) .$ .
|
| 195 |
+
|
| 196 |
+
Based on the notion of $\mathcal { G } _ { \eta }$ , we characterize the per-iteration ascent as follows.
|
| 197 |
+
|
| 198 |
+
Lemma 5.5. Let the iterates be generated by Algorithm $^ { l }$ . Then it holds that
|
| 199 |
+
|
| 200 |
+
$$
|
| 201 |
+
F ( \lambda ( \theta _ { j + 1 } ^ { i } ) ) \geq F ( \lambda ( \theta _ { j } ^ { i } ) ) + \frac { \eta } { 4 } \| \mathcal { G } _ { \eta } ( \theta _ { j } ^ { i } ) \| ^ { 2 } + \Big ( \frac { 1 } { 2 \eta } - L _ { \theta } \Big ) \| \theta _ { j + 1 } ^ { i } - \theta _ { j } ^ { i } \| ^ { 2 } - \Big ( \frac { \eta } { 2 } + \frac { 1 } { 2 L _ { \theta } } \Big ) \| \nabla _ { \theta } F ( \lambda ( \theta _ { j } ^ { i } ) ) - g _ { j } ^ { i } \| ^ { 2 } .
|
| 202 |
+
$$
|
| 203 |
+
|
| 204 |
+
This suggests us to bound mean-squared-error $\mathbb { E } [ \| \nabla _ { \theta } F ( \lambda ( \theta _ { j } ^ { i } ) ) - g _ { j } ^ { i } \| ^ { 2 } ]$ . For this purpose, we need to bound the importance sampling weight, by utilizing the soft-max form of policy parameterization (1).
|
| 205 |
+
|
| 206 |
+
Lemma 5.6. For any behavioral policy $\pi _ { \theta _ { 1 } }$ and target policy $\pi _ { \boldsymbol { \theta } _ { 2 } }$ parameterized by (1), the importance weight satisfies $\omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) \leq \exp \big \{ 2 ( t + 1 ) \ell _ { \psi } \| \theta _ { 1 } - \theta _ { 2 } \| \big \}$ , for $\forall 0 \leq t \leq H - 1$ .
|
| 207 |
+
|
| 208 |
+
Since TSIVR-PG only uses importance weights for two consecutive iterations $\theta _ { j } ^ { i } , \theta _ { j - 1 } ^ { i }$ while forcing $\| \theta _ { j } ^ { i } - \theta _ { j - 1 } ^ { i } \| \leq \delta$ by the truncated gradient step (11), we have $\omega _ { H - 1 } ( \tau | \theta _ { j } ^ { i } , \theta _ { j - 1 } ^ { i } ) \leq \exp \{ 2 H \ell _ { \psi } \delta \}$ w.p. 1. As we will see later, the effective horizon $H$ only has a mild magnitude of $\mathcal { O } \big ( ( 1 - \gamma ) ^ { - 1 } { \cdot } \log ( 1 / \epsilon ) \big )$ , the truncation radius only need to satisfy $\delta = \mathcal { O } ( H ^ { - 1 } \ell _ { \psi } ^ { - 1 } )$ s.t. $\omega _ { t - 1 } \big ( \tau \vert \theta _ { j } ^ { i } , \theta _ { j - 1 } ^ { i } \big ) = \mathcal { O } ( 1 )$ , for $\forall t \leq H - 1$ . Consequently, combining Lemma 5.3, 5.6 and Lemma B.1 of [48] gives the following result.
|
| 209 |
+
|
| 210 |
+
Lemma 5.7. Let policy $\pi _ { \theta }$ be parameterized by (1) with function $\psi$ satisfying Assumption 5.1. Suppose behavioral policy $\pi _ { \theta _ { 1 } }$ and target policy $\pi _ { \theta _ { 2 } }$ satisfy $\lVert { \boldsymbol { \theta } } _ { 1 } - { \boldsymbol { \theta } } _ { 2 } \rVert \leq \delta$ , then
|
| 211 |
+
|
| 212 |
+
$\begin{array} { r } { \mathbb { E } [ \omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) ] = 1 \quad a n d \quad \mathrm { V a r } \left( \omega _ { t } ( \tau | \theta _ { 1 } , \theta _ { 2 } ) \right) \leq C _ { \omega } ( t + 1 ) \cdot \| \theta _ { 1 } - \theta _ { 2 } \| ^ { 2 } , } \end{array}$ where $\tau$ is sampled under policy $\pi _ { \theta _ { 1 } }$ , and $C _ { \omega } ( t ) = t \big ( 4 \ell _ { \psi } ^ { 2 } ( t + \textstyle { \frac { 1 } { 2 } } ) + 2 L _ { \psi } \big ) ( e ^ { 4 \ell _ { \psi } \delta t } + 1 ) .$
|
| 213 |
+
|
| 214 |
+
As a result, we can bound the mean-squared-error of the $g _ { j } ^ { i }$ as follows.
|
| 215 |
+
|
| 216 |
+
Lemma 5.8. For the $P G$ estimators $g _ { j } ^ { i }$ , we have
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
\mathbb { S } \bigg [ \| g _ { j } ^ { i } - \nabla _ { \theta } F ( \lambda ( \theta _ { j } ^ { i } ) ) \| ^ { 2 } \bigg ] \leq \frac { C _ { 1 } } { N } + C _ { 2 } \gamma ^ { 2 H } + \frac { C _ { 3 } } { B } \cdot \sum _ { j ^ { \prime } = 1 } ^ { j } \mathbb { E } \left[ \| \theta _ { j ^ { \prime } - 1 } ^ { i } - \theta _ { j ^ { \prime } } ^ { i } \| ^ { 2 } \right] + C _ { 4 } \mathbb { E } \left[ \| \theta _ { j - 1 } ^ { i } - \theta _ { j } ^ { i } \| ^ { 2 } \right]
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
for some constants $C _ { 1 } , . . , C _ { 4 } > 0 .$ . In case $j = 0$ , we default $\textstyle \sum _ { j ^ { \prime } = 1 } ^ { 0 } \cdot = 0$
|
| 223 |
+
|
| 224 |
+
The expression of constants $C _ { i }$ ’s are complicated, we provide their detailed formula in the appendix. If we set H = O log(1/) and $\begin{array} { r } { \delta \le \frac { 1 } { 2 H \ell _ { \psi } } } \end{array}$ , then $C _ { i }$ only depends polynomially on the Lipschitz constants, $\log ( \epsilon ^ { - 1 } )$ , and $( 1 - \gamma ) ^ { - 1 }$ . Combining Lemma 5.5, 5.8, and 5.4 gives Theorem 5.9.
|
| 225 |
+
|
| 226 |
+
Theorem 5.9. For Algorithm $^ { l }$ , we choose $\begin{array} { r } { H = \frac { 2 \log ( 1 / \epsilon ) } { 1 - \gamma } } \end{array}$ , $\begin{array} { r } { \delta = \frac { 1 } { 2 H \ell _ { \psi } } } \end{array}$ , $B = m = \epsilon ^ { - 1 }$ , $N = \epsilon ^ { - 2 }$ η = 11+(C3+C4)/L2θ · 12Lθ . After running the algorithm for T = −1 epochs and output θout from $\{ \theta _ { j } ^ { i } \} _ { j = 0 , \cdots , m - 1 } ^ { i = 1 , \cdots , T }$ uniformly at random, we have $\mathbb { E } [ \| \mathcal { G } _ { \eta } ( \theta _ { o u t } ) \| ] \le \mathcal { O } ( \epsilon )$ . The total number of samples is $\dot { T } \times ( ( m - 1 ) B + N ) \times H = \tilde { \mathcal { O } } ( \epsilon ^ { - 3 } )$ . By Lemma 5.4, we also have $\mathbb { E } [ \| \nabla _ { \theta } F ( \lambda ( \theta _ { o u t } ) ) \| ] \le { \mathcal { O } } ( \epsilon )$ .
|
| 227 |
+
|
| 228 |
+
# 5.2 Convergence Towards Global Optimality
|
| 229 |
+
|
| 230 |
+
Next, we provide a mechanism to establish the convergence of TSIVR-PG to global optimality. For this purpose, we introduce the hidden convexity of the general utility RL problem. In addition to the smoothness of $F$ (Assumption 5.2), we further assume its concavity, formally stated as follows.
|
| 231 |
+
|
| 232 |
+
Assumption 5.10. Function $F$ is a concave function of the state-action occupancy measure.
|
| 233 |
+
|
| 234 |
+
Let $\mathcal { L }$ be the image of the mapping $\lambda ( \theta )$ . Then the parameterized policy optimization problem (2) can be rewritten as an equivalent occupancy optimization problem:
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
\begin{array} { r } { \operatorname* { m a x } _ { \theta } F ( \lambda ( \theta ) ) \qquad \Longleftrightarrow \qquad \operatorname* { m a x } _ { \mu \in \mathcal { L } } F ( \mu ) . } \end{array}
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
When the policy parameterization is powerful enough to represent any policy, the image $\mathcal { L }$ is a convex polytope, see e.g. [10]. Since $F$ is concave, the occupancy optimization problem is a convex optimization problem. In this case, if the mapping $\lambda ( \cdot )$ is invertible (see [51]), we may view the original problem (2) as a reformulation of a convex problem by a change of variable: $\theta = \lambda ^ { - 1 } ( \mu )$ . We call this property “hidden convexity”. However, requiring $\lambda ( \cdot )$ to be invertible is too restrictive, and it doesn’t even hold for simple soft-max policy with $\psi ( s , a ; \theta ) = \theta _ { s a }$ where multiple $\theta$ correspond to a same policy. Therefore, we adopt a weaker assumption where (i). $\pi _ { \theta }$ can represent any policy (ii). a continuous inverse $\lambda ^ { - 1 } ( \cdot )$ can be locally defined over a subset of $\theta$ .
|
| 241 |
+
|
| 242 |
+
Assumption 5.11. For policy parameterization of form (1), $\theta$ overparametrizes the set of policies in the following sense. $( i )$ . For any $\theta$ and $\lambda ( \theta )$ , there exist (relative) neighourhoods $\theta \in \mathcal { U } _ { \theta } \subset B ( \theta , \delta )$ and $\lambda ( \theta ) \in \mathcal { V } _ { \lambda ( \theta ) } \subset \lambda ( B ( \theta , \delta ) )$ s.t. $\left( \lambda | _ { \mathcal { U } _ { \theta } } \right) ( \cdot )$ forms a bijection between $\mathcal { U } _ { \theta }$ and $\mathcal { V } _ { \lambda ( \theta ) }$ , where $\left( \lambda | _ { \mathcal { U } _ { \theta } } \right) ( \cdot )$ is the confinement of $\lambda$ onto $\mathcal { U } _ { \theta }$ . We assume $( \lambda | _ { \mathcal { U } _ { \theta } } ) ^ { - 1 } ( \cdot )$ is $\ell _ { \theta }$ -Lipschitz continuous for any $\theta$ . (ii). Let $\pi _ { \theta ^ { \ast } }$ be the optimal policy. Assume there exists ¯ small enough, s.t. $( 1 - \epsilon ) \lambda ( \theta ) + \epsilon \lambda ( \theta ^ { * } ) \in$ $\mathcal { V } _ { \lambda ( \theta ) } f o r \forall \epsilon \le \bar { \epsilon } , \forall \theta$ .
|
| 243 |
+
|
| 244 |
+
Based on Assumption 5.11, we replace Lemma 5.5 with the following lemma.
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\begin{array} { r l r } { \displaystyle F ( \lambda ( \theta ^ { * } ) ) - F ( \lambda ( \theta _ { j + 1 } ^ { i } ) ) \ \le \ ( 1 - \epsilon ) \left( F ( \lambda ( \theta ^ { * } ) ) - F ( \lambda ( \theta _ { j } ^ { i } ) ) \right) } & { { } } & { { ( 1 5 ) } } \\ { \displaystyle + \left( L _ { \theta } + \frac { 1 } { 2 \eta } \right) \frac { 2 \epsilon ^ { 2 } \ell _ { \theta } ^ { 2 } } { ( 1 - \gamma ) ^ { 2 } } - \left( \frac { 1 } { 2 \eta } - L _ { \theta } \right) \| \theta _ { j + 1 } ^ { i } - \theta _ { j } ^ { i } \| ^ { 2 } + \frac { 1 } { L _ { \theta } } \| g _ { j } ^ { i } - \nabla _ { \theta } F ( \lambda ( \theta _ { j } ^ { i } ) ) \| ^ { 2 } . } & { } & { } \end{array}
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
The analysis of Lemma 5.12 is very different from its nonconvex optimization counterpart (Lemma 5.5). Next, we derive the sample complexity of the TSIVR-PG algorithm given Lemma 5.12 and 5.8.
|
| 251 |
+
|
| 252 |
+
Theorem 5.13. For TSIVR-PG method (Algorithm $^ { l }$ ), let $\epsilon \in ( 0 , \bar { \epsilon } )$ be the target accuracy. If we choose $H , m , B , N$ and $\delta$ according to Theorem 5.9. and we let the stepsize to be small enough s.t. $\begin{array} { r } { \eta \le \frac { 1 } { 2 L _ { \theta } + 8 ( C _ { 3 } + C _ { 4 } ) / L _ { \theta } } } \end{array}$ , then after at most $T = \log _ { 2 } ( \epsilon ^ { - 1 } )$ epochs, $\mathbb { E } \big [ F \big ( \hat { \lambda } ( \theta ^ { * } ) \big ) - F \big ( \lambda ( \tilde { \theta } _ { T } ) \big ) \big ] \leq \mathcal { O } ( \epsilon )$ The total number of samples taken is $T \times ( ( m - 1 ) B + N ) \times H = \tilde { \mathcal { O } } ( \epsilon ^ { - 2 } )$ .
|
| 253 |
+
|
| 254 |
+
# 6 Numerical Experiments
|
| 255 |
+
|
| 256 |
+
# 6.1 Maximizing Cumulative Reward.
|
| 257 |
+
|
| 258 |
+
In this experiment, we aim to evaluate the performance of the TSIVR-PG algorithm for maximizing the cumulative sum of reward. As the benchmarks, we also implement the SVRPG [49], the SRVRPG [48], the HSPGA [33], and the REINFORCE [47] algorithms. Our experiment is performed on benchmark RL environments including the FrozenLake, Acrobot and Cartpole that are available from OpenAI gym [8], which is a well-known toolkit for developing and comparing reinforcement learning algorithms. For all the algorithms, their batch sizes are chosen according to their theory. In details, let $\epsilon$ be any target accuracy. For both TSIVR-PG and SRVR-PG, we set $N = \Theta ( \epsilon ^ { - 2 } )$ , $B = m = \Theta ( \epsilon ^ { - 1 } )$ . For SVRPG, we set $N = \Theta ( \epsilon ^ { - 2 } )$ , $B = \Theta ( \epsilon ^ { - 4 / 3 } )$ and $m = \Theta ( \epsilon ^ { - 2 / 3 } )$ . For HSPGA, we set $B ^ { \prime } = \Theta ( \epsilon ^ { - 1 } )$ , other parameters are calculated according to formulas in [33] given $B$ . For REINFORCE, we set the batchsize to be $N = \Theta ( \epsilon ^ { - 2 } )$ . The parameter $\varepsilon$ and the stepsize/learning rate are tuned for each individual algorithm using a grid search. For each algorithm, we run the experiment for multiple times with random initialization of the policy parameters. The curve is obtained by first calculating the moving average of the most recent 50 episodes, and then calculate the median of the return over the outcomes of different runs. The upper and lower bounds of the shaded area are calculated as the $\textstyle { \frac { 1 } { 4 } }$ and $\frac 3 4$ quantiles over the outcomes. We run the experiment for 10 times for the FrozenLake environment and 50 times for the other environments. The detailed parameters used in the experiments are presented in the Appendix.
|
| 259 |
+
|
| 260 |
+
FrozenLake The FrozenLake8x8 environment is a tabular MDP with finite state and action spaces.
|
| 261 |
+
For this environment, the policy is parameterized with $\psi ( s , a ; \theta ) = \theta _ { s a }$ .
|
| 262 |
+
|
| 263 |
+
Cartpole and Acrobot Both the Cartpole environment and the Acrobot environment are environments with a discrete action space and a continuous state space. For both environments, we use a neural network with two hidden layers with width 64 for both layers to model the policy.
|
| 264 |
+
|
| 265 |
+
Result We plot our experiment outcomes in Figure 6.1. The experiments show that given enough episodes, all of the algorithms are able to solve the tasks, achieving nearly optimal returns. And as expected, the REINFORCE algorithm takes the longest time to find the optimal policy. While the other algorithms yield a faster convergence speed, the TSIVR-PG algorithm consistently outperforms the other benchmark algorithms under all of the environments, showing the advantage of our method.
|
| 266 |
+
|
| 267 |
+
# 6.2 Validating the $\tilde { \mathcal { O } } ( \epsilon ^ { - 2 } )$ Sample Complexity
|
| 268 |
+
|
| 269 |
+
Besides the comparison between different benchmark algorithms, we also perform a validation experiment showing that for certain environments, the convergence rate of TSIVR-PG is close to the theoretical guarantee. Because the parameters $N , B , m$ are dependent on the target accuracy $\epsilon$ , in this section we adopt a different way to set up these parameters: We first set a fixed epoch $E$ , and perform experiments using different values of the parameter √ $N$ . The parameter $B$ and $m$ are set according to our choice of $N$ by $B = m = \sqrt { N }$ . The performance of the algorithm output is calculated as the average score of the last few episodes, which is then averaged over 10 independent runs. Again, we use the FrozenLake8x8 environment to do the experiment. Because FrozenLake8x8 is a tabular environment whose transition and reward function can be easily obtained from the document, we can calculate it’s optimal value simply by value iteration, which takes 0.4146 when we choose $\gamma = 0 . 9 9$ . In this way, we calculate the gap between the algorithm return and the optimal value, and get log-log figure w.r.t. the gap and the number of episodes calculated by $E ( N + B m ) = 2 E N$ .
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 1: The performance curves of TSIVR-PG and benchmark algorithms under different environments. The curve is the median return over multiple runs and the shaded areas are calculated as the $\textstyle { \frac { 1 } { 4 } }$ and $\textstyle { \frac { 3 } { 4 } }$ quantiles of the experiment outcomes.
|
| 273 |
+
|
| 274 |
+
Result The result is shown in the first sub-figure of Figure 6.3, where the blue curve is the gap between the average return of experiment outcome and the optimal value and the shaded area is the range of one standard deviation of the logarithm value. In addition, we add a orange dotted line to fit the convergence curve, whose slope takes value $- 0 . 4 9 6$ , which nearly matches the $O ( \epsilon ^ { - 2 } )$ theoretical bound (slope $- 0 . 5 )$ .
|
| 275 |
+
|
| 276 |
+
# 6.3 Maximizing Non-linear Objective Function
|
| 277 |
+
|
| 278 |
+
The TSIVR-PG algorithm is designed not only to solve typical RL problems, but is also able to solve a broader class of problems where the objective function is a general concave function. Unfortunately, none of the benchmark algorithms proposed in the previous section have the ability to solve this kind of problem. To evaluate the performance of our algorithm, we choose another benchmark algorithm, which is the MaxEnt algorithm [16]. In the experiment, we use FrozenLake8x8 environment since it’s more tractable to compute $\lambda$ for a discrete state space. We set the objective function as
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
F ( \lambda ) = \sum _ { s \in S } \log { \Bigg ( } \sum _ { a \in { \mathcal { A } } } \lambda _ { s , a } + \sigma { \Bigg ) } ,
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
where $\sigma$ is a fixed small constant. We choose $\sigma = 0 . 1 2 5$ in our experiment. The orders of $N , B , m$ are set in the same way as those in section 6.1. For the MaxEnt algorithm, note that in the original paper, the nonlinear objective function assumes the input value is the stationary state distribution $d ^ { \pi }$ , but the input value can easily be changed into our $\lambda$ without changing the steps of the algorithm much. The result is illustrated in Fig. 6.3. From the result, we may see that our algorithm consistently outperforms the benchmark.
|
| 285 |
+
|
| 286 |
+
# 7 Broader Impact
|
| 287 |
+
|
| 288 |
+
There has been an emerging trend of applying stochastic variance reduction technique to enhance the performance of the policy gradient methods. However, all the existing variance-reduced policy gradient methods depend on an algorithm-dependent assumption that is made to every single iteration in running the algorithm, which actually may not be satisfied by many of these algorithms. We propose a simple yet effective mechanism to fix such dilemma for applying the SARAH/Spider variance reduction scheme in policy gradient methods. Our analysis can also be applied to other schemes such as STORM and Hybrid SARAH-SGD. Beyond that, we also show how the hidden convexity and overparameterization of the RL problem can help stochastic variance-reduced policy gradient methods to converge to global optima and yield better sample complexity.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 2: Left: Empirical Evaluation of the Convergence Rate of TSIVR-PG. The optimality gap achieved by TSIVR-PG decreases as the sample size increases, nearly matching the $\epsilon ^ { - 2 }$ sample complexity theory (orange line). Right: Performance Curve ofTSIVR-PG and MaxEnt for Maximizing Non-linear Objective Functions. The curve is the median return over 10 runs and the shaded areas are calculated as the $\textstyle { \frac { 1 } { 4 } }$ and $\frac 3 4$ quantiles of the experiment outcomes.
|
| 292 |
+
|
| 293 |
+
# 8 Limitation
|
| 294 |
+
|
| 295 |
+
To compute the policy gradient for the general utility function, one needs to compute gradient of the function $\mathrm { F }$ with respect to the state-action occupancy measure. Although for many instances, including standard cumulative sum of reward (Example 3.1) and set constrained RL (Example 3.3), estimating the occupancy measure is not necessary. There are many instances where estimating the occupancy measure is unavoidable. Due to the curse of dimensionality, the need for estimating the occupancy measure is a potential limitation if the state and action spaces are continuous and high-dimensional. One potential solution is to incorporate a function approximation for the occupancy measure, in a similar style of the Q-function approximation in the actor-critic method. We leave this for future development.
|
| 296 |
+
|
| 297 |
+
# References
|
| 298 |
+
|
| 299 |
+
[1] Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. Optimality and approximation with policy gradient methods in markov decision processes. In Conference on Learning Theory, pages 64–66. PMLR, 2020.
|
| 300 |
+
[2] Zeyuan Allen-Zhu and Elad Hazan. Variance reduction for faster non-convex optimization. In International conference on machine learning, pages 699–707, 2016.
|
| 301 |
+
[3] Mohammad Gheshlaghi Azar, Rémi Munos, Mohammad Ghavamzadeh, and Hilbert Kappen. Reinforcement learning with a near optimal rate of convergence. 2011.
|
| 302 |
+
[4] Mohammad Gheshlaghi Azar, Rémi Munos, and Hilbert J Kappen. Minimax pac bounds on the sample complexity of reinforcement learning with a generative model. Machine learning, 91(3):325–349, 2013.
|
| 303 |
+
[5] Jonathan Baxter and Peter L Bartlett. Infinite-horizon policy-gradient estimation. Journal of Artificial Intelligence Research, 15:319–350, 2001.
|
| 304 |
+
[6] Jalaj Bhandari and Daniel Russo. Global optimality guarantees for policy gradient methods. arXiv preprint arXiv:1906.01786, 2019.
|
| 305 |
+
[7] Jalaj Bhandari and Daniel Russo. A note on the linear convergence of policy gradient methods. arXiv preprint arXiv:2007.11120, 2020.
|
| 306 |
+
[8] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 307 |
+
[9] Shicong Cen, Chen Cheng, Yuxin Chen, Yuting Wei, and Yuejie Chi. Fast global convergence of natural policy gradient methods with entropy regularization. arXiv preprint arXiv:2007.06558, 2020.
|
| 308 |
+
[10] Yichen Chen, Lihong Li, and Mengdi Wang. Scalable bilinear pi learning using state and action features. arXiv preprint arXiv:1804.10328, 2018.
|
| 309 |
+
[11] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. Advances in neural information processing systems, 27:1646–1654, 2014.
|
| 310 |
+
[12] Eyal Even-Dar, Shie Mannor, Yishay Mansour, and Sridhar Mahadevan. Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems. Journal of machine learning research, 7(6), 2006.
|
| 311 |
+
[13] Cong Fang, Chris Junchi Li, Zhouchen Lin, and Tong Zhang. Spider: Near-optimal nonconvex optimization via stochastic path-integrated differential estimator. In Advances in Neural Information Processing Systems, pages 689–699, 2018.
|
| 312 |
+
[14] Maryam Fazel, Rong Ge, Sham M Kakade, and Mehran Mesbahi. Global convergence of policy gradient methods for the linear quadratic regulator. arXiv preprint arXiv:1801.05039, 2018.
|
| 313 |
+
[15] Saeed Ghadimi, Andrzej Ruszczynski, and Mengdi Wang. A single timescale stochastic approximation method for nested stochastic optimization. SIAM Journal on Optimization, 30(1):960–979, 2020.
|
| 314 |
+
[16] Elad Hazan, Sham Kakade, Karan Singh, and Abby Van Soest. Provably efficient maximum entropy exploration. In International Conference on Machine Learning, pages 2681–2691. PMLR, 2019.
|
| 315 |
+
[17] Zhouyuan Huo, Bin Gu, Ji Liu, and Heng Huang. Accelerated method for stochastic composition optimization with nonsmooth regularization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
|
| 316 |
+
[18] Sashank J Reddi, Suvrit Sra, Barnabas Poczos, and Alexander J Smola. Proximal stochastic methods for nonsmooth nonconvex finite-sum optimization. Advances in neural information processing systems, 29:1145–1153, 2016.
|
| 317 |
+
[19] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. Advances in neural information processing systems, 26:315–323, 2013.
|
| 318 |
+
[20] Sham M Kakade. A natural policy gradient. Advances in neural information processing systems, 14:1531–1538, 2001.
|
| 319 |
+
[21] Vijay R Konda and John N Tsitsiklis. Actor-critic algorithms. In Advances in neural information processing systems, pages 1008–1014, 2000.
|
| 320 |
+
[22] Vijaymohan R Konda and Vivek S Borkar. Actor-critic–type learning algorithms for markov decision processes. SIAM Journal on control and Optimization, 38(1):94–123, 1999.
|
| 321 |
+
[23] Guanghui Lan. Policy mirror descent for reinforcement learning: Linear convergence, new sampling complexity, and generalized problem classes. arXiv preprint arXiv:2102.00135, 2021.
|
| 322 |
+
[24] Xiangru Lian, Mengdi Wang, and Ji Liu. Finite-sum composition optimization via variance reduced gradient descent. In Artificial Intelligence and Statistics, pages 1159–1167. PMLR, 2017.
|
| 323 |
+
[25] Boyi Liu, Qi Cai, Zhuoran Yang, and Zhaoran Wang. Neural trust region/proximal policy optimization attains globally optimal policy. In Advances in Neural Information Processing Systems, pages 10565–10576, 2019.
|
| 324 |
+
[26] Jincheng Mei, Chenjun Xiao, Csaba Szepesvari, and Dale Schuurmans. On the global convergence rates of softmax policy gradient methods. arXiv preprint arXiv:2005.06392, 2020.
|
| 325 |
+
|
| 326 |
+
[27] Sobhan Miryoosefi, Kianté Brantley, Hal Daume III, Miro Dudik, and Robert E Schapire. Reinforcement learning with convex constraints. In Advances in Neural Information Processing Systems, pages 14093–14102, 2019.
|
| 327 |
+
|
| 328 |
+
[28] Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pages 1928–1937, 2016.
|
| 329 |
+
|
| 330 |
+
[29] Lam M Nguyen, Jie Liu, Katya Scheinberg, and Martin Takác. Sarah: A novel method for ˇ machine learning problems using stochastic recursive gradient. arXiv preprint arXiv:1703.00102, 2017.
|
| 331 |
+
|
| 332 |
+
[30] Lam M Nguyen, Marten van Dijk, Dzung T Phan, Phuong Ha Nguyen, Tsui-Wei Weng, and Jayant R Kalagnanam. Finite-sum smooth optimization with sarah. arXiv preprint arXiv:1901.07648, 2019.
|
| 333 |
+
|
| 334 |
+
[31] Matteo Papini, Damiano Binaghi, Giuseppe Canonaco, Matteo Pirotta, and Marcello Restelli. Stochastic variance-reduced policy gradient. arXiv preprint arXiv:1806.05618, 2018.
|
| 335 |
+
|
| 336 |
+
[32] Jan Peters and Stefan Schaal. Natural actor-critic. Neurocomputing, 71(7-9):1180–1190, 2008.
|
| 337 |
+
|
| 338 |
+
[33] Nhan H Pham, Lam M Nguyen, Dzung T Phan, Phuong Ha Nguyen, Marten van Dijk, and Quoc Tran-Dinh. A hybrid stochastic policy gradient algorithm for reinforcement learning. arXiv preprint arXiv:2003.00430, 2020.
|
| 339 |
+
|
| 340 |
+
[34] Sashank J Reddi, Ahmed Hefny, Suvrit Sra, Barnabas Poczos, and Alex Smola. Stochastic variance reduction for nonconvex optimization. In International conference on machine learning, pages 314–323, 2016.
|
| 341 |
+
|
| 342 |
+
[35] Sashank J Reddi, Suvrit Sra, Barnabás Póczos, and Alex Smola. Fast incremental method for nonconvex optimization. arXiv preprint arXiv:1603.06159, 2016.
|
| 343 |
+
|
| 344 |
+
[36] Mark Schmidt, Nicolas Le Roux, and Francis Bach. Minimizing finite sums with the stochastic average gradient. Mathematical Programming, 162(1-2):83–112, 2017.
|
| 345 |
+
|
| 346 |
+
[37] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pages 1889–1897, 2015.
|
| 347 |
+
|
| 348 |
+
[38] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 349 |
+
|
| 350 |
+
[39] Lior Shani, Yonathan Efroni, and Shie Mannor. Adaptive trust region policy optimization: Global convergence and faster rates for regularized mdps. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 5668–5675, 2020.
|
| 351 |
+
|
| 352 |
+
[40] Zebang Shen, Alejandro Ribeiro, Hamed Hassani, Hui Qian, and Chao Mi. Hessian aided policy gradient. In International Conference on Machine Learning, pages 5729–5738, 2019.
|
| 353 |
+
|
| 354 |
+
[41] Aaron Sidford, Mengdi Wang, Xian Wu, Lin F Yang, and Yinyu Ye. Near-optimal time and sample complexities for solving discounted markov decision process with a generative model. arXiv preprint arXiv:1806.01492, 2018.
|
| 355 |
+
|
| 356 |
+
[42] Aaron Sidford, Mengdi Wang, Xian Wu, and Yinyu Ye. Variance reduced value iteration and faster algorithms for solving markov decision processes. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 770–787. SIAM, 2018.
|
| 357 |
+
|
| 358 |
+
[43] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 359 |
+
|
| 360 |
+
[44] Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pages 1057–1063, 2000.
|
| 361 |
+
|
| 362 |
+
[45] Mengdi Wang, Ethan X Fang, and Han Liu. Stochastic compositional gradient descent: algorithms for minimizing compositions of expected-value functions. Mathematical Programming, 161(1-2):419–449, 2017.
|
| 363 |
+
[46] Mengdi Wang, Ji Liu, and Ethan X Fang. Accelerating stochastic composition optimization. The Journal of Machine Learning Research, 18(1):3721–3743, 2017.
|
| 364 |
+
[47] Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 365 |
+
[48] Pan Xu, Felicia Gao, and Quanquan Gu. Sample efficient policy gradient methods with recursive variance reduction. arXiv preprint arXiv:1909.08610, 2019.
|
| 366 |
+
[49] Pan Xu, Felicia Gao, and Quanquan Gu. An improved convergence analysis of stochastic variance-reduced policy gradient. In Uncertainty in Artificial Intelligence, pages 541–551. PMLR, 2020.
|
| 367 |
+
[50] Junyu Zhang, Amrit Singh Bedi, Mengdi Wang, and Alec Koppel. Cautious reinforcement learning via distributional risk in the dual domain. arXiv preprint arXiv:2002.12475, 2020.
|
| 368 |
+
[51] Junyu Zhang, Alec Koppel, Amrit Singh Bedi, Csaba Szepesvari, and Mengdi Wang. Variational policy gradient method for reinforcement learning with general utilities. arXiv preprint arXiv:2007.02151, 2020.
|
| 369 |
+
[52] Junyu Zhang and Lin Xiao. A composite randomized incremental gradient method. In International Conference on Machine Learning, pages 7454–7462, 2019.
|
| 370 |
+
[53] Junyu Zhang and Lin Xiao. Multi-level composite stochastic optimization via nested variance reduction. arXiv preprint arXiv:1908.11468, 2019.
|
| 371 |
+
[54] Junyu Zhang and Lin Xiao. A stochastic composite gradient method with incremental variance reduction. In Advances in Neural Information Processing Systems, pages 9078–9088, 2019.
|
| 372 |
+
[55] Junzi Zhang, Jongho Kim, Brendan O’Donoghue, and Stephen Boyd. Sample efficient reinforcement learning with reinforce. arXiv preprint arXiv:2010.11364, 2020.
|
| 373 |
+
[56] Kaiqing Zhang, Alec Koppel, Hao Zhu, and Tamer Ba¸sar. Global convergence of policy gradient methods to (almost) locally optimal policies. arXiv preprint arXiv:1906.08383, 2019.
|
| 374 |
+
[57] Mingming Zhao, Yongfeng Li, and Zaiwen Wen. A stochastic trust-region framework for policy optimization. arXiv preprint arXiv:1911.11640, 2019.
|
| 375 |
+
[58] Tingting Zhao, Hirotaka Hachiya, Gang Niu, and Masashi Sugiyama. Analysis and improvement of policy gradient estimation. Neural Networks, 26:118–129, 2012.
|
md/train/Rld-9OxQ6HU/Rld-9OxQ6HU.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/RmuXDtjDhG/RmuXDtjDhG.md
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Causal Abstractions of Neural Networks
|
| 2 |
+
|
| 3 |
+
Atticus Geiger∗, Hanson Lu∗, Thomas Icard, and Christopher Potts Stanford Stanford, CA 94305-2150 {atticusg, hansonlu, icard, cgpotts}@stanford.edu
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Structural analysis methods (e.g., probing and feature attribution) are increasingly important tools for neural network analysis. We propose a new structural analysis method grounded in a formal theory of causal abstraction that provides rich characterizations of model-internal representations and their roles in input/output behavior. In this method, neural representations are aligned with variables in interpretable causal models, and then interchange interventions are used to experimentally verify that the neural representations have the causal properties of their aligned variables. We apply this method in a case study to analyze neural models trained on Multiply Quantified Natural Language Inference (MQNLI) corpus, a highly complex NLI dataset that was constructed with a tree-structured natural logic causal model. We discover that a BERT-based model with state-of-the-art performance successfully realizes parts of the natural logic model’s causal structure, whereas a simpler baseline model fails to show any such structure, demonstrating that BERT representations encode the compositional structure of MQNLI.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Explainability and interpretability have long been central issues for neural networks, and they have taken on renewed importance as such models are now ubiquitous in research and technology. Recent structural evaluation methods seek to reveal the internal structure of these “black box” models. Structural methods include probes, attributions (feature importance methods), and interventions (manipulations of model-internal states). These methods can complement standard behavioral techniques (e.g., performance on gold evaluation sets), and they can yield insights into how and why models make the predictions they do. However, these tools have their limitations, and it has often been assumed that more ambitious and systematic causal analysis of such models is beyond reach.
|
| 12 |
+
|
| 13 |
+
Although there is a sense in which neural networks are “black boxes”, they have the virtue of being completely closed and controlled systems. This means that standard empirical challenges of causal inference due to lack of observability simply do not arise. The challenge is rather to identify high-level causal regularities that abstract away from irrelevant (but arbitrarily observable and manipulable) low-level details. Our contribution in this paper is to show that this challenge can be met. Drawing on recent innovations in the formal theory of causal abstraction [1, 2, 5, 22], we offer a methodology for meaningful causal explanations of neural network behavior.
|
| 14 |
+
|
| 15 |
+
Our methodology causal abstraction analysis2 consists of three stages. (1) Formulate a hypothesis by defining a causal model that might explain network behavior. Candidate causal models can be naturally adapted from theoretical and empirical modeling work in linguistics and cognitive sciences. (2) Search for an alignment between neural representations in the network and variables in the high-level causal model. (3) Verify experimentally that the neural representations have the same causal properties as their aligned high-level variables using the interchange intervention method of Geiger et al. [11].
|
| 16 |
+
|
| 17 |
+
As a case study, we apply this methodology to LSTM-based and BERT-based natural language inference (NLI) models trained on the logically complex Multiply Quantified NLI (MQNLI) dataset of Geiger et al. [10]. This challenging dataset was constructed with a tree-structured natural logic causal model [17, 29, 14]. Our BERT-based model has the structure of a standard NLI classifier, and yet it is able to perform well on MQNLI $( 8 8 \% )$ , a result Geiger et al. achieved only with highly customized task-specific models. By contrast, our LSTM-based model is much less successful $(46 \% )$ .
|
| 18 |
+
|
| 19 |
+
The obvious scientific question in this case study is what drives the success of the BERT-based model on this challenging task. To answer this we employ our methodology. (1) We formulate hypotheses by defining simplified variants of the natural logic causal model. (2) We search over potential alignments between neural representations in BERT and variables in our high-level causal models. (3) We perform interchange interventions on the BERT model for each alignment. We find that our BERT model partially realizes the causal structure of the natural logic causal model; crucially, the LSTM model does not. High-level causal explanation for system behavior is often considered a gold standard for interpretability, one that may be thought quixotic for complex neural models [16]. The point of our case study is to show that this high standard can be achieved.
|
| 20 |
+
|
| 21 |
+
We conclude by comparing our methodology to probing and the attribution method of integrated gradients [27]. We argue probing is unable to provide a causal characterization of models. We show formally that attribution methods do measure causal properties, and in that way they are similar to the tool of interchange interventions. However, our methodology of causal abstraction analysis provides a framework for systematically measuring and aggregating such causal properties in order to evaluate a precise hypothesis about abstract causal structure.
|
| 22 |
+
|
| 23 |
+
# 2 Related Work
|
| 24 |
+
|
| 25 |
+
Probes Probes are generally supervised models trained on the internal representations of networks with the goal of determining what those internal representations encode [7, 13, 20, 28]. Probes are fundamentally unable to directly measure causal properties of neural representations, and Ravichander et al. [21], Elazar et al. [9], and Geiger et al. [11] have argued that probes are limited in their ability to provide even indirect evidence of causal properties.
|
| 26 |
+
|
| 27 |
+
We now present an analytic example in which probing identifies seemingly crucial information in representations that have no causal impact on behavior. We assume the structure of the simple addition network $N _ { + }$ in Figure 1. For our embedding, we simply map every integer $i$ in $\mathbb { N } _ { 9 }$ to the 1-dimensional vector [i]. The weight matrices are
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
W _ { 1 } = { \left( \begin{array} { l } { 1 } \\ { 1 } \\ { 0 } \end{array} \right) } \quad W _ { 2 } = { \left( \begin{array} { l } { 1 } \\ { 1 } \\ { 1 } \end{array} \right) } \quad W _ { 3 } = { \left( \begin{array} { l } { 0 } \\ { 0 } \\ { 1 } \end{array} \right) } \quad \mathbf { w } = { \left( \begin{array} { l } { 0 } \\ { 1 } \\ { 0 } \end{array} \right) }
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
The output for an input sequence $\mathbf { x } = ( i , j , k )$ is given by $\left( \mathbf { x } W _ { 1 } ; \mathbf { x } W _ { 2 } ; \mathbf { x } W _ { 3 } \right) \mathbf { w } .$ .
|
| 34 |
+
|
| 35 |
+
In this network, $\mathbf { x } W _ { 1 }$ perfectly encodes $i + j$ , and $\mathbf { x } W _ { 3 }$ perfectly encodes $k$ . Thus, the identity model probe will be perfect in probing those representations for this information. However, neither representation plays a causal role in the network behavior; only $\mathbf { x } W _ { 2 }$ contributes to the output.
|
| 36 |
+
|
| 37 |
+
Attribution Methods Attribution methods aim to quantify the degree to which a network representation contributes to the output prediction of the model, for a specific example or set of examples [3, 24, 26, 27, 32]. In contrast to probing, the well known integrated gradients method (IG) can be given an unambiguous causal interpretation. Following [27] we define the vector $I G ( \mathbf { x } )$ , for an input $\mathbf { x }$ relative to a baseline b, to have ith component $I G _ { i } ( \mathbf { x } )$ given by the expression on the left:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\left( x _ { i } - b _ { i } \right) \cdot \int _ { \alpha = 0 } ^ { 1 } \frac { \partial F ( \alpha \mathbf { x } + ( 1 - \alpha ) \mathbf { b } ) } { \partial x _ { i } } d \alpha = \left( x _ { i } - b _ { i } \right) \cdot \int _ { \alpha = 0 } ^ { 1 } \operatorname* { l i m } _ { \epsilon \to 0 } \frac { F ( \mathbf { x } ^ { \alpha , \epsilon } ) - F ( \mathbf { x } ^ { \alpha } ) } { \epsilon } d \alpha
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Abbreviating the weighted average $\alpha { \mathbf { x } } + ( 1 - \alpha ) { \mathbf { b } }$ by $\mathbf { x } ^ { \alpha }$ , letting $\mathbf { x } ^ { \alpha , \epsilon }$ be the vector that differs from $\mathbf { x } ^ { \alpha }$ in that the ith coordinate is increased by $\epsilon$ , and then expanding the definition of partial derivative, this can be written in the form given on the right. The difference $F ( \mathbf { x } ^ { \alpha , \epsilon } ) - F ( \mathbf { x } ^ { \alpha } )$ is known in the (a) The causal model $C _ { + }$ (right) that first computes $S _ { 1 } = X + Y$ and $W = Z$ , before computing the final output $S _ { 2 } = W + S _ { 1 }$ aligned with the neural network $N _ { + }$ (left) with $L _ { 1 }$ highlighted as the hypothesized location encoding $S _ { 1 } = X + Y$ and $L _ { 2 }$ as the location encoding $W = Z$ .
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
|
| 49 |
+
(b) Low-level neural network interchange intervention. The network processes two different input sequences. The neural representation created at $L _ { 1 }$ for input sequence $( 1 , 2 , { \bar { 3 } } )$ is replaced by the corresponding representation created for input sequence $( 4 , 5 , 6 )$ .
|
| 50 |
+
|
| 51 |
+
(c) High-level symbolic computation interchange intervention. The computation processes two different input sequences. The sum at $S _ { 1 }$ for input sequence $( 1 , 2 , 3 )$ is replaced by the corresponding representation created for input sequence $( 4 , 5 , 6 )$ .
|
| 52 |
+
|
| 53 |
+
Figure 1: Our motivating example where we hypothesis that a symbolic computation $C _ { + }$ is a causal abstraction of a neural network $N _ { + }$ under a particular alignment (top). We can experimentally confirm this hypothesis by conducting an interchange intervention on both the network and the computation with every pair of inputs and evaluating whether the intervened network and intervened computation have the same counterfactual output behavior. We schematically depict an interchange intervention on the network $N _ { + }$ (bottom left) and the computation $C _ { + }$ (bottom right) with the base input $( 1 , 2 , 3 )$ and the source input $( 4 , 5 , 6 )$ . Observe that the output of the intervened neural network matches the output of the intervened symbolic computation, so we have success for this pair of inputs.
|
| 54 |
+
|
| 55 |
+
causal literature as the (individual) causal effect on the output (e.g., [15]) of increasing neuron $i$ by $\epsilon$ relative to the fixed input $\mathbf { x } ^ { \alpha }$ . So, essentially, $I G _ { i } ( \mathbf { x } )$ is measuring the average “limiting” causal effect of increasing neuron $i$ along the straight line from the baseline vector to the input vector $\mathbf { x }$ , weighted by the difference at $i$ between input and baseline. More recently, Chattopadhyay et al. [6] develop an attribution method that explicitly treats neural models as structured causal models and directly computes the individual causal effect of a feature to determine its attribution.
|
| 56 |
+
|
| 57 |
+
Attribution methods can measure causal properties, and, in that way, they are similar to the tool of interchange interventions. However, our methodology of causal abstraction analysis provides a framework for systematically measuring and aggregating such causal properties in order to evaluate a precise hypothesis about abstract causal structure.
|
| 58 |
+
|
| 59 |
+
Causal Abstraction Our goal is to evaluate whether the internal structure of a neural network realizes an abstract causal process. To concretize this, we turn to formal, broadly interventionist theories of causality [25, 19], in which causal processes are characterized by effects of interventions, and theories of abstraction [1, 2, 5, 22] where relationships between two causal processes are determined by the presence of systematic correspondences between the effects of interventions.
|
| 60 |
+
|
| 61 |
+
The notion of abstraction that we employ here is a relatively simple one called constructive abstraction [1]. Informally, a high-level model is a constructive abstraction of a low-level model if there is a way to partition the variables in the low-level model where each high-level variable can be assigned to a low-level partition cell, such that there is a systematic correspondence between interventions on the low-level partition cells and interventions on the high-level variables.
|
| 62 |
+
|
| 63 |
+
There are two properties of constructive abstraction that make it ideal for neural network analysis. First, the information content of partition cells of low-level variables can be determined by the high-level variables that they correspond to. For neural networks, the partition cells of low-level variables are sets of neurons, and our method supports reasoning at the level of vector representations (sets of neurons). Second, the causal dependencies between partitions of low-level variables are not necessarily preserved as causal dependencies between the high-level variables corresponding to these partitions. For example, the low-level model might be a fully connected neural network, whereas the high-level model might have much sparser connections. For neural network analysis, this means we can find causal abstractions that have far simpler causal structures than the underlying neural networks. We provide an example in the next section.
|
| 64 |
+
|
| 65 |
+
# 3 Causal Abstraction Analysis of Neural Networks
|
| 66 |
+
|
| 67 |
+
We now describe our methodology in more detail, illustrating the relevant concepts with an example of a neural network performing basic arithmetic. Specifically, suppose that we have a neural network $N _ { + }$ that takes in three vector representations $D _ { x } , D _ { y } , D _ { z }$ representing the integers $x , y .$ , and $z$ , and outputs the sum of the three inputs: $N _ { + } ( D _ { x } , D _ { y } , D _ { z } ) = x + y + z$ . We seek an informative causal explanation of this network’s behavior.
|
| 68 |
+
|
| 69 |
+
Formulating a Hypothesis A human performing this task might follow an algorithm in which they add together the first two numbers and then add that sum to the third number. We can hypothesize that the behavior of $N _ { + }$ is explained by this symbolic computation. Specifically, the network combines $D _ { x }$ and $D _ { y }$ to create an internal representation at some location $L _ { 1 }$ encoding $x + y$ ; it encodes $z$ at some location $L _ { 2 }$ ; and $L _ { 1 }$ and $L _ { 2 }$ are composed to encode $a + z$ at the location of the output representation. This hypothesis is given schematically in Figure 1a.
|
| 70 |
+
|
| 71 |
+
Following our methodology, we first define the causal model $C _ { + }$ in Figure 1a. Our informal hypothesis that a neural network’s behavior is explained by a simple algorithm can then be restated more formally: $C _ { + }$ is a constructive abstraction of the neural network $N _ { + }$ .
|
| 72 |
+
|
| 73 |
+
Alignment Search Now that we have hypothesized that the causal model $C _ { + }$ is a causal abstraction of the network $N _ { + }$ , the next step is to align the neural representations in $N _ { + }$ with the variables in $C _ { + }$ . The input embeddings $D _ { x }$ , $D _ { y }$ , and $D _ { z }$ must be aligned with the input variables $X , Y$ , and $Z$ and the output neuron $O$ must be aligned with the output variable $S _ { 2 }$ . That leaves the intermediate variables $S _ { 1 }$ and $W$ to be aligned with neural representations at some undetermined locations $L _ { 1 }$ and $L _ { 2 }$ . If this were an actual experiment (see below), we would perform an alignment search to consider many possible values for $L _ { 1 }$ and $L _ { 2 }$ . Each alignment is a hypothesis about where the network $N _ { + }$ stores and uses the values of $S _ { 1 }$ and $W$ . For the example, we assume the alignment in Figure 1a.
|
| 74 |
+
|
| 75 |
+
Interchange Interventions Finally, for a given alignment, we experimentally determine whether the neural representations at $L _ { 1 }$ and $L _ { 2 }$ have the same causal properties as $S _ { 1 }$ and $W$ . The basic experimental technique is an interchange intervention, in which a neural representation created during prediction on a “base” input is interchanged with the representation created for a “source” input [11]. We now show informally that this method can be used to prove that the causal model $C _ { + }$ is a constructive abstraction of the neural network $N _ { + }$ (Appendix $\mathbf { G }$ has formal details).
|
| 76 |
+
|
| 77 |
+
We first intervene on the causal model. Consider two inputs a, $\mathbf { a } ^ { \prime } \in ( \mathbb { N } _ { 9 } ) ^ { 3 }$ where $\mathbb { N } _ { 9 }$ is the set of integers 0–9. Let $\mathbf { a } = ( x , y , z )$ be the base input and $\mathbf { a } ^ { \prime } = \left( x ^ { \prime } , y ^ { \prime } , z ^ { \prime } \right)$ be the source input. Define
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
C _ { + } ^ { S _ { 1 } \mathbf { a } ^ { \prime } } ( \mathbf { a } ) = x ^ { \prime } + y ^ { \prime } + z
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
to be the output provided by $C _ { + }$ when $S _ { 1 }$ , the variable representing the intermediate sum, is intervened on and set to the value $x ^ { \prime } + y ^ { \prime }$ . Thus, for example, if the base input is $C _ { + } ( 1 , 2 , 3 ) = 6$ , and the source input is ${ \bf a } ^ { \prime } = ( 4 , 5 , 6 )$ , then $C _ { + } ^ { S _ { 1 } \mathbf { a } ^ { \prime } } ( 1 , 2 , 3 ) = 4 + 5 + 3 = 1 2$ . This process is depicted in Figure 1c. Next, we intervene on the neural network $N _ { + }$ . Let $\mathbf { D }$ be an embedding space that provides unique representations for $\mathbb { N } _ { 9 }$ , and consider two inputs $\boldsymbol { D } = ( D _ { x } , D _ { y } , D _ { z } )$ and $D ^ { \prime } = \bar { ( } D _ { x ^ { \prime } } , D _ { y ^ { \prime } } , \bar { D _ { z ^ { \prime } } } )$ , where all $D _ { i }$ and $D _ { i ^ { \prime } }$ are drawn from $\mathbf { D }$ . In parallel with (1), define
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
N _ { + } ^ { L _ { 1 } D ^ { \prime } } ( D )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
to be the output provided by $N _ { + }$ processing the input $D$ when the representation at location $L _ { 1 }$ is replaced with the representation at location $L _ { 1 }$ created when $N _ { + }$ is processing the input $D ^ { \prime }$ . This process is depicted in Figure 1b.
|
| 90 |
+
|
| 91 |
+
With these two definitions, we can define what it means to test the hypothesis that $N _ { + }$ computes $x + y$ at position $L _ { 1 }$ . Where $D _ { \mathbf { a } }$ is an embedding for a and $D _ { \mathbf { a ^ { \prime } } }$ is an embedding for $\mathbf { a } ^ { \prime }$ , we test:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
C _ { + } ^ { S _ { 1 } \mathbf { a } ^ { \prime } } ( \mathbf { a } ) = N _ { + } ^ { L _ { 1 } D _ { \mathbf { a } ^ { \prime } } } ( D _ { \mathbf { a } } )
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
If this equality holds for all source and base inputs a and $\mathbf { a } ^ { \prime }$ , then we can conclude that, for every intervention on $S _ { 1 }$ , there is an equivalent intervention on $L _ { 1 }$ . If we can establish a corresponding claim for $W$ and $L _ { 2 }$ , then we have shown that $C _ { + }$ is a constructive abstraction of $N _ { + }$ , since the inputs’ relationships are established by our embedding and there are no other interventions on $C _ { + }$ to test.
|
| 98 |
+
|
| 99 |
+
Analysis Suppose that all of our intervention experiments verify our hypothesis that $C _ { + }$ is a constructive abstraction of $N _ { + }$ with variables $S _ { 1 }$ and $W$ aligned to neural representations at $L _ { 1 }$ and $L _ { 2 }$ . This explains network behavior by resolving two crucial questions.
|
| 100 |
+
|
| 101 |
+
First, we learn what information is encoded in the representations $L _ { 1 }$ and $L _ { 2 }$ . Neural representations encode the values of the high-level variables they are aligned with. The location $L _ { 1 }$ encodes the variable $S _ { 1 }$ and the location $L _ { 2 }$ encodes the variable $W$ . This is similar to what probing achieves. However, our method is crucially different from probing. In probing, information content is established through purely correlational properties, meaning a neural representation with no causal role in network behavior can be successfully probed, as we showed in Section 2. In causal abstraction analysis, information content is established through purely causal properties, ensuring that the neural representation is actually implicated in model behavior.
|
| 102 |
+
|
| 103 |
+
Second, we learn what causal role $L _ { 1 }$ and $L _ { 2 }$ play in network behavior. Neural representations play a parallel causal role to their aligned high-level variables. At the location $L _ { 1 }$ , $D _ { x }$ and $D _ { y }$ are composed to form a neural representation with content $x + y$ that is then composed with $L _ { 2 }$ to create an output. The fact that $S _ { 1 }$ doesn’t depend on $z$ tells us that while $L _ { 1 }$ depends on $D _ { z }$ and representations at $L _ { 1 }$ may even correlate with $z$ , the information about $z$ is not causally represented at $L _ { 1 }$ . At the location $L _ { 2 }$ , the value of $z$ is simply repeated and then composed with $L _ { 1 }$ to create a final output.
|
| 104 |
+
|
| 105 |
+
Our method assigns causally impactful information content, but also identifies the abstract causal structure along which representations are composed. It thus encompasses and improves on both correlational (probing) and attribution methods.
|
| 106 |
+
|
| 107 |
+
# 4 The Natural Language Inference Task and Models
|
| 108 |
+
|
| 109 |
+
Multiply Quantified NLI Dataset The Multiply Quantified NLI (MQNLI) dataset of Geiger et al. [10] contains templatically generated English-language NLI examples that involve very complex interactions between quantifiers, negation, and modifiers. We provide a few examples in Figure 2b; the empty-string symbol $\varepsilon$ ensures perfect alignments at the token level both between premises and hypotheses and across all examples.
|
| 110 |
+
|
| 111 |
+
The MQNLI examples are labeled using an algorithmic implementation of the natural logic of MacCartney and Manning [18] over tree structures, and MQNLI has train/dev/test splits that vary in their difficulty. In the hardest setting, the train set is provably the minimal set of examples required to ensure that the dev and test sets can be perfectly solved by a simple symbolic model; in the easier settings, the train set redundantly encodes necessary information, which might allow a model to perform perfectly in assessment by memorization despite not having found a truly general solution. For a fuller review of the dataset, see Appendix A.
|
| 112 |
+
|
| 113 |
+
MQNLI is a fitting benchmark given our goals for a few reasons. First, we can focus on the hardest splits that can be generated, which will stress-test our NLI architectures in a standard behavioral way. Second, the MQNLI labeling algorithm itself suggests an appropriate causal model of the data-generating process. Figure 2a summarizes this model in tree form, and it is presented in full detail in Geiger et al. [10]. This allows us to rigorously assess whether a neural network has learned to implement variants of this causal model. The complexity of the MQNLI examples creates many opportunities to do this in linguistically interesting ways.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
(a) The causal structure of the high-level natural logic causal model $C _ { N a t L o g }$ that performs inference on MQNLI. The superscripts $P$ and $H$ stand for ‘premise’ and ‘hypothesis’ and the subscripts ‘Subj’ and ‘Obj’ stand for ‘Subject’ and ‘Object’. The node labels are used to explain the experimental results in Section 5
|
| 117 |
+
|
| 118 |
+
$\varepsilon$ every $\varepsilon$ baker $\varepsilon \varepsilon \varepsilon$ eats $\varepsilon$ no $\varepsilon$ bread
|
| 119 |
+
contradiction
|
| 120 |
+
$\varepsilon$ no angry baker $\varepsilon \varepsilon \varepsilon$ eats $\varepsilon$ no $\varepsilon$ bread
|
| 121 |
+
$\varepsilon$ every silly professor $\varepsilon \varepsilon \varepsilon$ sells not every $\varepsilon$ book
|
| 122 |
+
neutral
|
| 123 |
+
$\varepsilon$ every silly professor $\varepsilon \varepsilon \varepsilon$ sells not every $\varepsilon$ chair
|
| 124 |
+
not every sad baker $\varepsilon \varepsilon$ fairly admits not every odd idea
|
| 125 |
+
entailment
|
| 126 |
+
$\varepsilon$ some $\varepsilon$ baker does not $\varepsilon$ admits $\varepsilon$ no $\varepsilon$ idea
|
| 127 |
+
|
| 128 |
+
(b) MQNLI examples. The $\varepsilon$ token serves as padding (but still attended to by the model) and ensures a perfect alignment between both premises and hypotheses and across all examples. It is semantically an identity element.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Model</td><td>Train</td><td>Dev</td><td>Test</td></tr><tr><td>CBoW</td><td>88.04</td><td>54.18</td><td>53.99</td></tr><tr><td>TreeNN</td><td>67.01</td><td>54.01</td><td>53.73</td></tr><tr><td>CompTreeNN</td><td>99.65</td><td>80.17</td><td>80.21</td></tr><tr><td>BiLSTM</td><td>99.42</td><td>46.41</td><td>46.32</td></tr><tr><td>BERT</td><td>99.99</td><td>88.25</td><td>88.50</td></tr></table>
|
| 131 |
+
|
| 132 |
+
(c) MQNLI results. The first three models are from Geiger et al. 10, where the CompTreeNN is a taskspecific model not suitable for general NLI and functions as an idealized upperbound. Our results show that BERT-based models can surpass this without such alignments.
|
| 133 |
+
|
| 134 |
+
Figure 2: The natural logic causal model (top), MQNLI examples (left) and MQNLI results (right).
|
| 135 |
+
|
| 136 |
+
Models We evaluated two models on MQNLI: a randomly initialized multilayered Bidirectional LSTM (BiLSTM; [23]) and a BERT-based classifier model in which the English bert-base parameters [8] are fine-tuned on the MQNLI train set. Output predictions are computed using the final representation above the [CLS] token. Models are trained to predict the relation of every pair of aligned phrases in Figure 2a. Additional model and training details are given in Appendix B.
|
| 137 |
+
|
| 138 |
+
Results Figure 2c summarizes the results of our BERT and BiLSTM models on the hardest fair generalization task Geiger et al. [10] creates with MQNLI. We find that our BiLSTM model is not able to learn this task, and that our BERT model is able to achieve high accuracy. The only models in Geiger et al. [10] able to achieve above $50 \%$ accuracy were task-specific tree-structured models with the structure of the tree in Figure 2a. Thus, our BERT-based model is the first general-purpose model able to achieve good performance on this hard generalization task. Without pretraining, the BERT-based model achieves ${ \approx } 4 9 . 1 \%$ , confirming that pretraining is essential, as expected.
|
| 139 |
+
|
| 140 |
+
A natural hypothesis is that the BERT-based model achieves this high performance because it has in effect induced some approximation to the tree-like structure of the data-generating process in its own internal layers. With causal abstraction analysis, we are actually in a position to test this hypothesis.
|
| 141 |
+
|
| 142 |
+
# 5 A Case Study in Structural Neural Network Analysis
|
| 143 |
+
|
| 144 |
+
# 5.1 Causal Abstractions of Neural NLI models
|
| 145 |
+
|
| 146 |
+
Formulating Our Hypotheses We proceed just as we did for the simple motivating example in Section 3, except that we are now seeking to assess the extent to which the natural logic algebra in Figure 2a is a causal abstraction of the trained neural models in the above section.
|
| 147 |
+
|
| 148 |
+
The hallmark of Figure 2a is that it defines an alignment between premise and hypothesis at both lexical and phrasal levels. This pway. For a given non-leaf node $N$ mits us to run intein Figure 2a, let $C _ { N a t L o g } ^ { N }$ interventions in a nbe a submodel of $\boldsymbol { C } _ { N a t L o g }$ compositionalthat computes the relation between the aligned phrases under and uses them to compute the final output relation between premise and hypothesis. For example, let $C _ { N a t L o g } ^ { \mathrm { N P _ { O b j } } }$ be the submodel of $\boldsymbol { C } _ { N a t L o g }$ that computes the relation between the two aligned object noun phrases and then uses that relation in computing the final output relation between premise and hypothesis (see Figure 3 right). We would like to ask whether our trained neural models also compute this relation between object noun phrases and use it to make a final prediction. We can pose this same question for other nodes which correspond to a pair of aligned subphrases.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 3: A BERT-based NLI model (left) aligned with the natural logic causal model $C _ { N a t L o g } ^ { \mathrm { N P _ { O b j } } }$ (right), where the fourth vector representation above the $\mathrm { A d j } _ { \mathrm { O b j } } ^ { P }$ token in the network is aligned with $\mathrm { N P _ { O b j } }$ , the variable representing the relation between the object noun phrases. When analyzing a sample of 1000 examples, we found a subset of 383 where $C _ { N a t L o g } ^ { \mathrm { N P _ { O b j } } }$ is an abstraction of $N _ { N L I }$ under this alignment.
|
| 152 |
+
|
| 153 |
+
nd the variable causal model., we consider a $N$ . In principle, any location in the network could bry hypothesis in this space would be intractable. t of hidden representations based on the identity of he right oneus, for each. The BERT $N _ { N L I }$ $N$ $C _ { N a t L o g } ^ { N }$ ${ C _ { N a t L o g } ^ { N } } ^ { N }$ $N$ model we use has 12 Transformer layers [30], meaning that there are 12 hidden representations for each input token. Each alignment search considers aligning the intermediate high-level variable with dozens of possible locations in the grid of BERT representations. Specifically, the following locations were considered for each $N$ :
|
| 154 |
+
|
| 155 |
+
$\mathrm { Q _ { S u b j } }$ , $\mathrm { \Delta \ A j _ { \mathrm { S u b j } } }$ , $\mathrm { N _ { S u b j } }$ , Neg, Adv, V, $\mathrm { Q _ { O b j } }$ , $\mathrm { \Delta A d j _ { O b j } }$ , $\mathrm { N _ { O b j } }$ : hidden representations above the two descendant leaf tokens. • $\mathrm { N P _ { S u b j } }$ , VP, and $\mathrm { N P _ { O b j } }$ : same but above the four descendant leaf tokens.
|
| 156 |
+
|
| 157 |
+
$\mathrm { Q P _ { O b j } }$ idden representations above . $\mathrm { Q } _ { \mathrm { 0 b j } } ^ { P }$ $\mathrm { Q } _ { \mathrm { O b j } } ^ { H }$
|
| 158 |
+
. NegP: same but above $\mathrm { N e g } ^ { P }$ and $\mathrm { N e g } ^ { H }$ .
|
| 159 |
+
All nodes (for BERT): same but above
|
| 160 |
+
[CLS] and [SEP].
|
| 161 |
+
|
| 162 |
+
For each alignment considered, we performed a full causal abstraction analysis. We report the results from the best alignments in Table 1, and we summarize the results from all alignments in Appendix D.
|
| 163 |
+
|
| 164 |
+
Interchange Interventions We first focus on our high-level causal models. Consider a non-leaf node $N$ from Figure 2a and two input token sequences $e$ and $e ^ { \prime }$ from MQNLI. Define
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
C _ { N a t L o g } ^ { N e ^ { \prime } } ( e )
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
to be the output provided by the causal mode $C _ { N a t L o g } ^ { N }$ when processing input $e$ where the relation $N$ is changed to the relation between those subphrases
|
| 171 |
+
in $e ^ { \prime }$ . For example, simplifying for the sake of exposition, suppose $e$ is (some happy baker, no $\epsilon$
|
| 172 |
+
baker), which has output label contradiction, and suppose $e ^ { \prime }$ is (every happy person, some happy
|
| 173 |
+
aker), which has output label , the noun phrase relation is e ntailment.ailment; in e wish to intervene on the noun, it is reverse entailment. Thus, $N = \mathrm { N P }$ . In the
|
| 174 |
+
$e$ $e ^ { \prime }$ $C _ { N a t L o g } ^ { \mathrm { N P } e ^ { \prime } } ( e )$ $e$ to entailment while holding everything else about $e$ constant. This
|
| 175 |
+
results in the output label for the example (some happy person, no $\epsilon$ baker), which is neutral.
|
| 176 |
+
|
| 177 |
+
Next, we consider interventions in a neural model $N _ { N L I }$ . Define
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
N _ { N L I } ^ { L e ^ { \prime } } ( e )
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
Table 1: Largest subsets of examples on which specific models $C _ { N a t L o g } ^ { N }$ are abstractions of an LSTM and BERT model trained on MQNLI. We record the size of such subsets as a percentage of the total 1000 examples. On this subset, we know that the neural models compute a representation of the relation between the aligned subphrases under $N$ and use this information to make a final prediction.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Nodesadded</td><td>BERT</td></tr><tr><td>Adsubj</td><td>30.5</td></tr><tr><td>Nsub</td><td>37.2</td></tr><tr><td>Negp</td><td>14.9</td></tr><tr><td>AdvP</td><td>26.9</td></tr><tr><td>VP</td><td>35.6</td></tr><tr><td>Q</td><td>16.2</td></tr><tr><td>Adjsubj H</td><td>13.4</td></tr><tr><td>Nsub</td><td>12.0</td></tr><tr><td>NegH</td><td>34.4</td></tr><tr><td>AdvH</td><td>16.2</td></tr><tr><td>VH</td><td>13.4</td></tr><tr><td>Qbi</td><td>12.0</td></tr></table>
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Causal Model</td><td>LSTM</td><td>BERT</td></tr><tr><td>Qsubj</td><td>0.7</td><td>13.1</td></tr><tr><td>Qobj</td><td>0.9</td><td>7.3</td></tr><tr><td>Neg</td><td>0.7</td><td>21.4</td></tr><tr><td>Adjsubj</td><td>2.5</td><td>6.7</td></tr><tr><td>Nsubj</td><td>1.2</td><td>5.5</td></tr><tr><td>Adjobj</td><td>0.9</td><td>14.1</td></tr><tr><td>Nobj</td><td>0.7</td><td>8.8</td></tr><tr><td>V</td><td>0.4</td><td>11.4</td></tr><tr><td>Adv</td><td>1.4</td><td>7.9</td></tr><tr><td>NPsubj</td><td>1.0</td><td>6.7</td></tr><tr><td>NPobj</td><td>0.7</td><td>38.3</td></tr><tr><td>VP</td><td>0.4</td><td>11.4</td></tr><tr><td>NegP</td><td>0.9</td><td>11.8</td></tr></table>
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Nodes removed</td><td>BERT</td></tr><tr><td></td><td>31.9</td></tr><tr><td>A N</td><td>15.7</td></tr><tr><td></td><td>33.8</td></tr><tr><td>A</td><td>15.8 31.9</td></tr><tr><td></td><td>14.1</td></tr><tr><td>A</td><td>32.2</td></tr><tr><td></td><td>31.6</td></tr><tr><td></td><td>8.8</td></tr><tr><td></td><td></td></tr><tr><td>,Abj</td><td>32.1</td></tr></table>
|
| 190 |
+
|
| 191 |
+
(a) Main results (clique sizes) for nonleaf nodes of the tree in Figure 2a. The hypothesis we have most evidence for is that the BERT model computes a representation of the $\mathrm { N P _ { O b j } }$ node with the alignment shown in Figure 3. Remarkably, with 1000 examples sampled, we found a subset of 383 examples where $C _ { N a t L o g } ^ { \mathrm { N P _ { O b j } } }$ is an abstraction of BERT.
|
| 192 |
+
|
| 193 |
+
(b) Detailed results (clique sizes) for Altein a “neighborhood” around the model $C _ { N a t L o g } ^ { \mathrm { N P _ { O b j } } }$ causal models, which has a single intermediate variable composed of four lexical items (See Figure 3). At left, we have alternative causal models where one or two of those lexical items are removed from the composition. At right, we have alternatives obtained by adding one lexical item to the composition. We observe that no alternative hypothesis about causal structure considered has more evidence.
|
| 194 |
+
|
| 195 |
+
to be the output provided by $N _ { N L I }$ processing the input $e$ when the representation at location $L$ is replaced with the representation at location $L$ created when $N _ { N L I }$ is processing $e ^ { \prime }$ . This is exactly the process depicted in Figure 1, except now the networks are the complex trained networks of Section 4.
|
| 196 |
+
|
| 197 |
+
Our hypothesis linking Figure 2a with a model $N _ { N L I }$ takes the same form as (3). The causal model $C _ { N a t L o g } ^ { N }$ is a constructive abstraction of $N _ { N L I }$ when, for some representation location $L$ , it is the case that, for all MQNLI examples $e$ and $e ^ { \prime }$ , we have
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
C _ { N a t L o g } ^ { N e ^ { \prime } } ( e ) = N _ { N L I } ^ { L e ^ { \prime } } ( e )
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
This asserts a correspondence between interventions on the representations at $L$ in network $N _ { N L I }$ and interventions on the variable $N$ in the causal model $C _ { N a t L o g } ^ { N }$ . If it holds, then $N _ { N L I }$ computes the relation between the aligned phrases under the node $N$ and uses this information to compute the relation between the premise and hypothesis.
|
| 204 |
+
|
| 205 |
+
We call a pair of examples $( e , e ^ { \prime } )$ successful if it satisfies equation (6), i.e., interventions in both the target causal model and neural model produce equal results. In addition, to isolate the causal impact of our interventions, we specifically focus on pairs $( e , e ^ { \prime } )$ for which performing the intervention produces a different output value than without the intervention. We call a pair $( e , e ^ { \prime } )$ impactful if:
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
C _ { N a t L o g } ^ { N e ^ { \prime } } ( e ) \neq C _ { N a t L o g } ^ { N } ( e )
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
Quantifying Partial Success Equation (6) universally quantifies over all examples. We do not expect this kind of perfect correspondence to emerge in practice for real problems: neural network training is often approximate and variable in nature, and even our best model does not achieve perfect performance. However, we can still ask how to find the largest subset of MQNLI on which $C _ { N a t L o g } ^ { N }$ (6) holds for a given model. To do this, we seekis an abstraction of our neural models, for each non-leaf node N in CNatLog.
|
| 212 |
+
|
| 213 |
+
More specifically, considering each example in MQNLI as a vertex in a graph, we add an undirected edge between two examples $e _ { i }$ and $e _ { j }$ if and only if both the ordered pairs $( e _ { i } , e _ { j } )$ and $( e _ { j } , e _ { i } )$ satisfy (6). In other words, if and only if all ex $C _ { N a t L o g } ^ { N }$ isin n abstraction of a neural model on a subset of examples form a clique. $S$ of MQNLI $S$
|
| 214 |
+
|
| 215 |
+
The number of interventions we need to run scales quadratically with the number of inputs we consider, so we sample 1000 MQNLI examples, producing a total of $1 0 0 0 ^ { 2 } = 1 \mathbf { M }$ ordered pairs. We only consider examples for which the neural network outputs a correct label. For each node $N$ and each of its corresponding neural network locations $L$ , we perform interventions on all of these pairs.
|
| 216 |
+
|
| 217 |
+
We choose to measure the largest clique with at least one impactful edge, because (1) the causal abstraction relation holds with full force on that clique, but other measures such as the total number of connections lack this theoretical grounding, and (2) if a clique has at least one impactful edge, that guarantees the high-level variable is being used.
|
| 218 |
+
|
| 219 |
+
Results and Analysis For each target causal model node $N$ and neural network representation location $L$ , we construct a graph as described above with 1000 examples as vertices and add an edge between two examples $e _ { i }$ and $e _ { j }$ if and only if both $( e _ { i } , e _ { j } )$ and $( e _ { j } , e _ { i } )$ are successful. We then find the largest clique in this graph with at least one impactful edge and record its size.
|
| 220 |
+
|
| 221 |
+
Table 1a shows, for each causal model node $N$ , the maximum size of cliques found among all neural locations. With this stricter impactful criterion (as opposed to simply using intervention success), our results show that, for almost all nodes abstraction of BERT on a significant numb $N$ , our target causal model of examples in our datase $C _ { N a t L o g } ^ { \widetilde { N } }$ is indeed a causale subsets are much smaller for the BiLSTM model.
|
| 222 |
+
|
| 223 |
+
We also investigated alternative high-level causal structures that are not variants of $\boldsymbol { C } _ { N a t L o g }$ from Figure 2a. Specifically, we consider alternative models in a “neighborhood” around the model CNPObjNatLog that can be obtained by adding one leaf, or by removing one or two leaves to the composition. These results are in Table 1b. Remarkably, all of these alternative models result in smaller clique sizes, significantly so for many of them. This further supports the significance of our results.
|
| 224 |
+
|
| 225 |
+
This analysis is simtwo crucial differenis an abstraction of o the analysis of our hirst, for each variable , whereas in the addit $N$ othetical addition example in Section 3, ex, we are hypothesizing that the causal model example there was only one model. To inv ${ \dot { C } } _ { N a t L o g } ^ { N }$ $N _ { N L I }$
|
| 226 |
+
this difference, we take $N = \mathrm { N P _ { O b j } }$ as a paradigm case, as it is the model with the strongest results. (The results for other nodes are in Appendix D.) Second, we only achieved partial experimental success, whereas in the addition example we assumed complete success. Crucially, this means that the following analysis will be valid only on subsets of the input space on which the abstraction relation holds between NNLI and CNPObjNatLog.
|
| 227 |
+
|
| 228 |
+
We visualize the results of our intervention experiments for the node $\mathrm { N P _ { O b j } }$ in Figure 4. The alignment with the largest subset of inputs aligns the NPObj variable in CNPObjNatLog with the neural representation on the fourth layer of BERT above the $\mathrm { A d j } _ { \mathrm { O b j } } ^ { P }$ token (see Figure 3). Because neural representations encode the value of their aligned variables and play a parallel causal role to their high-level variables, we know that, on this subset of input examples, at the fourth neural representation above the $\mathrm { A d j } _ { \mathrm { O b j } } ^ { P }$ token, the four input embeddings for the object nouns and adjectives in the premise and hypothesis are composed to form a neural representation with information content of the relation between the object noun phrases in the premise and hypothesis. Then this representation is composed with the other input-embeddings to create an output representing the relation between the premise and hypothesis.
|
| 229 |
+
|
| 230 |
+
# 5.2 Comparison with Other Structural Analysis Methods
|
| 231 |
+
|
| 232 |
+
Probes We probed neural representation locations for the relation between aligned subexpressions on a subset of 12,800 randomly selected MQNLI examples. For a pair of aligned subexpressions below a node $N$ in Figure 2a, we probe the columns above the same set of restricted class of tokens as described in Section 5.1.
|
| 233 |
+
|
| 234 |
+
To evaluate these probes, we report accuracy as well as selectivity as defined by Hewitt and Liang [12]: probe accuracy minus control accuracy, where control accuracy is the train set accuracy of a probe with the same architecture but trained on a control task to factor out probe success that can be attributed to the probe model itself. Our control task is to learn a random mapping from node types to semantic relations; see Appendix C for full details on how this task was constructed.
|
| 235 |
+
|
| 236 |
+

|
| 237 |
+
Figure 4: Interchange intervention and probing results for the $\mathrm { N P _ { O b j } }$ position. Vertical axes denote layers of BERT and horizontal axes denote the token position of hidden representations. The intervention success rates reported here are calculated based on intervention experiments with a change in the output label. Clique sizes are reported as $\%$ of 1000 examples.
|
| 238 |
+
|
| 239 |
+
Figure 4 summarizes our probing results for $N = \mathrm { N P _ { O b j } }$ , along with corresponding interchange intervention results for comparison. Probes tell us that information about the relation between the aligned noun phrases is encoded in nearly all of the locations we considered, and using the selectivity metric does not result in any qualitative change. In contrast, our intervention heatmaps indicate only a small number of locations store this information in a causally relevant way. Clearly, our intervention experiments are far more discriminating than probes. Appendix D provides examples involving other variables along with the intervention experiments, where the general trend of interchange interventions being more discriminating holds.
|
| 240 |
+
|
| 241 |
+
Integrated Gradients Attribution methods that estimate feature importance can measure causal properties of neural representations, but a single feature importance method is an impoverished characterization of a representation’s role in network behavior. Whereas our interchange interventions gave us high-level information about how a neural representation is composed and what it is composed into, attribution methods simply tell us “how much” a representation contributes to the network output on a give input. Moreover, intervention interchanges provide a rich, high-level characterization of causal structure on a space of inputs.
|
| 242 |
+
|
| 243 |
+
We use integrated gradients on our models to verify the intuitive hypothesis that if a premise and hypothesis differ by a single token, then the neural representations above that token should be more causally responsible for the network output than other representations. For example, given premise ‘Every sleepy cat meows’ and hypothesis ‘Some hungry cat meows’, the attributive modifier position is different and the rest are matched. The neural representations above the adjective tokens sleepy and hungry should be more important for the network output than others, because if those adjectives were the same, the example label would change from neutral to entailment. We summarize the results of our integrated gradient experiments in Appendix E, where we confirm our intuitive hypothesis.
|
| 244 |
+
|
| 245 |
+
# 6 Conclusion
|
| 246 |
+
|
| 247 |
+
We have introduced a methodology for deriving interpretable causal explanations of neural network behaviors, grounded in a formal theory of causal abstraction. The methodology involves first formulating a hypothesis in the form of a high-level, interpretable causal model, then searching for an alignment between the neural network and the causal model, and finally verifying experimentally that the neural representations encode the same causal properties and information content as the corresponding components of the high-level causal model. As a case study demonstrating the feasibility of the approach, we analyzed neural models trained on the semantically formidable MQNLI dataset. Guided by the intuition that success on this challenging task may call for a way of recapitulating the causal structure of the natural logic model that generates the MQNLI data, we were able to verify the hypothesis that a state-of-the-art BERT-based model partially realizes this structure, whereas baseline models that do not perform as well fail to do so. This suggestive case study demonstrates that our theoretically grounded methodology can work in practice.
|
| 248 |
+
|
| 249 |
+
# Acknowledgments and Disclosure of Funding
|
| 250 |
+
|
| 251 |
+
Our thanks to Amir Feder, Noah Goodman, Elisa Kreiss, Josh Rozner, Zhengxuan Wu, and our anonymous reviewers. This research is supported in part by grants from Facebook and Google.
|
| 252 |
+
|
| 253 |
+
References
|
| 254 |
+
[1] S. Beckers and J. Y. Halpern. Abstracting causal models. Proceedings of the AAAI Conference on Artificial Intelligence, 33(01):2678–2685, Jul. 2019. doi: 10.1609/aaai.v33i01.33012678. URL https://ojs.aaai.org/index.php/AAAI/article/view/4117.
|
| 255 |
+
[2] S. Beckers, F. Eberhardt, and J. Y. Halpern. Approximate causal abstractions. In R. P. Adams and V. Gogate, editors, Proceedings of The 35th Uncertainty in Artificial Intelligence Conference, volume 115 of Proceedings of Machine Learning Research, pages 606–615, Tel Aviv, Israel, 22–25 Jul 2020. PMLR. URL http://proceedings.mlr.press/v115/beckers20a.html.
|
| 256 |
+
[3] A. Binder, G. Montavon, S. Bach, K. Müller, and W. Samek. Layer-wise relevance propagation for neural networks with local renormalization layers. CoRR, abs/1604.00825, 2016. URL http://arxiv.org/abs/1604.00825.
|
| 257 |
+
[4] S. Bongers, P. Forré, J. Peters, B. Schölkopf, and J. M. Mooij. Foundations of structural causal models with cycles and latent variables. arXiv.org preprint, arXiv:1611.06221v4 [stat.ME], Oct. 2020. URL https://arxiv.org/abs/1611.06221v4.
|
| 258 |
+
[5] K. Chalupka, F. Eberhardt, and P. Perona. Multi-level cause-effect systems. In A. Gretton and C. C. Robert, editors, Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, volume 51 of Proceedings of Machine Learning Research, pages 361–369, Cadiz, Spain, 09–11 May 2016. PMLR. URL http://proceedings.mlr.press/v51/chalupka16. html.
|
| 259 |
+
[6] A. Chattopadhyay, P. Manupriya, A. Sarkar, and V. N. Balasubramanian. Neural network attributions: A causal perspective. In K. Chaudhuri and R. Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 981–990, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/chattopadhyay19a.html.
|
| 260 |
+
[7] K. Clark, U. Khandelwal, O. Levy, and C. D. Manning. What does BERT look at? an analysis of BERT’s attention. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 276–286, Florence, Italy, Aug. 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-4828. URL https: //www.aclweb.org/anthology/W19-4828.
|
| 261 |
+
[8] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://www.aclweb.org/anthology/N19-1423.
|
| 262 |
+
[9] Y. Elazar, S. Ravfogel, A. Jacovi, and Y. Goldberg. Amnesic probing: Behavioral explanation with amnesic counterfactuals. In Proceedings of the 2020 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP. Association for Computational Linguistics, Nov. 2020. doi: 10.18653/v1/W18-5426.
|
| 263 |
+
[10] A. Geiger, I. Cases, L. Karttunen, and C. Potts. Posing fair generalization tasks for natural language inference. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4475–4485, Stroudsburg, PA, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1456. URL https://www.aclweb.org/anthology/D19-1456.
|
| 264 |
+
[11] A. Geiger, K. Richardson, and C. Potts. Neural natural language inference models partially embed theories of lexical entailment and negation. In Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 163–173, Online, Nov. 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.blackboxnlp-1.16. URL https://www.aclweb.org/anthology/2020.blackboxnlp-1.16.
|
| 265 |
+
[12] J. Hewitt and P. Liang. Designing and interpreting probes with control tasks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2733–2743, Hong Kong, China, Nov. 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1275. URL https://www.aclweb.org/anthology/D19-1275.
|
| 266 |
+
[13] D. Hupkes, S. Bouwmeester, and R. Fernández. Analysing the potential of seq-to-seq models for incremental interpretation in task-oriented dialogue. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 165–174, Brussels, Belgium, Nov. 2018. Association for Computational Linguistics. doi: 10.18653/v1/ W18-5419. URL https://www.aclweb.org/anthology/W18-5419.
|
| 267 |
+
[14] T. F. Icard and L. S. Moss. Recent progress on monotonicity. Linguistic Issues in Language Technology, 9(7):1–31, January 2013.
|
| 268 |
+
[15] G. W. Imbens and D. B. Rubin. Causal inference in statistics, social, and biomedical sciences. Cambridge University Press, 2015.
|
| 269 |
+
[16] T. P. Lillicrap and K. P. Kording. What does it mean to understand a neural network?, 2019.
|
| 270 |
+
[17] B. MacCartney and C. D. Manning. Natural logic for textual inference. In Proceedings of the ACL-PASCAL Workshop on Textual Entailment and Paraphrasing, RTE ’07, pages 193–200, Stroudsburg, PA, USA, 2007. Association for Computational Linguistics. URL http://dl.acm.org/citation.cfm?id=1654536.1654575.
|
| 271 |
+
[18] B. MacCartney and C. D. Manning. An extended model of natural logic. In Proceedings of the Eight International Conference on Computational Semantics, pages 140–156, Tilburg, The Netherlands, Jan. 2009. Association for Computational Linguistics. URL https://www. aclweb.org/anthology/W09-3714.
|
| 272 |
+
[19] J. Pearl. Direct and indirect effects. In Proceedings of the Seventeenth Conference on Uncertainty in Artificial Intelligence, UAI’01, page 411–420, San Francisco, CA, USA, 2001. Morgan Kaufmann Publishers Inc. ISBN 1558608001.
|
| 273 |
+
[20] M. Peters, M. Neumann, L. Zettlemoyer, and W.-t. Yih. Dissecting contextual word embeddings: Architecture and representation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1499–1509, Brussels, Belgium, Oct.- Nov. 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1179. URL https://www.aclweb.org/anthology/D18-1179.
|
| 274 |
+
[21] A. Ravichander, Y. Belinkov, and E. Hovy. Probing the probing paradigm: Does probing accuracy entail task relevance?, 2020.
|
| 275 |
+
[22] P. K. Rubenstein, S. Weichwald, S. Bongers, J. M. Mooij, D. Janzing, M. Grosse-Wentrup, and B. Schölkopf. Causal consistency of structural equation models. In Proceedings of the 33rd Conference on Uncertainty in Artificial Intelligence (UAI). Association for Uncertainty in Artificial Intelligence (AUAI), Aug. 2017. URL http://auai.org/uai2017/proceedings/ papers/11.pdf. \*equal contribution.
|
| 276 |
+
[23] M. Schuster and K. K. Paliwal. Bidirectional recurrent neural networks. IEEE transactions on Signal Processing, 45(11):2673–2681, 1997.
|
| 277 |
+
[24] A. Shrikumar, P. Greenside, A. Shcherbina, and A. Kundaje. Not just a black box: Learning important features through propagating activation differences. CoRR, abs/1605.01713, 2016. URL http://arxiv.org/abs/1605.01713.
|
| 278 |
+
[25] P. Spirtes, C. N. Glymour, and R. Scheines. Causation, Prediction, and Search. MIT Press, 2nd edition, 2001. ISBN 9780262194402.
|
| 279 |
+
|
| 280 |
+
[26] J. Springenberg, A. Dosovitskiy, T. Brox, and M. Riedmiller. Striving for simplicity: The all convolutional net. CoRR, 12 2014.
|
| 281 |
+
|
| 282 |
+
[27] M. Sundararajan, A. Taly, and Q. Yan. Axiomatic attribution for deep networks. In D. Precup and Y. W. Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3319–3328, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings. mlr.press/v70/sundararajan17a.html.
|
| 283 |
+
|
| 284 |
+
[28] I. Tenney, D. Das, and E. Pavlick. BERT rediscovers the classical NLP pipeline. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4593– 4601, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/ P19-1452. URL https://www.aclweb.org/anthology/P19-1452.
|
| 285 |
+
|
| 286 |
+
[29] J. van Benthem. A brief history of natural logic. In M. Chakraborty, B. Löwe, M. Nath Mitra, and S. Sarukki, editors, Logic, Navya-Nyaya and Applications: Homage to Bimal Matilal, 2008.
|
| 287 |
+
|
| 288 |
+
[30] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. u. Kaiser, and I. 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.
|
| 289 |
+
|
| 290 |
+
[31] T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, and J. Brew. Huggingface’s transformers: State-of-the-art natural language processing. ArXiv, abs/1910.03771, 2019.
|
| 291 |
+
|
| 292 |
+
[32] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In D. Fleet, T. Pajdla, B. Schiele, and T. Tuytelaars, editors, Computer Vision – ECCV 2014, pages 818–833, Cham, 2014. Springer International Publishing. ISBN 978-3-319-10590-1.
|
md/train/Rnn8zoAkrwr/Rnn8zoAkrwr.md
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Independent mechanism analysis, a new concept?
|
| 2 |
+
|
| 3 |
+
Luigi Gresele∗1
|
| 4 |
+
|
| 5 |
+
Julius von Kügelgen∗1,2
|
| 6 |
+
|
| 7 |
+
Vincent Stimper 1,2
|
| 8 |
+
|
| 9 |
+
Bernhard Schölkopf 1 Michel Besserve 1
|
| 10 |
+
|
| 11 |
+
1 Max Planck Institute for Intelligent Systems, Tübingen, Germany 2 University of Cambridge {luigi.gresele,jvk,vincent.stimper,bs,besserve}@tue.mpg.de
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Independent component analysis provides a principled framework for unsupervised representation learning, with solid theory on the identifiability of the latent code that generated the data, given only observations of mixtures thereof. Unfortunately, when the mixing is nonlinear, the model is provably nonidentifiable, since statistical independence alone does not sufficiently constrain the problem. Identifiability can be recovered in settings where additional, typically observed variables are included in the generative process. We investigate an alternative path and consider instead including assumptions reflecting the principle of independent causal mechanisms exploited in the field of causality. Specifically, our approach is motivated by thinking of each source as independently influencing the mixing process. This gives rise to a framework which we term independent mechanism analysis. We provide theoretical and empirical evidence that our approach circumvents a number of nonidentifiability issues arising in nonlinear blind source separation.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
One of the goals of unsupervised learning is to uncover properties of the data generating process, such as latent structures giving rise to the observed data. Identifiability [55] formalises this desideratum: under suitable assumptions, a model learnt from observations should match the ground truth, up to well-defined ambiguities. Within representation learning, identifiability has been studied mostly in the context of independent component analysis (ICA) [17, 40], which assumes that the observed data $\mathbf { x }$ results from mixing unobserved independent random variables $s _ { i }$ referred to as sources. The aim is to recover the sources based on the observed mixtures alone, also termed blind source separation (BSS). A major obstacle to BSS is that, in the nonlinear case, independent component estimation does not necessarily correspond to recovering the true sources: it is possible to give counterexamples where the observations are transformed into components $y _ { i }$ which are independent, yet still mixed with respect to the true sources $s _ { i }$ [20, 39, 98]. In other words, nonlinear ICA is not identifiable.
|
| 20 |
+
|
| 21 |
+
In order to achieve identifiability, a growing body of research postulates additional supervision or structure in the data generating process, often in the form of auxiliary variables [28, 30, 37, 38, 41]. In the present work, we investigate a different route to identifiability by drawing inspiration from the field of causal inference [71, 78] which has provided useful insights for a number of machine learning tasks, including semi-supervised [87, 103], transfer [6, 23, 27, 31, 61, 72, 84, 85, 97, 102, 107], reinforcement [7, 14, 22, 26, 53, 59, 60, 106], and unsupervised [9, 10, 54, 70, 88, 91, 104, 105] learning. To this end, we interpret the ICA mixing as a causal process and apply the principle of independent causal mechanisms (ICM) which postulates that the generative process consists of independent modules which do not share information [43, 78, 87]. In this context, “independent” does not refer to statistical independence of random variables, but rather to the notion that the distributions and functions composing the generative process are chosen independently by Nature [43, 48]. While a formalisation of ICM [43, 57] in terms of algorithmic (Kolmogorov) complexity [51] exists, it is not computable, and hence applying ICM in practice requires assessing such non-statistical independence with suitable domain specific criteria [96]. The goal of our work is thus to constrain the nonlinear ICA problem, in particular the mixing function, via suitable ICM measures, thereby ruling out common counterexamples to identifiability which intuitively violate the ICM principle.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: (Left) For the cocktail party problem, the ICM principle as traditionally understood would say that the content of speech $p _ { \mathbf { s } }$ is independent of the mixing or recording process f (microphone placement, room acoustics). IMA refines, or extends, this idea at the level of the mixing function by postulating that the contributions ${ \partial \mathbf { f } } / { \partial s _ { i } }$ of each source to $\mathbf { f }$ , as captured by the speakers’ positions relative to the recording process, should not be fine-tuned to each other. (Right) We formalise this independence between the ${ \partial \mathbf { f } } / { \partial s _ { i } }$ , which are the columns of the Jacobian $\mathbf { J _ { f } }$ , as an orthogonality condition: the absolute value of the determinant $| \mathbf { J _ { f } } |$ , i.e., the volume of the parallelepiped spanned by ${ \partial \mathbf { f } } / { \partial s _ { i } }$ , should decompose as the product of the norms of the ${ \partial \mathbf { f } } / { \partial s _ { i } }$ .
|
| 25 |
+
|
| 26 |
+
Traditionally, ICM criteria have been developed for causal discovery, where both cause and effect are observed [18, 45, 46, 110]. They enforce an independence between (i) the cause (source) distribution and (ii) the conditional or mechanism (mixing function) generating the effect (observations), and thus rely on the fact that the observed cause distribution is informative. As we will show, this renders them insufficient for nonlinear ICA, since the constraints they impose are satisfied by common counterexamples to identifiability. With this in mind, we introduce a new way to characterise or refine the ICM principle for unsupervised representation learning tasks such as nonlinear ICA.
|
| 27 |
+
|
| 28 |
+
Motivating example. To build intuition, we turn to a famous example of ICA and BSS: the cocktail party problem, illustrated in Fig. 1 (Left). Here, a number of conversations are happening in parallel, and the task is to recover the individual voices $s _ { i }$ from the recorded mixtures $x _ { i }$ . The mixing or recording process f is primarily determined by the room acoustics and the locations at which microphones are placed. Moreover, each speaker influences the recording through their positioning in the room, and we may think of this influence as $\partial \mathbf { f } / \partial s _ { i }$ . Our independence postulate then amounts to stating that the speakers’ positions are not fine-tuned to the room acoustics and microphone placement, or to each other, i.e., the contributions $\partial \mathbf { f } / \partial s _ { i }$ should be independent (in a non-statistical sense).1
|
| 29 |
+
|
| 30 |
+
Our approach. We formalise this notion of independence between the contributions $\partial \mathbf { f } / \partial s _ { i }$ of each source to the mixing process (i.e., the columns of the Jacobian matrix $\mathbf { J _ { f } }$ of partial derivatives) as an orthogonality condition, see Fig. 1 (Right). Specifically, the absolute value of the determinant $| \mathbf { J _ { f } } |$ , which describes the local change in infinitesimal volume induced by mixing the sources, should factorise or decompose as the product of the norms of its columns. This can be seen as a decoupling of the local influence of each partial derivative in the pushforward operation (mixing function) mapping the source distribution to the observed one, and gives rise to a novel framework which we term independent mechanism analysis (IMA). IMA can be understood as a refinement of the ICM principle that applies the idea of independence of mechanisms at the level of the mixing function.
|
| 31 |
+
|
| 32 |
+
Contributions. The structure and contributions of this paper can be summarised as follows:
|
| 33 |
+
|
| 34 |
+
• we review well-known obstacles to identifiability of nonlinear ICA $( \ S 2 . 1 )$ , as well as existing ICM criteria $\mathrm { ~ ( ~ \ S ~ } \mathrm { ~ ) ~ }$ , and show that the latter do not sufficiently constrain nonlinear ICA $^ { ( \ S ) }$ ; • we propose a more suitable ICM criterion for unsupervised representation learning which gives rise to a new framework that we term independent mechanism analysis (IMA) $( \ S 4 )$ ; we provide geometric and information-theoretic interpretations of IMA $\mathrm { ~ ( ~ \ S ~ } \mathrm { ~ ) ~ }$ , introduce an IMA contrast function which is invariant to the inherent ambiguities of nonlinear ICA $\mathrm { ~ ~ { ~ \left( \ S ~ \right. ~ } ~ } )$ , and show that it rules out a large class of counterexamples and is consistent with existing identifiability results (§ 4.3); • we experimentally validate our theoretical claims and propose a regularised maximum-likelihood learning approach based on the IMA constrast which outperforms the unregularised baseline $^ { ( \ S ) }$ ; additionally, we introduce a method to learn nonlinear ICA solutions with triangular Jacobian and a metric to assess BSS which can be of independent interest for the nonlinear ICA community.
|
| 35 |
+
|
| 36 |
+
# 2 Background and preliminaries
|
| 37 |
+
|
| 38 |
+
Our work builds on and connects related literature from the fields of independent component analysis $\mathrm { ~ ( ~ \ S ~ } \mathrm { ~ ) ~ }$ and causal inference $( \ S 2 . 2 )$ . We review the most important concepts below.
|
| 39 |
+
|
| 40 |
+
# 2.1 Independent component analysis (ICA)
|
| 41 |
+
|
| 42 |
+
Assume the following data-generating process for independent component analysis (ICA)
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { r } { { \mathbf { x } } = { \mathbf { f } } \left( { \mathbf { s } } \right) , \qquad p _ { { \mathbf { s } } } ( { \mathbf { s } } ) = \prod _ { i = 1 } ^ { n } p _ { s _ { i } } ( s _ { i } ) , } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where the observed mixtures $\mathbf { x } \in \mathbb { R } ^ { n }$ result from applying a smooth and invertible mixing function $\mathbf { f } : \mathbb { R } ^ { n } \to \mathbb { R } ^ { n }$ to a set of unobserved, independent signals or sources $\mathbf { s } \in \mathbb { R } ^ { n }$ with smooth, factorised density $p _ { \mathbf { s } }$ with connected support (see illustration Fig. 2b). The goal of ICA is to learn an unmixing function $\mathbf { g } : \mathbb { R } ^ { n } \to \mathbb { R } ^ { n }$ such that $\mathbf { y } = \mathbf { g } ( \mathbf { x } )$ has independent components. Blind source separation (BSS), on the other hand, aims to recover the true unmixing f $^ { - 1 }$ and thus the true sources s (up to tolerable ambiguities, see below). Whether performing ICA corresponds to solving BSS is related to the concept of identifiability of the model class. Intuitively, identifiability is the desirable property that all models which give rise to the same mixture distribution should be “equivalent” up to certain ambiguities, formally defined as follows.
|
| 49 |
+
|
| 50 |
+
Definition 2.1 $\sim$ -identifiability). Let $\mathcal { F }$ be the set of all smooth, invertible functions f $\displaystyle \dot { \mathbf { \beta } } : \mathbb { R } ^ { n } \to \mathbb { R } ^ { n }$ , and $\mathcal { P }$ be the set of all smooth, factorised densities $p _ { \mathbf { s } }$ with connected support on $\mathbb { R } ^ { n }$ . Let $\mathcal { M } \subseteq \mathcal { F } \times \mathcal { P }$ be a subspace of models and let $\sim$ be an equivalence relation on $\mathcal { M }$ . Denote by $\mathbf { f } _ { \ast } p _ { \mathbf { s } }$ the push-forward density of $p _ { \mathbf { s } }$ via f . Then the generative process (1) is said to be $\sim$ -identifiable on $\mathcal { M }$ if
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\forall ( \mathbf { f } , p _ { \mathrm { s } } ) , ( \tilde { \mathbf { f } } , p _ { \mathrm { \tilde { s } } } ) \in \mathcal { M } : \qquad \mathbf { f } _ { \ast } p _ { \mathrm { s } } = \tilde { \mathbf { f } } _ { \ast } p _ { \mathrm { \tilde { s } } } \qquad \implies \qquad ( \mathbf { f } , p _ { \mathrm { s } } ) \sim ( \tilde { \mathbf { f } } , p _ { \mathrm { \tilde { s } } } ) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
If the true model belongs to the model class $\mathcal { M }$ , then $\sim$ -identifiability ensures that any model in $\mathcal { M }$ learnt from (infinite amounts of) data will be $\sim$ -equivalent to the true one. An example is linear ICA which is identifiable up to permutation and rescaling of the sources on the subspace $\mathcal { M } _ { \mathrm { L I N } }$ of pairs of (i) invertible matrices (constraint on $\mathcal { F }$ ) and (ii) factorizing densities for which at most one $s _ { i }$ is Gaussian (constraint on $\mathcal { P }$ ) [17, 21, 93], see Appendix A for a more detailed account.
|
| 57 |
+
|
| 58 |
+
In the nonlinear case (i.e., without constraints on $\mathcal { F }$ ), identifiability is much more challenging. If $s _ { i }$ and $s _ { j }$ are independent, then so are $h _ { i } ( s _ { i } )$ and $h _ { j } ( s _ { j } )$ for any functions $h _ { i }$ and $h _ { j }$ . In addition to permutation-ambiguity, such element-wise $\mathbf { h } ( \mathbf { s } ) = { \big ( } h _ { 1 } ( s _ { 1 } ) , . . . , h _ { n } ( s _ { n } ) { \big ) }$ can therefore not be resolved either. We thus define the desired form of identifiability for nonlinear BSS as follows.
|
| 59 |
+
|
| 60 |
+
Definition 2.2 $( \sim _ { \mathrm { B S S } } )$ . The equivalence relation $\sim _ { \tt B S S }$ on $\mathcal { F } \times \mathcal { P }$ defined as in Defn. 2.1 is given by
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathbf { ( f , { p _ { \mathrm { s } } } ) \sim _ { \mathrm { { B S S } } } ( \tilde { \mathbf { f } } , { p _ { \tilde { \mathbf { s } } } } ) } \iff \exists \mathbf { P } , \mathbf { h } \quad \mathrm { s . t . } \quad ( \mathbf { f } , { p _ { \mathbf { s } } } ) = ( \tilde { \mathbf { f } } \circ \mathbf { h } ^ { - 1 } \circ \mathbf { P } ^ { - 1 } , ( \mathbf { P } \circ \mathbf { h } ) _ { \ast } \mathbf { \Lambda } \mathbf { p } _ { \tilde { \mathbf { s } } } )
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
here $\mathbf { P }$ is a permutation and $\mathbf { h } ( \mathbf { s } ) = { \big ( } h _ { 1 } ( s _ { 1 } ) , . . . , h _ { n } ( s _ { n } ) { \big ) }$ is an invertible, element-wise function.
|
| 67 |
+
|
| 68 |
+
A fundamental obstacle—and a crucial difference to the linear problem—is that in the nonlinear case, different mixtures of $s _ { i }$ and $s _ { j }$ can be independent, i.e., solving ICA is not equivalent to solving BSS. A prominent example of this is given by the Darmois construction [20, 39].
|
| 69 |
+
|
| 70 |
+
Definition 2.3 (Darmois construction). The Darmois construction $\mathbf { g } ^ { \mathrm { D } } : \mathbb { R } ^ { n } ( 0 , 1 ) ^ { n }$ is obtained by recursively applying the conditional cumulative distribution function (CDF) transform:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\begin{array} { r } { g _ { i } ^ { \mathrm { D } } ( \mathbf { x } _ { 1 : i } ) : = { \mathbb P } ( X _ { i } \leq x _ { i } | \mathbf { x } _ { 1 : i - 1 } ) = \int _ { - \infty } ^ { x _ { i } } p ( x _ { i } ^ { \prime } | \mathbf { x } _ { 1 : i - 1 } ) d x _ { i } ^ { \prime } ~ ( i = 1 , . . . , n ) . } \end{array}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
The resulting estimated sources ${ \bf y } ^ { \mathrm { D } } = { \bf g } ^ { \mathrm { D } } ( { \bf x } )$ are mutually-independent uniform r.v.s by construction, see Fig. 2a for an illustration. However, they need not be meaningfully related to the true sources s, and will, in general, still be a nonlinear mixing thereof [39].2 Denoting the mixing function corresponding to (4) by $\mathbf { f } ^ { \mathrm { { D } } } = ( \mathbf { g } ^ { \mathrm { { D } } } ) ^ { - 1 }$ and the uniform density on $( 0 , 1 ) ^ { n }$ by $p _ { \mathbf { u } }$ , the Darmois solution $( \mathbf { f } ^ { \mathrm { D } } , p _ { \mathbf { u } } )$ thus allows construction of counterexamples to $\sim _ { \tt B S S }$ -identifiability on $\mathcal { F } \times \mathcal { P }$ . 3
|
| 77 |
+
|
| 78 |
+
Remark 2.4. $\mathbf { g } ^ { \mathrm { { D } } }$ has lower-triangular Jacobian, i.e., $\partial g _ { i } ^ { \mathrm { D } } / \partial x _ { j } = 0$ for $i < j$ . Since the order of the $x _ { i }$ is arbitrary, applying $\mathbf { g } ^ { \mathrm { { D } } }$ after a permutation yields a different Darmois solution. Moreover, (4) yields independent components $\mathbf { y } ^ { \mathrm { { D } } }$ even if the sources $s _ { i }$ were not independent to begin with.4
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: (a) Any observed density $p _ { x }$ can be mapped to a uniform $p _ { y }$ via the CDF transform $g ( x ) = \mathbb { P } ( X \leq x )$ ; Darmois solutions $( \mathbf { f } ^ { \mathrm { D } } , p _ { \mathbf { u } } )$ constructed from (4) therefore automatically satisfy the independence postulated by IGCI (6). (b) ICA setting with $n = 2$ sources (shaded nodes are observed, white ones are unobserved). (c) Existing ICM criteria typically enforce independence between an observed input or cause distribution $p _ { \mathbf { c } }$ and a mechanism $\scriptstyle p _ { \mathbf { e } | \mathbf { c } }$ (independent objects are highlighted in blue and red). (d) IMA enforces independence between the contributions of different sources $s _ { i }$ to the mixing function f as captured by ${ \partial \mathbf { f } } / { \partial s _ { i } }$ .
|
| 82 |
+
|
| 83 |
+
Another well-known obstacle to identifiability are measure-preserving automorphisms (MPAs) of the source distribution $p _ { \mathbf { s } }$ : these are functions a which map the source space to itself without affecting its distribution, i.e., $\mathbf { a } _ { * } p _ { \mathbf { s } } = p _ { \mathbf { s } }$ [39]. A particularly instructive class of MPAs is the following [49, 58].
|
| 84 |
+
|
| 85 |
+
Definition 2.5 (“Rotated-Gaussian” MPA). Let $\mathbf { R } \in O ( n )$ be an orthogonal matrix, and denote by $\mathbf { F _ { s } } ( \mathbf { s } ) = \left( F _ { s _ { 1 } } ( s _ { 1 } ) , . . . , F _ { s _ { n } } ( s _ { n } ) \right)$ and $\Phi ( \mathbf { z } ) = ( \Phi ( z _ { 1 } ) , . . . , \Phi ( z _ { n } ) )$ the element-wise CDFs of a smooth, factorised density $p _ { \mathbf { s } }$ and of a Gaussian, respectively. Then the “rotated-Gaussian” MPA $\mathbf { a ^ { R } } ( p _ { \mathbf { s } } )$ is
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathbf { a } ^ { \mathbf { R } } ( p _ { \mathbf { s } } ) = \mathbf { F } _ { \mathbf { s } } ^ { - 1 } \circ \Phi \circ \mathbf { R } \circ \Phi ^ { - 1 } \circ \mathbf { F _ { s } } .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
$\mathbf { a ^ { R } } ( p _ { \mathbf { s } } )$ first maps to the (rotationally invariant) standard isotropic Gaussian (via $\Phi ^ { - 1 } \circ \mathbf { F _ { s } } ,$ ), then applies a rotation, and finally maps back, without affecting the distribution of the estimated sources. Hence, if $( \tilde { \mathbf { f } } , p _ { \tilde { \mathbf { s } } } )$ is a valid solution, then so is $( \tilde { \mathbf { f } } \circ \mathbf { a } ^ { \mathbf { R } } ( p _ { \tilde { \mathbf { s } } } ) , p _ { \tilde { \mathbf { s } } } )$ for any $\mathbf { R } \in O ( n )$ . Unless $\mathbf { R }$ is a permutation, this constitutes another common counterexample to $\sim _ { \tt B S S }$ -identifiability on $\mathcal { F } \times \mathcal { P }$ .
|
| 92 |
+
|
| 93 |
+
Identifiability results for nonlinear ICA have recently been established for settings where an auxiliary variable $\mathbf { u }$ (e.g., environment index, time stamp, class label) renders the sources conditionally independent [37, 38, 41, 49]. The assumption on $p _ { \mathbf { s } }$ in (1) is replaced with $\begin{array} { r } { p _ { \mathbf { s } | \mathbf { u } } ( \mathbf { s } | \mathbf { u } ) = \prod _ { i = 1 } ^ { n } p _ { s _ { i } | \mathbf { u } } ( s _ { i } | \mathbf { u } ) } \end{array}$ thus restricting $\mathcal { P }$ in Defn. 2.1. In most cases, $\mathbf { u }$ is assumed to be observed, though [30] is a notable exception. Similar results exist given access to a second noisy view $\tilde { \mathbf { x } }$ [28].
|
| 94 |
+
|
| 95 |
+
# 2.2 Causal inference and the principle of independent causal mechanisms (ICM)
|
| 96 |
+
|
| 97 |
+
Rather than relying only on additional assumptions on $\mathcal { P }$ (e.g., via auxiliary variables), we seek to further constrain (1) by also placing assumptions on the set $\mathcal { F }$ of mixing functions f . To this end, we draw inspiration from the field of causal inference [71, 78]. Of central importance to our approach is the Principle of Independent Causal Mechanisms (ICM) [43, 56, 87].
|
| 98 |
+
|
| 99 |
+
Principle 2.6 (ICM principle [78]). The causal generative process of a system’s variables is composed of autonomous modules that do not inform or influence each other.
|
| 100 |
+
|
| 101 |
+
These “modules” are typically thought of as the conditional distributions of each variable given its direct causes. Intuitively, the principle then states that these causal conditionals correspond to independent mechanisms of nature which do not share information. Crucially, here “independent” does not refer to statistical independence of random variables, but rather to independence of the underlying distributions as algorithmic objects. For a bivariate system comprising a cause c and an effect e, this idea reduces to an independence of cause and mechanism, see Fig. 2c. One way to formalise ICM uses Kolmogorov complexity $K ( \cdot )$ [51] as a measure of algorithmic information [43].
|
| 102 |
+
|
| 103 |
+
However, since Kolmogorov complexity is is not computable, using ICM in practice requires assessing Principle 2.6 with other suitable proxy criteria [9, 11, 34, 42, 45, 65, 75–78, 90, 110].5 Allowing for deterministic relations between cause (sources) and effect (observations), the criterion which is most closely related to the ICA setting in (1) is information-geometric causal inference (IGCI) [18, 46].6 IGCI assumes a nonlinear relation $\mathbf { e } = \mathbf { f } ( \mathbf { c } )$ and formulates a notion of independence between the cause distribution $p _ { \mathbf { c } }$ and the deterministic mechanism f (which we think of as a degenerate conditional $p _ { \mathbf { e } | \mathbf { c } } $ ) via the following condition (in practice, assumed to hold approximately),
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r } { C _ { \mathrm { I G C I } } ( \mathbf { f } , p _ { \mathbf { c } } ) : = \int \log \left| \mathbf { J } _ { \mathbf { f } } ( \mathbf { c } ) \right| p _ { \mathbf { c } } ( \mathbf { c } ) d \mathbf { c } - \int \log \left| \mathbf { J } _ { \mathbf { f } } ( \mathbf { c } ) \right| d \mathbf { c } = 0 , } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $( \mathbf { J _ { f } } ( \mathbf { c } ) ) _ { i j } = \partial f _ { i } / \partial c _ { j } ( \mathbf { c } )$ is the Jacobian matrix and $| \cdot |$ the absolute value of the determinant. $C _ { \mathrm { I G C I } }$ can be understood as the covariance between $p _ { \mathbf { c } }$ and $\log | \mathbf { J _ { f } } |$ (viewed as r.v.s on the unit cube w.r.t. the Lebesgue measure), so that $C _ { \mathrm { { I G C I } } } = 0$ rules out a form of fine-tuning between $p _ { \mathbf { c } }$ and $| \mathbf { J _ { f } } |$ . As its name suggests, IGCI can, from an information-geometric perspective, also be seen as an orthogonality condition between cause and mechanism in the space of probability distributions [46], see Appendix B.2, particularly eq. (19) for further details.
|
| 110 |
+
|
| 111 |
+
# 3 Existing ICM measures are insufficient for nonlinear ICA
|
| 112 |
+
|
| 113 |
+
Our aim is to use the ICM Principle 2.6 to further constrain the space of models ${ \mathcal { M } } \subseteq { \mathcal { F } } \times { \mathcal { P } }$ and rule out common counterexamples to identifiability such as those presented in $\ S$ . Intuitively, both the Darmois construction (4) and the rotated Gaussian MPA (5) give rise to “non-generic” solutions which should violate ICM: the former, $( \mathbf { f } ^ { \mathrm { D } } , p _ { \mathbf { u } } )$ , due the triangular Jacobian of $\mathbf { f } ^ { \mathrm { { D } } }$ (see Remark 2.4), meaning that each observation $x _ { i } = f _ { i } ^ { \mathrm { D } } ( \mathbf { y } _ { 1 : i } )$ only depends on a subset of the inferred independent components $\mathbf { y } _ { 1 : i }$ , and the latter, $( \mathbf { f } \circ \mathbf { a } ^ { \mathbf { R } } ( p _ { \mathbf { s } } ) , p _ { \mathbf { s } } )$ , due to the dependence of $\mathbf { f } \circ \mathbf { a } ^ { \mathbf { R } } ( p _ { \mathbf { s } } )$ on $p _ { \mathbf { s } }$ (5).
|
| 114 |
+
|
| 115 |
+
However, the ICM criteria described in $\ S$ were developed for the task of cause-effect inference where both variables are observed. In contrast, in this work, we consider an unsupervised representation learning task where only the effects (mixtures $\mathbf { x }$ ) are observed, but the causes (sources s) are not. It turns out that this renders existing ICM criteria insufficient for BSS: they can easily be satisfied by spurious solutions which are not equivalent to the true one. We can show this for IGCI. Denote by $\bar { \mathcal { M } } _ { \mathrm { I G C I } } = \{ ( \mathbf { f } , p _ { \mathbf { s } } ) \in \mathcal { F } \times \mathcal { P } : C _ { \mathrm { I G C I } } ( \mathbf { f } , p _ { \mathbf { s } } ) = 0 \} \subset \mathcal { F } \times \mathcal { P }$ the class of nonlinear ICA models satisfying IGCI (6). Then the following negative result holds.
|
| 116 |
+
|
| 117 |
+
Proposition 3.1 (IGCI is insufficient for $\sim _ { \tt B S S }$ -identifiability). (1) is not $\sim _ { \tt B S S }$ -identifiable on $\mathcal { M } _ { \mathrm { I G C I } }$
|
| 118 |
+
|
| 119 |
+
Proof. IGCI (6) is satisfied when $p _ { \mathbf { s } }$ is uniform. However, the Darmois construction (4) yields uniform sources, see Fig. 2a. This means that $( \mathbf { f } ^ { \mathrm { D } } \circ \mathbf { a } ^ { \mathbf { R } } ( p _ { \mathbf { u } } ) , p _ { \mathbf { u } } ) \in \mathcal { M } _ { \mathrm { I G C I } }$ , so IGCI can be satisfied by solutions which do not separate the sources in the sense of Defn. 2.2, see footnote 2 and [39].
|
| 120 |
+
|
| 121 |
+
As illustrated in Fig. 2c, condition (6) and other similar criteria enforce a notion of “genericity” or “decoupling” of the mechanism w.r.t. the observed input distribution.7 They thus rely on the fact that the cause (source) distribution is informative, and are generally not invariant to reparametrisation of the cause variables. In the (nonlinear) ICA setting, on the other hand, the learnt source distribution may be fairly uninformative. This poses a challenge for existing ICM criteria since any mechanism is generic w.r.t. an uninformative (uniform) input distribution.
|
| 122 |
+
|
| 123 |
+
# 4 Independent mechanism analysis (IMA)
|
| 124 |
+
|
| 125 |
+
As argued in $\ S$ , enforcing independence between the input distribution and the mechanism (Fig. 2c), as existing ICM criteria do, is insufficient for ruling out spurious solutions to nonlinear ICA. We therefore propose a new ICM-inspired framework which is more suitable for BSS and which we term independent mechanism analysis (IMA).8 All proofs are provided in Appendix C.
|
| 126 |
+
|
| 127 |
+
# 4.1 Intuition behind IMA
|
| 128 |
+
|
| 129 |
+
As motivated using the cocktail party example in $\ S$ and Fig. 1 $( L e f t )$ , our main idea is to enforce a notion of independence between the contributions or influences of the different sources $s _ { i }$ on the observations $\mathbf { x } = \mathbf { f } ( \mathbf { s } )$ as illustrated in Fig. 2d—as opposed to between the source distribution and mixing function, cf. Fig. 2c. These contributions or influences are captured by the vectors of partial derivatives ${ \partial \mathbf { f } } / { \partial s _ { i } }$ . IMA can thus be understood as a refinement of ICM at the level of the mixing f : in addition to statistically independent components $s _ { i }$ , we look for a mixing with contributions $\partial \mathbf { f } / \partial s _ { i }$ which are independent, in a non-statistical sense which we formalise as follows.
|
| 130 |
+
|
| 131 |
+
Principle 4.1 (IMA). The mechanisms by which each source $s _ { i }$ influences the observed distribution, as captured by the partial derivatives ${ \partial \mathbf { f } } / { \partial s _ { i } }$ , are independent of each other in the sense that for all s:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\underline { { \log | \mathbf { J } _ { \mathbf { f } } ( \mathbf { s } ) | } } = \sum _ { i = 1 } ^ { n } \log \left\| \frac { \partial \mathbf { f } } { \partial s _ { i } } ( \mathbf { s } ) \right\|
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Geometric interpretation. Geometrically, the IMA principle can be understood as an orthogonality condition, as illustrated for $n = 2$ in Fig. 1 $( R i g h t )$ . First, the vectors of partial derivatives ${ \partial \mathbf { f } } / { \partial s _ { i } }$ for which the IMA principle postulates independence, are the columns of $\mathbf { J _ { f } }$ . $| \mathbf { J _ { f } } |$ thus measures the volume of the $n$ −dimensional parallelepiped spanned by these columns, as shown on the right. The product of their norms, on the other hand, corresponds to the volume of an $n$ -dimensional box, or rectangular parallelepiped with side lengths $\| { \partial \mathbf { f } } / { \partial s _ { i } } \|$ , as shown on the left. The two volumes are equal if and only if all columns $\partial \mathbf { f } / \partial s _ { i }$ of $\mathbf { J _ { f } }$ are orthogonal. Note that (7) is trivially satisfied for $n = 1$ , i.e., if there is no mixing, further highlighting its difference from ICM for causal discovery.
|
| 138 |
+
|
| 139 |
+
Independent influences and orthogonality. In a high dimensional setting (large $n$ ), this orthogonality can be intuitively interpreted from the ICM perspective as Nature choosing the direction of the influence of each source component in the observation space independently and from an isotropic prior. Indeed, it can be shown that the scalar product of two independent isotropic random vectors in $\mathbb { R } ^ { n }$ vanishes as the dimensionality $n$ increases (equivalently: two high-dimensional isotropic vectors are typically orthogonal). This property was previously exploited in other linear ICM-based criteria (see [44, Lemma 5] and [45, Lemma 1 & Thm. 1]).9 The principle in (7) can be seen as a constraint on the function space, enforcing such orthogonality between the columns of the Jacobian of f at all points in the source domain, thus approximating the high-dimensional behavior described above.10
|
| 140 |
+
|
| 141 |
+
Information-geometric interpretation and comparison to IGCI. The additive contribution of the sources’ influences ${ \partial \mathbf { f } } / { \partial s _ { i } }$ in (7) suggests their local decoupling at the level of the mechanism f . Note that IGCI (6), on the other hand, postulates a different type of decoupling: one between $\log | \mathbf { J _ { f } } |$ and $p _ { \mathbf { s } }$ . There, dependence between cause and mechanism can be conceived as a fine tuning between the derivative of the mechanism and the input density. The IMA principle leads to a complementary, non-statistical measure of independence between the influences ${ \partial \mathbf { f } } / { \partial s _ { i } }$ of the individual sources on the vector of observations. Both the IGCI and IMA postulates have an information-geometric interpretation related to the influence of (“non-statistically”) independent modules on the observations: both lead to an additive decomposition of a KL-divergence between the effect distribution and a reference distribution. For IGCI, independent modules correspond to the cause distribution and the mechanism mapping the cause to the effect (see (19) in Appendix B.2). For IMA, on the other hand, these are the influences of each source component on the observations in an interventional setting (under soft interventions on individual sources), as measured by the KL-divergences between the original and intervened distributions. See Appendix B.3, and especially (22), for a more detailed account.
|
| 142 |
+
|
| 143 |
+
We finally remark that while recent work based on the ICM principle has mostly used the term “mechanism” to refer to causal Markov kernels $p ( X _ { i } | P A _ { i } )$ or structural equations [78], we employ it in line with the broader use of this concept in the philosophical literature.11 To highlight just two examples, [86] states that “Causal processes, causal interactions, and causal laws provide the mechanisms by which the world works; to understand why certain things happen, we need to see how they are produced by these mechanisms”; and [99] states that “Mechanisms are events that alter relations among some specified set of elements”. Following this perspective, we argue that a causal mechanism can more generally denote any process that describes the way in which causes influence their effects: the partial derivative ${ \partial \mathbf { f } } / { \partial s _ { i } }$ thus reflects a causal mechanism in the sense that it describes the infinitesimal changes in the observations $\mathbf { x }$ , when an infinitesimal perturbation is applied to $s _ { i }$ .
|
| 144 |
+
|
| 145 |
+
# 4.2 Definition and useful properties of the IMA contrast
|
| 146 |
+
|
| 147 |
+
We now introduce a contrast function based on the IMA principle (7) and show that it possesses several desirable properties in the context of nonlinear ICA. First, we define a local contrast as the difference between the two integrands of (7) for a particular value of the sources s.
|
| 148 |
+
|
| 149 |
+
Definition 4.2 (Local IMA contrast). The local IMA contrast $c _ { \mathrm { I M A } } ( \mathbf { f } , \mathbf { s } )$ of $\mathbf { f }$ at a point s is given by
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
c _ { \mathrm { I M A } } ( \mathbf { f } , \mathbf { s } ) = \sum _ { i = 1 } ^ { n } \log \left\| \frac { \partial \mathbf { f } } { \partial s _ { i } } ( \mathbf { s } ) \right\| - \log \left| \mathbf { J } _ { \mathbf { f } } ( \mathbf { s } ) \right| .
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
The local IMA contrast $c _ { \mathrm { I M A } } ( \mathbf { f } , \mathbf { s } )$ quantifies the extent to which the IMA principle is violated at a given point s. We summarise some of its properties in the following proposition.
|
| 156 |
+
|
| 157 |
+
Proposition 4.4 (Properties of $C _ { \mathrm { I M A } } ( \mathbf { f } , \mathbf { s } ) )$ . The local IMA contrast $c _ { \mathrm { I M A } } ( \mathbf { f } , \mathbf { s } )$ defined in (8) satisfies:
|
| 158 |
+
|
| 159 |
+
(i) $c _ { \mathrm { I M A } } ( \mathbf { f } , \mathbf { s } ) \geq 0$ , with equality if and only if all columns $\partial \mathbf { f } / \partial s _ { i } ( \mathbf { s } )$ of $\mathbf { J } _ { \mathbf { f } } ( \mathbf { s } )$ are orthogonal. (ii) $c _ { \mathrm { I M A } } ( \mathbf { f } , \mathbf { s } )$ is invariant to left multiplication of $\mathbf { J } _ { \mathbf { f } } ( \mathbf { s } )$ by an orthogonal matrix and to right multiplication by permutation and diagonal matrices.
|
| 160 |
+
|
| 161 |
+
Property $( i )$ formalises the geometric interpretation of IMA as an orthogonality condition on the columns of the Jacobian from $\ S$ , and property $( i i )$ intuitively states that changes of orthonormal basis and permutations or rescalings of the columns of $\mathbf { J _ { f } }$ do not affect their orthogonality. Next, we define a global IMA contrast w.r.t. a source distribution $p _ { \mathbf { s } }$ as the expected local IMA contrast.
|
| 162 |
+
|
| 163 |
+
Definition 4.5 (Global IMA contrast). The global IMA contrast $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { s } } )$ of f w.r.t. $p _ { \mathbf { s } }$ is given by
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
C _ { \mathrm { I M A } } ( \bf f , \it p _ { \mathrm { s } } ) = \mathbb { E } _ { { \bf s } \sim \it { p } _ { \mathrm { s } } } [ c _ { \mathrm { I M A } } ( \bf f , \bf s ) ] = \int c _ { \mathrm { I M A } } ( \bf f , \bf s ) \it { p } _ { \bf s } ( \bf s ) d \bf s .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
The global IMA contrast $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { s } } )$ thus quantifies the extent to which the IMA principle is violated for a particular solution $( \mathbf { f } , p _ { \mathbf { s } } )$ to the nonlinear ICA problem. We summarise its properties as follows.
|
| 170 |
+
|
| 171 |
+
Proposition 4.6 (Properties of $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { s } } ) )$ . The global IMA contrast $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { s } } )$ from (9) satisfies:
|
| 172 |
+
|
| 173 |
+
(i) $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { s } } ) ~ \geq ~ 0 ,$ , with equality iff. $\mathbf { J _ { f } } ( \mathbf { s } ) \ = \ \mathbf { O } ( \mathbf { s } ) \mathbf { D } ( \mathbf { s } )$ almost surely w.r.t. $p _ { \mathbf { s } }$ , where $\mathbf { O } ( \mathbf { s } ) , \mathbf { D } ( \mathbf { s } ) \in \mathbb { R } ^ { n \times n }$ are orthogonal and diagonal matrices, respectively;
|
| 174 |
+
|
| 175 |
+
(ii) $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { S } } ) = C _ { \mathrm { I M A } } ( \tilde { \mathbf { f } } , p _ { \tilde { \mathbf { S } } } )$ for any $\tilde { \mathbf { f } } = \mathbf { f } \circ \mathbf { h } ^ { - 1 } \circ \mathbf { P } ^ { - 1 }$ and $\tilde { \mathbf { s } } = \mathbf { P } \mathbf { h } ( \mathbf { s } )$ , where $\mathbf { P } \in \mathbb { R } ^ { n \times n }$ is $a$ permutation and $\mathbf { h } ( \mathbf { s } ) = ( h _ { 1 } ( s _ { 1 } ) , . . . , h _ { n } ( s _ { n } ) )$ an invertible element-wise function.
|
| 176 |
+
|
| 177 |
+
Property $( i )$ is the distribution-level analogue to $( i )$ of Prop. 4.4 and only allows for orthogonality violations on sets of measure zero w.r.t. $p _ { \mathbf { s } }$ . This means that $C _ { \mathrm { I M A } }$ can only be zero if f is an orthogonal coordinate transformation almost everywhere [19, 52, 66], see Fig. 3 for an example. We particularly stress property $( i i )$ , as it precisely matches the inherent indeterminacy of nonlinear ICA: $C _ { \mathrm { I M A } }$ is blind to reparametrisation of the sources by permutation and element wise transformation.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 3: An example of a (non-conformal) orthogonal coordinate transformation from polar (left) to Cartesian (right) coordinates.
|
| 181 |
+
|
| 182 |
+
# 4.3 Theoretical analysis and justification of $C _ { \mathbf { I M A } }$
|
| 183 |
+
|
| 184 |
+
We now show that, under suitable assumptions on the generative model (1), a large class of spurious solutions—such as those based on the Darmois construction (4) or measure preserving automorphisms such as ${ \bf a } ^ { \bf R }$ from (5) as described in $\ S \ : 2 . 1$ —exhibit nonzero IMA contrast. Denote the class of nonlinear ICA models satisfying (7) (IMA) by $\mathcal { M } _ { \mathrm { I M A } } = \{ ( \mathbf { f } , p _ { \mathrm { s } } ) \in \mathcal { F } \times \mathcal { P } : C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathrm { s } } ) = 0 \} \subset \mathcal { F } \times \mathcal { P }$ . Our first main theoretical result is that, under mild assumptions on the observations, Darmois solutions will have strictly positive $C _ { \mathrm { I M A } }$ , making them distinguishable from those in $\mathcal { M } _ { \mathrm { { I M A } } }$ .
|
| 185 |
+
|
| 186 |
+
Theorem 4.7. Assume the data generating process in (1) and assume that $x _ { i }$ ̸⊥⊥ $x _ { j }$ for some $i \neq j$ Then any Darmois solution $( \mathbf { f } ^ { D } , p _ { \mathbf { u } } )$ based on $\mathbf { g } ^ { D }$ as defined in (4) satisfies $C _ { \mathrm { I M A } } ( \mathbf { f } ^ { D } , p _ { \mathbf { u } } ) > 0$ . Thus $a$ solution satisfying $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { s } } ) = 0$ can be distinguished from $( \mathbf { f } ^ { D } , p _ { \mathbf { u } } )$ based on the contrast $C _ { \mathrm { I M A } }$ .
|
| 187 |
+
|
| 188 |
+
The proof is based on the fact that the Jacobian of $\mathbf { g } ^ { \mathrm { { D } } }$ is triangular (see Remark 2.4) and on the specific form of (4). A specific example of a mixing process satisfying the IMA assumption is the case where f is a conformal (angle-preserving) map.
|
| 189 |
+
|
| 190 |
+
Definition 4.8 (Conformal map). A smooth map f : $\mathbb { R } ^ { n } \to \mathbb { R } ^ { n }$ is conformal if $\mathbf { J } _ { \mathbf { f } } ( \mathbf { s } ) = \mathbf { O } ( \mathbf { s } ) \lambda ( \mathbf { s } ) \forall \mathbf { s } ,$ where $\lambda : \mathbb { R } ^ { n } \to \mathbb { R }$ is a scalar field, and $\mathbf { O } \in O ( n )$ is an orthogonal matrix.
|
| 191 |
+
|
| 192 |
+
Corollary 4.9. Under assumptions of Thm. 4.7, if additionally f is a conformal map, then $( \mathbf { f } , p _ { \mathbf { s } } ) \in$ $\mathcal { M } _ { \mathrm { I M A } }$ for any $p _ { \mathbf { s } } ~ \in ~ \mathcal { P }$ due to Prop. $\mathbf { \rho } ( i )$ , see Defn. 4.8. Based on Thm. 4.7, $( \mathbf { f } , p _ { \mathbf { s } } )$ is thus distinguishable from Darmois solutions $( \mathbf { f } ^ { D } , p _ { \mathbf { u } } )$ .
|
| 193 |
+
|
| 194 |
+
This is consistent with a result that proves identifiability of conformal maps for $n = 2$ and conjectures it in general [39].12 However, conformal maps are only a small subset of all maps for which $C _ { \mathrm { I M A } } = 0$ , as is apparent from the more flexible condition of Prop. $\mathbf { \chi } ( i )$ , compared to the stricter Defn. 4.8.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 4: Top. Visual comparison of different nonlinear ICA solutions for $n = 2$ : (left to right) true sources; observed mixtures; Darmois solution; true unmixing, composed with the measure preserving automorphism (MPA) from (5) (with rotation by $\pi / 4$ ); Darmois solution composed with the same MPA; maximum likelihood $\lambda = 0$ ); and $C _ { \mathrm { I M A } }$ -regularised approach $( \lambda = 1$ ). Bottom. Quantitative comparison of $C _ { \mathrm { I M A } }$ for different spurious solutions: learnt Darmois solutions for (a) $n = 2$ , and (b) $n \in \{ 2 , 3 , 5 , \hat { 1 } 0 \}$ dimensions; (c) composition of the MPA (5) in $n = 2$ dim. with the true solution (blue) and a Darmois solution (red) for different angles. (d) $C _ { \mathrm { I M A } }$ distribution for true MLP mixing (red) vs. Darmois solution (blue) for $n = 5$ dim., $L \in \{ 2 , 3 , 4 \}$ layers.
|
| 198 |
+
|
| 199 |
+
Example 4.10 (Polar to Cartesian coordinate transform). Consider the non-conformal transformation from polar to Cartesian coordinates (see Fig. 3), defined as $( x , y ) = \mathbf { f } ( r , \theta ) : = ( r \cos ( \theta ) , r \sin ( \theta ) )$ with independent sources $\mathbf { s } = ( r , \theta )$ , with $r \sim U ( 0 , R )$ and $\theta \sim U ( 0 , 2 \pi )$ .13 Then, $C _ { \mathrm { I M A } } ( \mathbf { f } , p _ { \mathbf { s } } ) = 0$ and $C _ { \mathrm { I M A } } \bar { ( } \mathbf { f } ^ { \mathrm { D } } , p _ { \mathrm { u } } ) > 0$ for any Darmois solution $( \mathbf { f } ^ { \mathrm { D } } , p _ { \mathbf { u } } )$ —see Appendix D for details.
|
| 200 |
+
|
| 201 |
+
Finally, for the case in which the true mixing is linear, we obtain the following result.
|
| 202 |
+
|
| 203 |
+
Corollary 4.11. Consider a linear ICA model, $\mathbf { x } = \mathbf { A } \mathbf { s }$ , with $\mathbb { E } [ \mathbf { s } ^ { \top } \mathbf { s } ] = \mathbf { I } ,$ , and $\mathbf { A } \in O ( n )$ an orthogonal, non-trivial mixing matrix, i.e., not the product of a diagonal and a permutation matrix DP. If at most one of the $s _ { i }$ is Gaussian, then $C _ { \mathrm { I M A } } ( \mathbf { A } , p _ { \mathbf { s } } ) = 0$ and $C _ { \mathrm { I M A } } ( \mathbf { f } ^ { D } , p _ { \mathbf { u } } ^ { \top } ) > 0$ .
|
| 204 |
+
|
| 205 |
+
In a “blind” setting, we may not know a priori whether the true mixing is linear or not, and thus choose to learn a nonlinear unmixing. Corollary 4.11 shows that, in this case, Darmois solutions are still distinguishable from the true mixing via $C _ { \mathrm { I M A } }$ . Note that unlike in Corollary 4.9, the assumption that $x _ { i } \not \perp x _ { j }$ for some $i \neq j$ is not required for Corollary 4.11. In fact, due to Theorem 11 of [17], it follows from the assumed linear ICA model with non-Gaussian sources, and the fact that the mixing matrix is not the product of a diagonal and a permutation matrix (see also Appendix A).
|
| 206 |
+
|
| 207 |
+
Having shown that the IMA principle allows to distinguish a class of models (including, but not limited to conformal maps) from Darmois solutions, we next turn to a second well-known counterexample to identifiability: the “rotated-Gaussian” MPA $\mathbf { a ^ { R } } ( p _ { \mathbf { s } } )$ (5) from Defn. 2.5. Our second main theoretical result is that, under suitable assumptions, this class of MPAs can also be ruled out for “non-trivial” $\mathbf { R }$ .
|
| 208 |
+
|
| 209 |
+
Theorem 4.12. Let $( \mathbf { f } , p _ { \mathbf { s } } ) \in \mathcal { M } _ { \mathrm { I M A } }$ and assume that f is a conformal map. Given $\mathbf { R } \in O ( n )$ , assume additionally that $\exists$ at least one non-Gaussian $s _ { i }$ whose associated canonical basis vector $\mathbf { e } _ { i }$ is not transformed by $\mathbf { R } ^ { - 1 } = \mathbf { R } ^ { \top }$ into another canonical basis vector $\mathbf { e } _ { j }$ . Then $C _ { \mathrm { I M A } } ( { \bf f } \circ { \bf a } ^ { \bf R } ( p _ { \bf s } ) , p _ { \bf s } ) > 0$
|
| 210 |
+
|
| 211 |
+
Thm. 4.12 states that for conformal maps, applying the $\mathbf { a ^ { R } } ( p _ { \mathbf { s } } )$ transformation at the level of the sources leads to an increase in $C _ { \mathrm { I M A } }$ except for very specific rotations $\mathbf { R }$ that are “fine-tuned” to $p _ { \mathbf { s } }$ in the sense that they permute all non-Gaussian sources $s _ { i }$ with another $s _ { j }$ . Interestingly, as for the linear case, non-Gaussianity again plays an important role in the proof of Thm. 4.12.
|
| 212 |
+
|
| 213 |
+
# 5 Experiments
|
| 214 |
+
|
| 215 |
+
Our theoretical results from $\ S \ 4$ suggest that $C _ { \mathrm { I M A } }$ is a promising contrast function for nonlinear blind source separation. We test this empirically by evaluating the $C _ { \mathrm { I M A } }$ of spurious nonlinear ICA solutions $\mathrm { ~ ( ~ \ S ~ } \mathrm { ~ ) ~ }$ , and using it as a learning objective to recover the true solution $( \ S 5 . 2 )$ .
|
| 216 |
+
|
| 217 |
+
We sample the ground truth sources from a uniform distribution in $[ 0 , 1 ] ^ { n }$ ; the reconstructed sources are also mapped to the uniform hypercube as a reference measure via the CDF transform. Unless otherwise specified, the ground truth mixing f is a Möbius transformation [81] (i.e., a conformal map) with randomly sampled parameters, thereby satisfying Principle 4.1. In all of our experiments, we use JAX [12] and Distrax [13]. For additional technical details, equations and plots see Appendix E. The code to reproduce our experiments is available at this link.
|
| 218 |
+
|
| 219 |
+
# 5.1 Numerical evaluation of the $C _ { \mathbf { I M A } }$ contrast for spurious nonlinear ICA solutions
|
| 220 |
+
|
| 221 |
+
Learning the Darmois construction. To learn the Darmois construction from data, we use normalising flows, see [35, 69]. Since Darmois solutions have triangular Jacobian (Remark 2.4), we use an architecture based on residual flows [16] which we constrain such that the Jacobian of the full model is triangular. This yields an expressive model which we train effectively via maximum likelihood.
|
| 222 |
+
|
| 223 |
+
$C _ { \mathbf { I M A } }$ of Darmois solutions. To check whether Darmois solutions (learnt from finite data) can be distinguished from the true one, as predicted by Thm. 4.7, we generate 1000 random mixing functions for $n = 2$ , compute the $C _ { \mathrm { I M A } }$ values of learnt solutions, and find that all values are indeed significantly larger than zero, see Fig. 4 (a). The same holds for higher dimensions, see Fig. 4 (b) for results with 50 random mixings for $n \in \{ 2 , 3 , 5 , 1 0 \}$ : with higher dimensionality, both the mean and variance of the $C _ { \mathrm { I M A } }$ distribution for the learnt Darmois solutions generally attain higher values.14 We confirmed these findings for mappings which are not conformal, while still satisfying (7), in Appendix E.5.
|
| 224 |
+
|
| 225 |
+
$C _ { \mathbf { I M A } }$ of MPAs. We also investigate the effect on $C _ { \mathrm { I M A } }$ of applying an MPA ${ \bf a } ^ { \bf R } ( \cdot )$ from (5) to the true solution or a learnt Darmois solution. Results for $n = 2$ dim. for different rotation matrices $\mathbf { R }$ (parametrised by the angle $\theta$ ) are shown in Fig. 4 (c). As expected, the behavior is periodic in $\theta$ , and vanishes for the true solution (blue) at multiples of $\pi / 2$ , i.e., when $\mathbf { R }$ is a permutation matrix, as predicted by Thm. 4.12. For the learnt Darmois solution (red, dashed) $C _ { \mathrm { I M A } }$ remains larger than zero.
|
| 226 |
+
|
| 227 |
+
$C _ { \mathbf { I M A } }$ values for random MLPs. Lastly, we study the behavior of spurious solutions based on the Darmois construction under deviations from our assumption of $C _ { \mathrm { I M A } } = 0$ for the true mixing function. To this end, we use invertible MLPs with orthogonal weight initalisation and leaky_tanh activations [29] as mixing functions; the more layers $L$ are added to the mixing MLP, the larger a deviation from our assumptions is expected. We compare the true mixing and learnt Darmois solutions over 20 realisations for each $\bar { L } \in \{ 2 , 3 , 4 \}$ , $n = 5$ . Results are shown in figure Fig. 4 (d): the $C _ { \mathrm { I M A } }$ of the mixing MLPs grows with $L$ ; still, the one of the Darmois solution is typically higher.
|
| 228 |
+
|
| 229 |
+
Summary. We verify that spurious solutions can be distinguished from the true one based on $C _ { \mathrm { I M A } }$ .
|
| 230 |
+
|
| 231 |
+
# 5.2 Learning nonlinear ICA solutions with $C _ { \mathbf { I M A } }$ -regularised maximum likelihood
|
| 232 |
+
|
| 233 |
+
Experimental setup. To use $C _ { \mathrm { I M A } }$ as a learning signal, we consider a regularised maximum-likelihood approach, with the following objective: $\mathcal { L } ( \mathbf { g } ) \bar { = } \mathbb { E } _ { \mathbf { x } } [ \log p _ { \mathbf { g } } ( \mathbf { x } ) ] - \lambda C _ { \mathrm { I M A } } ^ { \bar { - } } ( \mathbf { g } ^ { - 1 } , p _ { \mathbf { y } } )$ , where $\mathbf { g }$ denotes the learnt unmixing, $\mathbf { y } = \mathbf { g } ( \mathbf { x } )$ the reconstructed sources, and $\lambda \geq 0$ a Lagrange multiplier. For $\lambda = 0$ , this corresponds to standard maximum likelihood estimation, whereas for $\lambda > 0$ , $\mathcal { L }$ lower-bounds the likelihood, and recovers it exactly iff. $( \mathbf { g } ^ { - 1 } , p _ { \mathbf { y } } ) \in \mathcal { M } _ { \mathrm { I M A } }$ . We train a residual flow $\mathbf { g }$ (with full Jacobian) to maximise $\mathcal { L }$ . For evaluation, we compute (i) the KL divergence to the true data likelihood, as a measure of goodness of fit for the learnt flow model; and (ii) the mean correlation coefficient (MCC) between ground truth and reconstructed sources [37, 49]. We also introduce (iii) a nonlinear extension of the Amari distance [5] between the true mixing and the learnt unmixing, which is larger than or equal to zero, with equality iff. the learnt model belongs to the BSS equivalence class (Defn. 2.2) of the true solution, see Appendix E.5 for details.
|
| 234 |
+
|
| 235 |
+
Results. In Fig. 4 (Top), we show an example of the distortion induced by different spurious solutions for $n = 2$ , and contrast it with a solution learnt using our proposed objective (rightmost plot). Visually, we find that the $C _ { \mathrm { I M A } }$ -regularised solution (with $\lambda = 1$ ) recovers the true sources most faithfully. Quantitative results for 50 learnt models for each $\lambda \in \{ 0 . 0 , 0 . 5 , 1 . 0 \}$ and $n \in \{ 5 , 7 \}$ are summarised in Fig. 5 (see Appendix E for additional plots) . As indicated by the KL divergence values (left), most trained models achieve a good fit to the data across all values of $\lambda$ .15 We observe that using $C _ { \mathrm { I M A } }$ (i.e., $\lambda > 0$ ) is beneficial for BSS, both in terms of our nonlinear Amari distance (center, lower is better) and MCC (right, higher is better), though we do not observe a substantial difference between λ = 0.5 and λ = 1.16
|
| 236 |
+
|
| 237 |
+
Summary: $C _ { \mathrm { I M A } }$ can be a useful learning signal to recover the true solution.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 5: BSS via $C _ { \mathrm { I M A } }$ -regularised MLE for, side by side, $n = 5$ (blue) and $n = 7$ (red) dim. with $\lambda \in \{ 0 . 0 , 0 . 5 , 1 . 0 \}$ . (Left) KL-divergence between ground truth likelihood and learnt model; (center) nonlinear Amari distance given true mixing and learnt unmixing; (right) MCC between true and reconstructed sources.
|
| 241 |
+
|
| 242 |
+
# 6 Discussion
|
| 243 |
+
|
| 244 |
+
Assumptions on the mixing function. Instead of relying on weak supervision in the form of auxiliary variables [28, 30, 37, 38, 41, 49], our IMA approach places additional constraints on the functional form of the mixing process. In a similar vein, the minimal nonlinear distortion principle [108] proposes to favor solutions that are as close to linear as possible. Another example is the post-nonlinear model [98, 109], which assumes an element-wise nonlinearity applied after a linear mixing. IMA is different in that it still allows for strongly nonlinear mixings (see, e.g., Fig. 3) provided that the columns of their Jacobians are (close to) orthogonal. In the related field of disentanglement [8, 58], a line of work that focuses on image generation with adversarial networks [24] similarly proposes to constrain the “generator” function via regularisation of its Jacobian [82] or Hessian [74], though mostly from an empirically-driven, rather than from an identifiability perspective as in the present work.
|
| 245 |
+
|
| 246 |
+
Towards identifiability with $C _ { \mathbf { I M A } }$ . The IMA principle rules out a large class of spurious solutions to nonlinear ICA. While we do not present a full identifiability result, our experiments show that $C _ { \mathrm { I M A } }$ can be used to recover the BSS equivalence class, suggesting that identifiability might indeed hold, possibly under additional assumptions—e.g., for conformal maps [39].
|
| 247 |
+
|
| 248 |
+
IMA and independence of cause and mechanism. While inspired by measures of independence of cause and mechanism as traditionally used for cause-effect inference [18, 45, 46, 110], we view the IMA principle as addressing a different question, in the sense that they evaluate independence between different elements of the causal model. Any nonlinear ICA solution that satisfies the IMA Principle 4.1 can be turned into one with uniform reconstructed sources—thus satisfying IGCI as argued in $\ S \ 3 \cdot$ — through composition with an element-wise transformation which, according to Prop. 4.6 (ii), leaves the $C _ { \mathrm { I M A } }$ value unchanged. Both IGCI (6) and IMA (7) can therefore be fulfilled simultaneosly, while the former on its own is inconsequential for BSS as shown in Prop. 3.1.
|
| 249 |
+
|
| 250 |
+
BSS through algorithmic information. Algorithmic information theory has previously been proposed as a unifying framework for identifiable approaches to linear BSS [67, 68], in the sense that commonly-used contrast functions could, under suitable assumptions, be interpreted as proxies for the total complexity of the mixing and the reconstructed sources. However, to the best of our knowledge, the problem of specifying suitable proxies for the complexity of nonlinear mixing functions has not yet been addressed. We conjecture that our framework could be linked to this view, based on the additional assumption of algorithmic independence of causal mechanisms [43], thus potentially representing an approach to nonlinear BSS by minimisation of algorithmic complexity.
|
| 251 |
+
|
| 252 |
+
ICA for causal inference & causality for ICA. Past advances in ICA have inspired novel causal discovery methods [50, 64, 92]. The present work constitutes, to the best of our knowledge, the first effort to use ideas from causality (specifically ICM) for BSS. An application of the IMA principle to causal discovery or causal representation learning [88] is an interesting direction for future work.
|
| 253 |
+
|
| 254 |
+
Conclusion. We introduce IMA, a path to nonlinear BSS inspired by concepts from causality. We postulate that the influences of different sources on the observed distribution should be approximately independent, and formalise this as an orthogonality condition on the columns of the Jacobian. We prove that this constraint is generally violated by well-known spurious nonlinear ICA solutions, and propose a regularised maximum likelihood approach which we empirically demonstrate to be effective in recovering the true solution. Our IMA principle holds exactly for orthogonal coordinate transformations, and is thus of potential interest for learning spatial representations [33], robot dynamics [63], or physics problems where orthogonal reference frames are common [66].
|
| 255 |
+
|
| 256 |
+
# Acknowledgements
|
| 257 |
+
|
| 258 |
+
The authors thank Aapo Hyvärinen, Adrián Javaloy Bornás, Dominik Janzing, Giambattista Parascandolo, Giancarlo Fissore, Nasim Rahaman, Patrick Burauel, Patrik Reizinger, Paul Rubenstein, Shubhangi Ghosh, and the anonymous reviewers for helpful comments and discussions.
|
| 259 |
+
|
| 260 |
+
# Funding Transparency Statement
|
| 261 |
+
|
| 262 |
+
This work was supported by the German Federal Ministry of Education and Research (BMBF): Tübingen AI Center, FKZ: 01IS18039B; and by the Machine Learning Cluster of Excellence, EXC number 2064/1 - Project number 390727645.
|
| 263 |
+
|
| 264 |
+
# References
|
| 265 |
+
|
| 266 |
+
[1] Pierre Ablin, Jean-François Cardoso, and Alexandre Gramfort. Faster independent component analysis by preconditioning with hessian approximations. IEEE Transactions on Signal Processing, 66(15): 4040–4049, 2018.
|
| 267 |
+
[2] Khaled Alyani, Marco Congedo, and Maher Moakher. Diagonality measures of Hermitian positivedefinite matrices with application to the approximate joint diagonalization problem. Linear Algebra and its Applications, 528:290–320, 2017.
|
| 268 |
+
[3] Shun-ichi Amari. Information geometry. Japanese Journal of Mathematics, 16(1):1–48, 2021.
|
| 269 |
+
[4] Shun-ichi Amari and Hiroshi Nagaoka. Methods of information geometry, volume 191. American Mathematical Soc., 2007.
|
| 270 |
+
[5] Shun-ichi Amari, Andrzej Cichocki, Howard Hua Yang, et al. A new learning algorithm for blind signal separation. In Advances in Neural Information Processing Systems, pages 757–763, 1996.
|
| 271 |
+
[6] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019.
|
| 272 |
+
[7] Elias Bareinboim, Andrew Forney, and Judea Pearl. Bandits with unobserved confounders: A causal approach. Advances in Neural Information Processing Systems, 28:1342–1350, 2015.
|
| 273 |
+
[8] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, 2013.
|
| 274 |
+
[9] M Besserve, N Shajarisales, B Schölkopf, and D Janzing. Group invariance principles for causal generative models. In 21st International Conference on Artificial Intelligence and Statistics (AISTATS 2018), pages 557–565. International Machine Learning Society, 2018.
|
| 275 |
+
[10] M Besserve, A Mehrjou, R Sun, and B Schölkopf. Counterfactuals uncover the modular structure of deep generative models. In Eighth International Conference on Learning Representations (ICLR 2020), 2020.
|
| 276 |
+
[11] Patrick Blöbaum, Dominik Janzing, Takashi Washio, Shohei Shimizu, and Bernhard Schölkopf. Causeeffect inference by comparing regression errors. In International Conference on Artificial Intelligence and Statistics, pages 900–909. PMLR, 2018.
|
| 277 |
+
[12] 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.
|
| 278 |
+
[13] Jake Bruce, David Budden, Matteo Hessel, George Papamakarios, and Francisco Ruiz. Distrax: Probability distributions in JAX, 2021.
|
| 279 |
+
[14] Lars Buesing, Theophane Weber, Yori Zwols, Sebastien Racaniere, Arthur Guez, Jean-Baptiste Lespiau, and Nicolas Heess. Woulda, coulda, shoulda: Counterfactually-guided policy search. arXiv preprint arXiv:1811.06272, 2018.
|
| 280 |
+
[15] Jean-François Cardoso. The three easy routes to independent component analysis; contrasts and geometry. In Proc. ICA, volume 2001, 2001.
|
| 281 |
+
[16] Ricky T. Q. Chen, Jens Behrmann, David Duvenaud, and Jörn-Henrik Jacobsen. Residual flows for invertible generative modeling. In Advances in Neural Information Processing Systems, 2019.
|
| 282 |
+
[17] Pierre Comon. Independent component analysis, a new concept? Signal processing, 36(3):287–314, 1994.
|
| 283 |
+
[18] Povilas Daniušis, Dominik Janzing, Joris Mooij, Jakob Zscheischler, Bastian Steudel, Kun Zhang, and Bernhard Schölkopf. Inferring deterministic causal relations. In Proceedings of the Twenty-Sixth Conference on Uncertainty in Artificial Intelligence, pages 143–150, 2010.
|
| 284 |
+
[19] Gaston Darboux. Leçons sur les systemes orthogonaux et les coordonnées curvilignes. Gauthier-Villars, 1910.
|
| 285 |
+
[20] George Darmois. Analyse des liaisons de probabilité. In Proc. Int. Stat. Conferences 1947, page 231, 1951.
|
| 286 |
+
[21] George Darmois. Analyse générale des liaisons stochastiques: etude particulière de l’analyse factorielle linéaire. Revue de l’Institut international de statistique, pages 2–8, 1953.
|
| 287 |
+
[22] Andrew Forney, Judea Pearl, and Elias Bareinboim. Counterfactual data-fusion for online reinforcement learners. In International Conference on Machine Learning, pages 1156–1164. PMLR, 2017.
|
| 288 |
+
[23] Mingming Gong, Kun Zhang, Tongliang Liu, Dacheng Tao, Clark Glymour, and Bernhard Schölkopf. Domain adaptation with conditional transferable components. In International Conference on Machine Learning, pages 2839–2848. PMLR, 2016.
|
| 289 |
+
[24] 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, pages 2672–2680, 2014.
|
| 290 |
+
[25] Alexander N Gorban and Ivan Yu Tyukin. Blessing of dimensionality: mathematical foundations of the statistical physics of data. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 376(2118):20170237, 2018.
|
| 291 |
+
[26] Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Schölkopf. Recurrent independent mechanisms. In 9th International Conference on Learning Representations, 2021.
|
| 292 |
+
[27] Daniel Greenfeld and Uri Shalit. Robust learning with the hilbert-schmidt independence criterion. In International Conference on Machine Learning, pages 3759–3768. PMLR, 2020.
|
| 293 |
+
[28] Luigi Gresele, Paul K Rubenstein, Arash Mehrjou, Francesco Locatello, and Bernhard Schölkopf. The Incomplete Rosetta Stone problem: Identifiability results for multi-view nonlinear ICA. In Uncertainty in Artificial Intelligence, pages 217–227. PMLR, 2019.
|
| 294 |
+
[29] Luigi Gresele, Giancarlo Fissore, Adrián Javaloy, Bernhard Schölkopf, and Aapo Hyvarinen. Relative gradient optimization of the Jacobian term in unsupervised deep learning. Advances in Neural Information Processing Systems, 33, 2020.
|
| 295 |
+
[30] Hermanni Hälvä and Aapo Hyvärinen. Hidden Markov nonlinear ICA: Unsupervised learning from nonstationary time series. In Conference on Uncertainty in Artificial Intelligence, pages 939–948. PMLR, 2020.
|
| 296 |
+
[31] Christina Heinze-Deml and Nicolai Meinshausen. Conditional variance penalties and domain shift robustness. Machine Learning, 110(2):303–348, 2021.
|
| 297 |
+
[32] Tom Hennigan, Trevor Cai, Tamara Norman, and Igor Babuschkin. Haiku: Sonnet for JAX, 2020.
|
| 298 |
+
[33] Geoffrey E Hinton and Lawrence M Parsons. Frames of reference and mental imagery. Attention and performance IX, pages 261–277, 1981.
|
| 299 |
+
[34] Patrik Hoyer, Dominik Janzing, Joris M Mooij, Jonas Peters, and Bernhard Schölkopf. Nonlinear causal discovery with additive noise models. Advances in Neural Information Processing Systems, 21:689–696, 2008.
|
| 300 |
+
[35] Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron C. Courville. Neural autoregressive flows. In Jennifer G. Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80, pages 2083–2092. PMLR, 2018.
|
| 301 |
+
[36] Aapo Hyvärinen. Fast and robust fixed-point algorithms for independent component analysis. IEEE transactions on Neural Networks, 10(3):626–634, 1999.
|
| 302 |
+
[37] Aapo Hyvärinen and Hiroshi Morioka. Unsupervised feature extraction by time-contrastive learning and nonlinear ICA. In Advances in Neural Information Processing Systems, pages 3765–3773, 2016.
|
| 303 |
+
[38] Aapo Hyvärinen and Hiroshi Morioka. Nonlinear ICA of temporally dependent stationary sources. In Artificial Intelligence and Statistics, pages 460–469. PMLR, 2017.
|
| 304 |
+
[39] Aapo Hyvärinen and Petteri Pajunen. Nonlinear independent component analysis: Existence and uniqueness results. Neural Networks, 12(3):429–439, 1999.
|
| 305 |
+
[40] Aapo Hyvärinen, Juha Karhunen, and Erkki Oja. Independent Component Analysis. John Wiley & Sons, Ltd, 2001.
|
| 306 |
+
[41] Aapo Hyvärinen, Hiroaki Sasaki, and Richard Turner. Nonlinear ICA using auxiliary variables and generalized contrastive learning. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 859–868. PMLR, 2019.
|
| 307 |
+
[42] Dominik Janzing. Causal version of principle of insufficient reason and maxent. arXiv preprint arXiv:2102.03906, 2021.
|
| 308 |
+
[43] Dominik Janzing and Bernhard Schölkopf. Causal inference using the algorithmic Markov condition. IEEE Transactions on Information Theory, 56(10):5168–5194, 2010.
|
| 309 |
+
[44] Dominik Janzing and Bernhard Schölkopf. Detecting confounding in multivariate linear models via spectral analysis. Journal of Causal Inference, 6(1), 2018.
|
| 310 |
+
[45] Dominik Janzing, Patrik O Hoyer, and Bernhard Schölkopf. Telling cause from effect based on highdimensional observations. In International Conference on Machine Learning, 2010.
|
| 311 |
+
[46] Dominik Janzing, Joris Mooij, Kun Zhang, Jan Lemeire, Jakob Zscheischler, Povilas Daniušis, Bastian Steudel, and Bernhard Schölkopf. Information-geometric approach to inferring causal directions. Artificial Intelligence, 182:1–31, 2012.
|
| 312 |
+
[47] Dominik Janzing, Bastian Steudel, Naji Shajarisales, and Bernhard Schölkopf. Justifying informationgeometric causal inference. In Measures of complexity, pages 253–265. Springer, 2015.
|
| 313 |
+
[48] Dominik Janzing, Raphael Chaves, and Bernhard Schölkopf. Algorithmic independence of initial condition and dynamical law in thermodynamics and causal inference. New Journal of Physics, 18(9): 093052, 2016.
|
| 314 |
+
[49] Ilyes Khemakhem, Diederik Kingma, Ricardo Monti, and Aapo Hyvärinen. Variational autoencoders and nonlinear ICA: A unifying framework. In International Conference on Artificial Intelligence and Statistics, pages 2207–2217. PMLR, 2020.
|
| 315 |
+
[50] Ilyes Khemakhem, Ricardo Monti, Robert Leech, and Aapo Hyvarinen. Causal autoregressive flows. In International Conference on Artificial Intelligence and Statistics, pages 3520–3528. PMLR, 2021.
|
| 316 |
+
[51] Andrei N Kolmogorov. On tables of random numbers. Sankhya: The Indian Journal of Statistics, Series ¯ A, pages 369–376, 1963.
|
| 317 |
+
[52] Gabriel Lamé. Leçons sur les coordonnées curvilignes et leurs diverses applications. Mallet-Bachelier, 1859.
|
| 318 |
+
[53] Sanghack Lee and Elias Bareinboim. Structural causal bandits: where to intervene? Advances in Neural Information Processing Systems 31, 31, 2018.
|
| 319 |
+
[54] Felix Leeb, Yashas Annadani, Stefan Bauer, and Bernhard Schölkopf. Structural autoencoders improve representations for generation and transfer. arXiv preprint arXiv:2006.07796, 2020.
|
| 320 |
+
[55] Erich L Lehmann and George Casella. Theory of point estimation. Springer Science & Business Media, 2006.
|
| 321 |
+
[56] Jan Lemeire and Erik Dirkx. Causal models as minimal descriptions of multivariate systems, 2006.
|
| 322 |
+
[57] Jan Lemeire and Dominik Janzing. Replacing causal faithfulness with algorithmic independence of conditionals. Minds and Machines, 23(2):227–249, 2013.
|
| 323 |
+
[58] Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In International Conference on Machine Learning, pages 4114–4124. PMLR, 2019.
|
| 324 |
+
[59] Chaochao Lu, Bernhard Schölkopf, and José Miguel Hernández-Lobato. Deconfounding reinforcement learning in observational settings. arXiv preprint arXiv:1812.10576, 2018.
|
| 325 |
+
[60] Chaochao Lu, Biwei Huang, Ke Wang, José Miguel Hernández-Lobato, Kun Zhang, and Bernhard Schölkopf. Sample-efficient reinforcement learning via counterfactual-based data augmentation. arXiv preprint arXiv:2012.09092, 2020.
|
| 326 |
+
[61] Sara Magliacane, Thijs van Ommen, Tom Claassen, Stephan Bongers, Philip Versteeg, and Joris M Mooij. Domain adaptation by using causal inference to predict invariant conditional distributions. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 10869–10879, 2018.
|
| 327 |
+
[62] James Mahoney. Beyond correlational analysis: Recent innovations in theory and method. In Sociological forum, pages 575–593. JSTOR, 2001.
|
| 328 |
+
[63] Michael Mistry, Jonas Buchli, and Stefan Schaal. Inverse dynamics control of floating base systems using orthogonal decomposition. In 2010 IEEE International Conference on Robotics and Automation, pages 3406–3412. IEEE, 2010.
|
| 329 |
+
[64] Ricardo Pio Monti, Kun Zhang, and Aapo Hyvärinen. Causal discovery with general non-linear relationships using non-linear ICA. In Uncertainty in Artificial Intelligence, pages 186–195. PMLR, 2020.
|
| 330 |
+
[65] Joris M Mooij, Jonas Peters, Dominik Janzing, Jakob Zscheischler, and Bernhard Schölkopf. Distinguishing cause from effect using observational data: methods and benchmarks. The Journal of Machine Learning Research, 17(1):1103–1204, 2016.
|
| 331 |
+
[66] Parry Moon and Domina Eberle Spencer. Field theory handbook, including coordinate systems, differential equations and their solutions. Springer, 1971.
|
| 332 |
+
[67] Petteri Pajunen. Blind source separation using algorithmic information theory. Neurocomputing, 22(1-3): 35–48, 1998.
|
| 333 |
+
[68] Petteri Pajunen. Blind source separation of natural signals based on approximate complexity minimization. In Proc. Int. Workshop on Independent Component Analysis and Signal Separation (ICA’99), page 267. Citeseer, 1999.
|
| 334 |
+
[69] George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. Journal of Machine Learning Research, 22(57):1–64, 2021.
|
| 335 |
+
[70] Giambattista Parascandolo, Niki Kilbertus, Mateo Rojas-Carulla, and Bernhard Schölkopf. Learning independent causal mechanisms. In International Conference on Machine Learning, pages 4036–4044. PMLR, 2018.
|
| 336 |
+
[71] Judea Pearl. Causality. Cambridge university press, 2009.
|
| 337 |
+
[72] Judea Pearl and Elias Bareinboim. External validity: From do-calculus to transportability across populations. Statistical Science, 29(4):579–595, 2014.
|
| 338 |
+
[73] Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. Scikit-learn: Machine learning in python. The Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 339 |
+
[74] William S. Peebles, John Peebles, Jun-Yan Zhu, Alexei A. Efros, and Antonio Torralba. The Hessian penalty: A weak prior for unsupervised disentanglement. In ECCV, volume 12351, pages 581–597. Springer, 2020.
|
| 340 |
+
[75] Jonas Peters and Peter Bühlmann. Identifiability of Gaussian structural equation models with equal error variances. Biometrika, 101(1):219–228, 2014.
|
| 341 |
+
[76] Jonas Peters, Joris M Mooij, Dominik Janzing, and Bernhard Schölkopf. Causal discovery with continuous additive noise models. Journal of Machine Learning Research, 15:2009–2053, 2014.
|
| 342 |
+
[77] Jonas Peters, Peter Bühlmann, and Nicolai Meinshausen. Causal inference by using invariant prediction: identification and confidence intervals. Journal of the Royal Statistical Society. Series B (Statistical Methodology), pages 947–1012, 2016.
|
| 343 |
+
[78] Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference: foundations and learning algorithms. The MIT Press, 2017.
|
| 344 |
+
[79] Dinh-Tuan Pham and J-F Cardoso. Blind separation of instantaneous mixtures of nonstationary sources. IEEE Transactions on Signal Processing, 49(9):1837–1848, 2001.
|
| 345 |
+
[80] Dinh Tuan Pham and Philippe Garat. Blind separation of mixture of independent sources through a quasi-maximum likelihood approach. IEEE Transactions on Signal Processing, 45(7):1712–1725, 1997.
|
| 346 |
+
[81] Robert Phillips. Liouville’s theorem. Pacific Journal of Mathematics, 28(2):397–405, 1969.
|
| 347 |
+
[82] Aditya Ramesh, Youngduck Choi, and Yann LeCun. A spectral regularizer for unsupervised disentanglement. arXiv preprint arXiv:1812.01161, 2018.
|
| 348 |
+
[83] Danilo Jimenez Rezende. Short notes on divergence measures, 2018.
|
| 349 |
+
[84] Mateo Rojas-Carulla, Bernhard Schölkopf, Richard Turner, and Jonas Peters. Invariant models for causal transfer learning. The Journal of Machine Learning Research, 19(1):1309–1342, 2018.
|
| 350 |
+
[85] Dominik Rothenhäusler, Nicolai Meinshausen, Peter Bühlmann, and Jonas Peters. Anchor regression: Heterogeneous data meet causality. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 83(2):215–246, 2021.
|
| 351 |
+
[86] Wesley C Salmon. Scientific explanation and the causal structure of the world. Princeton University Press, 2020.
|
| 352 |
+
[87] B Schölkopf, D Janzing, J Peters, E Sgouritsa, K Zhang, and J Mooij. On causal and anticausal learning. In 29th International Conference on Machine Learning (ICML 2012), pages 1255–1262. International Machine Learning Society, 2012.
|
| 353 |
+
[88] Bernhard Schölkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, Anirudh Goyal, and Yoshua Bengio. Toward causal representation learning. Proceedings of the IEEE, 2021.
|
| 354 |
+
[89] Manfred R Schroeder. Listening with two ears. Music perception, 10(3):255–280, 1993.
|
| 355 |
+
[90] Naji Shajarisales, Dominik Janzing, Bernhard Schoelkopf, and Michel Besserve. Telling cause from effect in deterministic linear dynamical systems. In International Conference on Machine Learning, pages 285–294. PMLR, 2015.
|
| 356 |
+
[91] Xinwei Shen, Furui Liu, Hanze Dong, Qing Lian, Zhitang Chen, and Tong Zhang. Disentangled generative causal representation learning. arXiv preprint arXiv:2010.02637, 2020.
|
| 357 |
+
[92] Shohei Shimizu, Patrik O Hoyer, Aapo Hyvärinen, Antti Kerminen, and Michael Jordan. A linear non-Gaussian acyclic model for causal discovery. Journal of Machine Learning Research, 7(10), 2006.
|
| 358 |
+
[93] VP Skitovic. On a property of a normal distribution. In ´ Doklady Akad. Nauk, 1953. [94] James R Smart. Modern geometries. Brooks/Cole Pacific Grove, CA, 1998.
|
| 359 |
+
[95] Mirjam Soeten. Conformal maps and the theorem of Liouville. PhD thesis, Faculty of Science and Engineering, 2011. [96] B. Steudel, D. Janzing, and B. Schölkopf. Causal Markov condition for submodular information measures. In A. Kalai and M. Mohri, editors, Conference on Learning Theory (COLT), pages 464–476, Madison, WI, USA, 2010. OmniPress.
|
| 360 |
+
[97] Adarsh Subbaswamy, Peter Schulam, and Suchi Saria. Preventing failures due to dataset shift: Learning predictive models that transport. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 3118–3127. PMLR, 2019. [98] Anisse Taleb and Christian Jutten. Source separation in post-nonlinear mixtures. IEEE Transactions on Signal Processing, 47(10):2807–2820, 1999. [99] Charles Tilly. Historical analysis of political processes. In Handbook of sociological theory, pages 567–588. Springer, 2001.
|
| 361 |
+
[100] Ruy Tojeiro. Liouville’s theorem revisited. Enseignement Mathematique, 53(1/2):67, 2007.
|
| 362 |
+
[101] Pauli Virtanen, Ralf Gommers, Travis E Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, et al. Scipy 1.0: fundamental algorithms for scientific computing in python. Nature methods, 17(3):261–272, 2020.
|
| 363 |
+
[102] Julius von Kügelgen, Alexander Mey, and Marco Loog. Semi-generative modelling: Covariate-shift adaptation with cause and effect features. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 1361–1369. PMLR, 2019.
|
| 364 |
+
[103] Julius von Kügelgen, Alexander Mey, Marco Loog, and Bernhard Schölkopf. Semi-supervised learning, causality, and the conditional cluster assumption. In Conference on Uncertainty in Artificial Intelligence, pages 1–10. PMLR, 2020.
|
| 365 |
+
[104] Julius von Kügelgen, Ivan Ustyuzhaninov, Peter Gehler, Matthias Bethge, and Bernhard Schölkopf. Towards causal generative scene models via competition of experts. In ICLR 2020 Workshop on "Causal Learning for Decision Making", 2020.
|
| 366 |
+
[105] Julius von Kügelgen, Yash Sharma, Luigi Gresele, Wieland Brendel, Bernhard Schölkopf, Michel Besserve, and Francesco Locatello. Self-supervised learning with data augmentations provably isolates content from style. In Advances in Neural Information Processing Systems, 2021.
|
| 367 |
+
[106] Junzhe Zhang and Elias Bareinboim. Near-optimal reinforcement learning in dynamic treatment regimes. Advances in Neural Information Processing Systems, 32:13401–13411, 2019.
|
| 368 |
+
[107] K. Zhang, B. Schölkopf, K. Muandet, and Z. Wang. Domain adaptation under target and conditional shift. In S. Dasgupta and D. McAllester, editors, Proceedings of the 30th International Conference on Machine Learning, volume 28 of JMLR Workshop and Conference Proceedings, pages 819–827, 2013.
|
| 369 |
+
[108] Kun Zhang and Laiwan Chan. Minimal nonlinear distortion principle for nonlinear independent component analysis. Journal of Machine Learning Research, 9(Nov):2455–2487, 2008.
|
| 370 |
+
[109] Kun Zhang and Aapo Hyvärinen. On the identifiability of the post-nonlinear causal model. In Proceedings of the 25th Conference on Uncertainty in Artificial Intelligence, pages 647–655. AUAI Press, 2009.
|
| 371 |
+
[110] Jakob Zscheischler, Dominik Janzing, and Kun Zhang. Testing whether linear equations are causal: A free probability theory approach. In 27th Conference on Uncertainty in Artificial Intelligence, pages 839–847, 2011.
|
| 372 |
+
|
| 373 |
+
# Checklist
|
| 374 |
+
|
| 375 |
+
1. For all authors...
|
| 376 |
+
|
| 377 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 378 |
+
(b) Did you describe the limitations of your work? [Yes] See $\ S$ , where we discuss limitations of our theory (e.g. lines 354-357) and open questions.
|
| 379 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] Our work is mainly theoretical, and we believe it does not bear immediate negative societal impacts.
|
| 380 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 381 |
+
|
| 382 |
+
2. If you are including theoretical results...
|
| 383 |
+
|
| 384 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] We formally define the problem setting in $\ S 2$ and $\ S$ , and transparently state and discuss our assumptions in $\ S 4$ .
|
| 385 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] Due to space constraints, full proofs and detailed explanations are mainly reported in appendix C and appendix D; the proof of Prop. 3.1 is given in the main text.
|
| 386 |
+
|
| 387 |
+
3. If you ran experiments...
|
| 388 |
+
|
| 389 |
+
(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 code, data, and the configuration files are included in the supplemental material.
|
| 390 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] All details, including hyperparameters, seed for random number generators, etc. are specified in the configuration files which will be included in the supplemental.
|
| 391 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We visualized the distribution of the considered quantities via histograms and violin plots, see e.g. Figure 4 and Figure 5.
|
| 392 |
+
(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] They are specified appendix E.
|
| 393 |
+
|
| 394 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 395 |
+
|
| 396 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We use the Python libraries JAX and Distrax and cited the creators in the article.
|
| 397 |
+
(b) Did you mention the license of the assets? [Yes] Both packages have Apache License 2.0; we report this in the appendices.
|
| 398 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Implementations of our proposed methods and metrics will be provided in the supplemental.
|
| 399 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 400 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 401 |
+
|
| 402 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 403 |
+
|
| 404 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 405 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 406 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/RovX-uQ1Hua/RovX-uQ1Hua.md
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TEXT GENERATION BY LEARNING FROM DEMONSTRATIONS
|
| 2 |
+
|
| 3 |
+
Richard Yuanzhe Pang 1
|
| 4 |
+
|
| 5 |
+
yzpang@nyu.edu
|
| 6 |
+
|
| 7 |
+
He He 1,2 hehe@cs.nyu.edu
|
| 8 |
+
|
| 9 |
+
1 Courant Institute of Mathematical Sciences, New York University, New York, NY 10011, USA
|
| 10 |
+
2 Center for Data Science, New York University, New York, NY 10011, USA
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Current approaches to text generation largely rely on autoregressive models and maximum likelihood estimation. This paradigm leads to (i) diverse but low-quality samples due to mismatched learning objective and evaluation metric (likelihood vs. quality) and (ii) exposure bias due to mismatched history distributions (gold vs. model-generated). To alleviate these problems, we frame text generation as an offline reinforcement learning (RL) problem with expert demonstrations (i.e., the reference), where the goal is to maximize quality given model-generated histories. We propose GOLD (generation by off-policy learning from demonstrations): an easy-to-optimize algorithm that learns from the demonstrations by importance weighting. Intuitively, GOLD upweights confident tokens and downweights unconfident ones in the reference during training, avoiding optimization issues faced by prior RL approaches that rely on online data collection. According to both automatic and human evaluation, models trained by GOLD outperform those trained by MLE and policy gradient on summarization, question generation, and machine translation. Further, our models are less sensitive to decoding algorithms and alleviate exposure bias.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
A dominant approach to text generation is to use autoregressive models learned by maximum likelihood estimation (MLE) on supervised data. However, this approach introduces two well-known discrepancies between training and evaluation objectives that lead to undesired generations. First, the training loss is negative log-likelihood, whereas the evaluation is based on human judgment of the output quality. Under model misspecification, MLE tends to over-generalize, assigning large probability mass to both high-quality and low-quality sequences (Huszar, 2015; Simon et al., 2019). ´ Therefore, in practice, we must carefully select the decoding algorithms to produce high-quality outputs.
|
| 19 |
+
|
| 20 |
+
Second, during training, the autoregressive model conditions on the gold history/prefix; however, at inference time it conditions on model-generated history. This is known as the exposure bias problem (Ranzato et al., 2016; Bengio et al., 2015). In the worst case, one incorrect prediction can produce a low-probability prefix under the gold data distribution, and errors compound in each of the following steps (Ross et al., 2011). In practice, prior work has observed problems such as repetition and hallucination partly due to exposure bias (Holtzman et al., 2020; Wang & Sennrich, 2020).
|
| 21 |
+
|
| 22 |
+
We aim to bridge the gap between training and evaluation in this paper. To match training and evaluation objectives, ideally we should maximize output quality given model-generated histories. This corresponds to the reinforcement learning (RL) objective: maximizing the expected reward (quality) over trajectories (sequences) induced by the policy (model). However, optimizing this objective is notoriously difficult. Prior RL approaches mainly focus on fine-tuning a learned model to optimize sequence-level metrics such as BLEU (Papineni et al., 2002), but empirically it remains unclear if RL is beneficial to text generation (Wu et al., 2018; Choshen et al., 2020). Note that many challenges in RL arise from exploring an exponentially large space of sequences, with sparse rewards only on those close to the reference. We thus propose to learn from only the reference sequences without interaction (i.e., the offline setting). Specifically, we use off-policy policy gradient with importance weighting (Hastings, 1970; Hachiya et al., 2009; Parshakova et al., 2019), where training examples with higher probability under the model are weighted higher. Further, our reward functions approximate human judgment of the output quality by estimating how likely a human would have generated a sequence. We call our algorithm GOLD (Generation by Off-policy Learning from Demonstrations).
|
| 23 |
+
|
| 24 |
+
Results on news summarization, question generation, and machine translation show that GOLD leads to better model performance than MLE and RL fine-tuning by both task metrics and human-rated quality. Further, our analysis shows that GOLD learns high-precision models that are less sensitive to decoding algorithms. In addition, it alleviates exposure bias: the output quality does not degrade much as generation length increases.
|
| 25 |
+
|
| 26 |
+
# 2 FROM MLE TO RL FRAMEWORK
|
| 27 |
+
|
| 28 |
+
MLE training. Given a context $_ { \textbf { \em x } }$ such as a document, we want to generate a sequence of tokens $\pmb { y } = ( y _ { 0 } , \dots , y _ { T } )$ , where $y _ { i }$ comes from a vocabulary $\nu$ . The generator is modeled by a conditional probability distribution parametrized by $\theta$ : $\begin{array} { r } { p _ { \theta } ( \pmb { y } \mid x ) = \prod _ { t = 0 } ^ { T } p _ { \theta } ( y _ { t } \mid \pmb { y } _ { 0 : t - 1 } , \pmb { x } ) } \end{array}$ , where ${ \bf { \sigma } } _ { { \bf { y } } _ { 0 : } { t - 1 } }$ denotes the prefix $y _ { 0 } , \ldots , y _ { t - 1 }$ . Let $p _ { \mathrm { h u m a n } } ( \pmb { y } \mid \pmb { x } )$ denote the data-generating distribution. Using MLE, the loss function is
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\mathcal { L } ( \theta ) = - \mathbb { E } _ { y \sim p _ { \mathrm { h u m a n } } } \left[ \sum _ { t = 0 } ^ { T } \log p _ { \theta } ( y _ { t } \mid y _ { 0 : t - 1 } , \boldsymbol { x } ) \right] .
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
At inference time, we generate tokens sequentially according to $p _ { \theta }$
|
| 35 |
+
|
| 36 |
+
Evaluation. In practice, the quality of an output often relies on task-specific metrics such as fluency, correctness, and interestingness. Here for generality we consider perceptual quality (Huszar, 2015; ´ Hashimoto et al., 2019) which measures how likely a human would have generated the output given the context, i.e., $p _ { \mathrm { h u m a n } } ( \pmb { y } \mid \pmb { x } )$ . Thus the evaluation metric is
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\mathbb { E } _ { { \pmb y } \sim p _ { \theta } } \left[ \sum _ { t = 0 } ^ { T } \log p _ { \mathrm { h u m a n } } ( y _ { t } \mid \pmb y _ { 0 : t - 1 } , \pmb x ) \right] .
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
Comparing (1) and (2), we see that the training objective encourages high recall: the model must put probability mass on all human-generated sequences. In contrast, the evaluation metric encourages high precision: all outputs from the model must be of high quality. Unfortunately, directly optimizing the evaluation metric is impossible because $p _ { \mathrm { h u m a n } }$ is unknown and the expectation is difficult to estimate. We therefore develop a training objective that closely approximates (2) in the RL framework.
|
| 43 |
+
|
| 44 |
+
RL formulation. Let’s consider generation as a sequential decision-making process. At each time step $t$ , the policy $\pi _ { \theta }$ takes an action $a _ { t } \in \mathcal V$ , transits to the next state $s _ { t + 1 } = ( \pmb { y } _ { 0 : t } , \pmb { x } )$ , and receives a reward $r _ { t }$ . The policy corresponds to the generation model: $\pi _ { \boldsymbol { \theta } } ( a _ { t } \mid s _ { t } ) = p _ { \boldsymbol { \theta } } ( a _ { t } \mid \pmb { y } _ { 0 : t - 1 } , \pmb { x } )$ . We can thus represent a sequence as a trajectory $\tau = ( s _ { 0 } , a _ { 0 } , r _ { 0 } , \ldots , s _ { T } , a _ { T } , r _ { T } )$ . The set of trajectories derived from the training data is called demonstrations which show the desired behavior of a policy. The RL objective is to maximize J(θ) = Eτ∼πθ $J ( \theta ) = \mathbb { E } _ { \tau \sim \pi _ { \theta } } \left[ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r _ { t } \right]$ , where $\gamma \in ( 0 , 1 ]$ is the discount factor, and $\pi _ { \boldsymbol { \theta } } ( \tau )$ denotes the distribution of $\tau$ induced by $\pi _ { \theta }$ . If we knew oracle rewards $r _ { t } = p _ { \mathrm { h u m a n } } ( a _ { t } \mid s _ { t } )$ , then this objective would be exactly the evaluation metric we want to optimize. Next, we describe how to optimize $J ( \theta )$ with reward functions that approximate $p _ { \mathrm { h u m a n } }$ .
|
| 45 |
+
|
| 46 |
+
# 3 APPROACH
|
| 47 |
+
|
| 48 |
+
# 3.1 OFF-POLICY POLICY GRADIENT
|
| 49 |
+
|
| 50 |
+
Policy gradient. A straightforward way to optimize $J ( \theta )$ is policy gradient (PG) (Williams, 1992; Sutton et al., 2000). The gradient is given by
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\nabla _ { \theta } J ( \theta ) = \mathbb { E } _ { \tau \sim \pi _ { \theta } } \left[ \sum _ { t } \nabla _ { \theta } \log \pi _ { \theta } ( a _ { t } \mid s _ { t } ) \hat { Q } ( s _ { t } , a _ { t } ) \right] ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where Qˆ(st, at) = PTt0=t γ is the estimated return from state $s _ { t }$ . The expectation is estimated by Monte Carlo samples from $\pi _ { \theta }$ . In text generation, the return $\hat { Q } ( s _ { t } , a _ { t } )$ is often a sequence-level reward such as BLEU. In practice, the policy is likely to get stuck in a region of zero reward during training, generating gibberish without receiving any learning signal (Li et al., 2018; Keneshloo et al., 2019). A common remedy is to initialize the policy with the MLE solution and/or interleave with MLE gradient update during PG. However, this would bias the parameters towards the MLE solution, thus often leads to marginal gains in practice (Wu et al., 2018; Choshen et al., 2020).
|
| 57 |
+
|
| 58 |
+
Offline learning. To avoid zero-reward regions, we would like to reduce interaction with the environment and stay close to the demonstrated trajectories. In the extreme case, the policy is learned solely from the static demonstrations without additional interaction with the environment, which is referred to as the offline setting. While it is in general a more challenging problem, we argue that the offline setting is appropriate for text generation (Serban et al., 2017; Jaques et al., 2019). First, the environment dynamics is known: once a token is generated, we deterministically transition to the next state with the additional token appended to the prefix; no interaction is needed to learn the environment. Second, while exploration may lead to high-quality sequences different from the reference, we lack a good reward function to identify them (Novikova et al., 2017; Aharoni & Goldberg, 2018; Clark et al., 2019). Therefore, the benefit of exploration in text generation is limited.
|
| 59 |
+
|
| 60 |
+
In the offline setting, we cannot estimate the expected return of $\pi _ { \theta }$ by sampling trajectories from it, and must use trajectories from a different behavioral policy $\pi _ { b }$ , known as off-policy learning in RL. A common technique to estimate expectations under one distribution $\pi _ { \theta }$ given samples from a different distribution $\pi _ { b }$ is importance sampling, which leads to the following unbiased estimator of the gradient (Precup et al., 2000):
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathbb { E } _ { \tau \sim \pi _ { b } } \left[ \sum _ { t } w _ { t } \nabla _ { \theta } \log \pi _ { \theta } ( a _ { t } \mid s _ { t } ) \hat { Q } ( s _ { t } , a _ { t } ) \right] ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
with importance weights wt = Qtt0=0 πθ(at0 |st0 )πb(at0 |st0 ) .
|
| 67 |
+
|
| 68 |
+
Approximations. Computing the importance weights above requires multiplying per-action importance weight over multiple time steps. In practice, we have found that it is sensitive to optimization hyperparameters and takes longer to converge. Therefore, we use the per-action approximation: $\begin{array} { r } { w _ { t } \approx \frac { \pi _ { \theta } ( a _ { t } | s _ { t } ) } { \pi _ { b } ( a _ { t } | s _ { t } ) } } \end{array}$ . This corresponds to optimizing the expected return under the off-policy state distribution induced by $\pi _ { b }$ and the on-policy action distribution of $\pi _ { \theta }$ . Although this estimator is biased, empirically it has been shown to reduce variance and work reasonably well if $\pi _ { b }$ and $\pi _ { \theta }$ are close (Serban et al., 2017; Levine et al., 2020). Another obstacle is that we do not know $\pi _ { b }$ which produced the demonstrations $\mathcal { D } = \{ ( \boldsymbol { { \mathbf { x } } ^ { ( i ) } } , \boldsymbol { { \mathbf { y } } ^ { ( i ) } } ) \} _ { i = 1 } ^ { N }$ . One option is to estimate $\pi _ { b }$ on $\mathcal { D }$ . Here we take a simpler approach that uses the empirical distribution: $\pi _ { b } ( \tau ) \approx 1 / N$ for $\tau \in \mathcal { D }$ and 0 otherwise. As a result, the denominator in $w _ { t }$ is a constant and can be ignored in optimization. Our final approximated gradient has the form:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\nabla _ { \theta } J ( \theta ) \approx \sum _ { i = 1 } ^ { N } \sum _ { t = 0 } ^ { T } \pi _ { \theta } ( a _ { t } ^ { i } \mid s _ { t } ^ { i } ) \nabla _ { \theta } \log \pi _ { \theta } ( a _ { t } ^ { i } \mid s _ { t } ^ { i } ) \hat { Q } ( s _ { t } ^ { i } , a _ { t } ^ { i } ) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where the superscript $i$ represents the $i$ th trajectory. Compared with the MLE gradient: $\begin{array} { r } { \sum _ { i = 1 } ^ { N } \sum _ { t = 0 } ^ { T } \bar { \nabla _ { \theta } } \log \bar { \pi _ { \theta } } ( a _ { t } ^ { i } \mathbf { \pi } | \mathbf { \pi } \bar { s } _ { t } ^ { i } ) } \end{array}$ , our gradient (4) upweights actions with high return and actions preferred by the current policy $\pi _ { \theta }$ . Intuitively, it encourages the learning algorithm to focus on “easy” examples (high likelihood under the model) which improves precision.
|
| 75 |
+
|
| 76 |
+
# 3.2 REWARD
|
| 77 |
+
|
| 78 |
+
Let $R$ be the reward function such that $r _ { t } = R ( s _ { t } , a _ { t } )$ . To optimize the perceptual quality of a sequence (see (2)), we want $R ( s , a )$ to approximate $p _ { \mathrm { h u m a n } } ( a \mid s )$ , i.e., how likely humans would have generated $a$ given $s$ . In general, it is hard to develop a reliable reward function for text generation tasks because it must work well for a large set of possible generations. In the offline setting, however, we can restrict the domain of $R$ to state-action pairs on the demonstrations. Next, we propose three reward functions.
|
| 79 |
+
|
| 80 |
+
$\delta$ -reward. An obvious choice is a sequence-level reward, which considers all demonstrations to be equally good and assigns zero reward to any other outputs. Formally,
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
R _ { \delta } { \left( s _ { t } , a _ { t } \right) } \stackrel { \mathrm { d e f } } { = } \left\{ \begin{array} { l l } { 1 , } & { \mathrm { i f } t = T \mathrm { a n d } \left( s _ { 0 : T } , a _ { 0 : T } \right) \in \mathcal { D } } \\ { 0 , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where a reward of one is received in the terminal state for any trajectory in the demonstrations.
|
| 87 |
+
|
| 88 |
+
Estimated $p _ { \mathbf { h u m a n } }$ . In text generation tasks, an input often has many correct outputs and the reference may be an uncommon output that contains rare words or has complex syntax. To account for different likelihood of the references, we estimate the probability of each reference by minimizing ${ \mathrm { K L } } \left( p _ { \mathrm { h u m a n } } \| q \right)$ , where $q ( a \mid s )$ approximates $p _ { \mathrm { h u m a n } } ( a \mid s )$ . This is equivalent to finding the MLE solution (denoted by $p _ { \mathrm { M L E } }$ ).1 Importantly, $p _ { \mathrm { M L E } }$ is a reasonable approximation to $p _ { \mathrm { h u m a n } }$ when restricted to the demonstrations. It is not a good reward function in general, however; it can assign large probability mass to low-quality outputs. Given the estimated perceptual quality $p _ { \mathrm { M L E } } ( a \mid s )$ , we define two reward functions. Our first reward function corresponds to a product of probabilities when summed over the trajectory:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
R _ { p } ( s , a ) \ { \stackrel { \mathrm { d e f } } { = } } \ \log p _ { \mathrm { M L E } } ( a \mid s ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Assuming $\gamma = 1$ , the return at time step $t$ is $\begin{array} { r } { \hat { Q } _ { t } ( s _ { t } , a _ { t } ) = \sum _ { t ^ { \prime } = t } ^ { T } \log p _ { \mathrm { M L E } } ( a _ { t } \mid s _ { t } ) } \end{array}$ . Thus a sequence has high reward only if every word has high likelihood under $p _ { \mathrm { M L E } }$ . To allow for partial credits even if bad actions are taken at certain steps, we define another reward function corresponding to the sum of probabilities:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
R _ { s } ( s , a ) \stackrel { \mathrm { d e f } } { = } p _ { \mathrm { M L E } } ( a \mid s ) .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
The return subsequent $\begin{array} { r } { \hat { Q } ( s _ { t } , a _ { t } ) = \sum _ { t ^ { \prime } = t } ^ { T } p _ { \mathrm { M L E } } ( a _ { t } \mid s _ { t } ) } \end{array}$ , thus the policy can recover from bad decisions if the
|
| 101 |
+
|
| 102 |
+
# 3.3 THE GOLD ALGORITHM
|
| 103 |
+
|
| 104 |
+
Our full algorithm based on off-policy PG is shown in Algorithm 1. For importance weights $\pi _ { \theta } ( a \mid s )$ 1 , to avoid drastic changes, we initialize $\pi _ { \theta }$ 2 with the MLE solution. In addition, we 3 compute the importance weights by a weighting policy $\tilde { \pi } _ { \boldsymbol { \theta } }$ that synchronizes with $\pi _ { \theta }$ 4 periodically 5 so that the weights do not change frequently between updates. We also lower-bound the importance weight by a small number $u$ .
|
| 105 |
+
|
| 106 |
+
# Algorithm 1: GOLD
|
| 107 |
+
|
| 108 |
+
$\pi _ { \theta } p _ { \mathrm { M L E } }$ , $\tilde { \pi } _ { \boldsymbol { \theta } } \gets p _ { \mathrm { M L E } }$
|
| 109 |
+
for $s t e p = 1 , 2 , \ldots , M \mathbf { d }$ o Sample a minibatch $B = \{ ( \pmb { x } ^ { i } , \pmb { y } ^ { i } ) \} _ { i = 1 } ^ { | B | }$ foreach $( s _ { t } ^ { i } , a _ { t } ^ { i } )$ do Compute importance weights $\operatorname* { m a x } ( u , \tilde { \pi } _ { \theta } )$ , and compute returns $\hat { Q } ( s _ { t } ^ { i } , a _ { t } ^ { i } ) - b$ Update $\theta$ by (4) using gradient descent if step $\% k = 0$ then $\tilde { \pi } _ { \boldsymbol { \theta } } \gets \pi _ { \boldsymbol { \theta } }$
|
| 110 |
+
|
| 111 |
+
6 Another source of variance comes from policy 7 gradients. Since our return is computed from a 8 sum or product of probabilities ((6) and (7)), we truncate the future trajectory after five steps. We
|
| 112 |
+
|
| 113 |
+
Return: $\pi _ { \theta }$
|
| 114 |
+
|
| 115 |
+
follow the common practice to subtract a baseline $b$ from the return to reduce variance; moreover, to avoid negative reward on the demonstrations (after subtracting baseline), we lower-bound $p _ { \mathrm { M L E } }$ in (6) and (7) by a small number $c$ . In practice, GOLD is easy to implement; further, given an existing $p _ { \mathrm { M L E } }$ , the GOLD-training stage usually takes less time than MLE. The code is available.2.
|
| 116 |
+
|
| 117 |
+
# 4 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
# 4.1 SETUP
|
| 120 |
+
|
| 121 |
+
We chose four text generation tasks: (1) question generation (NQG; Zhou et al., 2017): given a passage and a short span of the passage, the goal is to generate a question that can be answered by the span; (2) summarization (CNN/DM; Hermann et al., 2015); (3) extreme summarization (XSum; Narayan et al., 2018): the references are more abstractive than CNN/DM summaries; (4) machine translation (IWSLT14 De-En; Cettolo et al., 2014). See Appendix A.1 for the size and the source of the datasets. We evaluate NQG and summarization by both automatic metrics, i.e., corpus-level BLEU-4 (Papineni et al., 2002) and ROUGE-1/2/L (Lin, 2004) respectively, as well as human ratings.
|
| 122 |
+
|
| 123 |
+
We experiment with three variants of GOLD: GOLD- $\delta$ , GOLD- $p _ { \cdot }$ , GOLD- $s$ , which uses the $\delta$ -reward and the two estimated rewards $R _ { p }$ and $R _ { s }$ ), respectively. Our baseline learning algorithm is standard MLE, and we compare with on-policy RL training using policy gradient in Section 4.3. We describe models for each task at the beginning of Section 4.2.
|
| 124 |
+
|
| 125 |
+
For GOLD training, we use the baseline $b = - 6 0$ for GOLD- $p$ and $b = 0$ for GOLD- $s$ . To lower bound the return such that it is non-negative on demonstrated trajectories, we tune the lower bound $c$ of $p _ { \mathrm { M L E } }$ in $\{ 0 , 0 . 0 1 , 0 . 0 5 , 0 . 1 \}$ in (6) and (7). Furthermore, to reduce variance for importance weights, we lower bound them by $u \in \{ 0 , 0 . 1 , 0 . 1 5 , 0 . 2 \}$ . All hyperparameters are tuned on the dev set. See Appendix A.3 for more reproduciblility details.
|
| 126 |
+
|
| 127 |
+
# 4.2 RESULTS AND ANALYSIS
|
| 128 |
+
|
| 129 |
+
Table 1: BLEU/ROUGE $( \uparrow )$ and perplexity (↓) using standard models on test sets. GOLD achieves better metric scores despite high heldout perplexity. Experiments are run using a fixed random seed (12); attempted three random seeds (1, 12, 123) and all BLEU/R-2 scores are within 0.1 points of the reported. Refer to Table 3 for transformer results.
|
| 130 |
+
|
| 131 |
+
<table><tr><td rowspan="3">MLE</td><td>NQG (NQG++ net)</td><td></td><td>CNN/DM (pointer generator network)</td></tr><tr><td>BLEU↑</td><td>ppl↓</td><td>R-1↑R-2↑R-L↑ ppl↓</td></tr><tr><td>14.23 14.96</td><td>29.25</td><td>39.00 17.10 36.07 20.11</td></tr><tr><td>GOLD-δ GOLD-p</td><td>15.93</td><td>110.58 148.84</td><td>39.02 217.16 35.98 133.10</td></tr><tr><td>GOLD-s</td><td>16.10</td><td>158.45</td><td>39.20 17.31 36.23 143.58 39.95 17.81 36.81 29.80</td></tr></table>
|
| 132 |
+
|
| 133 |
+
Table 2: Dev set results of standard models using different decoding algorithms. $b$ : beam size. We report the average of 3 runs for top- $k$ sampling. Models trained by GOLD are less sensitive to decoding algorithms.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>MLE</td><td>NQG (BLEU)</td><td>CNN/DM (ROUGE-2)</td></tr><tr><td></td><td>GOLD-s MLE</td><td>GOLD-s</td></tr><tr><td>greedy</td><td>14.13 16.06</td><td>17.40 18.51</td></tr><tr><td>beam search (b = 3) beam search (b = 5)</td><td>14.19 15.84</td><td>17.65 18.44</td></tr><tr><td>top-k samp. (k = 5) 11.27</td><td>14.07 15.74 15.41</td><td>17.63 18.25</td></tr><tr><td>top-k samp.(k = 20) 10.08</td><td>15.38</td><td>13.06 17.02</td></tr><tr><td></td><td></td><td>11.23 16.57</td></tr></table>
|
| 136 |
+
|
| 137 |
+
GOLD improves both standard and transformer models. Recall that one of our main motivations is that MLE tends to over-generalize under model misspecification, i.e., high recall but low precision. One may wonder whether this problem can be fixed by better modeling. Therefore, we evaluated GOLD with both standard high-performing models and state-of-the-art pretrained model. For standard models, we chose two representative seq2seq-based models, $\mathrm { N Q G + + }$ (Zhou et al., 2017) and the pointer-generator model (See et al., 2017) for NQG and CNN/DM respectively.3 Table 1 shows that GOLD is better than MLE in terms of BLEU and ROUGE. In particular, we find that using estimated rewards is superior to the $\delta$ -reward, showing the benefits of accounting for varying quality of the references. We thus consider only GOLD- $p$ and GOLD- $s$ in the rest of the experiments. For transformer models (Vaswani et al., 2017), we used the pretrained BART (Lewis et al., 2020) for NQG, CNN/DM, and XSum; we used standard transformer for IWSLT14 De-En. Table 3 shows that GOLD achieves better scores than MLE across all tasks, including near-SOTA on CNN/DM (R-2 $9 5 \%$ confidence interval: 21.84-22.33) and good performance on XSum (R-2 $9 5 \%$ CI: 22.25-22.92).
|
| 138 |
+
|
| 139 |
+
We further crowdsourced human evaluation by pairwise comparison4 between MLE-trained and GOLD- $s$ -trained model outputs. Each pair of comparison is repeated three times (by three different workers) and we take the majority answer. For each dataset, the evaluations are done by at least 15 different workers. For NQG, we showed workers the entire input and the questions generated by two models, and we ask workers to select the better one (with a third “tie” option). For summarization, we ask workers to select the generation closer in meaning to the reference without showing the article. More details are in Appendix C. Table 5 shows that workers prefer outputs from models trained by GOLD more often than those trained by MLE.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 1: Histograms of token-level NLL loss using standard models on NQG and CNN/DM dev sets. MLE learns high-recall models whose loss distribution is spread out; GOLD learns high-precision models whose loss distribution is concentrated on near-zero losses.
|
| 143 |
+
|
| 144 |
+
Table 3: Results using transformer models on test sets. The advantage of GOLD is maintained on advanced models based on transformers and pretraining.
|
| 145 |
+
Table 4: BLEU/ROUGE $( \uparrow )$ on test sets, using standard models finetuned with on-policy objectives. On-policy objectives marginally improve upon both MLE and GOLD baselines. Starred (\*) models have MLE baselines ${ > } 0 . 1$ difference to our MLE R-2. δR-2: R-2 for the model minus R-2 for the corresponding MLE. PG: standard policy gradient; PPO: proximal policy optimization.
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan="2">reward</td><td rowspan="2"></td><td>NQG</td><td colspan="2">CNN/DM</td></tr><tr><td>BLEU</td><td>R-2</td><td>8R-2</td></tr><tr><td colspan="2">Off-policy (this paper)</td><td></td><td></td><td></td></tr><tr><td>MLE</td><td></td><td>14.23</td><td>17.10</td><td></td></tr><tr><td>GOLD-s</td><td>Rs (Section 3.2); the only task-independent reward in this table</td><td>16.10</td><td>17.81</td><td>0.71</td></tr><tr><td>On-policy</td><td></td><td></td><td></td><td></td></tr><tr><td>MLE+PG</td><td>BLEU or R-2</td><td>14.55</td><td>17.35</td><td>0.25</td></tr><tr><td>MLE+PPO</td><td>human preferences (Ziegler et al., 2019)</td><td>1</td><td>17.61</td><td>0.62</td></tr><tr><td>MLE+PG(*)</td><td>R-L + saliency + summary-entailment (Pasunuru & Bansal, 2018)</td><td></td><td>18.00</td><td>0.67</td></tr><tr><td>MLE+PG(*)</td><td>question-answering score (Scialom et al., 2019)</td><td></td><td></td><td>17.66 -0.12</td></tr><tr><td>GOLD+PG</td><td>BLEU or R-2</td><td>16.38</td><td>18.14</td><td>1.04</td></tr></table>
|
| 148 |
+
|
| 149 |
+
GOLD encourages high-precision models. One interesting observation from Table 1 and Table 3 is that compared to MLE, GOLD leads to much higher held-out perplexities, while achieving better metric scores. Since both are evaluated against the reference, one would expect high perplexity to correlate with low metric scores. To better understand the behavior of GOLD, we examine the distributions of token-level negative log-likelihood (NLL) loss (a monotonic transformation of perplexity) in Figure 1. We see that the loss distribution of GOLD (compared to MLE) concentrates on near-zero losses (Figures 1a and 1c) with a long tail of large losses (Figures 1b and 1d), hence high perplexity. In contrast, MLE has much fewer near-zero losses and fewer large losses, suggesting it tries to generate all tokens; i.e., MLE encourages recall, as discussed in Section 2. We conclude that GOLD achieves better metric scores by focusing on easy-to-learn tokens at the expense of lower recall with respect to the reference.
|
| 150 |
+
|
| 151 |
+
Table 5: Human comparisons on 200 randomly selected test examples for each task. Win: $\%$ generations from GOLD-trained BART that are better than from MLE-trained BART, given the same source.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>NQG (BART)</td><td>CNN/DM (BART)</td><td>XSum (BART)</td></tr><tr><td>win lose tied</td><td>win lose tied</td><td>win lose tied</td></tr><tr><td>38.0 28.5 33.5</td><td>37.5 24.5 38.0</td><td>35.0 21.5 43.5</td></tr></table>
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 2: Left: Avg human ratings vs. generation length, on $7 3 6 ~ \mathrm { N Q G }$ samples. (Colored regions: $9 5 \%$ confidence interval.) Each data point has $\geq 3 0$ annotations. The quality of long generations from MLE-trained model drops heavily, but stays stable across lengths for GOLD- $s$ generations. Right: Avg NLL loss of tth token given the gold prefix tokens vs. time-step $t$ , on NQG dev set. Without exposure bias, NLL loss stays stable across lengths.
|
| 157 |
+
|
| 158 |
+
Another advantage of high-precision models is that they do not rely much on decoding algorithms to sample high-quality outputs from the learned distribution. From a RL perspective, the policy already considers future rewards when making local decisions, thus beam search is not necessary. As a result, we see in Table 2 that GOLD achieves similar performance with both argmax decoding and top- $k$ sampling. In contrast, MLE suffers significantly from sampling, which suggests that it learns a high-recall but low-precision model.
|
| 159 |
+
|
| 160 |
+
GOLD alleviates exposure bias. GOLD suffers less from exposure bias because it trains on the state/history distribution induced by the model instead of the reference data. Here, we empirically quantify the exposure bias problem in learned models. If there is exposure bias, then the output quality is expected to degrade as output length increases, as the history is more likely to deviate from the reference distribution with accumulated generation steps. To evaluate quality, we sampled 736 generations of different lengths from standard models trained by both MLE and GOLD on NQG. Given the paragraph, words to query on, and the generated questions, we then asked workers to rate the generations from 1 (worst) to 4 (best). Figure 2 (left) shows that the output quality of the MLE-trained model degrades when the sequence length is over 14 words, whereas the quality of the GOLD-s-trained model stays relatively stable across all lengths.5 Qualitatively, we observe frequent degenerations (Holtzman et al., 2020; Welleck et al., 2020a) including repetitions and hallucinations within a sentence generated by MLE-trained model, as shown in Table 6. In contrast, Figure 2 (right) shows the NLL loss conditioned on gold histories on NQG dev set.6 We can see that without exposure bias, NLL loss does not vary much as the length increases. Therefore, we conclude that the big performance drop for long generations using MLE is mainly due to exposure bias and GOLD does not suffer from the problem.
|
| 161 |
+
|
| 162 |
+
Table 6: NQG generations using standard models. Words to query on are bolded. Long generations from MLE-trained model often result in repetition or hallucination. More examples in appendix.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Input MLE</td><td>that projectwasentitledthefactoryprojecttoreferenceandywarholandtocreateafactorytocompletelydigitiethecolection. what was the name of the project that was not digitize to digitize ?</td></tr><tr><td>Input</td><td>GOLD what was the name of the project that was to reference andy warhol ? braddock(withgeorge washingtonasoneof hisaides)ledabout1,50amytroopsand provincial militiaonanexpeditioninjune</td></tr><tr><td>MLE</td><td>1755 to take fort duquesne . what was the name of the aid of george washington university ?</td></tr><tr><td></td><td>GOLD who led about 1,5oO army troops and provincial militia on an expedition ?</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 4.3 COMPARISON WITH ON-POLICY TRAINING
|
| 167 |
+
|
| 168 |
+
While offline RL is generally more challenging due to lack of interaction with the environment, we argue that the benefit from interaction is limited in text generation (Section 3.1) and overweighed by the optimization challenges. In this section, we investigate the effect of on-policy training using task metrics as rewards. Specifically, we pre-train the model using MLE and then fine-tune it using PG. To avoid degenerate solutions, we interleave MLE and PG updates evenly during fine-tuning. Similarly, we fine-tune GOLD-initialized models using PG. For on-policy fine-tuning, we use BLEU and ROUGE-2 as rewards for NQG and CNN/DM respectively.7 Table 4 shows that additional on-policy training improves both MLE and GOLD marginally. However, MLE with PG is still worse than GOLD. Further, one of the best-performing on-policy methods using a similarly competitive pretrained transformer model (Ziegler et al., 2019) also shows limited improvements over supervised baseline on CNN/DM, despite having better reward functions (domain-specific human preference annotations). Overall, the benefit from on-policy training is unclear in our experiments.8 Please refer to the appendix for more details.
|
| 169 |
+
|
| 170 |
+
# 4.4 DISCUSSION ON GENERATION DIVERSITY
|
| 171 |
+
|
| 172 |
+
The objective of GOLD is to produce high-precision text at the cost of recall: There are references that the model cannot generate with high probability, which is reflected by the high held-out perplexity in Table 1 and Table 3. One may wonder what the impact of GOLD on text “diversity” is. This issue warrants more discussion, but for text generation, “diversity” may stand for the following.
|
| 173 |
+
|
| 174 |
+
(1) Diversity as in the ability to generate a number of different correct generations given one context. This is often discussed in the context of mode collapse, which is an important problem for image generation and unconditional text generation (e.g., continuation from a prompt). However, for many conditional NLG tasks, while there are multiple correct outputs, producing one good generation is often sufficient in practice, e.g., question generation, summarization, machine translation, image captioning, text style transfer, and even chit-chat dialogues (unless users expect the bots to say different things in the same context every time). One exception is creative writing tasks where we would like to have multiple novel generations given the same context, e.g., generating from a language model (Caccia et al., 2020). In these cases, GOLD may not be able to provide a variety of high-quality generations given one context, although it would still produce different outputs given different contexts. Another potential failure mode is that in open-ended dialogues, if one common response has large probability under true data distribution, then GOLD may lead to a distribution concentrated on this mode. In this case, additional inductive bias is needed to separate good modes from bad ones, e.g., additional reward on specificity of the response. On the other hand, while MLE-trained models have good recall and we can potentially sample many different outputs with a high temperature, or large $k$ in top- $k$ sampling, or large $p$ in top- $p$ sampling,9 there are only a few high-quality ones. Our conjecture is that there may not be enough data to cover all modes, and in fact high-likelihood outputs from MLE-trained models are often degenerate (Stahlberg & Byrne, 2019; Cohen & Beck, 2019; Holtzman et al., 2020).
|
| 175 |
+
|
| 176 |
+
In sum, given the trade-off between diversity and quality, we argue that generating a single highquality output is a reasonable goal for most conditional text generation tasks, and we leave the question of generating both diverse and high-quality outputs to future work.
|
| 177 |
+
|
| 178 |
+
(2) Diversity as in the linguistic complexity of the output, given the input. First, we compare GOLD and MLE by measuring the complexity of the output using the number of unique n-grams and did not find significant difference. For example, GOLD’s number of unique 1/2/3/4/5-grams for XSum (using BART) is 18846/18835/18103/17639/17258, MLE’s is 19071/19053/18349/17875/17531, and gold-standard target numbers are 23674/23661/22869/22280/21822. In addition, for question generation and summarization, we measure the complexity of the output by abstractivness, i.e., the proportion of n-gram overlaps between the input and the generation. For XSum (using BART), the proportion of 1/2/3/4/5-gram overlap for MLE is $0 . 7 5 / 0 . 2 7 / 0 . 1 0 / 0 . 0 5 3 / 0 . 0 3 1$ and for GOLD: 0.73/0.24/0.087/0.039/0.021; the trend mostly holds for NQG and CNN/DM as well. In sum, we conclude that GOLD and MLE are comparable in producing complex or novel outputs.
|
| 179 |
+
|
| 180 |
+
(3) Diversity as in the coverage of the true data distribution. This definition is related to (1). This diversity is the “recall” intuitively, and can be measured by NLL loss or perplexity, which will be sacrificed. In our case, the consequence is that the model tends to ignore difficult gold examples (Figure 1), which in text generation, may sometimes be noise or outliers. Empirically for a large number of text generation tasks, paying less attention to such examples did not cause mode collapse in our case.
|
| 181 |
+
|
| 182 |
+
# 5 RELATED WORK
|
| 183 |
+
|
| 184 |
+
Exposure bias. In structured prediction, there is a flurry of works addressing exposure bias since Bengio et al. (2015). Most works focus on learning global sequence scores instead of locally normalized scores using either variants of beam search (Wiseman & Rush, 2016; Andor et al., 2016; Goyal et al., 2018) or energy networks (Belanger & McCallum, 2016; Tu et al., 2020). These training algorithms are often complex and costly. Exposure bias is well studied in imitation learning (Daume´ et al., 2009; Ross et al., 2011) and learning-to-search has been applied to RNNs to incorporate losses of sequences deviating from references (Leblond et al., 2018), but they require annotations or cost functions on non-reference sequences which may not be available for text generation.
|
| 185 |
+
|
| 186 |
+
Objectives beyond MLE. Policy gradient-based algorithms and their variants have been used extensively in text generation to optimize sequence-level metrics (Ranzato et al., 2016; Shen et al., 2016; Norouzi et al., 2016; Pasunuru & Bansal, 2018). In addition, off-policy RL is commonly used in dialogue where online interaction with users is expensive (Serban et al., 2017; Jaques et al., 2019). The main difference is that we take advantage of the demonstrations and design generic reward functions for generation tasks. There is another line of work using policy gradient to optimize reward from a discriminator that differentiates good vs. bad generations (Yu et al., 2017; Li et al., 2017; Lu et al., 2019). However, these approaches often underperform MLE in practice (Tevet et al., 2019) due to optimization challenges. Recently, a concurrent work, Kang & Hashimoto (2020), proposed truncated log-loss which both optimizes distinguishability and enjoys efficient optimization.
|
| 187 |
+
|
| 188 |
+
High-precision text generation. It is noticed early in neural text generation that MLE tends to produce high-recall models that over-generalize. Previously, high-quality outputs are selected mainly through decoding (e.g., beam search, low-temperature sampling, truncated sampling). Recently, there is an increasing amount of work on discouraging implausible samples during training, e.g., using negative sampling (Welleck et al., 2020b), self-training on high-quality samples (Kedzie & McKeown, 2019), and confidence-oriented decoding with calibration (Tian et al., 2020). In contrast, we tackle the fundamental problem of mismatched objectives and propose a general learning framework.
|
| 189 |
+
|
| 190 |
+
# 6 CONCLUSION
|
| 191 |
+
|
| 192 |
+
We provide an efficient algorithm that addresses the two train/test discrepancies in MLE training for text generation: likelihood as learning objective vs. quality as evaluation metric; gold history in training vs. model-generated history in inference. We have demonstrated that off-policy RL is a promising framework for text generation, with matched train/test objectives and optimization advantages like MLE. We believe more advanced off-policy learning techniques (e.g., proximity constraints) can be easily integrated into text generation and further improve performance.
|
| 193 |
+
|
| 194 |
+
# ACKNOWLEDGEMENTS
|
| 195 |
+
|
| 196 |
+
The authors thank Kyunghyun Cho, Tatsunori Hashimoto, Graham Neubig, Ethan Perez, Karl Stratos, Clara Vania, and Alex Warstadt (alphabetical order) for helpful discussions, and the anonymous reviewers for helpful feedback. This work was supported by Samsung Advanced Institute of Technology (Next Generation Deep Learning: From Pattern Recognition to AI) and Samsung Research (Improving Deep Learning Using Latent Structure).
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Roee Aharoni and Yoav Goldberg. Split and rephrase: Better evaluation and stronger baselines. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 719–724, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi: 10.18653/v1/P18-2114. URL https://www.aclweb.org/anthology/ P18-2114.
|
| 201 |
+
|
| 202 |
+
Daniel Andor, Chris Alberti, David Weiss, Aliaksei Severyn, Alessandro Presta, Kuzman Ganchev, Slav Petrov, and Michael Collins. Globally normalized transition-based neural networks. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2442–2452, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1231. URL https://www.aclweb.org/anthology/ P16-1231.
|
| 203 |
+
|
| 204 |
+
David Belanger and Andrew McCallum. Structured prediction energy networks. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 983–992, New York, New York, USA, 20–22 Jun 2016. PMLR. URL http://proceedings.mlr.press/ v48/belanger16.html.
|
| 205 |
+
|
| 206 |
+
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.
|
| 207 |
+
|
| 208 |
+
Massimo Caccia, Lucas Caccia, William Fedus, Hugo Larochelle, Joelle Pineau, and Laurent Charlin. Language gans falling short. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BJgza6VtPB.
|
| 209 |
+
|
| 210 |
+
Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, and Marcello Federico. Report on ¨ the 11th IWSLT evaluation campaign. In Proceedings of the International Workshop on Spoken Language Translation, volume 57, Hanoi, Vietnam, 2014.
|
| 211 |
+
|
| 212 |
+
Jaemin Cho, Minjoon Seo, and Hannaneh Hajishirzi. Mixture content selection for diverse sequence generation. 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. 3121–3131, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1308. URL https://www.aclweb.org/anthology/ D19-1308.
|
| 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 Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/D14-1179. URL https://www.aclweb. org/anthology/D14-1179.
|
| 215 |
+
|
| 216 |
+
Leshem Choshen, Lior Fox, Zohar Aizenbud, and Omri Abend. On the weaknesses of reinforcement learning for neural machine translation. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id ${ . } = { }$ H1eCw3EKvH.
|
| 217 |
+
|
| 218 |
+
Elizabeth Clark, Asli Celikyilmaz, and Noah A. Smith. Sentence mover’s similarity: Automatic evaluation for multi-sentence texts. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 2748–2760, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1264. URL https://www.aclweb.org/ anthology/P19-1264.
|
| 219 |
+
|
| 220 |
+
Eldan Cohen and Christopher Beck. Empirical analysis of beam search performance degradation in neural sequence models. volume 97 of Proceedings of Machine Learning Research, pp. 1290–1299, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr. press/v97/cohen19a.html.
|
| 221 |
+
|
| 222 |
+
Hal Daume, John Langford, and Daniel Marcu. Search-based structured prediction. ´ Machine learning, 75(3):297–325, 2009.
|
| 223 |
+
|
| 224 |
+
Kartik Goyal, Graham Neubig, Chris Dyer, and Taylor Berg-Kirkpatrick. A continuous relaxation of beam search for end-to-end training of neural sequence models. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 225 |
+
|
| 226 |
+
Hirotaka Hachiya, Takayuki Akiyama, Masashi Sugiayma, and Jan Peters. Adaptive importance sampling for value function approximation in off-policy reinforcement learning. Neural Networks, 22(10):1399–1410, 2009.
|
| 227 |
+
|
| 228 |
+
Tatsunori Hashimoto, Hugh Zhang, and Percy Liang. Unifying human and statistical evaluation for natural language generation. 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. 1689–1701, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1169. URL https://www.aclweb.org/ anthology/N19-1169.
|
| 229 |
+
|
| 230 |
+
W. K. Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97–109, 1970. ISSN 00063444. URL http://www.jstor.org/stable/ 2334940.
|
| 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 Advances in Neural Information Processing Systems, pp. 1693–1701, 2015.
|
| 233 |
+
|
| 234 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Comput., 9(8): 1735–1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL https://doi.org/10.1162/neco.1997.9.8.1735.
|
| 235 |
+
|
| 236 |
+
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In International Conference on Learning Representations, 2020.
|
| 237 |
+
|
| 238 |
+
Ferenc Huszar. How (not) to train your generative model: Scheduled sampling, likelihood, adversary? ´ arXiv preprint arXiv:1511.05101, 2015.
|
| 239 |
+
|
| 240 |
+
Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019.
|
| 241 |
+
|
| 242 |
+
Daniel Kang and Tatsunori Hashimoto. Improved natural language generation via loss truncation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 718–731, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020. acl-main.66. URL https://www.aclweb.org/anthology/2020.acl-main.66.
|
| 243 |
+
|
| 244 |
+
Chris Kedzie and Kathleen McKeown. A good sample is hard to find: Noise injection sampling and self-training for neural language generation models. In Proceedings of the 12th International Conference on Natural Language Generation, pp. 584–593, 2019.
|
| 245 |
+
|
| 246 |
+
Yaser Keneshloo, Tian Shi, Naren Ramakrishnan, and Chandan K Reddy. Deep reinforcement learning for sequence-to-sequence models. IEEE Transactions on Neural Networks and Learning Systems, 2019.
|
| 247 |
+
|
| 248 |
+
Remi Leblond, Jean-Baptiste Alayrac, Anton Osokin, and Simon Lacoste-Julien. SEARNN: Training ´ RNNs with global-local losses. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ HkUR_y-RZ.
|
| 249 |
+
|
| 250 |
+
Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
|
| 251 |
+
|
| 252 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Seattle, USA, July 2020. Association for Computational Linguistics.
|
| 253 |
+
|
| 254 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Sebastien Jean, Alan Ritter, and Dan Jurafsky. Adversarial ´ learning for neural dialogue generation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2157–2169, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1230. URL https: //www.aclweb.org/anthology/D17-1230.
|
| 255 |
+
|
| 256 |
+
Zichao Li, Xin Jiang, Lifeng Shang, and Hang Li. Paraphrase generation with deep reinforcement learning. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 3865–3878, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1421. URL https://www.aclweb.org/ anthology/D18-1421.
|
| 257 |
+
|
| 258 |
+
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.
|
| 259 |
+
|
| 260 |
+
Sidi Lu, Lantao Yu, Siyuan Feng, Yaoming Zhu, and Weinan Zhang. CoT: Cooperative training for generative modeling of discrete data. 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. 4164–4172, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/lu19d.html.
|
| 261 |
+
|
| 262 |
+
Kenton Murray and David Chiang. Correcting length bias in neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 212–223, Belgium, Brussels, October 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6322. URL https://www.aclweb.org/anthology/W18-6322.
|
| 263 |
+
|
| 264 |
+
Shashi Narayan, Shay B. Cohen, and Mirella Lapata. Don’t give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 1797–1807, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/ D18-1206. URL https://www.aclweb.org/anthology/D18-1206.
|
| 265 |
+
|
| 266 |
+
Mohammad Norouzi, Samy Bengio, zhifeng Chen, Navdeep Jaitly, Mike Schuster, Yonghui Wu, and Dale Schuurmans. Reward augmented maximum likelihood for neural structured prediction. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29, pp. 1723–1731. Curran Associates, Inc., 2016. URL https://proceedings.neurips.cc/paper/2016/file/ 2f885d0fbe2e131bfc9d98363e55d1d4-Paper.pdf.
|
| 267 |
+
|
| 268 |
+
Jekaterina Novikova, Ondˇrej Dusek, Amanda Cercas Curry, and Verena Rieser. Why we need ˇ new evaluation metrics for NLG. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2241–2252, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1238. URL https://www.aclweb.org/anthology/D17-1238.
|
| 269 |
+
|
| 270 |
+
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.
|
| 271 |
+
|
| 272 |
+
Tetiana Parshakova, Jean-Marc Andreoli, and Marc Dymetman. Distributional reinforcement learning for energy-based sequential models. arXiv preprint arXiv:1912.08517, 2019.
|
| 273 |
+
|
| 274 |
+
Ramakanth Pasunuru and Mohit Bansal. Multi-reward reinforced summarization with saliency and entailment. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 646–653, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-2102. URL https://www.aclweb.org/anthology/N18-2102.
|
| 275 |
+
|
| 276 |
+
Doina Precup, Richard S. Sutton, and Satinder Singh. Eligibility traces for off-policy policy evaluation. Computer Science Department Faculty Publication Series, UMass Amherst, 2000.
|
| 277 |
+
|
| 278 |
+
Weizhen Qi, Yu Yan, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei Zhang, and Ming Zhou. ProphetNet: Predicting future n-gram for sequence-to-SequencePre-training. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 2401–2410, Online, November 2020. Association for Computational Linguistics. URL https://www.aclweb. org/anthology/2020.findings-emnlp.217.
|
| 279 |
+
|
| 280 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020.
|
| 281 |
+
|
| 282 |
+
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 the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2383–2392, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1264. URL https://www.aclweb.org/ anthology/D16-1264.
|
| 283 |
+
|
| 284 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. In International Conference on Learning Representations, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016.
|
| 285 |
+
|
| 286 |
+
Stephane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured ´ prediction to no-regret online learning. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 627–635, 2011.
|
| 287 |
+
|
| 288 |
+
Thomas Scialom, Sylvain Lamprier, Benjamin Piwowarski, and Jacopo Staiano. Answers unite! unsupervised metrics for reinforced summarization models. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3246–3256, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1320. URL https://www.aclweb.org/anthology/D19-1320.
|
| 289 |
+
|
| 290 |
+
Abigail See, Peter J. Liu, and Christopher D. Manning. Get to the point: Summarization with pointer-generator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1073–1083, Vancouver, Canada, July 2017. Association for Computational Linguistics. doi: 10.18653/v1/P17-1099. URL https: //www.aclweb.org/anthology/P17-1099.
|
| 291 |
+
|
| 292 |
+
Iulian V Serban, Chinnadhurai Sankar, Mathieu Germain, Saizheng Zhang, Zhouhan Lin, Sandeep Subramanian, Taesup Kim, Michael Pieper, Sarath Chandar, Nan Rosemary Ke, et al. A deep reinforcement learning chatbot. arXiv preprint arXiv:1709.02349, 2017.
|
| 293 |
+
|
| 294 |
+
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.
|
| 295 |
+
|
| 296 |
+
Loic Simon, Ryan Webster, and Julien Rabin. Revisiting precision recall definition for generative modeling. 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. 5799–5808, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http: //proceedings.mlr.press/v97/simon19a.html.
|
| 297 |
+
|
| 298 |
+
Felix Stahlberg and Bill Byrne. On NMT search errors and model errors: Cat got your tongue? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3356–3362, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1331. URL https://www.aclweb.org/anthology/D19-1331.
|
| 299 |
+
|
| 300 |
+
Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
|
| 301 |
+
|
| 302 |
+
Guy Tevet, Gavriel Habib, Vered Shwartz, and Jonathan Berant. Evaluating text GANs as language models. 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. 2241–2247, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1233. URL https://www.aclweb.org/anthology/N19-1233.
|
| 303 |
+
|
| 304 |
+
Ran Tian, Shashi Narayan, Thibault Sellam, and Ankur P. Parikh. Sticking to the facts: Confident decoding for faithful data-to-text generation, 2020. URL https://openreview.net/forum? id $=$ HkxU2pNYPH.
|
| 305 |
+
|
| 306 |
+
Lifu Tu, Richard Yuanzhe Pang, and Kevin Gimpel. Improving joint training of inference networks and structured prediction energy networks. In Proceedings of the Fourth Workshop on Structured Prediction for NLP, pp. 62–73, Online, November 2020. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/2020.spnlp-1.8.
|
| 307 |
+
|
| 308 |
+
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.
|
| 309 |
+
|
| 310 |
+
Chaojun Wang and Rico Sennrich. On exposure bias, hallucination and domain shift in neural machine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 3544–3552, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.326. URL https://www.aclweb.org/anthology/2020. acl-main.326.
|
| 311 |
+
|
| 312 |
+
Sean Welleck, Ilia Kulikov, Jaedeok Kim, Richard Yuanzhe Pang, and Kyunghyun Cho. Consistency of a recurrent language model with respect to incomplete decoding. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5553–5568, Online, November 2020a. Association for Computational Linguistics. URL https://www. aclweb.org/anthology/2020.emnlp-main.448.
|
| 313 |
+
|
| 314 |
+
Sean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan, Kyunghyun Cho, and Jason Weston. Neural text generation with unlikelihood training. In International Conference on Learning Representations, 2020b. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SJeYe0NtvH.
|
| 315 |
+
|
| 316 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 317 |
+
|
| 318 |
+
Sam Wiseman and Alexander M. Rush. Sequence-to-sequence learning as beam-search optimization. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1296–1306, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1137. URL https://www.aclweb.org/anthology/D16-1137.
|
| 319 |
+
|
| 320 |
+
Lijun Wu, Fei Tian, Tao Qin, Jianhuang Lai, and Tie-Yan Liu. A study of reinforcement learning for neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 3612–3621, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-1397. URL https://www. aclweb.org/anthology/D18-1397.
|
| 321 |
+
|
| 322 |
+
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.
|
| 323 |
+
|
| 324 |
+
Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J. Liu. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization. In Proceedings of the 37th International Conference on Machine Learning, Proceedings of Machine Learning Research. PMLR, 2020.
|
| 325 |
+
|
| 326 |
+
Qingyu Zhou, Nan Yang, Furu Wei, Chuanqi Tan, Hangbo Bao, and Ming Zhou. Neural question generation from text: A preliminary study. In National CCF Conference on Natural Language Processing and Chinese Computing, pp. 662–671. Springer, 2017.
|
| 327 |
+
|
| 328 |
+
Daniel M Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593, 2019.
|
| 329 |
+
|
| 330 |
+
# A PRACTICAL SETUP AND IMPLEMENTATION
|
| 331 |
+
|
| 332 |
+
# A.1 TASKS AND DATASETS
|
| 333 |
+
|
| 334 |
+
(1) Natural question generation (NQG; Zhou et al., 2017) based on the SQuAD QA dataset (Rajpurkar et al., 2016): Given a text passage and a short span of the passage, the goal is to generate a question that can be answered by the span. (2) CNN/DailyMail summarization (CNN/DM): Given a piece of news, generate a few sentences of summary. We use the entity-non-anonymized version of CNN/DM dataset, following See et al. (2017). The target summaries tend to be extractive, meaning there tends to be heavy text-span overlaps between the source article and the target summary. (3) Extreme summarization (XSum; Narayan et al., 2018) is based on BBC news. The target summaries are highly abstractive. Past extractive strategies that work well for CNN/DM may not work well for XSum. (4) IWSLT14 German to English machine translation (IWSLT14 De-En; Cettolo et al., 2014) is a popular machine translation benchmark. Machine translation is different from the above three tasks, given that intuitively, the space of high-quality generation is smaller.
|
| 335 |
+
|
| 336 |
+
More details on datasets. We first provide the number of examples in each dataset. The train/dev/test split for NQG is 86229/8913/8919; the split for CNN/DM is 287227/13368/11490; the split for XSum is 204045/11332/11334; the split for IWSLT14 De-En is 160239/7283/6750.
|
| 337 |
+
|
| 338 |
+
To download and preprocess the NQG data, we follow the following instructions: https:// github.com/clovaai/FocusSeq2Seq; to download and preprocess the summarization data, we follow the following instructions: https://github.com/pytorch/fairseq/blob/ master/examples/bart/README.summarization.md; to download and preprocess the IWSLT14 De-En data, we follow the following instructions: https://github.com/pytorch/ fairseq/tree/master/examples/translation. More information can be found in our codebase.
|
| 339 |
+
|
| 340 |
+
# A.2 MODEL ARCHITECTURES
|
| 341 |
+
|
| 342 |
+
We use two sets of architectures for our experiments.
|
| 343 |
+
|
| 344 |
+
Standard architectures. For NQG, we use the model $\mathrm { N Q G + + }$ (Zhou et al., 2017), a seq2seqwith-attention model based on GRU (Cho et al., 2014), and for summarization we use pointer generator network (See et al., 2017), a seq2seq-with-attention model based on LSTM (Hochreiter & Schmidhuber, 1997). Specifically, we use 2 layers for both the encoder and the decoder, for both tasks. Other hyperparameters are based on the following implementation: https://github. com/clovaai/FocusSeq2Seq.
|
| 345 |
+
|
| 346 |
+
Transformer architectures. For NQG, CNN/DM, and XSum, we also experiment with one of the top-performing models, BART (Lewis et al., 2020). Our experiments are based on the pretrained BART model provided by original authors10: it has 12 encoder layers and 12 decoder layers, and it is pretrained on around 3.3 billion words of Wikipedia articles and books. We use the model to investigate if our methods work with models with stronger capabilities. For IWSLT14 De-En, we use a moderate-size standard transformer architecture (encoder/decoder embedding dimension 512, 4 encoder attention heads, 6 encoder layers, 4 decoder attention heads, 6 decoder layers), a top-performing architecture in machine translation.
|
| 347 |
+
|
| 348 |
+
# A.3 MORE ON REPRODUCIBILITY
|
| 349 |
+
|
| 350 |
+
The codebase is released. The link to the code is posted on the following website: yzpang.me.
|
| 351 |
+
|
| 352 |
+
Hyperparameters and training details on standard architectures. This paragraph corresponds to results in Table 1. We use a learning rate of 5e-4. For NQG, we use a batch size of 32; for CNN/DM we use a batch size of 16. We train using a single Nvidia GTX 1080 Ti (memory: 12 GB) GPU.
|
| 353 |
+
|
| 354 |
+
As discussed in Section 3.3 and Section 4.1, we tune the lower bound of $p _ { \mathrm { M L E } }$ in $\{ 0 , 0 . 0 1 , 0 . 0 5 , 0 . 1 \}$ For NQG models, the lower bound of 0.1 produces best performance. For CNN/DM using GOLD- $p$ the lower bound is 0.01; for CNN/DM using GOLD- $s$ , the lower bound is 0.
|
| 355 |
+
|
| 356 |
+
Recall that as discussed in Section 3.3, the weighting policy $\tilde { \pi } _ { \boldsymbol { \theta } }$ synchronizes with actual policy $\pi _ { \theta }$ once every $k$ steps so as to stabilize training. We tune $k \in \{ 1 5 0 0 , 2 6 9 1 \}$ (where 2691 steps corresponds to 1 epoch) for NQG and found that $k = 1 5 0 0$ works better for all NQG models. We tune $\bar { k ^ { \prime } } \in \{ 1 5 0 0 , 3 \bar { 0 } 0 0 , 5 0 0 0 \}$ for CNN/DM; we found that $k = 1 5 0 0$ works best for GOLD- $\delta$ and GOLD- $p$ , and $k = 5 0 0 0$ works best for GOLD- $s$ . Note that in practice, we do not observe big gaps when using other $k$ ’s in the set. For standard models, implementation is based on Cho et al. (2019). In all experiments, we evaluate once every epoch, and we do validation on the entire dev set, using task-specific metrics (BLEU/ROUGE-2), following Cho et al. (2019) and standard practice in machine translation.
|
| 357 |
+
|
| 358 |
+
Hyperparameters and training details on transformer models. This paragraph corresponds to results in Table 3. For transformer models, we use Nvidia P40 GPUs (memory: 24 GB each). For NQG, CNN/DM, and XSum based on BART, we use 4 GPUs to train. For IWSLT14 De-En, we use 1 GPU. Note that fairseq defines batch size in terms of number of tokens instead of number of sequences. For NQG, we use 512 tokens as batch size (for each of the four GPUs); for CNN/DM and XSum, we use 1024 tokens as batch size (for each of the four GPUs); for IWSLT14 De-En, we use 4096 tokens as batch size.
|
| 359 |
+
|
| 360 |
+
We use a learning rate of 2e-5 for NQG, CNN/DM, and XSum; 3e-4 for IWSLT14 De-En.
|
| 361 |
+
|
| 362 |
+
Recall that as discussed in Section 3.3, the weighting policy $\tilde { \pi } _ { \boldsymbol { \theta } }$ synchronizes with actual policy $\pi _ { \theta }$ once every $k$ steps so as to stabilize training. Here, $k = 1 0 0 0$ for NQG; $k = 5 0 0 0$ for CNN/DM, XSum, IWSLT14 De-En. As discussed in Section 3.3 and Section 4.1, the lower bound of $p _ { \mathrm { M L E } }$ is set to be 0.01 for GOLD- $p$ and 0.1 for GOLD- $s$ . For all other parameters that are not specific to GOLD, we use the default fairseq summarization parameters (which can be found through footnote 10).
|
| 363 |
+
|
| 364 |
+
For hyperparameter $u$ as discussed in Section 4.1, for NQG and CNN/DM, $u = 0 . 1$ ; for XSum, $u = 0 . 1 5$ ; for IWSLT14 De-EN, $u = 0 . 2$ .
|
| 365 |
+
|
| 366 |
+
As indicated, the hyperparameters were only tuned in a small set of possible values. More careful tuning may result in slightly better performances.
|
| 367 |
+
|
| 368 |
+
Number of parameters in each model. For standard models, we use $\mathrm { N Q G + + }$ for NQG, and it has 10372565 parameters. We use pointer generator for CNN/DM, and it has 19965705 parameters. For transformer models, the BART model for NQG, CNN/DM, and XSum all have 406290432 parameters; the transformer model used for IWSLT14 De-En has 39469056 parameters.
|
| 369 |
+
|
| 370 |
+
Average runtime. For standard models, based on the above models and the computing infrastructures, each epoch of NQG takes around 10 minutes to train and achieves best performance within 20 epochs. Each epoch of CNN/DM takes about 2 hours to train and achieves best performance within 15 epochs. For transformer models, each epoch of NQG takes around 5 minutes to train and achieves best dev performance within 5 epochs; each epoch of CNN/DM takes around 11 hours to train and achieves best dev performances within 5 epochs; each epoch of XSum takes around 8 hours to train; each epoch of IWSLT14 De-En takes around 3 minutes to train and achieves best performances within 100 epochs (as expected, given the large batch size11). Note that our transformer models are trained on P40s given hardware constraints; if the transformer models are trained on V100 GPUs, for example, the training time per epoch will likely be much shorter.
|
| 371 |
+
|
| 372 |
+
# A.4 MORE DISCUSSION ON APPROXIMATIONS
|
| 373 |
+
|
| 374 |
+
Recall that we truncated the future trajectory after five steps. In other words, the number of current+future steps is upper-bounded at six. Effectively, we are using a discount factor of 0.83.12
|
| 375 |
+
|
| 376 |
+
Given that the $Q$ -value corresponds to future return, we attempted using different strategies. (1) Using the entire future trajectory, and (2) using a fixed number of future steps. We attempted (1) on NQG using the standard models (tuned discount factor in $\{ 1 , 0 . 9 , 0 . 8 , 0 . 7 , \bar { 0 . 5 } \} )$ and found that $\{ 0 . 8 , 0 . 7 \}$ usually performs best, resulting in similar performance but longer training time, compared to the current 5-future-step approach. We attempted (2) using the number of future steps in $\{ 1 , 2 , 3 , 5 , 7 , 1 0 \}$ and found that using $\{ \bar { 5 } , 7 , 1 0 \}$ leads to similar results, which are slightly better compared to $\{ 1 , 2 , 3 \}$ . One benefit is that given a fixed number of future steps, we found that using easy-to-tune constant baselines work well, and training time is also much shorter.
|
| 377 |
+
|
| 378 |
+
# A.5 DETAILS ON ON-POLICY EXPERIMENTS
|
| 379 |
+
|
| 380 |
+
For the $\mathsf { M L E { + } P G }$ baseline, we used the REINFORCE algorithm with sequence-level rewards (BLEU for NQG and ROUGE-2 for summarization). We attempted two versions of the baselines: (i) constant baselines searched in $\{ 0 , 0 . 0 1 , 0 . 0 5 , 0 . 1 , 0 . 1 5 \}$ for BLEU (NQG) and ROUGE-2 (CNN/DM), as well as (ii) baselines computed by the average BLEU/ROUGE-2 over the last 100 steps, minus $\{ 0 , 0 . 0 5 \}$
|
| 381 |
+
|
| 382 |
+
In terms of training warmup choices, We tried two versions of the training algorithm. (a) We initialized with MLE and trained with PG losses interpolated with MLE losses, given we found that the training process would become very unstable without interpolation. (b) We also attempted the following: we intialized the model at random and used MIXER (Ranzato et al., 2016). However, we failed to find improvements compared to (a), under our architecture. A relevant work Choshen et al. (2020) showed that properly tuned on-policy RL may not work for text generation in some cases.
|
| 383 |
+
|
| 384 |
+
We also tried MIXER with the learned baseline for NQG, which is estimated by a simple linear regressor that takes RNN hidden states as inputs, according to Ranzato et al. (2016). After some tuning, we achieved only slight improvements in NQG (BLEU 14.71). One advantage of GOLD is that our algorithm does not rely on learning baselines which could have a big impact on performance of on-policy algorithms; in fact, all baselines are constants in this paper.
|
| 385 |
+
|
| 386 |
+
Note that for $\mathrm { G O L D + P G }$ models, we only attempted constant baselines; better tuning of baselines could potentially lead to stronger performance.
|
| 387 |
+
|
| 388 |
+
# B MORE ON RESULTS
|
| 389 |
+
|
| 390 |
+
# B.1 LEAD-3 BASELINES FOR SUMMARIZATION
|
| 391 |
+
|
| 392 |
+
The lead-3 baseline (using first 3 sentences as summaries) is a popular strong baseline in summarization literature. The ROUGE-1/2/L scores of the lead-3 baselines are as follows: 40.42/17.62/36.67 for CNN/DM; 16.30/1.60/11.95 for XSum. Our performance using transformer models beat these baselines by a large margin.
|
| 393 |
+
|
| 394 |
+
# B.2 PERFORMANCE WITH TRANSFORMER ARCHITECTURES
|
| 395 |
+
|
| 396 |
+
We experiment using transformer architectures, as shown in Table 3; we also experiment on two more tasks (compared to using standard architectures): XSum and IWSLT14 De-En. We achieve SOTA/near-SOTA result (according to automatic metrics which have inherent limitations) on CNN/DM: at the time of writing, our results (45.40/22.01/42.25 using GOLD- $p$ or 44.82/22.09/41.81 using GOLD- $s$ ) are higher than 44.17/21.47/41.11 (PEGASUS; Zhang et al., 2020) and 44.20/21.17/41.30 (ProphetNet; Qi et al., 2020), both slightly higher than BART. Note the PEGASUS CNN/DM result is pretrained on 1.5B news articles (around 3.8 terabyte), whereas BART is pretrained on 3.3B words (around 0.16 tetrabyte). Our XSum results are also higher than PEGASUS (45.20/22.06/36.99) trained on Colossal Clean Crawled Corpus (C4; Raffel et al., 2020), but lower than the PEGASUS result using the publicly-unavailable 1.5B-article 3.8 terabyte HugeNews (Zhang et al., 2020) as pretrained corpus. We hypothesize that if our models are applied onto their architectures instead of pointer generator networks or BART, we would similarly get non-trivial improvements.
|
| 397 |
+
|
| 398 |
+
We also achieve 0.81 point of BLEU improvement on IWSLT14 De-En; GOLD- $s$ performs better than the existing approaches that do not use knowledge distillation or data augmentation, as far as the authors are aware.
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 3: Exposure bias related figures on NQG dev set. Vertical axis: avg unsmoothed sentence-level BLEU. Horizontal axis: sentence length. The colored regions represent $9 5 \%$ confidence interval obtained using standard bootstrapping. Subfigures (a) and (c) show BLEU on randomly shuffled targets (from dev set); BLEU does not appear to punish long sentences. Note the scale of the vertial axes. Subfigures (b) and (d) show BLEU vs. generation length; BLEU on generations from MLEtrained model decreases by length, but BLEU on generations from GOLD-trained model appears to stay relatively stable.
|
| 402 |
+
|
| 403 |
+
# B.3 MORE ON EXPOSURE BIAS
|
| 404 |
+
|
| 405 |
+
With exposure bias. Recall that in Section 4.2, we used human evaluation (a score of 1 or 2 or 3 or 4) to approximate the output quality, and we found that the MLE-trained model degrades significantly when the generation length is long, whereas the quality of the GOLD- $s$ -trained model stays relatively stable across lengths.
|
| 406 |
+
|
| 407 |
+
Here, we use BLEU to approximate the quality of NQG generations, and we show that BLEU does not bias toward long sentences. Figure 3 shows the average sentence-level BLEU by sequence length.13
|
| 408 |
+
|
| 409 |
+
Specifically, Figures 3a and 3c show the BLEU on randomly shuffled targets (from dev set), which show that longer sentences do not appear to punish BLEU scores. Figures 3b and 3d show the BLEU by sentence length, on model generations. We see that MLE’s BLEU decreases by length but GOLD- $s$ ’s BLEU appears to stay relatively stable. We thus see some evidence that MLE is generating worse sentences as sentence gets longer.
|
| 410 |
+
|
| 411 |
+
If there is no exposure bias. In the main text, we used the NLL loss vs. length plot to demonstrate that without exposure bias, the loss does not vary much across length, so the MLE performance drop in Figure 2 (left) is mainly due to exposure bias. Here, we provide another way to analyze the case without exposure bias.
|
| 412 |
+
|
| 413 |
+
Figure 4 shows the token prediction accuracy conditioned on gold histories on NQG dev set. Note that for each example, we let $t _ { x } = L _ { x } - 5$ , where $L _ { x }$ is the length of reference sentence $_ { \textbf { \em x } }$ . We can see that without exposure bias, prediction accuracy does not vary much as the length increases. Therefore, we conclude that the big performance drop for long generations using MLE is mainly due to exposure bias and GOLD suffers less from the problem.
|
| 414 |
+
|
| 415 |
+
# B.4 EXAMPLES
|
| 416 |
+
|
| 417 |
+
Table 7 and Table 8 show the example generations based on the transformer models.
|
| 418 |
+
|
| 419 |
+

|
| 420 |
+
Figure 4: Accuracy of correct predictions of tth token given all prefix reference tokens on NQG dev set. Colored regions represents $9 5 \%$ confidence interval obtained using standard bootstrapping. Without exposure bias, token prediction accuracy stays relatively stable across lengths.
|
| 421 |
+
|
| 422 |
+
Table 7: NQG and CNN/DM examples based on transformer models. For NQG, words to query on are bolded.
|
| 423 |
+
|
| 424 |
+
<table><tr><td>task</td><td>objective example</td><td></td></tr><tr><td>NQG</td><td>input MLE</td><td>Some members of this community emigrated to the United States in the 1890s . when did some members of the portuguese-american community emigrate to the us ? GOLD-s when did some members of the community emigrate to the us ? reference in what era did some members of this community emigrate to the us ?</td></tr><tr><td>NQG</td><td>input MLE</td><td>Competition amongst workers tends to drive down wages due to the expendable nature of the worker in relation to his or her particular job . what is one of the reasons that causes wages to be lower ?</td></tr><tr><td>NQG</td><td>GOLD-s reference input</td><td>why do wages go down when there is competition amongst workers ? why does competition among workers drive down wages ? During the mid-eocene,it is believed that the drainage basin of the Amazon was split along the middle of the continent by the Purus Arch .</td></tr><tr><td></td><td>MLE GOLD-s</td><td>when was the purus arch formed ? when was the drainage basin of the amazon split ? reference in which point did the drainage basin of the amazon split ?</td></tr><tr><td>CNN/DM input</td><td></td><td>[omitted due to length and copyright issues,but the original news article can be retrieved by searching the reference online]</td></tr><tr><td></td><td>MLE</td><td>There are nearly 5,Ooo“gems”scattered across the country,ranging from museums to</td></tr><tr><td></td><td></td><td>archaeological areas and monuments. Italy boasts the highest number of UNESCO World</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td>Heritage sites in the world. Several of which risk crumbling to the ground due to neglect</td></tr><tr><td></td><td>GOLD-s</td><td>and lack of public resources. Italy boasts the highest number of UNESCO World Heritage sites in the world.The</td></tr><tr><td></td><td></td><td>Basilica of Assisi,where St. Frances’tomb lies,is badly in need of a restyle.Italy</td></tr><tr><td></td><td></td><td>doesn't know how to exploit this treasure,says Francesco Toti reference Italy boasts the highest number of UNESCO World Heritage sites in the world .Italy</td></tr><tr><td></td><td></td><td>doesn't know how to exploit treasures,and appears not to care about them, writes Silvia Marchetti .</td></tr><tr><td></td><td>CNN/DM input</td><td>[omitted due to length and copyright issues,but the original news article can be retrieved</td></tr><tr><td></td><td></td><td>by searching the reference online] President Obama has argued with progressive potentate Elizabeth Warren, calling her</td></tr><tr><td></td><td>MLE</td><td></td></tr><tr><td></td><td></td><td>"wrong"on trade policy.What everyone does next will be critical for the 2Ol6 elections</td></tr><tr><td></td><td></td><td>and the future of Democratic politics.Warren has publicly criticized "fast track"trade</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td>authority that would allow the White House to negotiate massive,multination trade deals.</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td>GOLD-s President Obama has argued with the progressive potentate Elizabeth Warren,calling her</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td>"wrong”on trade policy. Julian Zelizer: If Hillary Clinton wants to prove she'sa real</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td>populist, now is her chance to be even more clear about her position on the TPP deal .</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td>Sen.Elizabeth Warren has publicly criticized so-called "fast track” trade authority</td></tr><tr><td></td><td>reference</td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td>Sally Kohn:Why does President Obama call her wrong,and why is Hillary Clinton</td></tr></table>
|
| 425 |
+
|
| 426 |
+
Table 8: XSum and IWSLT14 De-En examples based on transformer models.
|
| 427 |
+
|
| 428 |
+
<table><tr><td>task</td><td colspan="2">objective example</td></tr><tr><td>XSum</td><td>input</td><td>[omitted due to length and copyright issues,but the original news article can be retrieved by searching the reference online]</td></tr><tr><td></td><td>MLE</td><td>The Isle of Wight father's decision not to pay a fine for taking his seven-year-old daughter on holiday during term time caused“a huge amount of confusion”,a senior MP has said.</td></tr><tr><td></td><td></td><td>GOLD-s The High Court ruling that a father could not be prosecuted for taking his seven- year-old daughter on a term-time holiday to Disney World caused“a huge amount</td></tr><tr><td></td><td></td><td>of confusion",MPs have said. reference A High Court ruling backing a parent who refused to pay a fine for taking his child on holiday in term time will cause“huge confusion",an MP has said.</td></tr><tr><td>XSum</td><td>input</td><td>[omited due to length and copyright issues,but the original news article can be retrieved by searching the reference online]</td></tr><tr><td></td><td>MLE</td><td>Flood defences at a Denbighshire beach could be strengthened to reduce the risk of them being breached.</td></tr><tr><td></td><td>GOLD-s</td><td>A new dune system could be built to protect a Denbighshire beach from flooding. eNew sand dunes may be created to reduce the risk of flooding on a beach on the</td></tr><tr><td></td><td>reference</td><td>Denbighshire and Flintshire border.</td></tr><tr><td>XSum</td><td>input</td><td>[omitted due to length and copyright issues,but the original news article can be retrieved by searching the reference online]</td></tr><tr><td></td><td>MLE</td><td>Fleetwood's League One play-off hopes suffered a blow as they were held to a goalless draw by League One strugglers Doncaster.</td></tr><tr><td></td><td>GOLD-s</td><td>Fleetwood and Blackburn played out a goalless draw in League One.</td></tr><tr><td></td><td>reference</td><td>Fleetwood Town dropped into the League One relegation places as they had to settle for a point after a stalemate with Doncaster.</td></tr><tr><td>IWSLT14 De-En input</td><td></td><td>ich hab da so ne kognitive rückkopplung,du hast was projiziert,was du sehen mochtest.</td></tr><tr><td></td><td>MLE</td><td>i've been doing this with cognitive feedback,you've been prospecting what you want to see.</td></tr><tr><td></td><td>GOLD-S</td><td>i've got cognitive feedback, you've proved what you want to see.</td></tr><tr><td></td><td>reference</td><td>eihave this cognitive feedback,you projected something you want to see.</td></tr><tr><td>IWSLT14 De-En input</td><td></td><td>es sind also alle werkzeuge vorhanden,und die einzige sache,die uns limitiert, ist unsere vorstellungskraft.</td></tr><tr><td></td><td>MLE</td><td>so there are all the tools available,and the only thing that's licensed to us is our imagination</td></tr><tr><td></td><td>GOLD-sS</td><td>so there are all the tools there,and the only thing that limited us is our imagination.</td></tr><tr><td>IWSLT14 De-En input</td><td></td><td>reference so all the tools are out there,and the only thing that limits us is our imagination. unser organismus hat eine groBartige methode erfunden, um solche unangenehmen</td></tr><tr><td></td><td></td><td>gefuhle wie neid einfach zum verschwinden zu bringen.</td></tr><tr><td></td><td>MLE</td><td>our organism has invented a great way to get such uncomfortable emotions as neither of us to disappear.</td></tr><tr><td></td><td>GOLD-s (</td><td>our organism invented a great way to make such uncomfortable emotions like</td></tr><tr><td></td><td></td><td>envy easy to disappear. reference our organism has come up with an excellent method to make unpleasant feelings</td></tr></table>
|
| 429 |
+
|
| 430 |
+
# C HUMAN EVALUATIONS
|
| 431 |
+
|
| 432 |
+
# C.1 PAIRWISE COMPARISON
|
| 433 |
+
|
| 434 |
+
Our goal is to enable high-quality generations that do not necessarily result in gold references. Given that corpus-level BLEU/ROUGE score is only a popular approximation of generation quality, we first conduct human ratings to confirm the hypothesis that our approaches are generating better sequences. For NQG, for each unit of human evaluation, we present the source paragraph, the words to ask the question on, the question generated by MLE-trained model, as well as the question generated by GOLD- $s$ -trained model. We ask the human evaluators the general question: which generated question is better? Figure 5 shows one example interface of pairwise comparisons.
|
| 435 |
+
|
| 436 |
+
Using NQG dev set, on standard models, of the 183 pairs of comparison we conducted human evaluations on, 42 $( 2 3 . 0 \% )$ MLE-questions are better, 81 $( 4 4 . 3 \% )$ GOLD- $s$ -questions are better, and 60 $( 3 2 . 8 \% )$ are tied. We also evaluate on models based on BART, shown in Table 5 in the main text.
|
| 437 |
+
|
| 438 |
+
For summarization tasks, given that it is infeasible to get high-quality annotations if we let workers read the entire news article14, we only did the following: given the reference summary, a summary generated from MLE model, and a summary generated from our model, we asked workers to compare which generated summary is closer in meaning to the reference summary. Figure 6 shows one example interface of the mentioned pairwise comparison for summarization. See Table 5 for results.
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
Figure 5: Interface for NQG pairwise comparisons, using Amazon Mechanical Turk.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 6: Interface for summarization pairwise comparisons, using Amazon Mechanical Turk.
|
| 445 |
+
|
| 446 |
+
# C.2 NQG RATING
|
| 447 |
+
|
| 448 |
+
NQG rating was conducted to examine if longer sentences (generated by MLE-trained model) will result in worse human ratings, and if GOLD alleviates the problem. In Figure 2 (left), to reduce variance, we group length by buckets of two (e.g., [7, 8], [9, 10], [11, 12], etc.). Furthermore, we sampled 736 annotations such that each bucket would contain at least 30 sentences (for human evaluation) for each of MLE and GOLD-s. We also shown the $9 5 \%$ confidence interval using standard bootstrapping, in Figure 2 (left).
|
| 449 |
+
|
| 450 |
+

|
| 451 |
+
Figure 7: Interface for NQG human ratings, using Amazon Mechanical Turk.
|
| 452 |
+
|
| 453 |
+
Given the paragraph, words to query on, and the generations, we ask workers to rate the generations. Figure 7 shows an example interface of NQG human ratings. We ask workers to consider both the correctness of the generation (i.e., if the question is asking about the specified words using facts) and the quality of the generation (i.e., if the generation is fluent and coherent). We ask workers to rate from 1 to 4, where 1 means very bad, 2 means slightly below average, 3 means slightly above average, and 4 means very good.
|
md/train/Rt5mjXAqHrY/Rt5mjXAqHrY.md
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Federated Linear Contextual Bandits
|
| 2 |
+
|
| 3 |
+
Ruiquan Huang The Pennsylvania State University rzh5514@psu.edu
|
| 4 |
+
|
| 5 |
+
Weiqiang Wu Facebook weiqiang.wwu@gmail.com
|
| 6 |
+
|
| 7 |
+
Jing Yang The Pennsylvania State University yangjing@psu.edu
|
| 8 |
+
|
| 9 |
+
Cong Shen University of Virginia cong@virginia.edu
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
This paper presents a novel federated linear contextual bandits model, where individual clients face different $K$ -armed stochastic bandits coupled through common global parameters. By leveraging the geometric structure of the linear rewards, a collaborative algorithm called Fed-PE is proposed to cope with the heterogeneity across clients without exchanging local feature vectors or raw data. Fed-PE relies on a novel multi-client G-optimal design, and achieves near-optimal regrets for both disjoint and shared parameter cases with logarithmic communication costs. In addition, a new concept called collinearly-dependent policies is introduced, based on which a tight minimax regret lower bound for the disjoint parameter case is derived. Experiments demonstrate the effectiveness of the proposed algorithms on both synthetic and real-world datasets.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Federated learning (FL) (McMahan et al., 2017) is an emerging distributed machine learning (ML) paradigm where massive number of clients collaboratively learn a shared prediction model while keeping all the training data on local devices. Compared with standard centralized machine learning, FL has the following characteristics (Kairouz et al., 2021):
|
| 18 |
+
|
| 19 |
+
• Heterogeneous local datasets. The local datasets, which are often generated at edge devices, are likely drawn from non-independent and identically distributed (non-IID) distributions. • Communication efficiency. The communication cost scales with the number of clients, which is one of the primary bottlenecks of FL. It is critical to minimize the communication cost while maintaining the learning accuracy. • Privacy. FL protects local data privacy by only sharing model updates instead of the raw data.
|
| 20 |
+
|
| 21 |
+
While the main focus of the state-of-the-art FL is on the supervised learning setting, recently, a few researchers begin to extend FL to the multi-armed bandits (MAB) framework (Lai and Robbins, 1985; Auer et al., 2002; Bubeck and Cesa-Bianchi, 2012; Agrawal and Goyal, 2012, 2013a). In the canonical setting of MAB, a player chooses to play one arm from a set of arms at each time slot. An arm, if played, will offer a reward that is drawn from its distribution which is unknown to the player. With all previous observations, the player needs to decide which arm to pull each time in order to maximize the cumulative reward. MAB thus represents an online learning model that naturally captures the intrinsic exploration-exploitation tradeoff in many sequential decision-making problems.
|
| 22 |
+
|
| 23 |
+
Extending FL to the MAB framework is naturally motivated by a corpus of applications, such as recommender systems, clinical trials, and cognitive radio. In those applications, the sequential decision making involves multiple clients and is distributed by nature. While classical MAB models assume immediate access to the sequentially generated data at the learning agent, under the new realm of FL, local datasets can be stored and analyzed at the clients, thus reducing the communication load and potentially protecting the data privacy.
|
| 24 |
+
|
| 25 |
+
Despite the potential benefits of FL, the sequential decision making and bandit feedback bring new challenges to the design of FL algorithms in the MAB setting. Different from the supervised learning setting where static datasets are collected beforehand, under the MAB setting, data is generated sequentially as decisions are made, actions are taken, and observations are collected. In order to maximize the cumulative reward and minimize the corresponding learning regret, it thus requires sophisticated coordination of the actions of the clients. The heterogeneous reward distributions across clients make the coordination process even more convoluted and challenging. Besides, the data privacy and communication efficiency requirements result in significant challenges for efficient information exchange and aggregation between local clients and the central server.
|
| 26 |
+
|
| 27 |
+
In this work, we attempt to address those challenges in a federated linear contextual bandits framework.
|
| 28 |
+
This particular problem is motivated by the following exemplary applications.
|
| 29 |
+
|
| 30 |
+
• Personalized content recommendation. For content (arm) recommendation in web-services, user engagement (reward) depends on the profile of a user (context). The central server may deploy a recommender system on each user’ local device (client) in order to personalize recommendations without knowing the personal profile or behavior of the user.
|
| 31 |
+
|
| 32 |
+
• Personalized online education. In order to maximize students performances (reward) in online learning, the education platform (central server) needs to personalize teaching methods (arms) based on the characteristics of individual students (context). With the online learning software installed at local devices (client), it is desirable to personalize the learning experiences without allowing the platform to access students’ characteristics or scores.
|
| 33 |
+
|
| 34 |
+
In those examples, the reward of pulling the same arm at different clients follows different distributions dependent on the context as in contextual bandits (Auer, 2003; Langford and Zhang, 2008). We note that conventional contextual bandits is defined with respect to a single player, where the time-varying context can be interpreted as different incoming user profiles. In contrast, we consider a multi-client model, where each client is associated with a fixed user profile. The variation of contexts is captured over clients as opposed to over time. Although the set of clients remains fixed through the learning process, the reward of pulling the same arm still varies across clients. Such a model naturally takes data heterogeneity into consideration. Besides, we adopt a linear reward model, which has been widely studied in contextual bandits (Li et al., 2010; Agrawal and Goyal, 2013b).
|
| 35 |
+
|
| 36 |
+
Main contributions. Our main contributions are summarized as follows.
|
| 37 |
+
|
| 38 |
+
First, we propose a new federated linear contextual bandits model that takes the diverse user preferences and data heterogeneity into consideration. Such a model naturally bridges local stochastic bandits with linear contextual bandits, and is well poised to capture the tradeoffs between communication efficiency and learning performances in the federated bandits setting.
|
| 39 |
+
|
| 40 |
+
Second, we design a novel algorithm named Fed-PE and further develop its variants to solve the federated linear contextual bandits problem. Under Fed-PE, clients only upload their local estimates of the global parameters without sharing their local feature vectors or raw observations. It not only keeps the personal information private, but also reduces the upload cost. We explicitly show that Fed-PE and its variants achieve near-optimal regret performances for both disjoint and shared parameter cases with logarithmic communication costs.
|
| 41 |
+
|
| 42 |
+
Third, we generalize the G-optimal design from the single-player setting (Lattimore and Szepesvári, 2020) to the multi-client setting. We develop a block coordinate ascent algorithm to solve the generalized G-optimal design efficiently with convergence guarantees. Such a multi-client G-optimal design plays a vital role in Fed-PE, and may find broad applications in related multi-agent setups.
|
| 43 |
+
|
| 44 |
+
Finally, we introduce a novel concept called collinearly-dependent policy and show that the celebrated LinUCB type of policies (Li et al., 2010), Thompson sampling based policies with Gaussian priors (Agrawal and Goyal, 2013b), and least squared estimation based policies, such as Fed-PE, are all in this category. By utilizing the property of collinearly-dependent policies, we are able to characterize a tight minimax regret lower bound in the disjoint parameter setting. We believe that this concept may be of independent interest for the study of bandits with linear rewards.
|
| 45 |
+
|
| 46 |
+
Table 1: Performance comparison
|
| 47 |
+
|
| 48 |
+
<table><tr><td>Model</td><td>Algorithm</td><td>Regret</td><td>Communication cost</td></tr><tr><td>Linear</td><td>DELB</td><td>O(dMTlog(T))</td><td>O((Md +dlog log d) log T)</td></tr><tr><td>Linear contextual (shared parameter)</td><td>FedUCB1 Fed-PE(this work) Lower bound</td><td>O(√dMTlog T) O(√dMTlog(KMT)) Ω(√dMT)</td><td>O(Md² log T) O(M(d² + dK) log T) N/A</td></tr><tr><td>Linear contextual (disjoint parameter)</td><td>Centralized² Fed-PE (this work) Lower bound (this work)</td><td>O(√dK MTlog(K MT)) O(√dKMTlog(KMT)) Ω(√dKMT)</td><td>O(Md²KT) O(Md² K log T) N/A</td></tr></table>
|
| 49 |
+
|
| 50 |
+
$M$ : number of clients; $K$ : number of arms; $_ T$ : time horizon; $^ d$ : ambient dimension of the feature vectors.
|
| 51 |
+
|
| 52 |
+
Notations. Throughout this paper, we use $\| { \boldsymbol { x } } \| _ { V }$ to denote $\sqrt { x \mathsf { r } V x }$ . The range of a matrix $A$ , denoted by range $( A )$ , is the subspace spanned by the column vectors of $A$ . We use $A ^ { \dagger }$ and $\operatorname { D e t } ( A )$ to denote the pseudo-inverse and pseudo-determinant of square matrix $A$ , respectively. The specific definitions can be found in Appendix B of the supplementary material.
|
| 53 |
+
|
| 54 |
+
# 2 Related Works
|
| 55 |
+
|
| 56 |
+
Collaborative and distributed bandits. Our model is closely related to the collaborative and distributed bandits when action collision is not considered. Landgren et al. (2016, 2018) and Martínez-Rubio et al. (2019) study distributed bandits in which multiple agents face the same MAB instance, and the agents collaboratively share their estimates over a fixed communication graph in order to design consensus-based distributed estimation algorithms to estimate the mean of rewards at each arm. Szorenyi et al. (2013) considers a similar setup where in each round an agent is able to communicate with a few random peers. Korda et al. (2016) considers the case where clients in different unknown clusters face independent bandit problems, and every agent can communicate with only one other agent per round. The communication and coordination among the clients in those works are fundamentally different from our work.
|
| 57 |
+
|
| 58 |
+
Wang et al. (2020) investigates communication-efficient distributed linear bandits, where the agents can communicate with a server by sending and receiving packets. It proposes two algorithms, namely, DELB and DisLinUCB, for fixed and time-varying action sets, respectively. The fixed action set setting is similar to our setup, except that it assumes that all agents face the same bandits model, which does not take data heterogeneity into consideration.
|
| 59 |
+
|
| 60 |
+
Federated bandits. A few recent works have touched upon the concept of federated bandits. With heterogeneous reward distributions at local clients, Shi and Shen (2021) and Shi et al. (2021) investigate efficient client-server communication and coordination protocols for federated MAB without and with personalization, respectively. Agarwal et al. (2020) studies regression-based contextual bandits as an example of the federated residual learning framework, where the reward of a client depends on both a global model and a local model. Li et al. (2020) and Zhu et al. (2021) focus on differential privacy based local data privacy protection in federated bandits. While the linear contextual bandit model considered in Dubey and Pentland (2020) is similar to this work, it focuses on federated differential privacy and proposes a LinUCB-based FedUCB algorithm, which incurs a higher regret compared with our result for the shared parameter case. A regret and communication cost comparison between Fed-PE and other baseline algorithms is provided in Table 1.
|
| 61 |
+
|
| 62 |
+
# 3 Problem Formulation
|
| 63 |
+
|
| 64 |
+
Clients and local bandits model. We consider a federated linear contextual bandits setting where there are $M$ clients pulling the same set of $K$ items (arms) denoted as $[ K ] : = \{ 1 , 2 , \dots , \bar { K } \}$ . At each time $t$ , each client $i \in [ M ]$ pulls an arm $a _ { i , t } \in [ K ]$ based on locally available information. The incurred reward $y _ { i , t }$ is given by $y _ { i , t } = r _ { i , a _ { i , t } } + \eta _ { i , t }$ , where $\eta _ { i , t }$ is a random noise, and $r _ { i , a _ { i , t } }$ is the unknown expected reward by pulling arm $a _ { i , t }$ . We note that without additional assumptions or interaction among the clients, each local model is a standard single-player stochastic MAB, where classic algorithms such as UCB (Auer and Ortner, 2010) and Thompson sampling (Agrawal and Goyal, 2012) are known to achieve order-optimal regret.
|
| 65 |
+
|
| 66 |
+
Linear reward structure with global parameters. In order to capture the inherent correlation between rewards of pulling the same arm by different clients, we assume $r _ { i , a }$ has a linear structure, i.e., $r _ { i , a } = x _ { i , a } ^ { \mathsf { T } } \theta _ { a }$ , where $x _ { i , a } \in \mathbb { R } ^ { d }$ is the feature vector associated with client $i$ and arm $a$ , and $\theta _ { a } \in \mathbb { R } ^ { d }$ is a fixed but unknown parameter vector for each $a \in [ K ]$ . Here we use $x ^ { \intercal }$ to denote the transpose of vector $x$ . The same arm $a$ may have different reward distributions for different clients, due to potentially varying $x _ { i , a }$ across clients. Such a linear model naturally captures the heterogeneous data distributions at the clients, yet admits possible collaborations among clients due to the common parameters $\{ \theta _ { a } \} _ { a \in [ K ] }$ . When $\theta _ { a }$ varies for different arm $a$ , it is called the disjoint parameter case; when $\theta _ { a }$ is known to be a constant across the arms, it is the shared parameter case. We investigate both cases in Sections 4 and 5, respectively.
|
| 67 |
+
|
| 68 |
+
Communication model. We assume there exists a central server in the system, and similar to FL, the clients can communicate with the server periodically with zero latency. Specifically, the clients can send “local model updates” to the central server, which then aggregates and broadcasts the updated “global model” to the clients. (We will specify these components later.) Note that just as in FL, communication is one of the major bottlenecks and the algorithm has to be conscious about its usage. Similar to Wang et al. (2020), we define the communication cost of an algorithm as the number of scalars (integers or real numbers) communicated between server and clients. We also make the assumption that clients and server are fully synchronized (McMahan et al., 2017).
|
| 69 |
+
|
| 70 |
+
Data privacy concerns. Similar to Dubey and Pentland (2020), our contextual bandit problem involves two sets of information that are desirable to be kept private to client $i$ : the feature vectors $\{ x _ { i , a } \} _ { a \in [ K ] }$ and the observed rewards $\{ y _ { i , t } \} _ { t \in [ T ] }$ . Different from the differential privacy mechanism adopted in Dubey and Pentland (2020), in this work, we aim to communicate estimated global model parameters $\{ \theta _ { a } \} _ { a }$ between the clients and the server. This is consistent with the FL framework, where only model updates are communicated instead of the raw data.
|
| 71 |
+
|
| 72 |
+
Assumption 1 We make the following assumptions throughout the paper:
|
| 73 |
+
|
| 74 |
+
1) Bounded parameters: For any $i \in [ M ]$ , $a \in [ K ]$ , we have $\| \theta _ { a } \| _ { 2 } \leq s$ , $0 < \ell \leq \| x _ { i , a } \| _ { 2 } \leq L$ . 2) Independent 1-subgaussian noise: $\eta _ { i , t }$ is a $I$ -subgaussian noise parameter sampled independently at each time for each client with $\mathbb { E } [ \eta _ { i , t } ] = 0 ,$ , $\mathbb { E } [ \exp ( \lambda \eta _ { i , t } ) ] \leq \exp ( \frac { \lambda ^ { 2 } } { 2 } )$ for any $\lambda > 0$ .
|
| 75 |
+
|
| 76 |
+
Assumption 1.1 is a standard assumption in the bandit literature, which ensures that the maximum regret at any step is bounded. We emphasize that our work does not make any assumption on the knowledge of suboptimality gaps, nor do we assume the existence of a unique optimal arm at each client.
|
| 77 |
+
|
| 78 |
+
Our objective is to minimize the expected cumulative regret among all clients, defined as:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathbb { E } [ R ( T ) ] = \mathbb { E } \left[ \sum _ { i = 1 } ^ { M } \sum _ { t = 1 } ^ { T } \Big ( x _ { i , a _ { i } ^ { * } } ^ { \top } \theta _ { a _ { i } ^ { * } } - x _ { i , a _ { i , t } } ^ { \top } \theta _ { a _ { i , t } } \Big ) \right] ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $a _ { i } ^ { * } \in [ K ]$ is an optimal arm for client $i$ : $\forall b \ne a _ { i } ^ { * }$ , $x _ { i , a _ { i } ^ { * } } ^ { \mathsf { T } } \theta _ { a _ { i } ^ { * } } - x _ { i , b } ^ { \mathsf { T } } \theta _ { b } \geq 0$
|
| 85 |
+
|
| 86 |
+
# 4 Federated Linear Contextual Bandits: Disjoint Parameter Case
|
| 87 |
+
|
| 88 |
+
# 4.1 Challenges
|
| 89 |
+
|
| 90 |
+
Solving the federated linear contextual bandits model faces several new challenges. The first challenge is due to the constraint that only locally estimated parameters $\{ \theta _ { a } \} _ { a \in [ K ] }$ are uploaded to the central server. While this is not an issue for stochastic MAB where the $\{ \theta _ { a } \} _ { a \in [ K ] }$ are scalars (Shi and Shen, 2021; Shi et al., 2021), this brings significant challenges for the aggregation of the local estimates into a “global model” in our setup. This is because under the linear reward structure, the locally received rewards $\{ y _ { i , t } \} _ { t \in [ T ] }$ only contain the projection of $\theta _ { a }$ along the direction of $x _ { i , a }$ , while the portion of information lying outside range $( x _ { i , a } )$ is not captured in $\{ y _ { i , t } \} _ { t \in [ T ] }$ . Thus, by utilizing $\{ y _ { i , t } \} _ { t \in [ T ] }$ , the locally estimated $\theta _ { a }$ , denoted as $\widehat { \theta } _ { i , a }$ , cannot provide any information of $\theta _ { a }$ beyond $\mathrm { r a n g e } ( x _ { i , a } )$ . Since $\{ x _ { i , a } \} _ { i \in [ M ] }$ are different for the same arm $a$ , the locally estimated $\{ \hat { \theta } _ { i , a } \} _ { i \in [ M ] }$ are essentially lying in different subspaces. The central server thus needs to take such geometric structure into account when aggregating $\{ \hat { \theta } _ { i , a } \}$ to construct the global estimate of $\theta _ { a }$ .
|
| 91 |
+
|
| 92 |
+
The geometric structure of the local rewards also brings another challenge for the coordination of actions of local clients. Intuitively, in order to help client $i$ accurately estimate the expected reward by pulling arm $a$ , it suffices to obtain an accurate projection of $\theta _ { a }$ on range $( x _ { i , a } )$ ; any part of $\theta _ { a }$ lying outside this subspace is irrelevant. Therefore, if two clients $i$ and $j$ have $x _ { i , a }$ and $x _ { j , a }$ orthogonal to each other, exchanging the local estimates $\widehat { \theta } _ { i , a }$ and $\widehat { \theta } _ { j , a }$ does not help the other client improve her own local estimation. On the other hand, if $x _ { i , a }$ and $x _ { j , a }$ are completely aligned with each other, $\widehat { \theta } _ { i , a }$ and $\widehat { \theta } _ { j , a }$ can be aggregated directly to improve the local estimation accuracy of both. With $M$ possible subspaces spanned by $\{ x _ { i , a } \} _ { i }$ , it is highly likely that different clients receive different amounts of relevant information (i.e., information lying in range $( x _ { i , a } ) )$ ) through information exchange facilitated by the central server. Therefore, in order to reduce the overall regret, it is necessary to coordinate the actions of clients in a sophisticated fashion.
|
| 93 |
+
|
| 94 |
+
Third, since the exact knowledge of the local feature vectors $\{ x _ { i , a } \}$ are kept from the central server, the server may not have an accurate estimation of the uncertainty level of the local estimates at each client, or how much the coordination would help individual clients. This would make efficient and effective coordination even more challenging.
|
| 95 |
+
|
| 96 |
+
# 4.2 Federated Phased Elimination (Fed-PE) Algorithm
|
| 97 |
+
|
| 98 |
+
To address the aforementioned challenges, we propose the Federated Phased Elimination (Fed-PE) algorithm. The Fed-PE algorithm works in phases, where the length of phase $p$ is $f ^ { p } + K$ . It contains a client side subroutine (Algorithm 1) and a server side subroutine (Algorithm 2). Throughout the paper we use superscript $p$ to indicate phase $p$ barring explicit explanation. We use $\mathcal { A } _ { i } ^ { p } \subset [ K ]$ to denote the subset of active arms at client $i$ in phase $p$ , $\mathcal { A } ^ { p } : = \cup _ { i = 1 } ^ { M } \mathcal { A } _ { i } ^ { p }$ , $\mathcal { R } _ { a } ^ { p } : = \{ i : a \in \mathcal { A } _ { i } ^ { p } \}$ , and define $\mathcal { T } _ { i , a } ^ { p }$ as the time indices at which client $i$ pulls arm $a$ during the collaborative exploration step in phase $p$ . Then, the algorithm works as follows.
|
| 99 |
+
|
| 100 |
+
# Algorithm 1 Fed-PE : client $i$
|
| 101 |
+
|
| 102 |
+
Input: 1: Ini $T , M , K , \alpha , f ^ { p }$ each arm and receive reward ; ; Send to the server; $a \in [ K ]$ $y _ { i , a }$ $\begin{array} { r } { \hat { \theta } _ { i , a } ^ { 0 } \frac { y _ { i , a } x _ { i , a } } { \parallel x _ { i , a } \parallel ^ { 2 } } } \end{array}$ $\{ \hat { \theta } _ { i , a } ^ { 0 } \} _ { a }$ $\mathcal { A } _ { i } ^ { 0 } [ K ] ; p 1$ .
|
| 103 |
+
2: while not reaching the time horizon $T$ do
|
| 104 |
+
3: Receive $\{ ( \hat { \theta } _ { a } ^ { p } , V _ { a } ^ { p } ) \} _ { a \in \mathcal A ^ { p - 1 } }$ from the server. . Arm elimination
|
| 105 |
+
4: for $a \in A _ { i } ^ { p - 1 }$ do $\begin{array} { r } { \hat { r } _ { i , a } ^ { p } x _ { i , a } ^ { \top } \hat { \theta } _ { a } ^ { p } , \qquad u _ { i , a } ^ { p } \alpha \boldsymbol { x } _ { i , a } _ { V _ { a } ^ { p } } / \ell . } \end{array}$ (2)
|
| 106 |
+
5:
|
| 107 |
+
6: $\begin{array} { r } { \hat { a } _ { i } ^ { p } \gets \arg \operatorname* { m a x } _ { a \in \mathcal { A } _ { i } ^ { p - 1 } } \hat { r } _ { i , a } ^ { p } , \mathcal { A } _ { i } ^ { p } \gets \left\{ a \in \mathcal { A } _ { i } ^ { p - 1 } | \hat { r } _ { i , a } ^ { p } + u _ { i , a } ^ { p } \geq \hat { r } _ { i , \hat { a } _ { i } ^ { p } } ^ { p } - u _ { i , \hat { a } _ { i } ^ { p } } ^ { p } \right\} . } \end{array}$
|
| 108 |
+
7: Send $\mathcal { A } _ { i } ^ { p }$ to the central server. . Active arm set updating
|
| 109 |
+
8: Receive $f _ { i , a } ^ { p }$ for all $a \in \mathcal { A } _ { i } ^ { p }$ .
|
| 110 |
+
9: for $a \in \mathcal { A } _ { i } ^ { p }$ do . Collaborative exploration
|
| 111 |
+
10: Pull arm a for f pi,a times and receive rewards {yi,t}t∈T pi,a . $\hat { \theta } _ { i , a } ^ { p } ( \frac { 1 } { f _ { i , a } ^ { p } } \sum _ { t \in \mathcal { T } _ { i , a } ^ { p } } y _ { i , t } ) \frac { x _ { i , a } } { \Vert x _ { i , a } \Vert ^ { 2 } } .$ (3)
|
| 112 |
+
11: end for
|
| 113 |
+
12: Send $\{ \hat { \theta } _ { i , a } ^ { p } \} _ { a \in \mathcal { A } _ { i } ^ { p } }$ to the server; Pull $\hat { a } _ { i } ^ { p }$ until phase length equals $f ^ { p } + K$ .
|
| 114 |
+
13: $p \gets p + 1$ .
|
| 115 |
+
14: end while
|
| 116 |
+
|
| 117 |
+
At the initialization phase, each client $i$ pulls every arm $a \in [ K ]$ once and receives a reward $y _ { i , a }$ , based on which it obtains an estimate of the projection of $\theta _ { a }$ . These estimates are sent to the server to construct a preliminary global estimate of $\theta _ { a }$ for each $a$ . The global estimates $\{ \hat { \theta } _ { a } ^ { 1 } \} _ { a }$ and the potential matrices $\{ \bar { V } _ { a } ^ { 1 } \} _ { a }$ are then broadcast to all clients, after which phase $p = 1$ begins. Note that after receiving $\{ \hat { \theta } _ { i , a } ^ { 0 } \} _ { i , a }$ , the central server will keep a unit vector $\bar { e } _ { i , a } = \hat { \theta } _ { i , a } ^ { 0 } / \| \hat { \theta } _ { i , a } ^ { 0 } \|$ for all $i \in [ M ] , a \in [ K ]$ . Since $\hat { \theta } _ { i , a } ^ { 0 }$ is a scaled version of $x _ { i , a }$ , $\bar { e } _ { i , a }$ lies in range $( x _ { i , a } )$ , and will be utilized to coordinate the arm pulling process (coined as collaborative exploration), as elaborated in Section 4.3.
|
| 118 |
+
|
| 119 |
+
At the beginning of phase $p$ , after receiving the broadcast $\{ \hat { \theta } _ { a } ^ { p } \} _ { a }$ and $\{ V _ { a } ^ { p } \} _ { a }$ from the server, each client $i$ will utilize the $( \hat { \theta } _ { a } ^ { p } , V _ { a } ^ { p } )$ pair to estimate the expected rewards $r _ { i , a }$ and obtain the confidence level according to Eqn. (2) for each $a \in \mathcal { A } _ { i } ^ { p - 1 }$ . Based on the constructed confidence interval, client $i$ then eliminates some arms in $\mathcal { A } _ { i } ^ { p - 1 }$ and obtains $\mathcal { A } _ { i } ^ { p }$ .
|
| 120 |
+
|
| 121 |
+
Next, each client $i$ sends the newly constructed active arm set $\mathcal { A } _ { i } ^ { p }$ to the server. The server then decides $f _ { i , a } ^ { p }$ , the number of times client $i$ pulling arm $a$ during the collaborative exploration step in phase $p$ for each $i \in [ M ]$ and $a \in \mathcal { A } _ { i } ^ { p }$ . The specific mechanism to decide $f _ { i , a } ^ { p }$ is elaborated in Section 4.3.
|
| 122 |
+
|
| 123 |
+
After the collaborative exploration step, client $i$ performs least-square estimation (LSE) for each arm $a \in \mathcal { A } _ { i } ^ { p }$ based on local observations collected in the current phase according to Eqn. (3) and then sends it to the server for global aggregation. Note that although $\widehat { \theta } _ { i , a } ^ { p }$ lies in range $( x _ { i , a } )$ , the exact value of $x _ { i , a }$ is not revealed to the server, thus preserving the privacy to certain extent.
|
| 124 |
+
|
| 125 |
+
# Algorithm 2 Fed-PE : Central server
|
| 126 |
+
|
| 127 |
+
Input: $T , M , K , \alpha , f ^ { p }$
|
| 128 |
+
|
| 129 |
+
1: Initialization: Receive $\begin{array} { r l } { \{ \hat { \theta } _ { i , a } ^ { 0 } \} _ { i , a } ; \bar { e } _ { i , a } \gets } & { { } \frac { \hat { \theta } _ { i , a } ^ { 0 } } { \lVert \hat { \theta } _ { i , a } ^ { 0 } \rVert } } \end{array}$ for all $\begin{array} { r } { i \in [ M ] , a \in [ K ] ; V _ { a } ^ { 1 } \gets \left( \sum _ { i \in [ M ] } \frac { \hat { \theta } _ { i , a } ^ { 0 } ( \hat { \theta } _ { i , a } ^ { 0 } ) ^ { \top } } { \| \hat { \theta } _ { i , a } ^ { 0 } \| } \right) ^ { \dagger } } \end{array}$ , $\begin{array} { r } { \hat { \theta } _ { a } ^ { 1 } \gets V _ { a } ^ { 1 } \left( \sum _ { i \in [ M ] } \hat { \theta } _ { i , a } ^ { 0 } \right) } \end{array}$ for all $a \in [ K ]$ ; Broadcast $\{ \hat { \theta } _ { a } ^ { 1 } , V _ { a } ^ { 1 } \} _ { a \in [ K ] } ; p \gets 1$ .
|
| 130 |
+
|
| 131 |
+
2: while not reaching the time horizon $T$ do
|
| 132 |
+
|
| 133 |
+
3: Receive $\{ \mathcal { A } _ { i } ^ { p } \} _ { i \in [ M ] }$ ; Set $\mathcal { A } ^ { p } \cup _ { i = 1 } ^ { M } \mathcal { A } _ { i } ^ { p }$ ; Set $\mathcal { R } _ { a } ^ { p } \{ i : a \in \mathcal { A } _ { i } ^ { p } \}$ .
|
| 134 |
+
4: Solve the multi-client $\mathbf { G }$ -optimal design in (6), and obtain solution $\pi ^ { p } = \{ \pi _ { i , a } ^ { p } \} _ { i \in [ M ] , a \in \mathcal { A } _ { i } ^ { p } }$
|
| 135 |
+
|
| 136 |
+
5: For every client $_ { i }$ , send $\{ f _ { i , a } ^ { p } : = \lceil \pi _ { i , a } ^ { p } f ^ { p } \rceil \} _ { a \in \mathcal { A } _ { i } ^ { p } }$
|
| 137 |
+
|
| 138 |
+
6: Receive $\{ ( a , \hat { \theta } _ { i , a } ^ { p } ) \} _ { a \in \mathcal { A } _ { i } ^ { p } }$ from each client $i$
|
| 139 |
+
|
| 140 |
+
7: for $a \in \mathcal { A } ^ { p }$ do
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
V _ { a } ^ { p + 1 } ( \sum _ { i \in \mathcal { R } _ { a } ^ { p } } f _ { i , a } ^ { p } \frac { \hat { \theta } _ { i , a } ^ { p } ( \hat { \theta } _ { i , a } ^ { p } ) ^ { \top } } { \| \hat { \theta } _ { i , a } ^ { p } \| ^ { 2 } } ) ^ { \dagger } , \quad \hat { \theta } _ { a } ^ { p + 1 } V _ { a } ^ { p + 1 } ( \sum _ { i \in \mathcal { R } _ { a } ^ { p } } f _ { i , a } ^ { p } \hat { \theta } _ { i , a } ^ { p } ) .
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
8: end for
|
| 147 |
+
|
| 148 |
+
9: Broadcast $\{ ( \hat { \theta } _ { a } ^ { p + 1 } , V _ { a } ^ { p + 1 } ) \} _ { a \in \mathcal { A } ^ { p } }$ to all clients.
|
| 149 |
+
10: $p \gets p + 1$ .
|
| 150 |
+
|
| 151 |
+
11: end while
|
| 152 |
+
|
| 153 |
+
# 4.3 Multi-client G-optimal Design
|
| 154 |
+
|
| 155 |
+
In this subsection, we elaborate the core design of Fed-PE, the collaborative exploration step. There are three main design objectives we aim to achieve: 1) As explained in Section 4.1, one of the main challenges in our federated linear contextual bandits setting is that, each client may benefit differently from the information exchange through the central server. To minimize the overall regret, for each arm $a \in \mathcal { A } ^ { p }$ , it is desirable to ensure that after the global aggregation following the collaboration exploration in phase $p$ , the uncertainty in $\hat { r } _ { i , a } ^ { p + 1 }$ across the clients is balanced. 2) For each client $i$ , in order to eliminate the sub-optimal arms efficiently, it is also important to guarantee that the uncertainty in rˆp+1i,a across the arms in $\mathcal { A } _ { i } ^ { p }$ is balanced. 3) Finally, in order to ensure synchronized model updating, we aim to have each client perform the same number of arm pulling in each phase.
|
| 156 |
+
|
| 157 |
+
Motivated by those objectives, we propose a multi-client G-optimal design to coordinate the exploration of all clients. Specifically, we define $\pi _ { i } ^ { p } : \mathcal { A } _ { i } ^ { p } [ 0 , 1 ]$ as a distribution on the active arm set $\mathcal { A } _ { i } ^ { p }$ for each $i$ , and denote $\pi ^ { p } : = ( \pi _ { 1 } ^ { p } , \dots , \pi _ { M } ^ { p } )$ as a vector in $\mathbb { R } ^ { \sum _ { i \in [ M ] } | \mathcal { A } _ { i } ^ { p } | }$ . Let $e _ { i , a } : = x _ { i , a } / \Vert x _ { i , a } \Vert$ . We note that $e _ { i , a }$ equals to either $\bar { e } _ { i , a }$ or $- \bar { e } _ { i , a }$ . Then, we define a feasible set $\mathcal { C } ^ { p } \subset \mathbb { R } ^ { \sum _ { i \in [ M ] } | \mathcal { A } _ { i } ^ { p } | }$ as follows:
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\mathcal { C } ^ { p } = \left\{ \pi ^ { p } \left| \begin{array} { l } { \pi _ { i , a } ^ { p } \geq 0 , \forall i \in [ M ] , a \in \mathcal { A } _ { i } ^ { p } , } \\ { \sum _ { a \in \mathcal { A } _ { i } ^ { p } } \pi _ { i , a } ^ { p } = 1 , \forall i \in [ M ] , } \\ { \mathrm { r a n k } ( \{ \pi _ { i , a } ^ { p } e _ { i , a } \} _ { i \in \mathcal { R } _ { a } ^ { p } } ) = \mathrm { r a n k } ( \{ e _ { i , a } \} _ { i \in \mathcal { R } _ { a } ^ { p } } ) , \forall a \in \mathcal { A } ^ { p } } \end{array} \right. \right\} .
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
We can verify that ${ \mathcal { C } } ^ { p }$ is a convex set. The first two conditions ensure that $\{ \pi _ { i , a } ^ { p } \} _ { a }$ form a valid distribution for each client $i$ . We name the last condition as the “rank-preserving” condition. We note that the subspace spanned by the LHS of the rank-preserving condition is always a subset of that spanned by the RHS. Thus, once the rank is preserved, the subspaces spanned by the LHS and the RHS are the same. Thus, this condition ensures that every dimension of $\theta _ { a }$ lying in $\mathrm { r a n g e } \big ( \{ x _ { i , a } \} _ { i \in \mathcal { R } _ { a } ^ { p } } \big )$ will be explored under the collaborative exploration. Any violation of the “rank-preserving” condition will lead to information missing along the unexplored dimensions, which shall be prevented in order to reduce the uncertainty level regarding arm $a$ at every client $i \in \mathcal { R } _ { a } ^ { p }$ .
|
| 164 |
+
|
| 165 |
+
Then, we formulate the so called multi-client $\mathbf { G }$ -optimal design problem as follows:
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\mathrm { m i n i m i z e ~ } G ( \pi ) = \sum _ { i = 1 } ^ { M } \operatorname* { m a x } _ { a \in A _ { i } ^ { p } } e _ { i , a } ^ { \top } \Bigg ( \sum _ { j \in \mathcal { R } _ { a } ^ { p } } \pi _ { j , a } ^ { p } e _ { j , a } e _ { j , a } ^ { \top } \Bigg ) ^ { \dagger } e _ { i , a } \quad \mathrm { s . t . ~ } \pi ^ { p } \in \mathcal { C } ^ { p } .
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
We note that uncertainty l $\begin{array} { r } { e _ { i , a } ^ { \intercal } \big ( \sum _ { j \in \mathcal { R } _ { a } ^ { p } } \pi _ { j , a } ^ { p } e _ { j , a } e _ { j , a } ^ { \intercal } \big ) ^ { \dagger } e _ { i , a } } \end{array}$ can be interpreted as an approximate measure of thee arms are explored locally according to distributions $x _ { i , a }$ $\{ \pi _ { i } ^ { p } \} _ { i }$ . Thus, the objective function is an approximate measure of the total uncertainties in the least explored arms at each of the clients. By solving (6), the aforementioned three design objectives can be met. We point out that although the server does not known $e _ { i , a }$ , the objective function remains the same when $e _ { i , a }$ is replaced by $\bar { e } _ { i , a }$ . Thus, the server can simply use $\bar { e } _ { i , a }$ to solve (6).
|
| 172 |
+
|
| 173 |
+
After solving (6) and obtaining $\{ \pi _ { i , a } ^ { p } \}$ , the server would set $\{ f _ { i , a } ^ { p } : = \lceil \pi _ { i , a } ^ { p } f ^ { p } \rceil \} _ { a \in \mathcal { A } _ { i } ^ { p } }$ and send it to client $i$ . Note that after taking the ceiling function, $\textstyle \sum _ { a \in A _ { i } ^ { p } } f _ { i , a } ^ { p }$ may be greater than $f ^ { p }$ . To ensure synchronized updating, each client $i$ would keep pulling the estimated best arm $\hat { a } _ { i } ^ { p }$ until the phase length equals $f ^ { p } + K$ .
|
| 174 |
+
|
| 175 |
+
We note that the multi-client G-optimal design formulated in (6) is related to the G-optimal design for the single-player linear bandits problem discussed in Lattimore and Szepesvári (2020), and the DELB algorithm for the distributed linear bandits in Wang et al. (2020). However, for such cases, the player(s) faces a single bandit problem, thus the objective is to simply obtain a distribution over a so-called core set of arms in order to minimize the maximum uncertainty across the arms. In contrast, due to the multiple clients involved in the federated bandits setting and the heterogeneous reward distributions, we are essentially solving M coupled G-design problems, one associated with each client. Such coupling effect fundamentally changes the nature of the problem, leading to very different characterization of the problem and numerical approaches.
|
| 176 |
+
|
| 177 |
+
In Appendix C.1 of the supplementary material, we analyze an equivalent problem of the multi-client G-optimal design. We note that such equivalence essentially generalizes the equivalence between the original G-optimal design and D-optimal design in Lattimore and Szepesvári (2020) to the coupled design case. While the original G-design problem can be approximately solved through the FrankWolfe algorithm under an appropriate initialization (Todd, 2016), solving the multi-client G-optimal design problem is numerically non-trivial. In Appendix C.2, we propose a block coordinate ascent algorithm to solve the equivalent problem of (6) efficiently with guaranteed convergence.
|
| 178 |
+
|
| 179 |
+
# 4.4 Theoretical Analysis of Fed-PE
|
| 180 |
+
|
| 181 |
+
We now characterize the performance of the Fed-PE algorithm.
|
| 182 |
+
|
| 183 |
+
Theorem 1 Under Assumption $I$ , with probability at least $1 - \delta$ , the cumulative regret under Fed-PE scales in $O \left( \sqrt { d K M T ( \log ( K ( \log T ) / \delta ) + \operatorname* { m i n } \{ d , \log M \} ) } \right)$ and the communication cost scales in $O ( M d ^ { 2 } K \log T )$ .
|
| 184 |
+
|
| 185 |
+
The complete version of Theorem 1 and its proof can be found in Appendix $\mathbf { D }$ in the supplementary material. For the communication cost, at each phase $p$ , client $i$ uploads at most $K$ local estimates with dimension $d$ and downloads at most $K$ global estimates and potential matrices with dimension $d$ and $d ^ { 2 }$ , respectively. Thus, the upload cost is $O ( M d K \log T )$ and the download cost is $O ( M d ^ { 2 } K \log T )$ .
|
| 186 |
+
|
| 187 |
+
Remark 1 When we set $\delta = { \cal O } ( \sqrt { { d K } / { M T } } )$ , the overall regret scales in $O ( { \sqrt { d K M T \log ( M K T ) } } )$ , and the per-client regret scales in $O ( \sqrt { d K T \log ( M K T ) / M } )$ . While the minimax lower bound for standard stochastic MAB scales in $\Omega ( \sqrt { K T } )$ , the collaborative learning induced by Fed-PE leads to $\sqrt { d / M }$ -fold reduction of the per-client regret. We also note that for single-player linear√ contextual bandits with disjoint parameters, the best known upper bound scales in $\tilde { O } ( \sqrt { d K M T } )$ (Dimakopoulou et al., 2017) over MT arm pulls, which indicates that the regret of Fed-PE is close to the state-of-the-art centralized algorithms at a communication cost in ${ \cal O } ( \log T )$ .
|
| 188 |
+
|
| 189 |
+
# 4.5 Enhanced Fed-PE
|
| 190 |
+
|
| 191 |
+
The original Fed-PE algorithm requires exponentially increasing $f ^ { p }$ in order to achieve the regret upper bound in Theorem 1. This is because in each phase $p$ , we only utilize the rewards collected in phase $p - 1$ to estimate $\theta _ { a }$ . While this simplifies the analysis, the measurements collected in earlier phases cannot be utilized. In order to overcome this limitation, we propose an Enhanced Fed-PE algorithm by leveraging all historical information. Enhanced Fed-PE achieves different tradeoffs between communication cost and regret performance by adjusting $f ^ { p }$ . The detailed description and analysis of Enhanced Fed-PE for different selection of $f ^ { p }$ can be found in Appendix E in the supplementary material.
|
| 192 |
+
|
| 193 |
+
# 4.6 Lower Bound
|
| 194 |
+
|
| 195 |
+
To derive a tight lower bound, we focus on a set of representative policies defined as follows.
|
| 196 |
+
|
| 197 |
+
Definition 1 (Collinearly-dependent policy) Two clients $i$ and $j$ are called collinear if there exist an arm $a \in [ K ]$ and a subset $s \subset [ M ]$ such that the following conditions are satisfied: 1) $x _ { i , a }$ ∈/ $\operatorname { s p a n } ( \{ x _ { m , a } | m \in S \} )$ ); and 2) $x _ { i , a } \in \operatorname { s p a n } ( \{ x _ { m , a } | m \in \mathcal { S } \} \cup \{ x _ { j , a } \} )$ . For any two clients $i$ and $j$ that are not collinear, if the action of client $i$ is independent of the action of $j$ under a policy $\pi$ , then, the policy is called a collinearly-dependent policy.
|
| 198 |
+
|
| 199 |
+
We note that the definition of collinearly-dependent policies is actually quite natural. Intuitively, for two clients that are not collinear, their local observations on any arm $a$ cannot be utilized to improve each other’s knowledge of their own local models. As a result, they should not affect each other’s decision-making process. As shown in the supplementary material, we can verify that the most celebrated ridge regression based LinUCB type of policies (Li et al., 2010), Thompson sampling based polices with Gaussian priors (Agrawal and Goyal, 2013b), and least-square estimation based policies, including Fed-PE, all fall in this category.
|
| 200 |
+
|
| 201 |
+
Theorem 2 For any collinearly-dependent policy, there exists an instance of the federated linear√ contextual bandits such that the regret is lower bounded as $R ( T ) = \Omega ( \sqrt { d K M T } )$ .
|
| 202 |
+
|
| 203 |
+
Remark 2 Theorem 2 essentially shows that, even if raw data transmission and instantaneous communication are allowed and other collinearly-dependent policies are adopted, we cannot improve the order of the regret summarized in Theorem 1 much, i.e., Fed-PE is order-optimal up to $\sqrt { \log ( K M T ) }$ .
|
| 204 |
+
|
| 205 |
+
The proof of Theorem 2 relies on the construction of a special instance of the federated linear contextual bandits where the clients can be divided into $d$ groups. Clients in each group face the same $K$ -armed stochastic bandits model locally, while clients from two distinct groups are not collinear. Analyzing the regret bound in each individual group, we can show that it is lower bounded by $\Omega ( \sqrt { K M T / d } )$ . Then, by utilizing the property of collinearly-dependent policies, we can show that the overall regret is lower bounded by $\Omega ( \sqrt { d K M T } )$ for this scenario. More discussions on the collinearly-dependent policies and the complete proof of Theorem 2 can be found in Appendix F in the supplementary material.
|
| 206 |
+
|
| 207 |
+
# 5 Federated Linear Contextual Bandits: Shared Parameter Case
|
| 208 |
+
|
| 209 |
+
The Fed-PE algorithm can be slightly modified for the shared parameter case where $\theta _ { a } = \theta , \forall a \in [ K ]$ . While the client side operation stays the same, the global aggregation step at the server side in (4) can be changed by letting the “potential matrix” $V ^ { p }$ be $( \sum _ { a \in [ K ] } ( V _ { a } ^ { p } ) ^ { \dagger } ) ^ { \dagger }$ , and the global estimator $\hat { \theta } ^ { p }$ be $\begin{array} { r } { V ^ { p } \left( \sum _ { i \in [ M ] } \sum _ { a \in \mathcal { A } _ { i } ^ { p - 1 } } f _ { i , a } ^ { p - 1 } \hat { \theta } _ { i , a } ^ { p - 1 } \right) } \end{array}$ . Below, we present the main result for this case and leave the detailed algorithm description and regret analysis in the supplementary material.
|
| 210 |
+
|
| 211 |
+
Theorem 3 Under Assumption $^ { l }$ , with probability at least $1 - \delta$ , the regret of the adapted Fed-PE for the shared parameter case is upper bounded by $O \left( \sqrt { d M T ( \log ( ( \log T ) / \delta ) + \operatorname* { m i n } \{ d , \log M K \} ) } \right)$ , and the communication cost scales in $O ( ( K d M + d ^ { 2 } M ) \log T )$ .
|
| 212 |
+
|
| 213 |
+
Remark 3 By setting $\delta \ = \ \ d { } O ( \sqrt { 1 / M T } )$ , we can show that the overall regret scales in $O ( { \sqrt { d M T \log ( M T K ) } } )$ . We note that this bound improves the regret bound for the no differential privacy guarantee case in Dubey and Pentland (2020) by a factor of $\sqrt { \log T }$ , although our settings are slightly different. By assuming all clients face the same linear bandits in this shared parameter setting, the regret in the federated setting over horizon $T$ must be worse than the linear√ bandits over horizon MT . Since the latter is lowered bounded by $\Omega ( \sqrt { d M T } )$ (Chu et al., 2011), the minimax regret for the shared parameter setting is bounded by $\Omega ( \sqrt { d M T } )$ as well. Thus, the modified Fed-PE is near-optimal for this case.
|
| 214 |
+
|
| 215 |
+
In terms of the communication cost, the uploading cost stays the same as in the disjoint parameter case, while the broadcast cost is reduced by a factor of $K$ , since only one potential matrix needs to be broadcast for the shared parameter case.
|
| 216 |
+
|
| 217 |
+
# 6 Experiments
|
| 218 |
+
|
| 219 |
+
Experiment results using both synthetic and real-world datasets are reported in this section to evaluate Fed-PE and the proposed enhancement. Additional experimental details and more experimental results can be found in the supplementary material. We consider four different algorithms, namely, Fed-PE, Enhanced Fed-PE, local UCB without communication, and a modified Fed-PE algorithm with full information exchange after collaborative exploration in each phase (coined as ‘Collaborative’ in Figure 1). For all experiments, we set $T = 2 ^ { 1 7 }$ , $f ^ { \bar { p } } = 2 ^ { p } , p \in \{ 1 , 2 , \ldots , 1 6 \}$ , and run 10 trials. For Fed-PE and its variants, we choose $\delta = 0 . 1$ . Note that other values of $\delta$ may further improve the regret. We evaluate the algorithms on both synthetic and MovieLens-100K datasets.
|
| 220 |
+
|
| 221 |
+
Synthetic Dataset: We first set $M = 1 0 0 , K = 1 0$ , and $d = 3$ . We set $\{ \theta _ { a } \}$ as the canonical basis of $\mathbb { R } ^ { 3 }$ . The feature vectors $x _ { i , a }$ are generated randomly ensuring that the suboptimality reward gaps lie in [0.2, 0.4] and $\ell = 0 . 5 , L = 1$ . The per-client cumulative regret as a function of $T$ is plotted in Figure 1(a). We see that Enhanced Fed-PE outperforms Fed-PE while being slightly worse than ‘Collaborative’. This indicates that keeping feature vectors $x _ { i , a }$ private to clients does not impact the learning performance significantly. All Fed-PE related algorithms outperform local UCB when $T$ is sufficiently large, demonstrating the effectiveness of communication in improving learning locally. We also set $K = 1 0$ , $d = 4$ , and vary the number of clients $M$ . The performance of Enhanced Fed-PE is plotted in Figure 1(b). We note that the per-client regret monotonically decreases as $M$ increases, corroborating the theoretical results.
|
| 222 |
+
|
| 223 |
+
Movielens Dataset: We then use the MovieLens-100K dataset (Harper and Konstan, 2015) to evaluate the performances. Motivated by Bogunovic et al. (2021), we first complete the rating matrix $R = [ r _ { i , a } ] \in \dot { \mathbb { R } } ^ { 9 4 3 \times 1 6 8 2 }$ through collaborative filtering (Morabia, 2019), and then use non-negative matrix factorization with 3 latent factors to get $R = W H$ , where $W \in \mathbb { R } ^ { 9 4 3 \times 3 }$ , $H \in \mathbb { R } ^ { 3 \times 1 6 8 2 }$ . Let $x _ { i , a }$ be the ith row vector of $W$ . We apply the $k$ -means algorithm to the row vectors of $H$ to produce $K = 3 0$ groups (arms), and let $\theta _ { a }$ be the center of the $a$ -th group. Finally, we randomly choose $M = 1 0 0$ users’ feature vectors. We observe that $0 . 4 \leq \| x _ { i , a } \| ^ { 2 } \leq 0 . 8$ , and the suboptimality gaps lie in [0.01, 0.8]. The regret performances of the algorithms are plotted in Figure 1(c). The curves show similar characteristics as in Figure 1(a). These results demonstrate the effectiveness of collaborative learning in the federated bandits setting.
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 1: Pseudo-regret over $T$ . Shaded area indicates the standard deviation.
|
| 227 |
+
|
| 228 |
+
# 7 Discussion and Conclusion
|
| 229 |
+
|
| 230 |
+
In this work, we have considered a novel federated linear contextual bandits model, which naturally connects local stochastic MAB models with linear contextual bandits through common global parameters. While each client can only observe a projection of each global parameter in its own subspace, Fed-PE utilizes the geometric structure of the local estimates to reconstruct the global parameters and guide efficient collaborative exploration. Theoretical analysis indicates that Fed-PE achieves near-optimal regret for both disjoint and shared parameter cases with a communication cost in the order of ${ \cal O } ( \log T )$ .
|
| 231 |
+
|
| 232 |
+
An interesting open question is whether we can further reduce the communication cost without downgrading the regret performance. In particular, we note the the original single-player G-optimal design allows for a sparse solution whose support is of size $d ( d \mathrm { + } 1 ) / 2$ . Our numerical results indicate that such sparse solutions exist for the multi-client G-optimal design as well. Utilizing the sparsity of the solution may reduce the communication cost significantly. Theoretical characterization of the existence of such sparse solutions is our next step.
|
| 233 |
+
|
| 234 |
+
Another possible direction to explore is to incorporate the differential privacy mechanism to the Fed-PE framework. Although local feature vectors $\{ x _ { i , a } \}$ are kept private under Fed-PE, local estimate $\widehat { \theta } _ { i , a }$ lies in range $( x _ { i , a } )$ , thus revealing the direction of $x _ { i , a }$ to the central server. We aim to add certain perturbation on $\widehat { \theta } _ { i , a }$ in order to obfuscate the direction information without significantly affecting the regret performance.
|
| 235 |
+
|
| 236 |
+
# Acknowledgments and Disclosure of Funding
|
| 237 |
+
|
| 238 |
+
The work of RH and JY was supported by the US National Science Foundation under Grants CNS-1956276, CNS-2003131, CNS-2114542, and ECCS-2030026. CS acknowledges the funding support by the US National Science Foundation under Grants ECCS-2029978, ECCS-2033671, and CNS-2002902. WW’s work was done before he joined Facebook.
|
| 239 |
+
|
| 240 |
+
# References
|
| 241 |
+
|
| 242 |
+
Agarwal, A., Langford, J., and Wei, C.-Y. (2020). Federated residual learning. arXiv 2003.12880.
|
| 243 |
+
|
| 244 |
+
Agrawal, S. and Goyal, N. (2012). Analysis of Thompson sampling for the multi-armed bandit problem. In Conference on Learning Theory, pages 39–1.
|
| 245 |
+
|
| 246 |
+
Agrawal, S. and Goyal, N. (2013a). Further optimal regret bounds for Thompson sampling. In Artificial Intelligence and Statistics, pages 99–107.
|
| 247 |
+
|
| 248 |
+
Agrawal, S. and Goyal, N. (2013b). Thompson sampling for contextual bandits with linear payoffs. In Proceedings of the 30th International Conference on International Conference on Machine Learning, pages 1220–1228.
|
| 249 |
+
|
| 250 |
+
Auer, P. (2003). Using confidence bounds for exploitation-exploration trade-offs. J. Mach. Learn. Res., 3:397–422.
|
| 251 |
+
|
| 252 |
+
Auer, P., Cesa-Bianchi, N., and Fischer, P. (2002). Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2-3):235–256.
|
| 253 |
+
|
| 254 |
+
Auer, P. and Ortner, R. (2010). UCB revisited: Improved regret bounds for the stochastic multi-armed bandit problem. Periodica Mathematica Hungarica, 61(1):55–65.
|
| 255 |
+
|
| 256 |
+
Bogunovic, I., Losalka, A., Krause, A., and Scarlett, J. (2021). Stochastic linear bandits robust to adversarial attacks. In International Conference on Artificial Intelligence and Statistics, pages 991–999. PMLR.
|
| 257 |
+
|
| 258 |
+
Bubeck, S. and Cesa-Bianchi, N. (2012). Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends® in Machine Learning, 5(1):1–122.
|
| 259 |
+
|
| 260 |
+
Chu, W., Li, L., Reyzin, L., and Schapire, R. (2011). Contextual bandits with linear payoff functions. In Gordon, G., Dunson, D., and Dudík, M., editors, Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pages 208–214, Fort Lauderdale, FL, USA. PMLR.
|
| 261 |
+
|
| 262 |
+
Dimakopoulou, M., Zhou, Z., Athey, S., and Imbens, G. (2017). Estimation considerations in contextual bandits. arXiv preprint arXiv:1711.07077.
|
| 263 |
+
|
| 264 |
+
Dubey, A. and Pentland, A. (2020). Differentially-private federated linear bandits. Advances in Neural Information Processing Systems, 33.
|
| 265 |
+
|
| 266 |
+
Harper, F. M. and Konstan, J. A. (2015). The MovieLens Datasets: History and context. ACM Trans. Interact. Intell. Syst., 5(4).
|
| 267 |
+
|
| 268 |
+
Kairouz, P., McMahan, H. B., Avent, B., Bellet, A., Bennis, M., Bhagoji, A. N., Bonawitz, K., Charles, Z., Cormode, G., Cummings, R., D’Oliveira, R. G. L., Eichner, H., Rouayheb, S. E., Evans, D., Gardner, J., Garrett, Z., Gascón, A., Ghazi, B., Gibbons, P. B., Gruteser, M., Harchaoui, Z., He, C., He, L., Huo, Z., Hutchinson, B., Hsu, J., Jaggi, M., Javidi, T., Joshi, G., Khodak, M., Konecný, J., Korolova, A., Koushanfar, F., Koyejo, S., Lepoint, T., Liu, Y., Mittal, P., Mohri, M., ˇ Nock, R., Özgür, A., Pagh, R., Raykova, M., Qi, H., Ramage, D., Raskar, R., Song, D., Song, W., Stich, S. U., Sun, Z., Suresh, A. T., Tramèr, F., Vepakomma, P., Wang, J., Xiong, L., Xu, Z., Yang, Q., Yu, F. X., Yu, H., and Zhao, S. (2021). Advances and open problems in federated learning. Foundations and Trends® in Machine Learning, 14(1).
|
| 269 |
+
|
| 270 |
+
Korda, N., Szorenyi, B., and Li, S. (2016). Distributed clustering of linear bandits in peer to peer networks. In Balcan, M. F. and Weinberger, K. Q., editors, Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 1301–1309, New York, New York, USA. PMLR.
|
| 271 |
+
|
| 272 |
+
Lai, T. L. and Robbins, H. (1985). Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1):4–22.
|
| 273 |
+
|
| 274 |
+
Landgren, P., Srivastava, V., and Leonard, N. E. (2016). On distributed cooperative decision-making in multiarmed bandits. In 2016 European Control Conference (ECC), pages 243–248. IEEE.
|
| 275 |
+
|
| 276 |
+
Landgren, P., Srivastava, V., and Leonard, N. E. (2018). Social imitation in cooperative multiarmed bandits: partition-based algorithms with strictly local information. In 2018 IEEE Conference on Decision and Control (CDC), pages 5239–5244. IEEE.
|
| 277 |
+
|
| 278 |
+
Langford, J. and Zhang, T. (2008). The epoch-greedy algorithm for multi-armed bandits with side information. In Advances in Neural Information Processing Systems, pages 817–824.
|
| 279 |
+
|
| 280 |
+
Lattimore, T. and Szepesvári, C. (2020). Bandit Algorithms. Cambridge University Press.
|
| 281 |
+
|
| 282 |
+
Li, L., Chu, W., Langford, J., and Schapire, R. E. (2010). A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th International Conference on World Wide Web, pages 661–670.
|
| 283 |
+
|
| 284 |
+
Li, T., Song, L., and Fragouli, C. (2020). Federated recommendation system via differential privacy. In IEEE International Symposium on Information Theory (ISIT), pages 2592–2597.
|
| 285 |
+
|
| 286 |
+
Martínez-Rubio, D., Kanade, V., and Rebeschini, P. (2019). Decentralized cooperative stochastic bandits. In Advances in Neural Information Processing Systems, pages 4529–4540.
|
| 287 |
+
|
| 288 |
+
McMahan, B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. (2017). Communicationefficient learning of deep networks from decentralized data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), pages 1273–1282, Fort Lauderdale, FL, USA.
|
| 289 |
+
Morabia, K. (2019). Collaborative-filtering. https://github.com/kevalmorabia97/ Collaborative-Filtering.
|
| 290 |
+
Shi, C. and Shen, C. (2021). Federated multi-armed bandits. In Proceedings of the 35th AAAI Conference on Artificial Intelligence (AAAI).
|
| 291 |
+
Shi, C., Shen, C., and Yang, J. (2021). Federated multi-armed bandits with personalization. In Proceedings of the 24rd International Conference on Artificial Intelligence and Statistics (AISTATS).
|
| 292 |
+
Szorenyi, B., Busa-Fekete, R., Hegedus, I., Ormandi, R., Jelasity, M., and Kegl, B. (2013). Gossipbased distributed stochastic bandit algorithms. In Proceedings of the 30th International Conference on Machine Learning, pages 19–27.
|
| 293 |
+
Todd, M. J. (2016). Minimum-Volume Ellipsoids. Society for Industrial and Applied Mathematics, Philadelphia, PA.
|
| 294 |
+
Wang, Y., Hu, J., Chen, X., and Wang, L. (2020). Distributed bandit learning: Near-optimal regret with efficient communication. In International Conference on Learning Representations.
|
| 295 |
+
Zhu, Z., Zhu, J., Liu, J., and Liu, Y. (2021). Federated bandit: A gossiping approach. Proceedings of the ACM on Measurement and Analysis of Computing Systems, 5(1):1–29.
|
md/train/RtNpzLdHUAW/RtNpzLdHUAW.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STOCHASTIC SUBSET SELECTION FOR EFFICIENT TRAINING AND INFERENCE OF NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Current machine learning algorithms are designed to work with huge volumes of high dimensional data such as images. However, these algorithms are being increasingly deployed to resource constrained systems such as mobile devices and embedded systems. Even in cases where large computing infrastructure is available, the size of each data instance, as well as datasets, can provide a huge bottleneck in data transfer across communication channels. Also, there is a huge incentive both in energy and monetary terms in reducing both the computational and memory requirements of these algorithms. For non-parametric models that require to leverage the stored training data at the inference time, the increased cost in memory and computation could be even more problematic. In this work, we aim to reduce the volume of data these algorithms must process through an endto-end two-stage neural subset selection model, where the first stage selects a set of candidate points using a conditionally independent Bernoulli mask followed by an iterative coreset selection via a conditional Categorical distribution. The subset selection model is trained by meta-learning with a distribution of sets. We validate our method on set reconstruction and classification tasks with feature selection as well as the selection of representative samples from a given dataset, on which our method outperforms relevant baselines. We also show in our experiments that our method enhances scalability of non-parametric models such as Neural Processes.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The recent success of deep learning algorithms partly owes to the availability of huge volume of data (Deng et al., 2009; Krizhevsky et al., 2009; Liu et al., 2015), which enables training of very large deep neural networks. However, the high dimensionality of each data instance and the large size of datasets makes it difficult, especially for resource-limited devices (Chan et al., 2018; Li et al., 2019; Bhatia et al., 2019), to store and transfer the dataset, or perform on-device learning with the data. This problem becomes more problematic for non-parametric models such as Neural Processes (Hensel, 1973; Kim et al., 2019a) which require the training dataset to be stored for inference. Therefore, it is appealing to reduce the size of the dataset, both at the instance (Dovrat et al., 2019; Li et al., 2018b;b) and the dataset level, such that we selects only a small number of samples from the dataset, each of which contains only few selected input features (e.g. pixels). Then, we could use the selected subset for the reconstruction of the entire set (either each instance or the entire dataset) or for a prediction task, such as classification.
|
| 12 |
+
|
| 13 |
+
The simplest way to obtain such a subset is random sampling, but it is highly sub-optimal in that it treats all elements in the set equally. However, the pixels from each image and examples from each dataset will have varying degree of importance (Katharopoulos & Fleuret, 2018) to a target task, whether it is reconstruction or prediction, and thus random sampling will generally incur large loss of accuracy for the target task. There exist some work on coreset construction (Huggins et al., 2016; Campbell & Broderick, 2018; 2019) which proposed to construct a small subset with the most important samples for Bayesian posterior inference. However, these methods cannot be applied straightforwardly to deep learning with an arbitrary target task. How can we then sample elements from the given set to construct a subset, such that it suffers from minimal accuracy loss on any target task? To this end, we propose to learn a sampler that learns to sample the most important samples for a given task, by training it jointly with the target task and additionally meta-learn a sampler over a distribution of datasets for instance selection in the classification task.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Concept: Our Stochastic Subset Selection method is generic and can be applied to many type of sets. (a) Selecting a subset of features (pixels) out of an image. This reduces communication cost in data transfer between devices and allows faster training or inference on resource-constrained devices due to the reduced computational cost. (b) Selecting a subset of instances out of a dataset. This helps resource-constrained system to train faster, or to make non-parametric inference more scalable.
|
| 17 |
+
|
| 18 |
+
Specifically, we learn the sampling rate for individual samples in two stages. First we learn a Bernoulli sampling rate for individual sample to efficiently screen out less important elements. Then, to select the most important elements out of this candidate set considering relative importance, we use a Categorical distribution to model the conditional distribution of sampling each element given a set of selected elements. After learning the sampling probability for each stage, we could perform stochastic selection of a given set, with linear time complexity. Our Stochastic Subset Selection (SSS) is a general framework to sample elements from a set, and it can be applied to both feature sampling and instance sampling. SSS can reduce the memory and computation cost required to process data while retaining performance on downstream tasks.
|
| 19 |
+
|
| 20 |
+
Our model can benefit from a wide range of practical applications. For example, when sending an image to an edge device with low computing power, instead of sending the entire image, we could send a subset of pixels with their coordinates, which will reduce both communication and inference cost. Similarly, edge devices may need to perform inference on a huge amount of data that could be represented as a set (e.g. video, point clouds) in real-time, and our feature selection could be used to speed up the inference. Moreover, our model could also help with on-device learning on personal data (e.g. photos), as it can select out examples to train the model at a reduced cost. Finally, it can help with the scalability of non-parametric models which requires storage of training examples, such as Neural Processes, to scale up to large-scale problems.
|
| 21 |
+
|
| 22 |
+
We validate our SSS model on multiple datasets for 1D function regression and 2D image reconstruction and classification for both feature selection and instance selection. The results show that our method is able to select samples with minimal decrease on the target task accuracy, largely outperforming random or an existing sampling method. Our contribution in this work is threefold:
|
| 23 |
+
|
| 24 |
+
• We propose a novel two-stage stochastic subset selection method that learns to sample a subset from a larger set with linear time complexity, with minimal loss of accuracy at the downstream task. We propose a framework that trains the subset selection model via meta-learning, such that it can generalize to unseen tasks. We validate the efficacy and generality of our model on various datasets for feature selection from an instance and instance selection from a dataset, on which it significantly outperforms relevant baselines.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Set encoding - Permutation invariant networks Recently, extensive research efforts have been made in the area of set representation learning with the goal of obtaining order-invariant (or equivariant) and size-invariant representations. Many propose simple methods to obtain set representations by applying non-linear transformations to each element before a pooling layer (e.g. average pooling or max pooling) (Ravanbakhsh et al., 2016; Qi et al., 2017b; Zaheer et al., 2017; Sannai et al., 2019). However, these models are known to have limited expressive power and sometimes not capable of capturing high moments of distributions. Yet approaches such as Stochastic Deep Network (De Bie et al., 2018) and Set Transformer (Lee et al., 2018) consider the pairwise (or higher order) interactions among set elements and hence can capture more complex statistics of the distributions . These methods often result in higher performance in classification/regression tasks; however, they have run time complexities of $O ( n ^ { \mathbf { \bar { 2 } } } )$ or higher.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 2: Overview. The subset $D _ { s }$ is sampled by a stochastic 2-stage subset selection process. Dark shaded boxes correspond to selected elements while lightly shaded boxes correspond to non-selected elements in the given set. Also, Ber and Cat correspond to the Bernoulli and Categorical distributions respectively. (a) Candidate(in blue) Selection. (b) Core Subset(in green) Selection using continuous relaxations of discrete distributions.
|
| 32 |
+
|
| 33 |
+
Subset sampling There exist some works which have been proposed to handle large sets. Dovrat et al. (2019) proposed to learn to sample a subset from a set by generating $k$ virtual points, then matching them back to a subset of the original set. However, such element generation and matching process is highly inefficient. Our method on the other hand only learns to select from the original elements and does not suffer from such overhead. Wang et al. (2018) proposed to distill the knowledge of a large dataset to a small number of artificial data instances. However, these artificial data instances are only for faster training and doesn’t capture the statistics of the original set. Moreover, the instances are generated artificially and can differ from the original set making the method less applicable to other tasks. Also several works (Qi et al., 2017a;c; Li et al., 2018b; Eldar et al., 1997; Moenning & Dodgson, 2003) propose farthest point sampling, which selects $k$ points from a set by ensuring that the selected samples are far from each other on a given metric space.
|
| 34 |
+
|
| 35 |
+
Image Compression Due to the huge demand for image and video transfer over the internet, a number of works have attempted to compress images with minimal distortion. These models (Toderici et al., 2017; Rippel & Bourdev, 2017; Mentzer et al., 2018; Li et al., 2018a) typically consist of a pair of encoder and decoder, where the encoder will transfer the image into a compact matrix to reduce the memory footprint and communication cost, while the decoder is used to reconstruct the image back. These methods, while achieving huge successes in the image compression problem, are less flexible than ours. Firstly, our model can be applied to any type of sets (and instances represented as sets), while the aforementioned models mainly work for images represented in tensor form. Furthermore, our method can be applied both at the instance and dataset level.
|
| 36 |
+
|
| 37 |
+
Representation learning Our instance-sampling model is also related to the Variational Auto Encoder (VAE) (Kingma & Welling, 2013). However, while VAE learns a compact representation of a data point, our model learns a compact representation of a set. Balın et al. (2019) learns a global feature selection model for reconstruction of the input data from selected features via unsupervised learning. Chen et al. (2018) learns instancewise feature selection with the goal of model interpretation by extracting subset of features most informative for a given sample. Our method also falls in this category.
|
| 38 |
+
|
| 39 |
+
Active Learning Active learning methods are aimed at selection of data points for labeling given a small labelled set. This domain is different from our method since active learning does not consider the label information but our method does utilize label information. Also, our motivation is quite different. We focus on efficiency in inference and training of non-parametric models by reducing the sizes of the inputs, be it pixels or instances and this greatly differs from the goal of active learning. Methods such as (Sener & Savarese, 2017; Coleman et al., 2019; Wei et al., 2015) all tackle the data selection problem in the active learning setting.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 3: Graphical Models: (a) Feature Selection for Reconstruction. (b) Feature Selection for Prediction Task. (c) Instance Selection model. (d) Instance Selection model for Classification
|
| 43 |
+
|
| 44 |
+
# 3 APPROACH
|
| 45 |
+
|
| 46 |
+
# 3.1 PRELIMINARIES
|
| 47 |
+
|
| 48 |
+
In this work, we consider data of the type $D = \{ d _ { 1 } , \ldots , d _ { n } \}$ where individual $d _ { i }$ ’s are possibly represented as input $x _ { i }$ and target $y _ { i }$ . $D$ is the complete set and we assume that within $D$ , there exists a subset $D _ { s } = \{ s _ { i } , \ldots , s _ { k } \} \subset D$ such that $k \ll n$ and that for an arbitrarily defined loss function $\ell ( . , D )$ that we are interested in optimizing over the full set $D$ , $D _ { s }$ can be used as a proxy for $D$ such that $\ell ( . , D ) \approx \ell ( . , D _ { s } )$ . In what follows, we present a method that learns the conditional distribution $p ( D _ { s } | D )$ of the subset $D _ { s }$ via a two stage selection procedure dubbed candidate selection and autoregressive subset selection. The overall objective is then to minimize the loss function with respect to the subset $D _ { s }$ , $\mathbb { E } _ { p ( D _ { s } | D ) } [ \ell ( . , D _ { s } ) ]$ . When the set $D$ itself follows a distribution of sets as in the meta-learning framework, then the objective becomes $\mathbb { E } _ { D } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ \ell ( . , D _ { s } ) ] ]$ . In essence, we seek to construct a subset $D _ { s }$ that is optimally representative of the full set $D$ w.r.t $\ell ( . )$ .
|
| 49 |
+
|
| 50 |
+
# 3.2 STOCHASTIC SUBSET SELECTION
|
| 51 |
+
|
| 52 |
+
In order to select $D _ { s }$ , we need to model the interactions among the elements of $D$ and construct $D _ { s }$ based on said interactions. However, when the cardinality $| D |$ of the set $D$ is large or it’s elements $d _ { i }$ ’s are high dimensional, modeling such pairwise interactions becomes computationally infeasible. As such, we first present the candidate selection procedure used to construct a smaller set, $D _ { c }$ , without considering inter-sample dependencies. This is then followed by the autoregressive subset selection procedure used to construct $D _ { s }$ from $D _ { c }$ by modeling inter-sample dependencies. The complete model is depicted in Figure 2.
|
| 53 |
+
|
| 54 |
+
# 3.3 CANDIDATE SELECTION
|
| 55 |
+
|
| 56 |
+
We model the task of candidate selection as a random Bernoulli process where the logits of the Bernoulli function are conditioned on the set representation of the full set $D$ and the individual elements $d _ { i } \in D$ . For a set $D$ with cardinality $n$ we define $Z : = \{ z _ { i } \} _ { i = 1 } ^ { n }$ such that $z _ { i } \in \{ 0 , 1 \}$ and $z _ { i } = 1$ implies that $d _ { i } \in D _ { c }$ and for each $d _ { i }$ , $z _ { i }$ is computed according to:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
p ( z _ { i } | d _ { i } , D ) = \mathtt { B e r } ( z _ { i } ; \rho ( d _ { i } , r ( D ) ) ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $r ( D )$ is a permutation-invariant function that compresses $D$ into a single vector set representation and $\rho ( d _ { i } , r ( D ) )$ computes the logits used to calculate the probability of $d _ { i }$ belonging to $D _ { c }$ . We implement both $r ( D )$ and $\rho ( d _ { i } , r ( D ) )$ as neural networks and specifically for $r ( D )$ , we use Deep Sets (Zaheer et al., 2017). Since Ber is non-differentiable, we use the continuous relaxations of the Bernoulli distribution introduced in (Maddison et al., 2016; Jang et al., 2016; Gal et al., 2017).
|
| 63 |
+
|
| 64 |
+
Specifically, to sample $z _ { i }$ , we execute the following computational routine:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
z _ { i } = \sigma \Big ( \frac { 1 } { \tau } \Big ( \log \frac { \pi _ { i } } { 1 - \pi _ { i } } + \log \frac { u } { 1 - u } \Big ) \Big ) , \quad \pi _ { i } = \rho ( d _ { i } , r ( D ) ) , \quad u \sim \mathrm { U n i f } ( 0 , 1 ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\sigma$ is the Sigmoid function, $\tau$ is the temperature for the continuous relaxation and $u$ is sampled from the uniform distribution. $\tau$ is set to 0.05 in all our experiments. Given that pair-wise interactions
|
| 71 |
+
|
| 72 |
+
<table><tr><td colspan="2">Algorithm1Fixed Size Subset Selection</td></tr><tr><td>Input OutputDg= {s1,S2,..., sk} (selected subset)</td><td>k(subset size),q(# elements selected at each iteration),D= {d1,d2,...,dn} (Full Set)</td></tr><tr><td colspan="2">1:procedure STOCHASTIC SUBSET SELECTION(k,q, D)</td></tr><tr><td>2: 3:</td><td>(π1,π2,.:.,πn) ←(p(di,r(D)),...,p(dn,r(D)))</td></tr><tr><td></td><td>Zi~Ber(πi) fori=1,...,n.</td></tr><tr><td>4: 5:</td><td>Dc←{di fori=1:nif zi} Candidate Selection</td></tr><tr><td>6:</td><td>Ds← for i=1,...,k/q do AutoRegressive Subset Selection</td></tr><tr><td>7:</td><td>Ds←DUAUTOSELECT(q,Ds,Dc) Select q elements</td></tr><tr><td>8:</td><td>return D s</td></tr><tr><td>9:</td><td>procedure AUTOSELECT(q,Dg,Dc)</td></tr><tr><td colspan="2">10: C={w1,w2,...,wm} ←Dc\Ds</td></tr><tr><td>11:</td><td>(p1,p2,...,Pm)←(f(w1,Dc,Ds),f(w2,Dc,Ds),...,f(wm,Dc,Ds))</td></tr><tr><td>12:</td><td>(p1,P2,...,Pm) ← (pi,p2,...,Pm)/∑j=1Pj</td></tr><tr><td>13: 14:</td><td>Q ← Select q elements from C with probability (pi,P2,..., pm)</td></tr><tr><td></td><td>return Q</td></tr></table>
|
| 73 |
+
|
| 74 |
+
between elements are not considered in this stage, learning $p ( z _ { i } | d _ { i } , D )$ ensures that highly activating samples are selected instead of a random subset of the original set.
|
| 75 |
+
|
| 76 |
+
# 3.4 AUTOREGRESSIVE SUBSET SELECTION
|
| 77 |
+
|
| 78 |
+
The candidate selection stage can introduce samples with redundant information in $D _ { c }$ since no effort was made to compare the informativity of the elements. To alleviate this issue, we must first model the interactions between the elements of $D _ { c }$ and construct $D _ { s }$ based on the relative importance of individual elements. To construct a representative subset $D _ { s }$ with $| D _ { s } | = k$ , $k$ iterative steps are required and at step $i$ the probability of an element in $D _ { c } \setminus D _ { s } ^ { ( i - 1 ) }$ belonging to $D _ { s }$ is computed according to:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
p ( s _ { i } = d | D _ { c } , D _ { s } ^ { ( i - 1 ) } ) = \frac { f ( d , D _ { c } , D _ { s } ^ { ( i - 1 ) } ) } { \sum _ { d ^ { \prime } \in D _ { c } \backslash D _ { s } ^ { ( i - 1 ) } } f ( d ^ { \prime } , D _ { c } , D _ { s } ^ { ( i - 1 ) } ) } \quad \forall d \in D _ { c } \setminus D _ { s } ^ { ( i - 1 ) } ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $D _ { s } ^ { ( i - 1 ) }$ is the constructed subset at iteration $i - 1$ and $f$ is a positive function. The key to avoiding samples with redundant information in $D _ { s } ^ { ( k ) }$ lies in the fact that for each element added to $D _ { s }$ , it’s selection is conditioned on both $D _ { c }$ and all elements in $D _ { s } ^ { ( i - 1 ) }$ . We further propose a method that samples $q$ elements from $\mathbf { C a t } ( p _ { 1 } , \ldots , p _ { m } )$ in a single pass for efficient training. Specifically, instead of sampling $q$ times from the categorical distribution, we can sample the selection mask for element $j$ from $\mathrm { B e r } ( q * p _ { j } )$ . In this routine, the probability of the element $j$ being selected is $q * p _ { j }$ which is very close to the original distribution. Algorithm 1 details the entire procedure. The inference complexity depends heavily on the choice of the function $f$ . If $f$ considers the pairwise interactions between all candidate elements and the selected elements, the inference complexity is $O ( n ) { + } O ( k ^ { 2 } d / q )$ where $n , d , k$ correspond to $| D |$ , $| D _ { c } |$ and $| D _ { s } |$ respectively. In our experiments, for the choice of the function $f$ , we utilize either a Set Transformer(Lee et al., 2018) or DeepSets(Zaheer et al., 2017) to model the pairwise interactions between the elements of a given set.
|
| 85 |
+
|
| 86 |
+
# 3.5 CONSTRAINING THE SIZE OF $D _ { c }$
|
| 87 |
+
|
| 88 |
+
For computational efficiency, we may desire to restrict the size of $D _ { c }$ to save computational cost when constructing $D _ { s }$ . We adopt the idea of Information Bottleneck and constrain the distribution of $Z$ for $D _ { c }$ . Specifically,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbb { E } _ { p ( D ) } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ \ell ( . , D _ { s } ) ] + \beta \mathbf { K } \mathbf { L } [ p ( Z | D ) | | r ( Z ) ] ]
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 4: Models’ performance on set reconstruction and classification task (lighter-color areas present the standard deviations). (a) 1D Function reconstruction. (b) CelebA (reconstruction). (c) CelebA (classification)
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 5: 1D Function Reconstruction.
|
| 99 |
+
|
| 100 |
+
where $r ( Z )$ is a sparse prior. In our experiments, we set the parameter of the Bernoulli spares prior $r ( Z )$ to either 0.1 or 0.01 for different levels of sparsity and $\beta$ is set to 1.0 or 0.001.
|
| 101 |
+
|
| 102 |
+
# 3.6 TASKS
|
| 103 |
+
|
| 104 |
+
We now present four tasks for which the described subset selection method is applied.
|
| 105 |
+
|
| 106 |
+
Set Reconstruction Given $D _ { s }$ and a network $p _ { \theta } ( Y | X , D _ { s } )$ parameterized by $\theta$ , the task is to reconstruct $D = ( X , Y )$ . The objective function for this task is given as:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r } { \mathbb { E } _ { p ( D ) } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ - \log p _ { \theta } ( Y | X , D _ { s } ) ] + \beta \mathbf { K L } [ p ( Z | D ) | | r ( Z ) ] ] } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Minimizing this objective ensures that we learn a compact subset $( D _ { s } )$ most representative of $D$ and $D _ { s }$ can then be used for other tasks. We implement $p _ { \theta } ( Y | X , D _ { s } )$ as an Attentive Neural Process (ANP) (Kim et al., 2019b). An ANP takes as input a context $D _ { s }$ in this case) and predicts a distribution of the elements in the original set $D$ . It mimics the behaviour of a Gaussian Process but with reduced inference complexity. The complete model is depicted in Figure 3a.Experimental results for this task can be found in Section 4.1.
|
| 113 |
+
|
| 114 |
+
Set Classification/Prediction We can also opt to train the network to predict a single target $y _ { D }$ for the set $D$ . For instance, the target could be the class of an image(classification) or the statistics of the set(regression problem). Here, $p _ { \theta } ( y _ { D } | D _ { s } )$ is a neural network that predicts the target $y _ { D }$ . A set in this task, may be the features from a single example like an image and experimental results can be found in Section 4.2.The model for this task is depicted in Figure 3b. The objective function for this task is given as:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathbb { E } _ { p ( D ) } [ \mathbb { E } _ { p ( D _ { s } | D ) } [ - \log p _ { \theta } ( y _ { D } | D _ { s } ) ] + \beta \mathbf { K L } [ p ( Z | D ) | | r ( Z ) ] ]
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Dataset Distillation: Instance Selection For this task, we are given a dataset $\begin{array} { r l } { \mathcal { D } } & { { } = } \end{array}$ $\{ D _ { 1 } , \ldots , D _ { n } \}$ where each $D _ { i }$ is a set of data points sampled from the entire dataset. Using CelebA as in illustrative example, some $D _ { i }$ may consist of $| D _ { i } |$ randomly sampled faces from the whole dataset. The goal is to construct $D _ { s }$ for each $D _ { i } \in \mathcal { D }$ . We describe a model capable of taking as input $D _ { i } \in \mathcal { D }$ to perform a task such as the reconstruction of all elements in the given dataset.
|
| 121 |
+
|
| 122 |
+
Table 1: CelebA Attributes Classification.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Model</td><td>#Pixels</td><td>Storage</td><td>mAUC</td></tr><tr><td>Full Image</td><td>All 38804</td><td>114KB</td><td>0.9157</td></tr><tr><td>RS</td><td>500</td><td>5KB</td><td>0.8471</td></tr><tr><td>SSS(rec)</td><td>500</td><td>5KB</td><td>0.8921</td></tr><tr><td>SSS(MC)</td><td>500</td><td>5*5KB</td><td>0.9132</td></tr><tr><td>SSS(ours)</td><td>500</td><td>5KB</td><td>0.9093</td></tr></table>
|
| 125 |
+
|
| 126 |
+
For a single dataset $D _ { i } \in \mathcal { D }$ , we apply the subset construction method already described to a $D _ { s }$ that can be used to reconstruct all the elements in $D _ { i }$ . In essence, $D _ { i }$ is distilled into a new dataset $D _ { s }$ with $k < | D _ { i } |$ elements. The task then is to reconstruct the entire set $D _ { i }$ back conditioned only on $D _ { s }$ . As a first step, we represent $D _ { s }$ as a unique representative vector $c$ for each element in the dataset akin to the statistics network used in the Neural Statistician (Edwards & Storkey, 2016) model. Specifically, to reconstruct an element $d _ { i } \in D _ { i }$ given $D _ { s }$ , $c$ is computed by applying a stochastic cross-attention
|
| 127 |
+
|
| 128 |
+
Table 2: . FID Score for varying Instance Selection
|
| 129 |
+
|
| 130 |
+
<table><tr><td>#Instances</td><td>2</td><td>5</td><td>10</td><td>15</td><td>20</td><td>30</td></tr><tr><td>FPS</td><td>6.50</td><td>4.51</td><td>3.07</td><td>2.75</td><td>2.71</td><td>2.29</td></tr><tr><td>Random</td><td>3.73</td><td>1.16</td><td>0.90</td><td>0.38</td><td>0.39</td><td>0.20</td></tr><tr><td>SSS(ours)</td><td>2.53</td><td>1.02</td><td>0.59</td><td>0.33</td><td>0.24</td><td>0.17</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Table 3: Accuracy on miniImagenet
|
| 133 |
+
|
| 134 |
+
<table><tr><td>#Instances</td><td>1</td><td>2</td><td>5</td><td>10</td></tr><tr><td>FPS</td><td>0.432</td><td>0.501</td><td>0.598</td><td>0.636</td></tr><tr><td>Random</td><td>0.444</td><td>0.525</td><td>0.618</td><td>0.663</td></tr><tr><td>SSS(ours)</td><td>0.475</td><td>0.545</td><td>0.625</td><td>0.664</td></tr></table>
|
| 135 |
+
|
| 136 |
+
mechanism on $D _ { s }$ where the stochasticity is supplied by a query $\alpha$ which is computed using $d _ { i }$ . To obtain varying styles in the generated images, we additionally learn a latent variable $w$ used to perturb $c$ and both are combined to obtain a new element $x$ . The graphical model for this process is depicted in Figure 3c. Additionally, to ensure that $c$ is properly learnt, we add an informativity loss by reconstructing $c$ from the generated samples from the given dataset. The objective for the model depicted in Figure 3c for a single dataset $D$ is :
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r } { \mathcal { L } ( \theta , \phi , \psi ) = \displaystyle \sum _ { d _ { i } \in D } \big [ \mathbb { E } _ { q _ { \phi } ( w _ { i } \mid d _ { i } ) } \big [ p _ { \theta } ( d _ { i } \vert w _ { i } , c _ { i } ) \big ] - \mathbf { K L } [ q _ { \phi } ( w _ { i } \vert d _ { i } ) \vert \vert p _ { \psi } ( w ) \big ] } \\ { - \mathbf { K L } \big [ q _ { \phi } ( \alpha _ { i } \vert d _ { i } ) \vert \vert p _ { \psi } ( \alpha ) \big ] - \mathbf { K L } \big [ q _ { \phi } ( c _ { i } \vert D _ { s } , \alpha _ { i } ) \vert \vert p _ { \phi } ( c ) \big ] \big ] } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $p _ { \psi } ( \cdot )$ are priors on their respective latent variables and $q _ { \phi } ( \cdot )$ ’s are implemented with neural networks. All priors are chosen to be Gaussian with zero mean and unit variance. This objective is combined with the informativity loss on all samples in $D _ { i }$ . It is important to note that $c$ is computed using only $D _ { i }$ for every element in $D$ . In addition to Equation 7 and the informativity loss, the model is optimized together with the subset selection model already described. When the model is fully optimized, it is applied to the instance selection task on the given dataset. In summary, the purpose of the generative model introduced is to train the subset selection module for the instance selection task. Experimetal results for this task can be found in Section 4.3.
|
| 143 |
+
|
| 144 |
+
Dataset Distillation: Classification Finally in the dataset distillation task, we consider the problem of selecting prototypes to be used for few-shot classification. Here, we adopt Prototypical Networks (Snell et al., 2017) and apply the subset selection model to the task of selecting representative prototypes from each class to be used for classifying new instances. By learning to select the prototypes, we can remove outliers that would otherwise change the class prediction boundaries in the classification task. The complete graphical model for this task is given in Figure 3d where again $D _ { s }$ corresponds to the selected prototypes and $x _ { * }$ and $y _ { * }$ correspond to query and class label respectively. Experimental results for this task can be found in Section 4.3.
|
| 145 |
+
|
| 146 |
+
# 4 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
In this section, we present our experimental results. Model architectures and training hyper parameters are specified in the Appendix C.
|
| 149 |
+
|
| 150 |
+
# 4.1 FEATURE SELECTION EXPERIMENTS
|
| 151 |
+
|
| 152 |
+
Function Reconstruction - Approximation Our first experiment is on 1D function reconstruction. Suppose that we have a function ${ \bar { f } } : [ a , b ] \to \mathbb { R }$ . We first construct a set of data points of that function: $D = \{ ( x _ { 1 } , y _ { 1 } = f ( x _ { 1 } ) ) , ( x _ { 2 } , y _ { 2 } = f ( x _ { 2 } ) ) , \ldots , ( x _ { n } , y _ { n } = f ( x _ { n } ) ) \}$ where $( x _ { 1 } , x _ { 2 } , \ldots , x _ { n } )$ are uniformly distributed along the $\mathbf { X }$ -axis within the interval $[ a , b ]$ . Now if we have a family of functions $( f ^ { ( 1 ) } , f ^ { ( 2 ) } , \dots , f ^ { ( N ) } )$ , this will lead to a family of sets $( \bar { D } ^ { ( 1 ) } , D ^ { ( 2 ) } , \dots , D ^ { ( N ) } )$ . We train our model which consists of the subset selection model $p ( D _ { s } | D )$ and a task network $p ( \dot { Y } | X , D _ { s } )$ (e.g. ANP), on this data set and report the reconstruction loss, which is the negative log-likelihood.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 6: CelebA reconstruction samples with varying number of pixels.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 7: Instance Selection Samples from a dataset of size 200.
|
| 159 |
+
|
| 160 |
+
We compare SSS with Random Select(RS) (randomly selects a subset of $D$ and uses an ANP to reconstruct the set), and Learning to Sample (LTS) (Dovrat et al., 2019) to sample k elements and uses an ANP to reconstruct the set). Figure 4a shows the performance (reconstruction loss) of our models(SSS) and the baselines.
|
| 161 |
+
|
| 162 |
+
SSS out-performs Random Select (RS), verifying that the subset selection model $p ( D _ { s } | D )$ can learn a meaningful distribution for the selected elements. Our model also out-performs the Learning to Sample (LTS) baseline.
|
| 163 |
+
|
| 164 |
+
Through the visualization of the selected points in Figure 5, we can see that out model tends to pick out more points (presented as red dots) in the drifting parts of the curve, which is reasonable since these parts are harder to reconstruct. The other two baselines sometimes fails to do that, which leads to inaccurate reconstructions.
|
| 165 |
+
|
| 166 |
+
Image Reconstruction Given an image we learn to select a core subset of pixels that best reconstructs the original image. Here, $x$ is 2-dimensional and $y$ is 3-dimensional for RGB images. An ANP is then used to reconstruct the remaining pixels from a set of context elements (selected subset in our case). We conduct this experiment on the CelebA dataset (Liu et al., 2018). Figure 4b shows that our model significantly outperforms ANP with RS (as in the original ANP paper) and the LTS baseline. Figure 6 shows the reconstruction samples of our model which are visually better than the reconstruction of the baselines for the same number of pixels.
|
| 167 |
+
|
| 168 |
+
# 4.2 CLASSIFICATION/REGRESSION
|
| 169 |
+
|
| 170 |
+
In this subsection, we validate our model on the prediction task. The goal is to learn to select a subset for a target task such as classification or regression. We again use the CelebA dataset, but this time the selected pixels are used to give predictions for 40 attributes of a celebrity’s face (in a multi-task learning setting). For our proposed model, only the selected pixels are used for prediction (other pixels’ values are set to zeros). Table 1 shows that using only 500 pixels $( \sim 1 . 3 \%$ of total pixels in an image), we can achieve a mean AUC of 0.9093 $9 9 . 3 \%$ of the accuracy obtained with the full image). Figure $\cdot$ shows the classification performance (in terms of mean AUC) versus the number of pixels selected. The AUC with selected pixels learned from our SSS is significantly higher than that of the random pixels baseline, showing the effectiveness of our subset selection method. We also include another baseline, namely SSS(rec). This is our stochastic subset selection model trained for reconstruction, but then later used for classification. Our model outperforms this variant, showing the effectiveness of training with the target task. Note that LTS cannot be applied to this experimental setup because during training, the generated virtual points cannot be converted back to an image in matrix form (due to the virtual coordinate), thus we cannot train the LTS model with CNN-based classification on the target task.
|
| 171 |
+
|
| 172 |
+
Ablation Study Since our method is stochastic, the predictive distribution can be written as $\mathbb { E } _ { p ( D _ { s } | D ) } \left[ p _ { \theta } ( \dot { y } _ { D } | D _ { s } ) \right]$ , and we can use Monte Carlo sampling to get the prediction in practice. However, throughout the experiment section, we only reported the result with one sampled subset, since it gives the best reduction in memory and computational cost. This can be seen as MC sampling with one sample. We compare it against another variant: SSS(MC) with MC sampling (5 samples). It should be noted that by doing MC sampling with 5 samples, the computational cost (inference) is increased by 5 times, and the memory requirement can be increased by up to 5 times too. Table 1 shows that our model achieves comparable performance with that variant, thus justifying that it can achieve good performance for target tasks, while reducing memory and computation requirement.
|
| 173 |
+
|
| 174 |
+
# 4.3 DATASET DISTILLATION
|
| 175 |
+
|
| 176 |
+
Instance Selection We present results on the instance selection task applied to a whole dataset. In this task, we use the CelebA dataset since it has an imbalance both in terms of gender and race. A dataset is constructed by sampling 200 random images from the full dataset. In this experiment, we seek to select only a few(5-30) representative images from these generated datasets. On this task, our subset selection module is trained via the procedure detailed in Section 3.6 on instance selection. To evaluate the effectiveness of the SSS model, we evaluate the model in terms of the diversity in the selected subset using the Fréchet Inception Distance(FID Score) (Heusel et al., 2017) which measures the similarity and diversity between two datasets. We compare our model with the model that randomly samples instances from the full dataset. Additionally, we compare our method with the Farthest Point Sampling(FPS) algorithm which selects $k$ points from a given set by computing distances on a metric space between all elements and selecting those elements that are furthest from each other. FPS in general seeks to obtain a wide coverage over a given set and hence is a suitable baseline. The results of this experiment is presented in Table 4 where our selection method achieves a lower FID score compared to FPS and Random Sampling. Additionally, given that the dataset is highly imbalanced, FPS performs worst since by selecting the furthest elements in the given set it cannot capture the true representation of the whole dataset even when compared with Random Sampling. Also for small sample selection, our method outperforms FPS and Random Sampling significantly since our method is able to model the interactions within the full dataset and hence can select the most representative subset.
|
| 177 |
+
|
| 178 |
+
Classification We use the miniImageNet dataset (Vinyals et al., 2016) and go from a 20 shot classification task to one of 1,2,5 or 10 shot classification task. We again compare with Random Sampling and FPS and apply them together with SSS for the reduction in shot. The results for this experiment is shown in Table 3, where it can be observed that SSS can learn to select more representative prototypes compared to the other methods especially in the few-shot problems where the choice of prototypes matters more. All models were trained for 300 epochs and the best model was picked using a validation set.
|
| 179 |
+
|
| 180 |
+
# 5 CONCLUSION
|
| 181 |
+
|
| 182 |
+
In this paper, we have proposed a stochastic subset selection method to reduce the size of an arbitrary set while preserving performance on a target task. Our selection method utilizes a Bernoulli mask to perform candidate selection, and a stack of Categorical distributions to iteratively select a core subset from the candidate set. As a result, the selection process does take the dependencies of the set’s members into account. Hence, it can select a compact set that avoids samples with redundant information. By using the compact subset in place of the original set for a target task, we can save memory, communication and computational cost. We hope that this can facilitate the use of machine learning algorithm in resource-limited systems such as mobile and embedded devices.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Muhammed Fatih Balın, Abubakar Abid, and James Zou. Concrete autoencoders: Differentiable feature selection and reconstruction. In International Conference on Machine Learning, pp. 444–453, 2019.
|
| 187 |
+
Abhinav Bhatia, Pradeep Varakantham, and Akshat Kumar. Resource constrained deep reinforcement learning. In Proceedings of the International Conference on Automated Planning and Scheduling, volume 29, pp. 610–620, 2019.
|
| 188 |
+
Trevor Campbell and Tamara Broderick. Bayesian coreset construction via greedy iterative geodesic ascent. arXiv preprint arXiv:1802.01737, 2018.
|
| 189 |
+
Trevor Campbell and Tamara Broderick. Automated scalable bayesian inference via hilbert coresets. The Journal of Machine Learning Research, 20(1):551–588, 2019.
|
| 190 |
+
Michael Chan, Daniel Scarafoni, Ronald Duarte, Jason Thornton, and Luke Skelly. Learning network architectures of deep cnns under resource constraints. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 1703–1710, 2018.
|
| 191 |
+
|
| 192 |
+
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.
|
| 193 |
+
|
| 194 |
+
Cody Coleman, Christopher Yeh, Stephen Mussmann, Baharan Mirzasoleiman, Peter Bailis, Percy Liang, Jure Leskovec, and Matei Zaharia. Selection via proxy: Efficient data selection for deep learning. arXiv preprint arXiv:1906.11829, 2019.
|
| 195 |
+
|
| 196 |
+
Gwendoline De Bie, Gabriel Peyré, and Marco Cuturi. Stochastic deep networks. arXiv preprint arXiv:1811.07429, 2018.
|
| 197 |
+
|
| 198 |
+
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.
|
| 199 |
+
|
| 200 |
+
Oren Dovrat, Itai Lang, and Shai Avidan. Learning to sample. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2760–2769, 2019.
|
| 201 |
+
|
| 202 |
+
Harrison Edwards and Amos Storkey. Towards a neural statistician. arXiv preprint arXiv:1606.02185, 2016.
|
| 203 |
+
|
| 204 |
+
Yuval Eldar, Michael Lindenbaum, Moshe Porat, and Yehoshua Y Zeevi. The farthest point strategy for progressive image sampling. IEEE Transactions on Image Processing, 6(9):1305–1315, 1997.
|
| 205 |
+
|
| 206 |
+
Yarin Gal, Jiri Hron, and Alex Kendall. Concrete dropout. In Advances in neural information processing systems, pp. 3581–3590, 2017.
|
| 207 |
+
|
| 208 |
+
HERBERT Hensel. Neural processes in thermoregulation. Physiological Reviews, 53(4):948–1017, 1973.
|
| 209 |
+
|
| 210 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems, pp. 6626–6637, 2017.
|
| 211 |
+
|
| 212 |
+
Jonathan Huggins, Trevor Campbell, and Tamara Broderick. Coresets for scalable bayesian logistic regression. In Advances in Neural Information Processing Systems, pp. 4080–4088, 2016.
|
| 213 |
+
|
| 214 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 215 |
+
|
| 216 |
+
Angelos Katharopoulos and François Fleuret. Not all samples are created equal: Deep learning with importance sampling. arXiv preprint arXiv:1803.00942, 2018.
|
| 217 |
+
|
| 218 |
+
Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. arXiv preprint arXiv:1901.05761, 2019a.
|
| 219 |
+
|
| 220 |
+
Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. arXiv preprint arXiv:1901.05761, 2019b.
|
| 221 |
+
|
| 222 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 223 |
+
|
| 224 |
+
Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-10 and cifar-100 datasets. URl: https://www. cs. toronto. edu/kriz/cifar. html, 6, 2009.
|
| 225 |
+
|
| 226 |
+
Juho Lee, Yoonho Lee, Jungtaek Kim, Adam R Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer. arXiv preprint arXiv:1810.00825, 2018.
|
| 227 |
+
|
| 228 |
+
Mengtian Li, Ersin Yumer, and Deva Ramanan. Budgeted training: Rethinking deep neural network training under resource constraints. arXiv preprint arXiv:1905.04753, 2019.
|
| 229 |
+
|
| 230 |
+
Mu Li, Wangmeng Zuo, Shuhang Gu, Debin Zhao, and David Zhang. Learning convolutional networks for content-weighted image compression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3214–3223, 2018a.
|
| 231 |
+
|
| 232 |
+
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, pp. 820–830, 2018b.
|
| 233 |
+
|
| 234 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
|
| 235 |
+
|
| 236 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Large-scale celebfaces attributes (celeba) dataset. Retrieved August, 15:2018, 2018.
|
| 237 |
+
|
| 238 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 239 |
+
|
| 240 |
+
Fabian Mentzer, Eirikur Agustsson, Michael Tschannen, Radu Timofte, and Luc Van Gool. Conditional probability models for deep image compression. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4394–4402, 2018.
|
| 241 |
+
|
| 242 |
+
Carsten Moenning and Neil A Dodgson. Fast marching farthest point sampling. Technical report, University of Cambridge, Computer Laboratory, 2003.
|
| 243 |
+
|
| 244 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 652–660, 2017a.
|
| 245 |
+
|
| 246 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 652–660, 2017b.
|
| 247 |
+
|
| 248 |
+
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet $^ { + + }$ : Deep hierarchical feature learning on point sets in a metric space. In Advances in neural information processing systems, pp. 5099–5108, 2017c.
|
| 249 |
+
|
| 250 |
+
Siamak Ravanbakhsh, Jeff Schneider, and Barnabas Poczos. Deep learning with sets and point clouds. arXiv preprint arXiv:1611.04500, 2016.
|
| 251 |
+
|
| 252 |
+
Oren Rippel and Lubomir Bourdev. Real-time adaptive image compression. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2922–2930. JMLR. org, 2017.
|
| 253 |
+
|
| 254 |
+
Akiyoshi Sannai, Yuuki Takai, and Matthieu Cordonnier. Universal approximations of permutation invariant/equivariant functions by deep neural networks. arXiv preprint arXiv:1903.01939, 2019.
|
| 255 |
+
|
| 256 |
+
Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. arXiv preprint arXiv:1708.00489, 2017.
|
| 257 |
+
|
| 258 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems, pp. 4077–4087, 2017.
|
| 259 |
+
|
| 260 |
+
George Toderici, Damien Vincent, Nick Johnston, Sung Jin Hwang, David Minnen, Joel Shor, and Michele Covell. Full resolution image compression with recurrent neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5306–5314, 2017.
|
| 261 |
+
|
| 262 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pp. 3630–3638, 2016.
|
| 263 |
+
|
| 264 |
+
Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A Efros. Dataset distillation. arXiv preprint arXiv:1811.10959, 2018.
|
| 265 |
+
|
| 266 |
+
Kai Wei, Rishabh Iyer, and Jeff Bilmes. Submodularity in data subset selection and active learning. In International Conference on Machine Learning, pp. 1954–1963, 2015.
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
# A APPENDIX
|
| 271 |
+
|
| 272 |
+
Organization This supplementary file is organized as follows. We provide the full pseudo-code for the Greedy Training Algorithm.We then show some visualization of our method for feature selection (in both 1D function and CelebA dataset) and report the results with multiple runs of the instance selection experiment, as well as its visualization. Qualitative results for Instance Selection as applied to the few-shot classification task are provided together with model specifications.
|
| 273 |
+
|
| 274 |
+
# A.1 GREEDY TRAINING ALGORITHM
|
| 275 |
+
|
| 276 |
+
Algorithm 2 shows our greedy training algorithm with stochastic gradient descent. The idea of the greedy training algorithm is to train the auto-regressive model to select the best next $q$ elements from the candidate set to minimize the target loss on the selected samples. By doing this, we do not have to run the auto-regressive model $k / q$ time during training, thus reducing the computational cost.
|
| 277 |
+
|
| 278 |
+
<table><tr><td colspan="2">Algorithm2 Greedy Training Algorithm</td></tr><tr><td rowspan="4">Input</td><td>k(max subset size)</td></tr><tr><td>q(# elements selected at each iteration)</td></tr><tr><td>p(D) (distribution of sets)</td></tr><tr><td>α (learning rate)</td></tr><tr><td>Output</td><td>a target task with loss function l(·, ·) trained model with converged θ and </td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2">1:0,←initialization 2:while not converged do</td></tr><tr><td></td><td></td></tr><tr><td>3:</td><td> Sample a minibatch with m sets D(1), D(2),..,D(m) from p(D)</td></tr><tr><td>4: 5:</td><td>D)~ p(D)|D()) for j=1...m</td></tr><tr><td>6:</td><td>i~ random sample from (O,...,k - q) I()~ random i-element subset of D) for j = 1... m</td></tr><tr><td>7:</td><td>Q()~ select a q-element subset from Di)\1(i) (with the auto-regressive model)</td></tr><tr><td>8:</td><td></td></tr><tr><td></td><td>0←0-avθ∑j=-1e(.,10)UQの),Φ←Φ-aVm∑j=1e(,1))UQ))</td></tr></table>
|
| 279 |
+
|
| 280 |
+
# B INSTANCE SELECTION SAMPLES
|
| 281 |
+
|
| 282 |
+
In this section, we show more examples of our 1D and CelebA experiments on how the models select the set elements for the target task.
|
| 283 |
+
|
| 284 |
+
# B.0.1 1D FUNCTION - RECONSTRUCTION
|
| 285 |
+
|
| 286 |
+
Figure 8 shows the reconstruction samples of our model on the 1D function dataset, which is objectively better than that of Learning to Sample (LTS) or Random Subset (RS). Since RS selects the set elements randomly, it can leave out important part of the 1D curve leading to wrong reconstructions. LTS also selects insufficient amount of set elements in some parts of the curves, resulting in suboptimal reconstructions.
|
| 287 |
+
|
| 288 |
+
# B.1 CELEBA
|
| 289 |
+
|
| 290 |
+
Figure 9 shows the selected pixels of our model for both the classification and reconstruction task. For the attribute classification task, the model tends to select pixels mainly from the face, since the task is to classify characteristics of the person. For reconstruction, the selected pixels are more evenly distributed, since the background also contributes significantly to the reconstruction loss.
|
| 291 |
+
|
| 292 |
+
# B.2 DATASET DISTILLATION: INSTANCE SELECTION
|
| 293 |
+
|
| 294 |
+
In Table 4, we represent the full results for the Instance Selection model on the CelebA dataset. For these experiments, we construct a set by randomly sampling 200 face images from the full dataset. To evaluate the model, we create multiple such datasets and run the baselines(Random Sampling and FPS) and SSS on the same datasets. The FID metric is then computed on the instances and averaged on all the randomly constructed datasets. For FPS, we use the open-source implementation in https://github.com/rusty1s/pytorch_cluster. Further, we provide qualitative results on a single dataset in Figure 10 where we show how our model picks 5 instances from the full set of 200 images face images.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 8: Reconstruction samples of 1D functions with different selection methods
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 9: Selected pixels for different tasks on CelebA.
|
| 301 |
+
|
| 302 |
+
Table 4: . FID Score for varying Instance Selection
|
| 303 |
+
|
| 304 |
+
<table><tr><td>#Instances</td><td>2</td><td>5</td><td>10</td><td>15</td><td>20</td><td>30</td></tr><tr><td>FPS</td><td>6.5014 ± 4.3502</td><td>4.5098± 2.3809</td><td>3.0746 ± 1.0979</td><td>2.7458 ± 0.6201</td><td>2.7118 ± 1.0410</td><td>2.2943± 0.8010</td></tr><tr><td>Random</td><td>3.7309 ± 1.1690</td><td>1.1575 ± 0.6532</td><td>0.8970 ± 0.4867</td><td>0.3843 ± 0.2171</td><td>0.3877 ± 0.1906</td><td>0.1980 ±0.1080</td></tr><tr><td>SSS</td><td>2.5307 ± 1.3583</td><td>1.0186 ± 0.1982</td><td>0.5922 ± 0.3181</td><td>0.3331 ± 0.1169</td><td>0.2381 ± 0.1153</td><td>0.1679 ± 0.0807</td></tr></table>
|
| 305 |
+
|
| 306 |
+
# B.3 DATASET DISTILLATION: CLASSIFICATION
|
| 307 |
+
|
| 308 |
+
In Figure 11 we provide visualizations for the instance selection problem as applied to the few-shot classification task. Here, we go from a 20-shot to a 1-shot classification problem where the prototype is selected from the support using SSS.
|
| 309 |
+
|
| 310 |
+
# C MODEL SPECIFICATIONS
|
| 311 |
+
|
| 312 |
+
SSS consists of $r ( D )$ , $\rho ( d _ { i } , r ( D ) )$ and $f ( d , D _ { c } , D _ { s } ^ { ( i - 1 ) }$ . We describe the models in this section.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 10: Visualization of a set with 200 images for instance selection. The two stage selection method in SSS is visualized as Candidate Set and SSS. A coreset of size 5 is visualized.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 11: Sample visualization of prototype selection for the miniImagenet dataset on the few-shot classification task. Each row represents a set that corresponds to the support from which a prototype is selected for the few-shot classification task.
|
| 319 |
+
|
| 320 |
+
For all experiments, $r ( D )$ is implemented as DeepSets. This means that we take the mean of all the samples in a set to obtain the set representation.
|
| 321 |
+
|
| 322 |
+
$\rho ( d _ { i } , r ( D ) )$ is implemented as a neural network with the following specifications: there are 3 Linear layers each followed by ReLU activation. Also, all inputs are projected into feature space using 3 Linear layers, each followed by ReLU activation.
|
| 323 |
+
|
| 324 |
+
In the set classification task, $f ( d , D _ { c } , D _ { s } ^ { ( i - 1 ) }$ is implemented as a Set Transformer network. All other experiments use DeepSets.
|
md/train/Rx9dBZaV_IP/Rx9dBZaV_IP.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Conformal Time-Series Forecasting
|
| 2 |
+
|
| 3 |
+
Kamile Stankevi˙ ciˇ ut¯ e˙ University of Oxford University of Cambridge ks830@cam.ac.uk
|
| 4 |
+
|
| 5 |
+
Ahmed M. Alaa University of California, Los Angeles ahmedmalaa@ucla.edu
|
| 6 |
+
|
| 7 |
+
Mihaela van der Schaar University of Cambridge University of California, Los Angeles The Alan Turing Institute mv472@cam.ac.uk
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Current approaches for (multi-horizon) time-series forecasting using recurrent neural networks (RNNs) focus on issuing point estimates, which are insufficient for informing decision-making in critical application domains wherein uncertainty estimates are also required. Existing methods for uncertainty quantification in RNNbased time-series forecasts are limited as they may require significant alterations to the underlying architecture, may be computationally complex, may be difficult to calibrate, may incur high sample complexity, and may not provide theoretical validity guarantees for the issued uncertainty intervals. In this work, we extend the inductive conformal prediction framework to the time-series forecasting setup, and propose a lightweight uncertainty estimation procedure to address the above limitations. With minimal exchangeability assumptions, our approach provides uncertainty intervals with theoretical guarantees on frequentist coverage for any multi-horizon forecast predictor and any dataset. We demonstrate the effectiveness of the conformal forecasting framework by comparing it with existing baselines on a variety of synthetic and real-world datasets.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Time-series forecasting tasks are central to a broad range of application domains, including stock price predictions [1, 2], service demand forecasting [3, 4], and medical prognoses [5–7]. Recurrent neural networks (RNNs) and their variants (e.g., LSTM, GRU, etc.) constitute an instrumental class of models that are most commonly used to carry out time-series forecasting tasks [8, 9]. These models, however, are usually used to issue point predictions—i.e., singular estimates of the future values of a time-series. In many high-stakes applications—such as finance and medicine—these are not enough; estimates of uncertainty are also required for accurate risk assessment and decision-making [10]. For example, clinical practitioners need to make treatment decisions accounting for all potential scenarios, where less likely scenarios may have graver consequences and require more care compared to the more likely scenarios [11, 12].
|
| 16 |
+
|
| 17 |
+
While various methods for uncertainty estimation in standard feed-forward neural networks have been recently proposed [13–15], equivalent methods for RNN-based time-series models are still under-explored. Existing solutions include Bayesian recurrent neural networks [16–18], quantile regression models [3, 19], latent variable models with deep state-space architectures [6, 20], and post-hoc uncertainty estimates using bootstrapping, jackknife or other ensembling procedures [21– 23]. Each of these solutions has its own limitations: Bayesian models may be difficult to calibrate, quantile predictors may “overfit” their uncertainty estimates, and bootstrapping methods scale poorly for RNNs with large number of parameters. Almost all existing methods share at least one of the two major drawbacks: (1) they require substantial modifications to the underlying model architecture, and (2) they provide no theoretical guarantees on frequentist coverage, any of the exceptions being computationally intractable.
|
| 18 |
+
|
| 19 |
+
We aim to address the above limitations by adapting conformal prediction (CP) [24, 25]—a framework used to derive prediction intervals with guaranteed finite-sample frequentist coverage—to the timeseries forecasting setup. CP has originally been designed to construct prediction intervals for scalar targets; on the other hand, observations and predictions in time-series forecasting involve temporally dependent, potentially multivariate sequences that are not, in general, directly comparable due to differences in observation lengths, irregular frequencies, non-stationarity, and other variations in temporal dynamics (comparison between training points being a key step in CP). We extend CP to a novel, computationally efficient conformal forecasting framework that can leverage any underlying point forecasting model to produce multi-step prediction intervals with coverage guarantees across the prediction horizon. We focus on RNN-based conformal forecasting architectures, which we call conformal forecasting RNNs (CF-RNNs), and explore their effectiveness in providing valid and efficient coverage intervals.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
Most previous work in the area of uncertainty quantification in deep learning focuses on feed-forward neural network models. Much less work has been done on uncertainty estimation for time-series models. In what follows, we discuss previous methods developed for uncertainty estimation for RNNs, which we also summarise in Table 1.
|
| 24 |
+
|
| 25 |
+
Table 1: Overview of the most popular RNN-based probabilistic forecasting methods.
|
| 26 |
+
|
| 27 |
+
<table><tr><td>Method</td><td>Paradigm</td><td>Architecture</td><td>Time-series observations</td><td>Frequentist coverage</td></tr><tr><td>Bayesian RNNs [16-18]</td><td>Bayesian</td><td>Built-in</td><td>Multiple</td><td></td></tr><tr><td>Monte Carlo dropout [26]</td><td>Bayesian (approx.)</td><td>Built-in</td><td>Multiple</td><td></td></tr><tr><td>MQ-[3], SQF-RNN [19]</td><td></td><td>Built-in</td><td>Multiple</td><td>一</td></tr><tr><td>BJ-RNN [21]</td><td>Frequentist</td><td>Post-hoc</td><td>Multiple</td><td>1-2α</td></tr><tr><td>EnbPI [27]</td><td>Frequentist (approx.)</td><td>Ensemble</td><td>Single</td><td>1-α</td></tr><tr><td>CF-RNN (proposed)</td><td>Frequentist</td><td>Post-hoc</td><td>Multiple</td><td>1-α</td></tr></table>
|
| 28 |
+
|
| 29 |
+
Bayesian RNNs [16–18] extend the ideas of Bayesian inference to RNN models, expressing the model (epistemic1) uncertainty through distributions on model parameters [28, 29]. Exact Bayesian inference quickly becomes infeasible, however; various approximations based on Markov chain Monte Carlo [30–33] or variational inference [34–37] are needed. Bayesian neural networks depend on significant changes in the underlying model architecture (at least doubling the number of parameters), and rely on a good choice of prior (which may be challenging in practice). While simplifying techniques such as Monte Carlo dropout [26] (with RNN-specific adaptation in Gal and Ghahramani [38]) exist, they are often difficult to calibrate [21].
|
| 30 |
+
|
| 31 |
+
Quantile RNNs can be viewed as a deep neural network extension of quantile regression [39] for sequential data: instead of returning a series of point estimates across the prediction horizon, quantile RNNs learn the prediction intervals directly, with upper and lower bounds of the forecast as separate prediction targets. The standard approach to achieve this is to use the appropriate pinball loss function as the objective. While successful applications of this approach in time-series forecasting exist [3], naively learning individual bounds may have problems such as quantile crossing; more recent approaches Gasthaus et al. [19] resolve this by fitting the entire quantile function. Quantile RNNs are additionally at risk of quantile overfitting due to poor sample complexity [21].
|
| 32 |
+
|
| 33 |
+
Ensembles are based on the principle of training and combining multiple models, e.g. deep ensembles trained on different random initialisations [40, 41], or models retrained on partial datasets (jackknife or bootstrap resampling-based RNNs, [22, 21]). Deep neural network ensembles are in general not mathematically principled for uncertainty quantification [42]; while resampling-based models resolve this and provide post-hoc frequentist coverage guarantees, they are instead limited in their time and space complexity. For example, exact inference on the state-of-the-art blockwise jackknife RNN (BJ-RNN) model [21] takes ${ \cal O } ( P ^ { 3 } )$ time for $P$ parameters, and even with simplifying approximations—which in turn deteriorate accuracy—the model does not scale beyond small datasets.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Time-series observation paradigms. (Left) The dataset is assumed to comprise a single timeseries, with observations being individual time-steps within the time-series. These observations are temporally dependent. (Right) The dataset consists of a set of independent time-series, where the entire series is treated as an observation. Independence of time-series implies their exchangeability.
|
| 37 |
+
|
| 38 |
+
Conformal prediction (CP) For a given significance level (error rate) $\alpha$ , the goal of CP [24, 25] is to return a prediction region $\varGamma ^ { \alpha }$ that is guaranteed to contain the true value with probability of at least $( 1 - \alpha )$ . In regression problems (such as time-series forecasting), CP is modified to work inductively using an additional calibration set and an underlying model—an approach called inductive conformal prediction (ICP) [43, 44]. Little work has been done applying (I)CP methods for time-series forecasting; the main challenge is that CP assumes exchangeability, where any permutation of the dataset observations is equiprobable. However, the time-steps within a time-series are inherently non-exchangeable due to temporal dependencies (Figure 1, left); naively applying CP to derive forecast intervals from a given time-series is therefore not methodologically valid and lacks the validity guarantees. One notable exception is the EnbPI model [27], which bypasses the exchangeability assumption (introducing some others) and uses an ensemble of bootstrapped estimators to provide approximately valid intervals. However, we argue that learning from a single time-series—while useful in cases where indeed only one time-series is available—may not be optimal in settings where datasets contain multiple time-series, the shared patterns of which could potentially be exploited (Figure 1, right). To the best of our knowledge, no existing method has applied CP to the latter forecasting setting (despite it being more methodologically grounded); yet the datasets of multiple time-series are increasingly common and useful [45].
|
| 39 |
+
|
| 40 |
+
# 3 Conformal forecasting RNNs (CF-RNNs)
|
| 41 |
+
|
| 42 |
+
In this Section, we introduce the conformal forecasting RNN (CF-RNN) model. We start off by formalizing the multi-horizon time-series forecasting problem in Section 3.1, and providing the necessary background on inductive conformal prediction (ICP) for regression tasks in Section 3.2. We introduce the details of the conformal forecasting procedure in Section 3.3.
|
| 43 |
+
|
| 44 |
+
# 3.1 Multi-horizon time-series forecasting
|
| 45 |
+
|
| 46 |
+
Let $y _ { t : t ^ { \prime } } = ( y _ { t } , y _ { t + 1 } \ldots , y _ { t ^ { \prime } } )$ be a time-series of $d$ -dimensional observations $y _ { t } , \ldots , y _ { t ^ { \prime } } \in \mathbb R ^ { d }$ that start at time step $t$ and end at time step $t ^ { \prime }$ . A multi-horizon time-series forecast predicts future values
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\hat { y } _ { ( t ^ { \prime } + 1 ) : ( t ^ { \prime } + H ) } = \left( \hat { y } _ { t ^ { \prime } + 1 } , \ldots , \hat { y } _ { t ^ { \prime } + H } \right) \in \mathbb { R } ^ { H \times d } ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
given the history of observed values $y _ { 1 : t ^ { \prime } }$ , where $H$ is the number of steps to be predicted (the prediction horizon). For critical applications, we are interested in the uncertainty associated with the forecast—for each time step $h$ in the prediction horizon, we would like to obtain prediction intervals of the form $[ \hat { y } _ { t + h } ^ { L } , \hat { y } _ { t + h } ^ { U } ]$ , $h \in \{ 1 , \ldots , H \}$ , so that the ground truth value $y _ { t + h }$ is contained in the interval with a sufficiently high probability. We fix a desired significance level (or error rate) $\alpha$ , such that the ground-truth values of the entire time-series trajectory are contained within the intervals; i.e.,
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathbb { P } \left[ y _ { t + h } \in [ \hat { y } _ { t + h } ^ { L } , \hat { y } _ { t + h } ^ { U } ] , \forall h \in \{ 1 , \dots , H \} \right] \geq 1 - \alpha .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
# 3.2 Inductive conformal prediction (ICP)
|
| 59 |
+
|
| 60 |
+
Given a set of observations $\mathcal { D } = \{ ( \mathbf { x } ^ { ( i ) } , y ^ { ( i ) } ) \} _ { i = 1 } ^ { l }$ and a new example $\mathbf { x } ^ { ( l + 1 ) }$ , the ICP procedure [24, 46, 47] returns a prediction interval $\varGamma ^ { \alpha }$ such that the property of validity is satisfied:
|
| 61 |
+
|
| 62 |
+
Property 1. (Validity) Under the exhangeability assumption, any conformal predictor will return the prediction region $\begin{array} { r } { \dot { T } ^ { \alpha } ( \mathbf { x } ^ { ( i ) } ) } \end{array}$ such that the probability of error $y ^ { ( l + 1 ) } \not \in { \Gamma } ^ { \alpha } ( \dot { \mathbf { x } } ^ { ( l + 1 ) } )$ is not greater than $\alpha$ . Alternatively:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathbb { P } [ y ^ { ( l + 1 ) } \in { \Gamma } ^ { \alpha } ( \mathbf { x } ^ { ( l + 1 ) } ) \mid \mathcal { D } ] \geq 1 - \alpha .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
The conformal prediction framework is distribution-free (i.e. it does not have any assumptions on the distribution of the underlying data $\mathcal { D }$ ), and applies to any underlying predictive model as long as the exchangeability assumption is satisfied:
|
| 69 |
+
|
| 70 |
+
Assumption 1. (Exchangeability) In a dataset of l observations $\{ ( \mathbf { x } ^ { ( i ) } , y ^ { ( i ) } ) \} _ { i = 1 } ^ { l }$ , any of its $l !$ permutations are equiprobable. Note that independent identically distributed (iid) observations satisfy exchangeability.
|
| 71 |
+
|
| 72 |
+
The inductive2 variant of CP operates by splitting the training set into the proper training set of size $n$ and a calibration set of size $m$ : $\mathcal { D } = \mathcal { D } _ { \mathrm { t r a i n } } \cup \mathcal { D } _ { \mathrm { c a l } }$ . The proper training set is used to train the underlying (auxiliary) model $M$ , and the calibration set is used to obtain the nonconformity scores, which measure how unusual is the given example compared to previously observed data. While CP guarantees validity for any nonconformity score (including a random number generator), the most commonly used nonconformity score in regression is of the form
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
R _ { i } = A ( \mathcal D , ( { \mathbf x } ^ { ( i ) } , y ^ { ( i ) } ) ) = A ( M ( { \mathbf x } ^ { ( i ) } | \mathcal D ) , y ^ { ( i ) } ) ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $\varDelta$ is some distance metric. While any choice for $M$ is valid, the best architecture depends on the dataset and the problem. When $\varDelta ( \hat { y } , y ) = | \hat { y } - y |$ , the nonconformity score $R _ { i } = | \hat { y } ^ { ( i ) } - y ^ { ( i ) } |$ corresponds to the residual error between the prediction of the underlying model and the true label.
|
| 79 |
+
|
| 80 |
+
The resulting empirical nonconformity score distribution $\{ R _ { i } \} _ { i = 1 } ^ { l }$ is used to compute a critical nonconformity score $\hat { \varepsilon }$ , which corresponds to the $\lceil ( m + 1 ) ( \mathrm { i } - \bar { \alpha } ) \rceil$ -th smallest residual [48]. For a new example $\mathbf { x } ^ { ( l + 1 ) }$ , the prediction interval is then:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\Gamma ^ { \alpha } ( \mathbf { x } ^ { ( l + 1 ) } ) = [ \hat { y } ^ { ( l + 1 ) } - \hat { \varepsilon } , \hat { y } ^ { ( l + 1 ) } + \hat { \varepsilon } ] ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
with $\hat { y } ^ { ( l + 1 ) } = M ( \mathbf { x } ^ { ( l + 1 ) } )$ .
|
| 87 |
+
|
| 88 |
+
# 3.3 CF-RNN: ICP for multi-horizon RNNs
|
| 89 |
+
|
| 90 |
+
So far we have considered the case when the labels $y \in \mathbb R$ are scalar, but multi-horizon time-series forecasts return $H$ $d$ -dimensional) values (in this work, we focus on $d = 1$ ; extending the results to multivariate time-series is left for future work). We extend the ICP framework to handle the multi-horizon forecasting setup, while maintaining the validity of the resulting multi-horizon forecast intervals—we call this the conformal forecasting framework.
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 2: CF-RNN uncertainty estimation procedure. (a) The calibration set is used to obtain the empirical distribution of nonconformity scores $\hat { \varepsilon } _ { h }$ , and its appropriate quantile is selected depending on the desired target coverage level. (b) Critical nonconformity scores are used to obtain the prediction interval.
|
| 94 |
+
|
| 95 |
+
Let $\mathcal { D }$ be the set of exchangeable observations of the form $\left( y _ { 1 : T } , y _ { T + 1 : T + H } \right)$ , where $y _ { 1 : T }$ is the time-series consisting of $T$ observed steps, and $y _ { T + 1 : T + H }$ is the $H$ -step forecast. Note that the label $y _ { T + 1 : T + H }$ is now an $H$ -dimensional value, in contrast with the scalar $y$ value from before. Due to the sequential nature of the task, we will use an RNN as the underlying model $M$ . We set $M$ to produce multi-horizon forecasts directly (where at each time step $t$ , all values of the $H$ -step target $y _ { t + 1 : t + H }$ are predicted at the same time from a single embedding) rather than recursively (where a single prediction is obtained at a time, and successive values are obtained by iteratively feeding them back into the RNN). We motivate our choice of the direct strategy by its robustness to error accumulation [50, 3], and conditionally independent predictions given the state of $M$ (which will be important for theoretical guarantees as discussed below). We now replace the single-dimensional nonconformity score defined earlier by its $H$ -dimensional counterpart,
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
R _ { i } = \left[ | y _ { t + 1 } ^ { ( i ) } - \hat { y } _ { t + 1 } ^ { ( i ) } | , \dots , | y _ { t + H } ^ { ( i ) } - \hat { y } _ { t + H } ^ { ( i ) } | \right] ^ { \top } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\left[ \widehat { y } _ { t + 1 } ^ { ( i ) } , \ldots , \widehat { y } _ { t + H } ^ { ( i ) } \right] ^ { \top } = M ( y _ { 1 : t } ^ { ( i ) } )$ . Since the $H$ conditionally independent predictions are obtained from the same embedding, we apply Bonferroni correction to the critical calibration scores in order to maintain the desired error rate $\alpha$ . In particular, the original $\alpha$ is divided by $H$ , so that the critical nonconformity scores $\hat { \varepsilon } _ { 1 } , \dots , \hat { \varepsilon } _ { H }$ become the $\lceil ( m + 1 ) ( 1 - \alpha / H ) \rceil$ -th smallest residuals in the corresponding nonconformity score distributions. The resulting set of prediction intervals is therefore
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r } { \int _ { 1 } ^ { \alpha } \left( y _ { ( 1 : t ) } ^ { ( l + 1 ) } \right) , \ldots , \int _ { H } ^ { \alpha } \left( y _ { ( 1 : t ) } ^ { ( l + 1 ) } \right) , } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r } { T _ { h } ^ { \alpha } \left( y _ { ( 1 : t ) } ^ { ( l + 1 ) } \right) = \left[ \hat { y } _ { t + h } ^ { ( l + 1 ) } - \hat { \varepsilon } _ { h } , \hat { y } _ { t + h } ^ { ( l + 1 ) } + \hat { \varepsilon } _ { h } \right] \quad \forall h \in \{ 1 , \ldots , H \} . } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
In summary, the conformal forecasting RNN (CF-RNN) model consists of an RNN issuing point forecasts, and a conformal forecasting procedure to derive the uncertainty. The entire procedure for constructing prediction intervals in CF-RNN is illustrated in Figure 2 and summarized in Algorithm 1. Finally, we show the theoretical motivations behind our approach via the following Theorem, which provides validity for intervals obtained with the conformal forecasting procedure.
|
| 114 |
+
|
| 115 |
+
Theorem 1. (Conformal forecasting validity) Let $\mathcal { D } = \left\{ \left( y _ { 1 : t } ^ { ( i ) } , y _ { t + 1 : t + H } ^ { ( i ) } \right) \right\} _ { i = 1 } ^ { l }$ be the dataset of exchangeable time-series observations and their i=1-step forecasts obtained from the same underlying probability distribution. Let M be the recurrent neural network predicting $H$ -step forecasts using the direct strategy. For any significance level $\alpha \in [ 0 , 1 ]$ , the intervals obtained with the ICP-based conformal forecasting algorithm will have the error rate of at most $\alpha$ ; alternatively,
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathbb { P } \left( \forall h \in \{ 1 , \dots , H \} . y _ { t + h } \in \left[ \hat { y } _ { t + h } - \hat { \varepsilon } _ { h } , \hat { y } _ { t + h } + \hat { \varepsilon } _ { h } \right] \right) \geq 1 - \alpha .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
The proof follows from conditional validity of ICP in Vovk [51] and Boole’s inequality. The full statement and detailed proof is provided in Appendix A.
|
| 122 |
+
|
| 123 |
+
# Algorithm 1 Conformal forecasting RNN (CF-RNN)
|
| 124 |
+
|
| 125 |
+
<table><tr><td>1:Input: A trained model M producing H-step forecasts,</td><td>m</td></tr><tr><td>2: 3:</td><td>,target error rate α. i=1 Output: Critical nonconformity scores ε1,., H.</td></tr><tr><td>4:</td><td>Initializeε1={,...,εH={.</td></tr><tr><td>5:</td><td>fori=1 to m do</td></tr><tr><td>6:</td><td>yt+1:t+H ← M(yi). (i)</td></tr><tr><td>7:</td><td>forh=1 to H do</td></tr><tr><td>8:</td><td>(i) (i)</td></tr><tr><td>9:</td><td>end for</td></tr><tr><td>10: 11:</td><td>end for for h=1toHdo</td></tr><tr><td>12:</td><td>(Bonferroni and finite sample correction)</td></tr><tr><td>13:</td><td>εh ←[(m+1)(1-α/H)]-th smallest residual in εh.</td></tr><tr><td>14:</td><td>end for</td></tr><tr><td>15:</td><td>return ε1,...,€H.</td></tr><tr><td>16:</td><td>For a new time-series example y*:t:</td></tr><tr><td></td><td></td></tr><tr><td>17:</td><td>Yt+1:t+H ←M(yi:t).</td></tr><tr><td>18:</td><td>return intervals 9t+1 ±ε1,... 9t+H ±εH.</td></tr></table>
|
| 126 |
+
|
| 127 |
+
# 4 Experiments
|
| 128 |
+
|
| 129 |
+
In this section, we showcase the performance of the conformal forecasting RNN (CF-RNN) model against three baselines: the frequentist blockwise jackknife RNN (BJ-RNN) [21], the multi-quantile RNN (MQ-RNN) [3], and the Monte Carlo dropout-based RNN (DP-RNN) [26]. We chose these baselines as the most popular and representative examples of the different paradigms for uncertainty estimation (frequentist, quantile prediction and Bayesian uncertainty estimation for BJ-RNN, MQRNN and DP-RNN respectively). All architectures use LSTM as the underlying recurrent neural network, and are adapted to produce direct multi-horizon forecasts. We first present the performance of CF-RNNs on synthetic data with controlled properties. Since BJ-RNNs do not scale to larger real datasets, we use smaller synthetic datasets to provide the comparison of BJ-RNNs with the other methods. Finally, we compare the performance of CF-RNNs with the remaining two baselines on three real-world medical datasets. The code is available at github.com/kamilest/conformal-rnn.
|
| 130 |
+
|
| 131 |
+
# 4.1 Synthetic data
|
| 132 |
+
|
| 133 |
+
We first generate the synthetic time-series consisting of two components: the autoregressive process determining the trend of the time-series, and the noise process representing the inherent uncertainty of the dataset.3 For a time-series of length $T$ , this is expressed mathematically as:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
y _ { t } = \sum _ { k = 0 } ^ { t } a ^ { k } \cdot x _ { k } + \epsilon _ { t } , \forall k \in \{ 1 , \ldots , T \} ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where $x _ { t } \sim \mathcal { N } ( \mu _ { x } , \sigma _ { x } ^ { 2 } )$ , $a = 0 . 9$ is the memory parameter and $\epsilon _ { t } \sim \mathcal { N } ( 0 , \sigma _ { t } ^ { 2 } )$ is the noise process. We consider five time-dependent noise variance profiles, $\sigma _ { t } ^ { 2 } = 0 . 1 t n$ and five static noise variance profiles $\sigma _ { t } ^ { 2 } = 0 . 1 n$ , for $\bar { n = \{ 1 , \ldots , 5 \} }$ .
|
| 140 |
+
|
| 141 |
+
# 4.2 Results
|
| 142 |
+
|
| 143 |
+
We train the models on 2000 training sequences (with CF-RNNs splitting this dataset into 1000 true training and 1000 calibration sequences) for the two noise variance profiles. We aim to forecast prediction intervals for $H$ future values $y _ { T + 1 : T + H }$ for a default coverage rate of $90 \%$ $\alpha = 0 . 1 $ ). Here, $T = 1 5$ and $H = 5$ . The RNN hyperparameters for the networks underlying the uncertainty estimation models are fixed in order to ensure fair comparison, and largely follow those provided in previous work [21]. These are detailed in the Appendix B along with the time-series model parameters. Where possible,4 we repeat the experiments five times with a new randomly generated dataset, reporting the variation in empirical joint coverage over the different realisations.
|
| 144 |
+
|
| 145 |
+
Table 2: Comparison of joint coverages produced by CF-RNNs and competing baselines on autoregressive series with static or time-dependent noise profiles. Where possible, empirical joint coverages are aggregated over repeated trials with randomly generated datasets.
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan="2" colspan="2">Noise mode</td><td colspan="4">Empirical joint coverage</td></tr><tr><td>CF-RNN</td><td>BJ-RNN</td><td>MQ-RNN</td><td>DP-RNN</td></tr><tr><td rowspan="5">Static =0.1n</td><td>n=1</td><td>92.8 ± 0.8%</td><td>100%</td><td>65.0 ± 2.7%</td><td>5.4 ± 0.5%</td></tr><tr><td>n=2</td><td>94.0 ± 0.4%</td><td>100%</td><td>65.6 ± 3.4%</td><td>5.6 ± 1.0%</td></tr><tr><td>n=3</td><td>94.6 ± 1.6%</td><td>100%</td><td>66.4 ± 1.9%</td><td>5.0 ± 0.9%</td></tr><tr><td>n=4</td><td>94.3 ± 1.4%</td><td>100%</td><td>65.2 ± 4.4%</td><td>4.7 ± 1.0%</td></tr><tr><td>n=5</td><td>94.3 ± 1.4%</td><td>100%</td><td>67.2 ± 1.6%</td><td>4.2 ± 1.0%</td></tr><tr><td rowspan="5">Time-dependent ²=0.1tn</td><td>n=1</td><td>92.7 ± 1.3%</td><td>99.4%</td><td>63.4 ± 1.5%</td><td>2.5 ± 1.1%</td></tr><tr><td>n=2</td><td>92.4 ± 0.9%</td><td>100%</td><td>60.9 ± 1.9%</td><td>0.4 ± 0.2%</td></tr><tr><td>n=3</td><td>90.9 ± 1.3%</td><td>100%</td><td>57.2 ± 2.1%</td><td>0.3 ± 0.2%</td></tr><tr><td>n=4</td><td>90.6 ± 1.2%</td><td>97.0%</td><td>57.1 ± 3.7%</td><td>0.0 ± 0.1%</td></tr><tr><td>n=5</td><td>91.1 ± 0.7%</td><td>99.4%</td><td>58.6 ± 2.1%</td><td>0.1 ± 0.1%</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Table 3: Prediction interval widths of CF-RNNs and competing baselines on synthetic datasets of autoregressive time-series with static or time-dependent noise profiles. The mean and standard deviation are reported over all prediction horizons and random seeds.
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan="2" colspan="2">Noise mode</td><td colspan="4">Interval widths</td></tr><tr><td>CF-RNN</td><td>BJ-RNN</td><td>MQ-RNN</td><td>DP-RNN</td></tr><tr><td rowspan="5">Static 8=0.1n</td><td>n=1</td><td></td><td>16.45 ± 3.69</td><td>98.45 ± 25.95</td><td>9.47 ± 1.99</td><td>2.82 ± 0.33</td></tr><tr><td></td><td>n=2</td><td>16.97 ± 3.34</td><td>32.53 ± 2.92</td><td>9.63 ± 1.85</td><td>2.95± 0.37</td></tr><tr><td></td><td>n=3</td><td>17.12 ± 3.50</td><td>35.82 ± 1.59</td><td>9.72 ± 1.92</td><td>2.77 ± 0.37</td></tr><tr><td></td><td>n=4</td><td>17.34 ± 3.77</td><td>33.83 ± 2.49</td><td>9.71 ± 1.80</td><td>2.87 ± 0.35</td></tr><tr><td>n=5</td><td></td><td>16.97 ± 3.27</td><td>51.23 ± 3.21</td><td>9.84 ± 1.99</td><td>2.85 ± 0.38</td></tr><tr><td rowspan="5">Time-dependent ²=0.1tn</td><td></td><td>n=1</td><td>19.80 ± 3.61</td><td>27.09 ± 1.16</td><td>11.50 ± 1.66</td><td>3.01 ± 0.35</td></tr><tr><td>n=2</td><td></td><td>25.74 ± 3.32</td><td>104.85 ± 5.68</td><td>15.45 ± 1.68</td><td>3.15 ± 0.37</td></tr><tr><td>n=3</td><td></td><td>32.70 ± 3.97</td><td>36.45 ± 1.25</td><td>20.05 ± 2.02</td><td>3.62 ± 0.33</td></tr><tr><td></td><td>n=4</td><td>40.74 ± 4.10</td><td>33.24 ± 2.32</td><td>25.02 ± 2.11</td><td>3.91 ± 0.45</td></tr><tr><td>n=5</td><td></td><td>49.00 ± 5.58</td><td>51.45 ± 5.37</td><td>30.55 ± 2.54</td><td>4.15 ± 0.57</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Tables 2 and 3 compare the joint coverage uncertainty intervals of the models. Both CF-RNN and BJ-RNN empirically surpass the target joint coverage of $90 \%$ $\alpha = 0 . 1$ ) in both static and timedependent noise settings, satisfying the finite-sample frequentist coverage guarantees as required.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 3: Trade-offs between the dataset size, joint coverage and interval widths. (Left and Middle) The relationship between the training dataset size, joint coverage rate (left) and average interval width (middle) for CF-RNN, MQ-RNN and DP-RNN baselines. (Right) The trade-off between the coverage rate and prediction horizon for a fixed prediction interval width in CF-RNN models with different types of the underlying RNN.
|
| 157 |
+
|
| 158 |
+
Table 3 additionally illustrates that CF-RNN intervals adapt to the properties of the temporal dynamics of the dataset: when the noise is static (and the time-series more predictable), CF-RNN prediction interval widths do not change much with increasing base variance; on the other hand, when the noise profile is time-dependent—so that inherent noise of the time-series accumulates in addition to uncertainty of the model itself—the average intervals get wider with increasing dataset uncertainty. The other frequentist baseline—BJ-RNN—has markedly wider intervals than those of CF-RNN. This might be important to maintain the perfect coverage; however, we argue that as long as the coverage rate surpasses target coverage, the intervals should be as efficient (narrow) as possible to be the most informative for decision making. (Consider that infinite intervals would have perfect coverage but would not be informative.) In addition, BJ-RNNs take prohibitively long to compute (the reason for which they contain only a single seed and will also be excluded from the comparisons on real data). Conversely, the ICP procedure only requires running the trained RNN model on a calibration set (where the model can be calibrated for any desired coverage simultaneously, with no additional computational cost), at which point adding uncertainty intervals to a prediction takes constant time. On the other hand, baselines following the alternative (non-frequentist) paradigms—MQ-RNN and DP-RNN—both fail to achieve target coverage, sometimes reporting coverage rates as low as zero. For this reason, while the two models also come with narrower (more efficient) intervals, lack of coverage guarantees makes them less useful in high stakes real-world applications.
|
| 159 |
+
|
| 160 |
+
Experiments on the data with controlled properties provide additional insight on the trade-offs between the desired coverage rate and how far into the future can the predictions be reliably made. These trade-offs are shown in Figure 3 as applied to the datasets with time-dependent noise variance profile $\sigma _ { t } ^ { 2 } = 0 . 1 t$ . The left and middle panels show the average performance of the CF-RNN, MQ-RNN and DP-RNN baselines depending on the training dataset size. CF-RNN is the only model to achieve and maintain the required joint coverage rate with finite number of examples; additionally, with more data (larger calibration datasets), the distribution of nonconformity scores can be specified more accurately, so the width of the intervals decreases. Finally, in the panel on the right we fix the prediction interval width and for each horizon $H$ compute the largest coverage level $1 - \alpha$ maintained by CF-RNN. As shown in the Figure, low target coverage levels allow us to make valid predictions far into the future, and ideal coverage levels can only be achieved with horizons near the prediction point. The overall trend is maintained for every recurrent neural network model $M$ .
|
| 161 |
+
|
| 162 |
+
# 4.3 Experiments on real data
|
| 163 |
+
|
| 164 |
+
We now demonstrate the effectiveness of our procedure on real-world time-series. We train the proposed CF-RNN architecture as well as the MQ-RNN and DP-RNN baselines on three datasets summarised in Table 4. For the first task, we use the data from the Medical Information Mart for Intensive Care (MIMIC-III) [52] dataset, where we forecast daily observations of white blood cell counts of varying lengths. For the second task, we use the electroencephalography (EEG) dataset from the UCI machine learning repository [53], where we forecast trajectories of downsampled EEG signals obtained from healthy subjects exposed to three types of visual stimuli. For the final task, we forecast daily COVID-19 cases within the United Kingdom local authority districts. All datasets are publicly available and the medical data is anonymised. We selected these datasets to represent a variety of scenarios of real time-series: the numbers of available training instances span different orders of magnitude (from hundreds to tens of thousands), the datasets have varying observation sequence lengths, different stationarity properties (e.g. the COVID-19 time-series are synchronous—each time step representing the same point in time—the others are not), different noise profiles (e.g. EEG signal data will inherently have higher frequencies than MIMIC-III white blood cell count data), and different target prediction horizons. We note that COVID-19 dataset is especially challenging as the forecasts contain a wave of infections and lockdowns, with the wave starting at different points for every region. Details on datasets and their preprocessing are provided in Appendix C.
|
| 165 |
+
|
| 166 |
+
Table 4: Dataset properties. The number in parentheses under the training example column indicates how many examples were used for training when a calibration set was required, such as in the case of CF-RNNs.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Dataset</td><td># Training sequences</td><td>Window length T</td><td>Prediction horizon H</td></tr><tr><td>MIMIC-III [52]</td><td>3823 (2000)</td><td>[3,47]</td><td>2</td></tr><tr><td>EEG [53]</td><td>19200 (15360)</td><td>40</td><td>10</td></tr><tr><td>COVID-19 [54]</td><td>300 (200)</td><td>100</td><td>50</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 5: Uncertainty forecasting model performance on three real-world datasets. Coverage refers to joint coverage (higher is better), and is averaged over the random splits of the dataset and training seeds. Prediction interval lengths (lower is better) are averaged over the prediction horizons and random seeds.
|
| 171 |
+
|
| 172 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">MIMIC-III</td><td colspan="2">EEG</td><td colspan="2">COVID-19</td></tr><tr><td>Coverage</td><td>CI/PI lengths</td><td>Coverage</td><td>CI/PI lengths</td><td>Coverage</td><td>CI/PI lengths</td></tr><tr><td>DP-RNN</td><td>40.2 ± 13.9%</td><td>3.59 ± 0.90</td><td>3.3 ± 0.7%</td><td>7.39 ± 0.74</td><td>0.0 ±0.0%</td><td>61.18 ± 32.37</td></tr><tr><td>MQ-RNN</td><td>89.3 ± 1.2%</td><td>16.16 ± 3.92</td><td>48.0 ±4.0%</td><td>21.39 ± 2.36</td><td>15.0 ± 5.9%</td><td>136.56 ± 63.32</td></tr><tr><td>CF-RNN</td><td>94.0 ± 1.2%</td><td>20.59 ± 3.10</td><td>96.5 ± 1.0%</td><td>61.86 ± 18.02</td><td>89.7±5.3%</td><td>733.95 ± 582.52</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Performance of the models is summarised in Table 5. We note that the underlying LSTM model of the proposed CF-RNN architecture had the same hyperparameters as the competing baselines, yet fewer training instances (as some of the examples are used for the calibration procedure). Despite this, CF-RNN obtains the highest coverage for all datasets, and is the only model to empirically achieve the target joint coverage rates. While this seems to disproportionately affect the efficiency of CF-RNN intervals (as these are the widest), the predictions are indeed reliable across the range of datasets and scenarios. On the other hand, the baseline models seem to have competitive coverage with better efficiency in some settings (e.g. MIMIC-III), yet revert to unreliable predictions in less certain scenarios (e.g. COVID-19). In other words, CF-RNN adapts its prediction interval widths to reliably match the required target coverage, increasing the width for unpredictable datasets.
|
| 175 |
+
|
| 176 |
+
Finally, we briefly explore the importance of and motivation behind the Bonferroni correction of the error rate in the CF-RNN calibration procedure. Table 6 shows that calibration scores without Bonferroni correction generally lead to poor joint coverage, even though independent coverage rates normally achieve the target coverage (most notable exception being the COVID-19 dataset selected for its forecasting difficulty).
|
| 177 |
+
|
| 178 |
+
Table 6: Bonferroni-corrected and uncorrected empirical coverages of the CF-RNN model. Joint coverage is aggregated over the different random seeds; independent coverages present the range of observed values across all horizons and all random seeds.
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">MIMIC-III</td><td colspan="2">EEG</td><td colspan="2">COVID-19</td></tr><tr><td>Joint</td><td>Independent</td><td>Joint</td><td>Independent</td><td>Joint</td><td>Independent</td></tr><tr><td>CF-RNN</td><td>94.0 ± 1.2%</td><td>[93.8%, 96.8%]</td><td>96.5 ± 1.0%</td><td>[98.3%,99.8%]</td><td>89.7 ± 5.3%</td><td>[87.5%,100.0%]</td></tr><tr><td>Uncorrected</td><td>89.0 ± 1.4%</td><td>[89.0%,91.4%]</td><td>59.4 ± 2.4%</td><td>[85.5%,91.6%]</td><td>55.5±8.0%</td><td>[77.5%,98.8%]</td></tr></table>
|
| 181 |
+
|
| 182 |
+
# 5 Conclusion
|
| 183 |
+
|
| 184 |
+
In this paper, we extended the ICP framework to the multi-horizon time-series forecasting problem, providing a lightweight algorithm with theoretical guarantees for frequentist coverage. Extending from the initial investigation presented in Appendix D, future work would focus on increasing the overall efficiency of prediction intervals by reducing their width, which would involve making them more adaptive to individual observations.
|
| 185 |
+
|
| 186 |
+
# Acknowledgments
|
| 187 |
+
|
| 188 |
+
The authors would like to thank the reviewers for their helpful comments. This work was supported by AstraZeneca, the US Office of Naval Research (ONR) and the National Science Foundation (NSF, grant number 1722516).
|
| 189 |
+
|
| 190 |
+
References
|
| 191 |
+
[1] Sreelekshmy Selvin, R Vinayakumar, EA Gopalakrishnan, Vijay Krishna Menon, and KP Soman. Stock price prediction using lstm, rnn and cnn-sliding window model. In 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), pages 1643–1647. IEEE, 2017.
|
| 192 |
+
[2] Wei Bao, Jun Yue, and Yulei Rao. A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PloS one, 12(7):e0180944, 2017.
|
| 193 |
+
[3] Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka. A multihorizon quantile recurrent forecaster. arXiv preprint arXiv:1711.11053, 2017.
|
| 194 |
+
[4] Lingxue Zhu and Nikolay Laptev. Deep and confident prediction for time series at uber. In 2017 IEEE International Conference on Data Mining Workshops (ICDMW), pages 103–110. IEEE, 2017.
|
| 195 |
+
[5] Bryan Lim, Ahmed Alaa, and Mihaela van der Schaar. Forecasting treatment responses over time using recurrent marginal structural networks. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 7494–7504, 2018.
|
| 196 |
+
[6] Ahmed M Alaa and Mihaela van der Schaar. Attentive state-space modeling of disease progression. In Advances in Neural Information Processing Systems, pages 11334–11344, 2019.
|
| 197 |
+
[7] Benjamin Shickel, Patrick James Tighe, Azra Bihorac, and Parisa Rashidi. Deep ehr: a survey of recent advances in deep learning techniques for electronic health record (ehr) analysis. IEEE journal of biomedical and health informatics, 22(5):1589–1604, 2017.
|
| 198 |
+
[8] Martin Sundermeyer, Ralf Schlüter, and Hermann Ney. Lstm neural networks for language modeling. In Thirteenth annual conference of the international speech communication association, 2012.
|
| 199 |
+
[9] Nal Kalchbrenner and Phil Blunsom. Recurrent continuous translation models. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1700–1709, 2013.
|
| 200 |
+
[10] Christian Gollier. The economics of risk and uncertainty. Edward Elgar Publishing Limited, 2018.
|
| 201 |
+
[11] Michael W Dusenberry, Dustin Tran, Edward Choi, Jonas Kemp, Jeremy Nixon, Ghassen Jerfel, Katherine Heller, and Andrew M Dai. Analyzing the role of model uncertainty for electronic health records. In Proceedings of the ACM Conference on Health, Inference, and Learning, pages 204–213, 2020.
|
| 202 |
+
[12] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? arXiv preprint arXiv:1703.04977, 2017.
|
| 203 |
+
[13] Wesley Maddox, Timur Garipov, Pavel Izmailov, Dmitry Vetrov, and Andrew Gordon Wilson. A simple baseline for bayesian uncertainty in deep learning. arXiv preprint arXiv:1902.02476, 2019.
|
| 204 |
+
[14] Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. In Advances in Neural Information Processing Systems, pages 7047–7058, 2018.
|
| 205 |
+
[15] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems (NeurIPS), pages 6402–6413, 2017.
|
| 206 |
+
|
| 207 |
+
[16] Meire Fortunato, Charles Blundell, and Oriol Vinyals. Bayesian recurrent neural networks. arXiv preprint arXiv:1704.02798, 2017.
|
| 208 |
+
|
| 209 |
+
[17] Jen-Tzung Chien and Yuan-Chu Ku. Bayesian recurrent neural network for language modeling. IEEE transactions on neural networks and learning systems, 27(2):361–374, 2015.
|
| 210 |
+
|
| 211 |
+
[18] Derrick T Mirikitani and Nikolay Nikolaev. Recursive bayesian recurrent neural networks for time-series modeling. IEEE Transactions on Neural Networks, 21(2):262–274, 2009.
|
| 212 |
+
|
| 213 |
+
[19] Jan Gasthaus, Konstantinos Benidis, Yuyang Wang, Syama Sundar Rangapuram, David Salinas, Valentin Flunkert, and Tim Januschowski. Probabilistic forecasting with spline quantile function rnns. In The 22nd international conference on artificial intelligence and statistics, pages 1901–1910. PMLR, 2019.
|
| 214 |
+
|
| 215 |
+
[20] Syama Sundar Rangapuram, Matthias W Seeger, Jan Gasthaus, Lorenzo Stella, Yuyang Wang, and Tim Januschowski. Deep state space models for time series forecasting. Advances in neural information processing systems, 31:7785–7794, 2018.
|
| 216 |
+
|
| 217 |
+
[21] Ahmed Alaa and Mihaela van der Schaar. Frequentist uncertainty in recurrent neural networks via blockwise influence functions. In International Conference on Machine Learning, pages 175–190. PMLR, 2020.
|
| 218 |
+
|
| 219 |
+
[22] Ahmed Alaa and Mihaela van der Schaar. Discriminative jackknife: Quantifying uncertainty in deep learning via higher-order influence functions. In International Conference on Machine Learning, pages 165–174. PMLR, 2020.
|
| 220 |
+
|
| 221 |
+
[23] Chen Xu and Yao Xie. Conformal prediction interval for dynamic time-series. International Conference on Machine Learning, 2021.
|
| 222 |
+
|
| 223 |
+
[24] Vladimir Vovk, Alex Gammerman, and Glenn Shafer. Algorithmic learning in a random world. Springer Science & Business Media, 2005.
|
| 224 |
+
|
| 225 |
+
[25] Glenn Shafer and Vladimir Vovk. A tutorial on conformal prediction. Journal of Machine Learning Research, 9(3), 2008.
|
| 226 |
+
|
| 227 |
+
[26] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pages 1050–1059. PMLR, 2016.
|
| 228 |
+
|
| 229 |
+
[27] Chen Xu and Yao Xie. Conformal prediction interval for dynamic time-series. In International Conference on Machine Learning, pages 11559–11569. PMLR, 2021.
|
| 230 |
+
|
| 231 |
+
[28] David JC MacKay. A practical bayesian framework for backpropagation networks. Neural computation, 4(3):448–472, 1992.
|
| 232 |
+
|
| 233 |
+
[29] Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
|
| 234 |
+
|
| 235 |
+
[30] Radford M Neal. Bayesian learning via stochastic dynamics. In Advances in neural information processing systems, pages 475–482, 1993.
|
| 236 |
+
|
| 237 |
+
[31] Radford M Neal et al. Mcmc using hamiltonian dynamics. Handbook of markov chain monte carlo, 2(11):2, 2011.
|
| 238 |
+
|
| 239 |
+
[32] Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th international conference on machine learning (ICML-11), pages 681–688. Citeseer, 2011.
|
| 240 |
+
|
| 241 |
+
[33] Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient hamiltonian monte carlo. In International conference on machine learning, pages 1683–1691. PMLR, 2014.
|
| 242 |
+
|
| 243 |
+
[34] Alex Graves. Practical variational inference for neural networks. Advances in neural information processing systems, 24, 2011.
|
| 244 |
+
|
| 245 |
+
[35] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 246 |
+
[36] Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14(5), 2013.
|
| 247 |
+
[37] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International Conference on Machine Learning, pages 1613–1622. PMLR, 2015.
|
| 248 |
+
[38] Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent neural networks. Advances in neural information processing systems, 29:1019–1027, 2016.
|
| 249 |
+
[39] Roger Koenker and Kevin F Hallock. Quantile regression. Journal of economic perspectives, 15(4):143–156, 2001.
|
| 250 |
+
[40] Stanislav Fort, Huiyi Hu, and Balaji Lakshminarayanan. Deep ensembles: A loss landscape perspective. arXiv preprint arXiv:1912.02757, 2019.
|
| 251 |
+
[41] Xueheng Qiu, Le Zhang, Ye Ren, Ponnuthurai N Suganthan, and Gehan Amaratunga. Ensemble deep learning for regression and time series forecasting. In 2014 IEEE symposium on computational intelligence in ensemble learning (CIEL), pages 1–6. IEEE, 2014.
|
| 252 |
+
[42] Tim Pearce, Felix Leibfried, and Alexandra Brintrup. Uncertainty in neural networks: Approximately bayesian ensembling. In International conference on artificial intelligence and statistics, pages 234–244. PMLR, 2020.
|
| 253 |
+
[43] Anastasios Angelopoulos, Stephen Bates, Jitendra Malik, and Michael I Jordan. Uncertainty sets for image classifiers using conformal prediction. International Conference on Learning Representations, 2021.
|
| 254 |
+
[44] Harris Papadopoulos. Inductive conformal prediction: Theory and application to neural networks. In Tools in artificial intelligence. Citeseer, 2008.
|
| 255 |
+
[45] David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. Deepar: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3): 1181–1191, 2020.
|
| 256 |
+
[46] Harris Papadopoulos and Haris Haralambous. Reliable prediction intervals with regression neural networks. Neural Networks, 24(8):842–851, 2011.
|
| 257 |
+
[47] Harris Papadopoulos, Kostas Proedrou, Volodya Vovk, and Alex Gammerman. Inductive confidence machines for regression. In European Conference on Machine Learning, pages 345–356. Springer, 2002.
|
| 258 |
+
[48] Gianluca Zeni, Matteo Fontana, and Simone Vantini. Conformal prediction: a unified review of theory and new challenges. arXiv preprint arXiv:2005.07972, 2020.
|
| 259 |
+
[49] Vladimir Vovk. Transductive conformal predictors. In IFIP International Conference on Artificial Intelligence Applications and Innovations, pages 348–360. Springer, 2013.
|
| 260 |
+
[50] Souhaib Ben Taieb and Amir F Atiya. A bias and variance analysis for multistep-ahead time series forecasting. IEEE transactions on neural networks and learning systems, 27(1):62–76, 2015.
|
| 261 |
+
[51] Vladimir Vovk. Conditional validity of inductive conformal predictors. In Asian conference on machine learning, pages 475–490. PMLR, 2012.
|
| 262 |
+
[52] Alistair EW Johnson, Tom J Pollard, Lu Shen, H Lehman Li-Wei, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. Mimic-iii, a freely accessible critical care database. Scientific data, 3(1):1–9, 2016.
|
| 263 |
+
[53] Catherine Blake. Uci repository of machine learning databases. http://www. ics. uci. edu/˜ mlearn/MLRepository. html, 1998.
|
md/train/RzYrn625bu8/RzYrn625bu8.md
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VATT: Transformers for Multimodal Self-Supervised Learning from Raw Video, Audio and Text
|
| 2 |
+
|
| 3 |
+
Hassan Akbari∗ Columbia University ha2436@columbia.edu
|
| 4 |
+
|
| 5 |
+
Liangzhe Yuan Google lzyuan@google.com
|
| 6 |
+
|
| 7 |
+
Rui Qian∗ Cornell University rq49@cornell.edu
|
| 8 |
+
|
| 9 |
+
Wei-Hong Chuang Google whchuang@google.com
|
| 10 |
+
|
| 11 |
+
Shih-Fu Chang Columbia University sc250@columbia.edu
|
| 12 |
+
|
| 13 |
+
Yin Cui Google yincui@google.com
|
| 14 |
+
|
| 15 |
+
Boqing Gong
|
| 16 |
+
Google
|
| 17 |
+
bgong@google.com
|
| 18 |
+
|
| 19 |
+
# Abstract
|
| 20 |
+
|
| 21 |
+
We present a framework for learning multimodal representations from unlabeled data using convolution-free Transformer architectures. Specifically, our VideoAudio-Text Transformer (VATT) takes raw signals as inputs and extracts multimodal representations that are rich enough to benefit a variety of downstream tasks. We train VATT end-to-end from scratch using multimodal contrastive losses and evaluate its performance by the downstream tasks of video action recognition, audio event classification, image classification, and text-to-video retrieval. Furthermore, we study a modality-agnostic, single-backbone Transformer by sharing weights among the three modalities. We show that the convolution-free VATT outperforms state-of-the-art ConvNet-based architectures in the downstream tasks. Especially, VATT’s vision Transformer achieves the top-1 accuracy of $8 2 . 1 \%$ on Kinetics-400, $8 3 . 6 \%$ on Kinetics-600, $7 2 . 7 \%$ on Kinetics-700, and $4 1 . 1 \%$ on Moments in Time, new records while avoiding supervised pre-training. Transferring to image classification leads to $7 8 . 7 \%$ top-1 accuracy on ImageNet compared to ${ \bar { 6 4 . 7 \% } }$ by training the same Transformer from scratch, showing the generalizability of our model despite the domain gap between videos and images. VATT’s audio Transformer also sets a new record on waveform-based audio event recognition by achieving the mAP of $3 9 . 4 \%$ on AudioSet without any supervised pre-training. VATT’s source code is publicly available.2
|
| 22 |
+
|
| 23 |
+
# 1 Introduction
|
| 24 |
+
|
| 25 |
+
Convolutional neural networks (CNNs) [53, 51] have triumphed over various computer vision tasks. The inductive bias induced by convolutions, namely translation invariance and locality, are proven effective for the visual data. In the meantime, however, we witness in the natural language processing (NLP) community a paradigm shift from the models with strong inductive biases, such as recurrent neural networks [43, 7] and CNNs [104, 32], to more general architectures constructed upon selfattention. Particularly, Transformers [88] have become the de facto model architecture for NLP tasks [23, 70, 71, 10]. Pre-training a Transformer on large text corpora followed by fine-tuning gives rise to state-of-the-art results for different downstream tasks.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Overview of the VATT architecture and the self-supervised, multimodal learning strategy. VATT linearly projects each modality into a feature vector and feeds it into a Transformer encoder. We define a semantically hierarchical common space to account for the granularity of different modalities and employ the Noise Contrastive Estimation (NCE) to train the model.
|
| 29 |
+
|
| 30 |
+
In view of the success of the attention mechanism in NLP, there has been a rich line of works exploring its potential in computer vision. Early work studied hybrid models consisting of both convolutions and attention modules [89, 94, 36, 105]. Recent studies showed that convolution-free, specially designed all-attention models can match CNNs’ performance on image recognition tasks [106, 44, 73]. Most recently, [25] achieved impressive performance on several image recognition tasks, including ImageNet [22], using a pre-trained Transformer with minimal architecture changes. Their work delivered a compelling message that “large scale (supervised) training trumps inductive bias (for image classification).” This conclusion was further extended to video recognition tasks by [9, 5].
|
| 31 |
+
|
| 32 |
+
However, the large-scale supervised training of Transformers is essentially troubling for two main reasons. First, it rules out the much larger other part of “big visual data,” i.e, the vast amount of unlabeled, unstructured visual data. As a result, the supervised training strategy could produce biased systems that require even more labeled data to correct their biases. Second, this strategy fundamentally limits the application scope of Transformers in computer vision because it is costly and extremely time-consuming to collect enough labeled images or videos for training the millions of parameters, choosing hyper-parameters, and validating their expected generalization.
|
| 33 |
+
|
| 34 |
+
Hence, this work poses another pressing question about the Transformers that take raw signals as input. How to empower them with large-scale, unlabeled visual data? To answer this question, we draw insights from NLP. BERT [23] and GPT [70, 71, 10] use masked language modeling as their pre-training tasks. Natural languages are organic supervision for Transformers. They sequentially place words, phrases, and sentences into context, granting them semantics and syntax. For visual data, the most organic supervision is arguably the multimodal videos. They are abundantly available in the digital world, and their temporal, cross-modality regulation, and therefore supervision, requires no human annotation. The extreme scale of multimodal videos is potentially capable to teach Transformers necessary priors, as opposed to predefined inductive biases, to model the visual world.
|
| 35 |
+
|
| 36 |
+
To this end, we study self-supervised, multimodal pre-training of three Transformers [88], which take as input the raw RGB frames of internet videos, audio waveforms, and text transcripts of the speech audio, respectively. We call the video, audio, text Transformers VATT. Figure 1 illustrates the architecture. VATT borrows the exact architecture from BERT [23] and ViT [25] except the layer of tokenization and linear projection reserved for each modality separately. This design shares the same spirit as ViT that we make the minimal changes to the architecture so that the learned model can transfer its weights to various frameworks and tasks. Furthermore, the self-supervised, multimodal learning strategy resonates the spirit of BERT and GPT that the pre-training requires minimal human curated labels.
|
| 37 |
+
|
| 38 |
+
We evaluate the pre-trained Transformers on a variety of downstream tasks: image classification, video action recognition, audio event classification, and zero-shot text-to-video retrieval. Fine-tuning the vision-modality Transformer on ImageNet [22] obtains the top-1 accuracy of $7 8 . 7 \%$ , which is comparable to $7 9 . { \dot { 9 } } \%$ achieved by ViT. This result is especially appealing considering the domain gap between videos and images, and that ViT is pre-trained using a large-scale, human-curated image dataset. Furthermore, we set new records on Kinetics-400 [14], Kinetics-600 [15], Moments in Time [61], and AudioSet [33] without supervised pre-training.
|
| 39 |
+
|
| 40 |
+
Our VATT results, along with others reported for NLP tasks [23, 10], image recognition [25], semantic segmentation [108], point cloud classification [107], and action recoginition [9], demonstrate that Transformer is a versatile general-purpose architecture for different types of data.
|
| 41 |
+
|
| 42 |
+
To move one step forward, we challenge the Transformers in VATT by a seemingly too strong constraint: sharing weights among the video, audio, and text modalities. The idea is to test whether there exists a single, general-purpose model for all the modalities — of course, they still have their own layers of tokenization and linear projection. Preliminary results are encouraging. This modality-agnostic Transformer is on par with three modality-specific ones of slightly smaller sizes.
|
| 43 |
+
|
| 44 |
+
Finally, another contribution of this work is DropToken, a simple and yet effective technique to reduce the training complexity with a minor reduction of the end Transformers’ performance. DropToken randomly drops a portion of the video and audio tokens from each input sequence during training, allowing for high-resolution inputs and leveraging their abundance. This is significant for Transformers because their computational complexity is quadratic with respect to the number of input tokens.
|
| 45 |
+
|
| 46 |
+
# 2 Related work
|
| 47 |
+
|
| 48 |
+
# 2.1 Transformers in Vision
|
| 49 |
+
|
| 50 |
+
Transformer was originally built for NLP tasks [88] and the design of multi-head attention shows its effectiveness on modeling long-term correlation of words. A few attempts have been made to use Transformer for vision tasks like image super-resolution [99], object detection [11] and multimodal video understanding [84, 19, 57]. However these methods still rely on the feature extracted by CNNs. Recently, [25] proposes a set of convolution-free vision Transformers which directly work on raw images and obtain competitive performance with CNNs. [86] improves the training data efficiency of [25] by using stronger data augmentations and knowledge distillation. Since then, the pure Transformer design has been adopted to various vision tasks including semantic segmentation [108], point cloud classification [107], action recoginition [9, 78, 5]. To the best of our knowledge, our VATT is the first Transformer model on raw multimodal inputs of video, audio and text.
|
| 51 |
+
|
| 52 |
+
# 2.2 Self-Supervised Learning
|
| 53 |
+
|
| 54 |
+
Single vision modality. Early work of self-supervised visual representation learning usually learns from unlabeled images via manually specified pretext tasks, like auto-encoding [64, 102, 103], patch location prediction [24], solving jigsaw puzzles [63], and image rotation prediction [35]. [95] propose a novel instance discrimination objective. The recent trend of contrastive learning [40, 17, 100, 37, 41, 85] integrates data augmentations and instance discrimination by maintaining relative consistency between representations of an image and its augmented view. Clustering can also provide an effective addition [12]. Recently, [18] conduct contrastive learning using ViT [25] and achieve impressive results. As for the video domain, it is natural to exploit the temporal signals as the pretext task. Examples include predicting the future frame [82], motion and appearance statistics [90], speed [8, 91] and encodings [56, 38, 39], sorting frames or video clips [54, 97, 45, 31]. Recently, [68] apply contrastive learning to videos with a temporal sampling strategy and temporally consistent spatial augmentation.
|
| 55 |
+
|
| 56 |
+
Multimodal video. Video is a natural source of multimodal data. Multimodal self-supervised learning can be achieved by predicting whether a video has correspondence with an audio stream [3, 4, 62, 50], cross-modality clustering [2], and evolving losses [67]. Recently, [1] use contrastive loss to learn from video, audio and text; [74] learn to predict a broad view that spans a longer temporal context from a narrow view. VATT serves as a first work combining the strength of convolution-free Transformer and multimodal contrastive learning.
|
| 57 |
+
|
| 58 |
+
# 3 Approach
|
| 59 |
+
|
| 60 |
+
In this section, we introduce our convolution-free VATT architecture and elaborate on the selfsupervised multimodal objectives for training VATT from scratch.
|
| 61 |
+
|
| 62 |
+
Figure 1 is an overview of the architecture. We feed each modality to a tokenization layer, where the raw input is projected to an embedding vector followed by a Transformer. There are two major settings: 1) The backbone Transformers are separate and have specific weights for each modality, and 2) The Transformers share weights, namely, there is a single backbone Transformer applied to any of the modalities. In either setting, the backbone extracts modality-specific representations, which are then mapped to common spaces to be compared with each other by contrastive losses. We describe each module in the following.
|
| 63 |
+
|
| 64 |
+
# 3.1 Tokenization and Positional Encoding
|
| 65 |
+
|
| 66 |
+
VATT operates on raw signals. The vision-modality input consists of 3-channel RGB pixels of video frames, the audio input is in the form of air density amplitudes (waveforms), and the text input is a sequence of words. We first define a modality-specific tokenization layer that takes as input the raw signals and returns a sequence of vectors to be fed to the Transformers. Besides, each modality has its own positional encoding, which injects the order of tokens into Transformers [88]. We partition an entire video clip of size $T \times H \times W$ to a sequence of $\lceil T / t \rceil \cdot \lceil H / h \rceil \cdot \lceil W / w \rceil$ patches, where each patch contains $t \times h \times w \times 3$ voxels. We apply a linear projection on the entire voxels in each patch to get a $d$ -dimensional vector representation. This projection is performed by a learnable weight $W _ { v p } \in \mathbb { R } ^ { t \cdot h \cdot w \cdot 3 \times d }$ . This can be seen as a 3D extension of the patching mechanism proposed in [25]. To encode the position of these patches, we define a dimension-specific sequence of learnable embeddings as follows:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r l } { e _ { i , j , k } = e _ { \mathrm { T e m p o r a l } _ { i } } + e _ { \mathrm { H o r i z o n t a l } _ { j } } + e _ { \mathrm { V e r t i c a l } _ { k } } , } & { } \\ { E _ { \mathrm { T e m p o r a l } } \in \mathbb { R } ^ { \lceil T / t \rceil \times d } , } & { E _ { \mathrm { H o r i z o n t a l } } \in \mathbb { R } ^ { \lceil H / h \rceil \times d } , \quad E _ { \mathrm { V e r t i c a l } } \in \mathbb { R } ^ { \lceil W / w \rceil \times d } } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $e _ { i }$ is the $i$ -th row of $\pmb { { \cal E } }$ . This scheme allows us to use $\lceil T / t \rceil + \lceil H / h \rceil + \lceil W / w \rceil$ positional embeddings to encode all the $\lceil T / t \rceil \cdot \lceil H / h \rceil \cdot \lceil W / w \rceil$ patches in a video clip. The raw audio waveform is a 1D input with length $T ^ { \prime }$ , and we partition it to $\lceil T ^ { \prime } / t ^ { \prime } \rceil$ segments each containing $t ^ { \prime }$ waveform amplitudes. Similar to video, we apply a linear projection with a learnable weight $W _ { a p } \in \mathbb { R } ^ { t ^ { \prime } \times d }$ to all elements in a patch to get a $d$ -dimensional vector representation. We use $\lceil T ^ { \prime } / t ^ { \prime } \rceil$ learnable embeddings to encode the position of each waveform segment. For text, we first construct a vocabulary of size $v$ out of all words in our training dataset. For an input text sequence, we then map each word to a $v$ -dimensional one-hot vector followed by a linear projection with a learnable weight $W _ { t p } \in \mathbb { R } ^ { v \times d }$ . This is equivalent to an embedding dictionary lookup, which has been widely used in natural language understanding [60].
|
| 73 |
+
|
| 74 |
+
# 3.1.1 DropToken
|
| 75 |
+
|
| 76 |
+
We introduce DropToken, a simple and yet effective strategy to reduce the computational complexity during training. Once we get the token sequence for the video or audio modality, we randomly sample a portion of the tokens and then feed the sampled sequence, not the complete set of tokens, to the Transformer. This is crucial for reducing the computational cost because a Transformer’s computation complexity is quadratic, $O ( N ^ { 2 } )$ , where $N$ is number of tokens in the input sequence. Any effort on reducing the input length would reduce the number of FLOPs quadratically. This has an immediate impact on the wall clock time for training these models and makes it possible to host large models in limited hardware. We argue that instead of reducing the resolution or dimension of the raw inputs, it is better to keep a high-fidelity input and randomly sample the tokens via DropToken. DropToken is appealing especially with the raw video and audio inputs, which may contain high redundancies.
|
| 77 |
+
|
| 78 |
+
# 3.2 The Transformer Architecture
|
| 79 |
+
|
| 80 |
+
For simplicity, we adopt the most established Transformer architecture [23], which has been widely used in NLP. Similar to ViT [25], we do not tweak the architecture so that our weights can be easily transferred to any standard Transformer implementation. We will briefly elaborate on the pipeline (also illustrated in Figure 1 middle panel) and refer the reader to [25, 23] for more details of the standard Transformer architecture. The sequence of input tokens to the Transformer follows the below formulation:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
z _ { \mathrm { i n } } = [ x _ { \mathrm { A G G } } ; ~ x _ { 0 } W _ { P } ; ~ x _ { 1 } W _ { P } ; \ldots ; ~ x _ { N } W _ { P } ] + e _ { \mathrm { P O S } }
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where ${ \mathbf { \mathcal { x } } } _ { n }$ is the input patches sequence and $\pmb { x } _ { \mathrm { A G G } }$ is the learnable embedding of a special aggregation token whose corresponding output in the Transformer $( z _ { \mathrm { o u t } } ^ { 0 } )$ is used as the aggregated representation for the entire input sequence. This will be later used for classification and common space mapping. We use a standard self-attention [88] as the Multi-Head-Attention (MHA) module, and GeLU [42] as the activation in the MLP layer. We also use Layer Normalization [6] before the MHA and MLP modules. In our text model, we remove the position encoding $e _ { \mathrm { P O S } }$ and add a learnable relative bias to each attention score of the first layer in the MHA module. This simple change makes our text model’s weights directly transferable to the state-of-the-art text model T5 [72].
|
| 87 |
+
|
| 88 |
+
# 3.3 Common Space Projection
|
| 89 |
+
|
| 90 |
+
We use common space projection and contrastive learning in that common space to train our networks. More specifically, given a video-audio-text triplet, we define a semantically hierarchical common space mapping that enables us to directly compare video-audio pairs as well as video-text pairs by the cosine similarity. As argued in [1], such comparison is more feasible if we assume there are different levels of semantic granularity for these modalities. To achieve this, we define multi-level projections as follows:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r l } { z _ { v , v a } = g _ { v \to v a } ( z _ { \mathrm { o u t } } ^ { \mathrm { v i d e o } } ) , \ } & { z _ { a , v a } = g _ { a \to v a } ( z _ { \mathrm { o u t } } ^ { \mathrm { a u d i o } } ) } \\ { z _ { t , v t } = g _ { t \to v t } ( z _ { \mathrm { o u t } } ^ { \mathrm { t e x t } } ) , \ } & { z _ { v , v t } = g _ { v \to v t } ( z _ { v , v a } ) } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $g _ { v v a }$ and $g _ { a v a }$ are the projection heads to respectively map the video and audio Transformers’ outputs to the video-audio common space $\boldsymbol { S _ { v a } }$ . Moreover, $g _ { t v t }$ and $g _ { v v t }$ project the text Transformer’s outputs and the video embedding in the $\boldsymbol { S } _ { v a }$ space to video-text common space, $\boldsymbol { S _ { v t } }$ . This multi-level common space projection is depicted in Figure 1 (the rightmost panel). The main intuition behind this hierarchy is that different modalities have different levels of semantic granularity, so we should impose this as an inductive bias in the common space projection. Similar to [1], we use a linear projection for $g _ { a v a } ( . )$ , $g _ { t v t } ( . )$ , and $g _ { v v t } ( . )$ , and a two-layer projection with ReLU in between for $g _ { v v a } ( . )$ . To ease the training, a batch normalization is used after each linear layer.
|
| 97 |
+
|
| 98 |
+
# 3.4 Multimodal Contrastive Learning
|
| 99 |
+
|
| 100 |
+
Inspired by [1, 3, 59], we use Noise Contrastive Estimation (NCE) to align video-audio pairs and Multiple Instance Learning NCE (MIL-NCE) to align video-text pairs. The pairs are composed from different temporal locations in the video-audio-text stream. Positive pairs from two modalities are constructed by sampling their corresponding streams from the same location in the video, and negative pairs are constructed by sampling from any non-matching locations in the video [1]. Concretely, given the common space specified in Section 3, the loss objectives can be written as follows:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathrm { N C E } ( z _ { v , v a } , z _ { a , v a } ) = - \log \left( \frac { \exp ( z _ { v , v a } ^ { \top } z _ { a , v a } / \tau ) } { \exp ( z _ { v , v a } ^ { \top } z _ { a , v a } / \tau ) + \sum _ { z ^ { \prime } \in \mathcal { N } } \exp ( z _ { v , v a } ^ { \prime \top } z _ { a , v a } ^ { \prime } / \tau ) } \right) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\begin{array} { r } { \mathcal { A } \mathrm { I L } \mathrm { - N C E } ( z _ { v , v t } , \{ z _ { t , v t } \} ) = - \log \left( \frac { \sum _ { z _ { k , v t } \in \mathcal { P } } \exp ( z _ { v , v t } ^ { \top } z _ { t , v t } / \tau ) } { \sum _ { z _ { t , v t } \in \mathcal { P } } \exp ( z _ { v , v t } ^ { \top } z _ { t , v t } / \tau ) + \sum _ { z ^ { \prime } \in \mathcal { N } } \exp ( z _ { v , v t } ^ { \prime \top } z _ { t , v t } ^ { \prime } / \tau ) } \right) , } \end{array}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\mathcal { N }$ contains all non-matching pairs in a batch. In Equation 5, $\mathcal { P }$ contains five text clips that are nearest neighbors to the video clip in time. $\tau$ is a temperature to adjust the softness of the objectives in distinguishing the positive pairs from the negative pairs.
|
| 111 |
+
|
| 112 |
+
The overall per-sample objective for training the entire VATT model end-to-end is as follows:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\mathcal { L } = \mathrm { N C E } ( z _ { v , v a } , z _ { a , v a } ) + \lambda \mathrm { M I L } \mathrm { - N C E } ( z _ { v , v t } , \{ z _ { t , v t } \} ) ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\lambda$ balances the two losses. The model is optimized based on the back-propagation of the average loss calculated over a batch of samples.
|
| 119 |
+
|
| 120 |
+
# 4 Experiments
|
| 121 |
+
|
| 122 |
+
In this section, we first briefly describe the experimental setup for the pre-training and downstream evaluation, and then present the results and analytic interpretation of VATT in different tasks. We refer the reader to the Appendix for a more detailed description of all experimental settings.
|
| 123 |
+
|
| 124 |
+
# 4.1 Experimental Setup
|
| 125 |
+
|
| 126 |
+
Pre-train: we use a combination of AudioSet [33] and HowTo100M [58] datasets to pre-train VATT— we use only a subset of the HowTo100M dataset in compliance with Youtube’s policies. Following [1], we use video-audio-text triplets from HowTo100M clips while only using video-audio pairs from AudioSet. We sample 32 frames at 10 fps with a spatial size of $2 2 4 \times 2 2 4$ following a random crop, horizontal flip and color augmentation (details in A.2.1). Accordingly, we sample audio waveforms in sync at $4 8 \mathrm { k H z }$ . Both video and audio are normalized between [-1,1]. We use patch sizes of $4 \times 1 6 \times 1 6$ and 128 for video and raw waveform tokenization, respectively (ablation in A.5). We use one-hot vectors to encode text sequences (capped to 16 tokens) with the vocabulary size of $2 ^ { 1 6 }$ . In all pre-training experiments, we use DropToken with drop rate $50 \%$ . We train our models using the Adam optimizer [46] with a quarter-period cosine scheduled learning rate from 1e-4 to 5e-5 and 10k warmup steps. Optimization is performed on totally $5 0 0 \mathrm { k }$ steps with batch size 2048 (512 in exploration experiments). Following the previously established practice [1] for the projection to the common spaces $\boldsymbol { S _ { v a } }$ and $\boldsymbol { S _ { v t } }$ , we use $d _ { v a } = 5 1 2$ and $d _ { v t } = 2 5 6$ . We also use the temperature of $\tau = 0 . 0 7$ and the weight of $\lambda = 1$ in the loss in Equation 6. We use 4 network sizes in our experiments (details in A.2.2). We use the Medium model (155M parameters) for our modality-agnostic variant (VATT-MA), and 3 variants for the modality-specific video-audio-text backbones: Base-Base-Small (BBS; 197M), Medium-Base-Small (MBS; 264M), and Large-Base-Small (LBS; 415M). Pre-training an MBS VATT with batch size 2048 on 256 TPUs (v3) takes less than 3 days. Pre-training with batch size 512 takes less than 1 day.
|
| 127 |
+
|
| 128 |
+
Downstream: we evaluate the pre-trained VATT models on 4 major downstream tasks using a total of 10 datasets. We use UCF101 [81], HMDB51 [52], Kinetics-400 [14], Kinetics-600 [15], and Moments in Time [61] for video action recognition. We use ESC50 [66] and AudioSet [33] for audio event classification, and we evaluate the quality of our video-text common space representations by zero-shot text-to-video retrieval on YouCook2 [109] and MSR-VTT [98]. Finally, we evaluate the transferability of the vision backbone by fine-tuning it on ImageNet classification [22]. Since HMDB51, UCF101, and ESC50 are very small datasets compared to the size of our networks, we only use them to train a linear classifier on top of the frozen pre-trained backbones. In our exploration experiments, we report linear classification accuracy and zero-shot video retrieval metrics. We refer to the Appendix for a detailed description of the datasets and the experimental setup.
|
| 129 |
+
|
| 130 |
+
# 4.2 Results
|
| 131 |
+
|
| 132 |
+
# 4.2.1 Fine-tuning for video action recognition
|
| 133 |
+
|
| 134 |
+
We fine-tune VATT’s vision Transformer on Kinetics-400, Kinetics-600, and Moments in Time, three of the arguably most established large-scale datasets for video action recognition. We use the final checkpoints of four pre-train settings for these experiments: three modality-specific variations (LBS, MBS, BBS), and one modality-agnostic (Medium). Table 1 shows the results compared with the state-of-the-art video models. On all three datasets, we achieve higher accuracy than previous works including TimeSFormer [9], a recent effort in fine-tuning the ViT checkpoints obtained by supervised pre-training. In contrast, our pre-training does not rely on any labels curated by humans. To the best of our knowledge, VATT provides the first vision Transformer backbone that is pre-trained from scratch using self-supervision on multimodal videos and achieves state-of-the-art results on video action recognition. It is also worth mentioning that fine-tuning VATT on the most recent Kinetics-700 dataset results in a top-1 accuracy of $7 2 . 7 \%$ , which outperforms the state-of-the-art top-1 accuracy of $7 2 . 4 \%$ in [47].
|
| 135 |
+
|
| 136 |
+
To further quantify how much the multimodal self-supervised pre-training helps in achieving these numbers, we train a variant from scratch without any pre-training and observe the top-1 and top-5 accuracies of $2 6 . 4 \%$ and $5 1 . 8 \%$ on Kinetics-400, respectively. The low accuracies verify the efficacy of our pre-training strategy for VATT. Finally, we find that VATT-MA-Medium, the modality-agnostic backbone shared by the video, audio, and text modalities, is on par with the modality-specific VATTBase when fine-tuned for the video action recognition. This result is encouraging as it indicates the potential of unifying three data modalities by a single Transformer backbone.
|
| 137 |
+
|
| 138 |
+
<table><tr><td></td><td colspan="2">Kinetics-400</td><td colspan="2">Kinetics-600</td><td colspan="2">Moments in Time</td><td rowspan="2">TFLOPS</td></tr><tr><td>METHOD</td><td>ToP-1</td><td>TOP-5</td><td>TOP-1</td><td>TOP-5</td><td>TOP-1</td><td>TOP-5</td></tr><tr><td>I3D[13]</td><td>71.1</td><td>89.3</td><td>71.9</td><td>90.1</td><td>29.5</td><td>56.1</td><td></td></tr><tr><td>R(2+1)D [26]</td><td>72.0</td><td>90.0</td><td>-</td><td>-</td><td>1</td><td>1</td><td>17.5</td></tr><tr><td>bLVNet [27]</td><td>73.5</td><td>91.2</td><td>-</td><td>/</td><td>31.4</td><td>59.3</td><td>0.84</td></tr><tr><td>S3D-G [96]</td><td>74.7</td><td>93.4</td><td>=</td><td></td><td>-</td><td>-</td><td>-</td></tr><tr><td>Oct-I3D+NL [20]</td><td>75.7</td><td>1</td><td>76.0</td><td></td><td>=</td><td>1</td><td>0.84</td></tr><tr><td>D3D[83]</td><td>75.9</td><td>=</td><td>77.9</td><td></td><td></td><td></td><td>=</td></tr><tr><td>I3D+NL [93]</td><td>77.7</td><td>93.3</td><td>-</td><td></td><td></td><td></td><td>10.8</td></tr><tr><td>ip-CSN-152 [87]</td><td>77.8</td><td>92.8</td><td>1</td><td></td><td></td><td>=</td><td>3.3</td></tr><tr><td>AttentionNAS [92]</td><td>-</td><td>1</td><td>79.8</td><td>94.4</td><td>32.5</td><td>60.3</td><td>1.0</td></tr><tr><td>AssembleNet-101 [77]</td><td>-</td><td>=</td><td>-</td><td>-</td><td>34.3</td><td>62.7</td><td>1</td></tr><tr><td>MoViNet-A5 [47]</td><td>78.2</td><td>1</td><td>82.7</td><td>1</td><td>39.1</td><td>-</td><td>0.29</td></tr><tr><td>LGD-3D-101 [69]</td><td>79.4</td><td>94.4</td><td>81.5</td><td>95.6</td><td>-</td><td>=</td><td>-</td></tr><tr><td>SlowFast-R101-NL [30]</td><td>79.8</td><td>93.9</td><td>81.8</td><td>95.1</td><td></td><td></td><td>7.0</td></tr><tr><td>X3D-XL [29]</td><td>79.1</td><td>93.9</td><td>81.9</td><td>95.5</td><td>=</td><td></td><td>1.5</td></tr><tr><td>X3D-XXL [29]</td><td>80.4</td><td>94.6</td><td>1</td><td>-</td><td></td><td></td><td>5.8</td></tr><tr><td>TimeSFormer-L [9]</td><td>80.7</td><td>94.7</td><td>82.2</td><td>95.6</td><td>-</td><td>=</td><td>7.14</td></tr><tr><td>VATT-Base</td><td>79.6</td><td>94.9</td><td>80.5</td><td>95.5</td><td>38.7</td><td>67.5</td><td>9.09</td></tr><tr><td>VATT-Medium</td><td>81.1</td><td>95.6</td><td>82.4</td><td>96.1</td><td>39.5</td><td>68.2</td><td>15.02</td></tr><tr><td>VATT-Large</td><td>82.1</td><td>95.5</td><td>83.6</td><td>96.6</td><td>41.1</td><td>67.7</td><td>29.80</td></tr><tr><td>VATT-MA-Medium</td><td>79.9</td><td>94.9</td><td>80.8</td><td>95.5</td><td>37.8</td><td>65.9</td><td>15.02</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 1: Video action recognition accuracy on Kinetics-400, Kinetics-600, and Moments in Time.
|
| 141 |
+
|
| 142 |
+
# 4.2.2 Fine-tuning for audio event classification
|
| 143 |
+
|
| 144 |
+
We fine-tune VATT’s audio Transformer on AudioSet, which benchmarks the task of multi-label audio event classification. We use the final checkpoints of two pre-train settings: one modality-specific (BBS), and one modality-agnostic (Medium). Table 2 shows the results compared to state-of-the-art models. Following common practice [34, 48], we report mean Average Precision (mAP), Area Under Curve (AUC), and d-prime (based on AUC) [34]. Our audio Transformer consistently outperforms the existing CNN-based models in all metrics. More interestingly, fine-tuning the modality-agnostic backbone (VATT-MA-Medium) is on par with fine-tuning the modality-specific one (VATT-Base). To the best of our knowledge, VATT is the first Transformer that outperforms CNN-based models in audio event recognition. VATT operates on raw waveforms and does not utilize any handcrafted features.
|
| 145 |
+
|
| 146 |
+
# 4.2.3 Fine-tuning for image classification
|
| 147 |
+
|
| 148 |
+
In this section, we show that our pipeline is capable of transferring the learned knowledge into another domain by performing the image classification task, even though the models are pre-trained in the multimodal video domain. We fine-tune the vision Transformer in VATT-BBS on ImageNet without any modification to the backbone architecture. Instead, to satisfy the voxel-to-patch layer we replicate the input image 4 times and feed it to the network. The network sees the input as a single-frame video clip and performs spatial self-attention. Table 3 shows the results for fine-tuning the vision Transformer end-to-end on ImageNet. We can see that our pre-training leads to a significant boost in the accuracy compared to training from scratch. We also observe that even though the self-supervised pre-training happens in the video domain, we still achieve competitive results to the supervised pre-training using large-scale image data [25].
|
| 149 |
+
|
| 150 |
+
# 4.2.4 Zero-shot text-to-video retrieval
|
| 151 |
+
|
| 152 |
+
We feed video-text pairs to VATT-MBS, and extract representations in the $\boldsymbol { S _ { v t } }$ space. We then calculate the similarity between each video-text pair from YouCook2 and MSR-VTT. Given a text query, we rank the videos based on their similarities to the text. We then measure the recall for the correct video in the top-10 videos. We also measure the median of the rank of the correct video. Table 4 compares our video retrieval results to two baselines. In our experiments we observe that the zero-shot retrieval results are heavily affected by the batch size and number of epochs, confirming the observation made in [1]. That said, our model still delivers comparable results to MMV [1] while being pre-trained with a half number of epochs and a half batch size of theirs. We also experiment with a larger batch size 8192 and longer pre-training for 6 epochs, arriving at exactly the same results as MIL-NCE [59] on YouCook2 and the $\mathbf { R } @ 1 0$ of 29.2 and MedR of 42 on MSR-VTT. We also notice that, probably due to the noisy nature of text transcripts, a sophisticated language model like ours is underrated. As shown in [1], using a simple linear projection would still perform reasonably well. It is worth exploring other, higher-quality text sources in future work.
|
| 153 |
+
|
| 154 |
+
Table 2: Finetuning results for AudioSet event classification.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>METHOD</td><td>mAP AUC d-prime</td></tr><tr><td>DaiNet [21]</td><td>29.5 95.8 2.437</td></tr><tr><td>LeeNet11 [55]</td><td>26.6 95.3 2.371</td></tr><tr><td>LeeNet24 [55]</td><td>33.6 96.3 2.525</td></tr><tr><td>Res1dNet31 [49]</td><td>36.5 95.8 2.444</td></tr><tr><td>Res1dNet51 [49]</td><td>35.5 94.8 2.295</td></tr><tr><td>Wavegram-CNN [49]</td><td>38.9 96.8 2.612</td></tr><tr><td>VATT-Base</td><td>39.4 97.1 2.895</td></tr><tr><td>VATT-MA-Medium</td><td>39.3 97.0 2.884</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Table 3: Finetuning results for ImageNet classification.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>METHOD</td><td>PRE-TRAINING DATA</td><td>TOP-1</td><td>TOP-5</td></tr><tr><td>iGPT-L [16]</td><td>ImageNet</td><td>72.6</td><td>1</td></tr><tr><td>ViT-Base [25]</td><td>JFT</td><td>79.9</td><td>1</td></tr><tr><td>VATT-Base</td><td>-</td><td>64.7</td><td>83.9</td></tr><tr><td>VATT-Base</td><td>HowTo100M</td><td>78.7</td><td>93.9</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 4: Zero-shot text-to-video retrieval.
|
| 163 |
+
|
| 164 |
+
<table><tr><td></td><td colspan="4">YouCook2 MSR-VTT</td></tr><tr><td>METHOD</td><td>BATCH EPOCH R@10 MedR R@ 10 MedR 27</td><td></td><td></td><td></td></tr><tr><td>MIL-NCE [59]</td><td>8192</td><td>51.2</td><td>10 32.4</td><td>30</td></tr><tr><td>MMV[1]</td><td>4096 8</td><td>45.4</td><td>13 31.1</td><td>38</td></tr><tr><td>VATT-MBS</td><td>2048 4</td><td>45.5</td><td>13 29.7</td><td>49</td></tr><tr><td>VATT-MA-Medium</td><td>2048 4</td><td>40.6</td><td>17</td><td>23.6 67</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 4.2.5 Feature visualization
|
| 167 |
+
|
| 168 |
+
We take our modality-specific and modality-agnostic VATT fine-tuned on Kinetics-400 and visualize their output feature representations using t-SNE. For comparison, we also include the feature visualization of the vision Transformer trained from scratch on Kinetics-400. From Figure 2, we observe that the fine-tuned VATT yields a much better separation than the model trained from scratch. Furthermore, it is worth noting that there is no clear difference between the modality-agnostic features and the modality-specific ones.
|
| 169 |
+
|
| 170 |
+
We further investigate the VATT backbones without any fine-tuning. We randomly choose 1k video clips from the YouCook2 dataset and store the representations from two points of a pre-trained VATT model. One is after the tokenization layer (input space of the Transformer), and the other is after the common space projection (output space), where the loss is computed. Figure 3-top visualizes the representations, comparing modality-specific VATT to modality-agnostic VATT. Interestingly, we observe that the representations are slightly more mixed together in the modality-agnostic setting compared to the modality-specific ones, implying that the modality-agnostic backbone sees different modalities as different symbols describing the same concept. This is analogous to a unified language model in NLP that supports multiple languages.
|
| 171 |
+
|
| 172 |
+
To see how well VATT distinguishes positive video-text pairs from randomly sampled pairs, we calculate pair-wise similarities for all possible pairs and perform a Kernel Density Estimation (KDE) to visualize the distributions of the similarities of the positive pairs vs. negative pairs. We perform this procedure for both input and output spaces of the modality-specific and modality-agnostic backbones. Figure 3-bottom shows the KDE curves of these similarities. We can see that VATT in both settings separates the positive and negative pairs in its output space. This verifies VATT’s efficacy in learning a semantic common space for different modalities, even if we share the backbone across modalities.
|
| 173 |
+
|
| 174 |
+
# 4.2.6 Model Activations
|
| 175 |
+
|
| 176 |
+
We measure the average activation of the modality-agnostic VATT when a full multimodal input is fed to the model. More specifically, we sample $1 0 0 \mathrm { k }$ short video clips from the test split of HowTo100M along with their corresponding audio and text and feed them to the model separately. For each modality, we calculate the average activation of each node at the output of the MLP module, before the residual addition (Figure 1-Transformer Encoder). Figure 4 shows the average activations across all nodes in a Medium-size model. We observe that earlier nodes in the model are activated with the text inputs, while the middle-to-later nodes are activated with video and audio modalities. However, the nodes in the last layers of the network are activated with all modalities almost equally. This might suggest that the model allocates different nodes to certain modalities while reaching the same level of semantic perception for all modalities in the later layers. Such observation encourages further studies on the possibility of utilizing Mixture-of-Experts [79, 28, 76] to increase the model’s capacity for simultaneous multimodal perception. We leave this direction of research for future work.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 2: t-SNE visualization of the feature representations extracted by the vision Transformer in different training settings. For better visualization, we show 100 random classes from Kinetics-400.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 3: t-SNE visualization and distribution of pair-wise similarities of the input space vs. output space for modality-specific and modality-agnostic backbones when different modalities are fed.
|
| 183 |
+
|
| 184 |
+
# 4.2.7 Effect of DropToken
|
| 185 |
+
|
| 186 |
+
We introduced a new method to reduce the redundancy in high-resolution data. To study the effect of the proposed DropToken method on downstream applications and the pre-training computation, we perform pre-training by randomly dropping $7 5 \%$ , $5 0 \%$ , $2 5 \%$ , and $0 \%$ (no drop) of the tokens from the video and audio inputs. Table 5 shows the accuracy of linear classification on HMDB51, UCF101, ESC50 and $\mathrm { R @ 1 0 }$ on YouCook2 and MSR-VTT vs. the drop rate along with GFLOPs during a forward call. We choose $5 0 \%$ sampling rate for our large-scale pre-training as it offers a good trade-off between accuracy and computational costs. We then take the final checkpoint of the pre-trained VATT with $5 0 \%$ DropToken rate and perform fine-tuning on Kinetics-400 at different DropToken rates and at different spatial and temporal resolutions to see how high-resolution inputs coupled with DropToken compare to low-resolution inputs with no tokens dropped during fine-tuning. Table 6 shows the top-1 accuracy on Kinetics-400. We argue against using low-resolution inputs, which is the most common approach to reduce the computational cost during training. Instead, we suggest using high-resolution inputs with DropToken, whose accuracy and training cost are comparable to or better than low-resolution counterparts.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Late Activation for Video & Audio
|
| 190 |
+
Figure 4: The average node activation across the Modality-Agnostic-Medium VATT while feeding a multimodal video-audio-text triplet to the model.
|
| 191 |
+
|
| 192 |
+
<table><tr><td></td><td>DropToken Drop Rate 75%</td></tr><tr><td>Multimodal GFLOPs 188.1</td><td>50% 25% 0% 375.4 574.2 784.8</td></tr><tr><td>HMDB51 62.5</td><td>65.6 66.4</td></tr><tr><td>UCF101</td><td>64.8 85.5 87.2</td></tr><tr><td>84.0 ESC50 78.9</td><td>84.1 84.6</td></tr><tr><td>YouCookII 17.9</td><td>20.7 24.2</td></tr><tr><td>14.1</td><td>14.6 15.1</td></tr></table>
|
| 193 |
+
|
| 194 |
+
Table 5: Top-1 accuracy of linear classification and $\mathrm { R @ 1 0 }$ of video retrieval vs. drop rate vs. inference GFLOPs in the VATT-MBS.
|
| 195 |
+
|
| 196 |
+
<table><tr><td rowspan="2">Resolution/ FLOPs</td><td colspan="4">DropToken Drop Rate</td></tr><tr><td>75%</td><td>50%</td><td>25%</td><td>0%</td></tr><tr><td>32 × 224 × 224 Inference (GFLOPs)</td><td></td><td></td><td>=</td><td>79.9 548.1</td></tr><tr><td>64×224 ×224 Inference (GFLOPs)</td><td>= -</td><td>=</td><td>= 1</td><td>80.8 1222.1</td></tr><tr><td>32 ×320×320 Inference (GFLOPs)</td><td>79.3 279.8</td><td>80.2 572.5</td><td>80.7 898.9</td><td>81.1 1252.3</td></tr></table>
|
| 197 |
+
|
| 198 |
+
Table 6: Top-1 accuracy of video action recognition on Kinetics400 using high-resolution inputs coupled with DropToken vs. low-resolution inputs.
|
| 199 |
+
|
| 200 |
+
# 5 Conclusion and Discussion
|
| 201 |
+
|
| 202 |
+
In this paper, we present a self-supervised multimodal representation learning framework based on Transformers. Our study suggests that Transformers are effective for learning semantic video/audio/text representations — even if one model is shared across modalities — and multimodal self-supervised pre-training is promising for reducing their dependency on large-scale labeled data. We show that DropToken can significantly reduce the pre-training complexity with video and audio modalities and have minor impact on the models’ generalization. We report new records of results on video action recognition and audio event classification and competitive performance on image classification and video retrieval. Having these results, we still see some limitations in our work. Firstly, not all videos have organic audio or speech, while our approach depends on meaningful multimodal correspondences. Besides, the text modality currently consists of speech transcripts, which are noisy and sometimes sparse. Potential negative Societal Impacts are mainly concerned with applications. The models could be biased if one applies our approach to the multimodal videos that are not representative enough. Finally, our method is still demanding in computation, though we managed to avoid the need for human labels. Future work can improve upon these limitations.
|
| 203 |
+
|
| 204 |
+
# Acknowledgments and Disclosure of Funding
|
| 205 |
+
|
| 206 |
+
We would like to thank Min-Hsuan Tsai, Jean-Baptise Alayrac, Andrew Audibert, Yeqing Li, Vidush Mukund, and the TensorFlow team for their help with codes, infrastructure, and insightful discussions.
|
| 207 |
+
|
| 208 |
+
# References
|
| 209 |
+
|
| 210 |
+
[1] Jean-Baptiste Alayrac, Adrià Recasens, Rosalia Schneider, Relja Arandjelovic, Jason Rama- ´ puram, Jeffrey De Fauw, Lucas Smaira, Sander Dieleman, and Andrew Zisserman. Selfsupervised multimodal versatile networks. In NeurIPS, 2020. 3, 5, 6, 8, 17, 18, 19, 20 [2] Humam Alwassel, Dhruv Mahajan, Bruno Korbar, Lorenzo Torresani, Bernard Ghanem, and Du Tran. Self-supervised learning by cross-modal audio-video clustering. arXiv preprint arXiv:1911.12667, 2019. 3, 20 [3] Relja Arandjelovic and Andrew Zisserman. Look, listen and learn. In CVPR, 2017. 3, 5 [4] Relja Arandjelovic and Andrew Zisserman. Objects that sound. In ECCV, 2018. 3 [5] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luciˇ c, and Cordelia ´ Schmid. Vivit: A video vision transformer. arXiv preprint arXiv:2103.15691, 2021. 2, 3 [6] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 5 [7] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. 1 [8] Sagie Benaim, Ariel Ephrat, Oran Lang, Inbar Mosseri, William T Freeman, Michael Rubinstein, Michal Irani, and Tali Dekel. Speednet: Learning the speediness in videos. In CVPR,
|
| 211 |
+
2020. 3 [9] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understanding? arXiv preprint arXiv:2102.05095, 2021. 2, 3, 6, 7 [10] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. 2, 3 [11] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. 3 [12] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020.
|
| 212 |
+
3 [13] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, 2017. 7 [14] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, 2017. 3, 6, 17 [15] Joao Carreira, Eric Noland, Andras Banki-Horvath, Chloe Hillier, and Andrew Zisserman. A short note about kinetics-600. arXiv preprint arXiv:1808.01340, 2018. 3, 6, 17 [16] Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In ICML, 2020. 8 [17] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. 3 [18] Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised visual transformers. arXiv preprint arXiv:2104.02057, 2021. 3 [19] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In ECCV, 2020. 3 [20] Yunpeng Chen, Haoqi Fan, Bing Xu, Zhicheng Yan, Yannis Kalantidis, Marcus Rohrbach, Shuicheng Yan, and Jiashi Feng. Drop an octave: Reducing spatial redundancy in convolutional neural networks with octave convolution. In ICCV, 2019. 7
|
| 213 |
+
[21] Wei Dai, Chia Dai, Shuhui Qu, Juncheng Li, and Samarjit Das. Very deep convolutional neural networks for raw waveforms. In ICASSP, 2017. 8
|
| 214 |
+
[22] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. 2, 3, 6, 17
|
| 215 |
+
[23] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019. 2, 3, 4
|
| 216 |
+
[24] Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In ICCV, 2015. 3
|
| 217 |
+
[25] 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. In ICLR, 2021. 2, 3, 4, 7, 8
|
| 218 |
+
[26] Heng Wang Du Tran, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. 2018 ieee. In CVPR, 2017. 7
|
| 219 |
+
[27] Quanfu Fan, Chun-Fu (Ricarhd) Chen, Hilde Kuehne, Marco Pistoia, and David Cox. More Is Less: Learning Efficient Video Representations by Temporal Aggregation Modules. In NeurIPS. 2019. 7
|
| 220 |
+
[28] William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961, 2021. 9
|
| 221 |
+
[29] Christoph Feichtenhofer. X3d: Expanding architectures for efficient video recognition. In CVPR, 2020. 7
|
| 222 |
+
[30] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In ICCV, 2019. 7, 18
|
| 223 |
+
[31] Basura Fernando, Hakan Bilen, Efstratios Gavves, and Stephen Gould. Self-supervised video representation learning with odd-one-out networks. In CVPR, 2017. 3
|
| 224 |
+
[32] Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In ICML, 2017. 1
|
| 225 |
+
[33] Jort F. Gemmeke, Daniel P. W. Ellis, Dylan Freedman, Aren Jansen, Wade Lawrence, R. Channing Moore, Manoj Plakal, and Marvin Ritter. Audio set: An ontology and human-labeled dataset for audio events. In ICASSP, 2017. 3, 6, 17
|
| 226 |
+
[34] Jort F Gemmeke, Daniel PW Ellis, Dylan Freedman, Aren Jansen, Wade Lawrence, R Channing Moore, Manoj Plakal, and Marvin Ritter. Audio set: An ontology and human-labeled dataset for audio events. In ICASSP, 2017. 7
|
| 227 |
+
[35] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In ICLR, 2018. 3
|
| 228 |
+
[36] Rohit Girdhar and Deva Ramanan. Attentional pooling for action recognition. In NeurIPS, 2017. 2
|
| 229 |
+
[37] Jean-Bastien Grill, Florian Strub, Florent Altché, 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. In NeurIPS, 2020. 3
|
| 230 |
+
[38] Tengda Han, Weidi Xie, and Andrew Zisserman. Video representation learning by dense predictive coding. In ICCV Workshops, 2019. 3
|
| 231 |
+
[39] Tengda Han, Weidi Xie, and Andrew Zisserman. Memory-augmented dense predictive coding for video representation learning. In ECCV, 2020. 3 [40] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. 3 [41] Olivier J Hénaff, Aravind Srinivas, Jeffrey De Fauw, Ali Razavi, Carl Doersch, SM Eslami, and Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019. 3 [42] Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016. 5 [43] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation,
|
| 232 |
+
1997. 1 [44] Han Hu, Zheng Zhang, Zhenda Xie, and Stephen Lin. Local relation networks for image recognition. In ICCV, 2019. 2 [45] Dahun Kim, Donghyeon Cho, and In So Kweon. Self-supervised video representation learning with space-time cubic puzzles. In AAAI, 2019. 3 [46] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6, 18 [47] Dan Kondratyuk, Liangzhe Yuan, Yandong Li, Li Zhang, Mingxing Tan, Matthew Brown, and Boqing Gong. Movinets: Mobile video networks for efficient video recognition. In CVPR,
|
| 233 |
+
2021. 6, 7 [48] Qiuqiang Kong, Changsong Yu, Yong Xu, Turab Iqbal, Wenwu Wang, and Mark D Plumbley. Weakly labelled audioset tagging with attention neural networks. TASLP, 2019. 7 [49] Qiuqiang Kong, Yin Cao, Turab Iqbal, Yuxuan Wang, Wenwu Wang, and Mark D Plumbley. Panns: Large-scale pretrained audio neural networks for audio pattern recognition. TASLP,
|
| 234 |
+
2020. 8, 19 [50] Bruno Korbar, Du Tran, and Lorenzo Torresani. Cooperative learning of audio and video models from self-supervised synchronization. NeurIPS, 2018. 3, 20 [51] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012. 1 [52] H. Kuehne, H. Jhuang, E. Garrote, T. Poggio, and T. Serre. HMDB: a large video database for human motion recognition. In ICCV, 2011. 6, 17 [53] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998. 1 [54] Hsin-Ying Lee, Jia-Bin Huang, Maneesh Singh, and Ming-Hsuan Yang. Unsupervised representation learning by sorting sequences. In ICCV, 2017. 3 [55] Jongpil Lee, Jiyoung Park, Keunhyoung Luke Kim, and Juhan Nam. Sample-level deep convolutional neural networks for music auto-tagging using raw waveforms. arXiv preprint arXiv:1703.01789, 2017. 8 [56] William Lotter, Gabriel Kreiman, and David Cox. Deep predictive coding networks for video prediction and unsupervised learning. arXiv preprint arXiv:1605.08104, 2016. 3 [57] Huaishao Luo, Lei Ji, Botian Shi, Haoyang Huang, Nan Duan, Tianrui Li, Xilin Chen, and Ming Zhou. Univilm: A unified video and language pre-training model for multimodal understanding and generation. arXiv preprint arXiv:2002.06353, 2020. 3 [58] Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, and Josef Sivic. Howto100m: Learning a text-video embedding by watching hundred million narrated video clips. In ICCV, 2019. 6, 17
|
| 235 |
+
|
| 236 |
+
[59] Antoine Miech, Jean-Baptiste Alayrac, Lucas Smaira, Ivan Laptev, Josef Sivic, and Andrew Zisserman. End-to-end learning of visual representations from uncurated instructional videos. In CVPR, 2020. 5, 8, 17, 20
|
| 237 |
+
|
| 238 |
+
[60] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. 4, 18
|
| 239 |
+
|
| 240 |
+
[61] Mathew Monfort, Alex Andonian, Bolei Zhou, Kandan Ramakrishnan, Sarah Adel Bargal, Tom Yan, Lisa Brown, Quanfu Fan, Dan Gutfreund, Carl Vondrick, et al. Moments in time dataset: one million videos for event understanding. TPAMI, 2019. 3, 6, 17
|
| 241 |
+
|
| 242 |
+
[62] Pedro Morgado, Nuno Vasconcelos, and Ishan Misra. Audio-visual instance discrimination with cross-modal agreement. arXiv preprint arXiv:2004.12943, 2020. 3
|
| 243 |
+
|
| 244 |
+
[63] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In ECCV, 2016. 3
|
| 245 |
+
|
| 246 |
+
[64] Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In CVPR, 2016. 3
|
| 247 |
+
|
| 248 |
+
[65] Mandela Patrick, Yuki M Asano, Polina Kuznetsova, Ruth Fong, João F Henriques, Geoffrey Zweig, and Andrea Vedaldi. Multi-modal self-supervision from generalized data transformations. arXiv preprint arXiv:2003.04298, 2020. 20
|
| 249 |
+
|
| 250 |
+
[66] Karol J. Piczak. ESC: Dataset for Environmental Sound Classification. In ACM MM, 2015. 6, 17
|
| 251 |
+
|
| 252 |
+
[67] AJ Piergiovanni, Anelia Angelova, and Michael S Ryoo. Evolving losses for unsupervised video representation learning. In CVPR, 2020. 3, 20
|
| 253 |
+
|
| 254 |
+
[68] Rui Qian, Tianjian Meng, Boqing Gong, Ming-Hsuan Yang, Huisheng Wang, Serge Belongie, and Yin Cui. Spatiotemporal contrastive video representation learning. In CVPR, 2021. 3 [69] Zhaofan Qiu, Ting Yao, Chong-Wah Ngo, Xinmei Tian, and Tao Mei. Learning spatio-temporal representation with local and global diffusion. In CVPR, 2019. 7
|
| 255 |
+
|
| 256 |
+
[70] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. 2
|
| 257 |
+
|
| 258 |
+
[71] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 2019. 2
|
| 259 |
+
|
| 260 |
+
[72] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR, 2020. 5
|
| 261 |
+
|
| 262 |
+
[73] Prajit Ramachandran, Niki Parmar, Ashish Vaswani, Irwan Bello, Anselm Levskaya, and Jonathon Shlens. Stand-alone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019. 2
|
| 263 |
+
|
| 264 |
+
[74] Adrià Recasens, Pauline Luc, Jean-Baptiste Alayrac, Luyu Wang, Florian Strub, Corentin Tallec, Mateusz Malinowski, Viorica Patraucean, Florent Altché, Michal Valko, et al. Broaden your views for self-supervised video learning. arXiv preprint arXiv:2103.16559, 2021. 3
|
| 265 |
+
|
| 266 |
+
[75] Steffen Rendle. Factorization machines. In ICDM, 2010. 19 [76] Carlos Riquelme, Joan Puigcerver, Basil Mustafa, Maxim Neumann, Rodolphe Jenatton, André Susano Pinto, Daniel Keysers, and Neil Houlsby. Scaling vision with sparse mixture of experts. arXiv preprint arXiv:2106.05974, 2021. 9
|
| 267 |
+
|
| 268 |
+
[77] Michael S Ryoo, AJ Piergiovanni, Mingxing Tan, and Anelia Angelova. Assemblenet: Searching for multi-stream neural connectivity in video architectures. arXiv preprint arXiv:1905.13209, 2019. 7
|
| 269 |
+
|
| 270 |
+
[78] Gilad Sharir, Asaf Noy, and Lihi Zelnik-Manor. An image is worth 16x16 words, what is a video worth? arXiv preprint arXiv:2103.13915, 2021. 3
|
| 271 |
+
|
| 272 |
+
[79] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017. 9
|
| 273 |
+
|
| 274 |
+
[80] Laura Smith, Nikita Dhawan, Marvin Zhang, Pieter Abbeel, and Sergey Levine. Avid: Learning multi-stage tasks via pixel-level translation of human videos. arXiv preprint arXiv:1912.04443, 2019. 20
|
| 275 |
+
|
| 276 |
+
[81] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012. 6, 17
|
| 277 |
+
|
| 278 |
+
[82] Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In ICML, 2015. 3
|
| 279 |
+
|
| 280 |
+
[83] Jonathan Stroud, David Ross, Chen Sun, Jia Deng, and Rahul Sukthankar. D3d: Distilled 3d networks for video action recognition. In WACV, 2020. 7
|
| 281 |
+
|
| 282 |
+
[84] Chen Sun, Fabien Baradel, Kevin Murphy, and Cordelia Schmid. Learning video representations using contrastive bidirectional transformer. arXiv preprint arXiv:1906.05743, 2019. 3
|
| 283 |
+
|
| 284 |
+
[85] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In ECCV, 2020. 3
|
| 285 |
+
|
| 286 |
+
[86] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020. 3
|
| 287 |
+
|
| 288 |
+
[87] Du Tran, Heng Wang, Lorenzo Torresani, and Matt Feiszli. Video classification with channelseparated convolutional networks. In ICCV, 2019. 7
|
| 289 |
+
|
| 290 |
+
[88] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. 1, 2, 3, 4, 5
|
| 291 |
+
|
| 292 |
+
[89] Fei Wang, Mengqing Jiang, Chen Qian, Shuo Yang, Cheng Li, Honggang Zhang, Xiaogang Wang, and Xiaoou Tang. Residual attention network for image classification. In CVPR, 2017. 2
|
| 293 |
+
|
| 294 |
+
[90] Jiangliu Wang, Jianbo Jiao, Linchao Bao, Shengfeng He, Yunhui Liu, and Wei Liu. Selfsupervised spatio-temporal representation learning for videos by predicting motion and appearance statistics. In CVPR, 2019. 3
|
| 295 |
+
|
| 296 |
+
[91] Jiangliu Wang, Jianbo Jiao, and Yun-Hui Liu. Self-supervised video representation learning by pace prediction. In ECCV, 2020. 3
|
| 297 |
+
|
| 298 |
+
[92] Xiaofang Wang, Xuehan Xiong, Maxim Neumann, AJ Piergiovanni, Michael S Ryoo, Anelia Angelova, Kris M Kitani, and Wei Hua. Attentionnas: Spatiotemporal attention cell search for video classification. In ECCV, 2020. 7
|
| 299 |
+
|
| 300 |
+
[93] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, 2018. 7
|
| 301 |
+
|
| 302 |
+
[94] Sanghyun Woo, Jongchan Park, Joon-Young Lee, and In So Kweon. Cbam: Convolutional block attention module. In ECCV, 2018. 2
|
| 303 |
+
|
| 304 |
+
[95] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, 2018. 3
|
| 305 |
+
|
| 306 |
+
[96] Saining Xie, Chen Sun, Jonathan Huang, Zhuowen Tu, and Kevin Murphy. Rethinking spatiotemporal feature learning: Speed-accuracy trade-offs in video classification. In ECCV, 2018. 7
|
| 307 |
+
|
| 308 |
+
[97] Dejing Xu, Jun Xiao, Zhou Zhao, Jian Shao, Di Xie, and Yueting Zhuang. Self-supervised spatiotemporal learning via video clip order prediction. In CVPR, 2019. 3 [98] Jun Xu, Tao Mei, Ting Yao, and Yong Rui. Msr-vtt: A large video description dataset for bridging video and language. In CVPR, 2016. 6, 17 [99] Fuzhi Yang, Huan Yang, Jianlong Fu, Hongtao Lu, and Baining Guo. Learning texture transformer network for image super-resolution. In CVPR, 2020. 3 [100] Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In CVPR, 2019. 3 [101] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 19 [102] Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In ECCV,
|
| 309 |
+
2016. 3 [103] Richard Zhang, Phillip Isola, and Alexei A Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In CVPR, 2017. 3 [104] Xiang Zhang, Junbo Zhao, and Yann Lecun. Character-level convolutional networks for text classification. NeurIPS, 2015. 1 [105] Y Zhang, K Li, K Li, B Zhong, and Y Fu. Residual non-local attention networks for image restoration. In ICLR, 2019. 2 [106] Hengshuang Zhao, Jiaya Jia, and Vladlen Koltun. Exploring self-attention for image recognition. In CVPR, 2020. 2 [107] Hengshuang Zhao, Li Jiang, Jiaya Jia, Philip Torr, and Vladlen Koltun. Point transformer. arXiv preprint arXiv:2012.09164, 2020. 3 [108] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. arXiv preprint arXiv:2012.15840, 2020.
|
| 310 |
+
3
|
| 311 |
+
|
| 312 |
+
[109] Luowei Zhou, Chenliang Xu, and Jason J Corso. Towards automatic learning of procedures from web instructional videos. In AAAI, 2018. 6, 17
|
md/train/S11KBYclx/S11KBYclx.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING CURVE PREDICTION WITH BAYESIAN NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Aaron Klein, Stefan Falkner, Jost Tobias Springenberg & Frank Hutter
|
| 4 |
+
Department of Computer Science
|
| 5 |
+
University of Freiburg
|
| 6 |
+
{kleinaa,sfalkner,springj,fh}@cs.uni-freiburg.de
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Different neural network architectures, hyperparameters and training protocols lead to different performances as a function of time. Human experts routinely inspect the resulting learning curves to quickly terminate runs with poor hyperparameter settings and thereby considerably speed up manual hyperparameter optimization. The same information can be exploited in automatic hyperparameter optimization by means of a probabilistic model of learning curves across hyperparameter settings. Here, we study the use of Bayesian neural networks for this purpose and improve their performance by a specialized learning curve layer.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Deep learning has celebrated many successes, but its performance relies crucially on good hyperparameter settings. Bayesian optimization (e.g, Brochu et al. (2010); Snoek et al. (2012); Shahriari et al. (2016)) is a powerful method for optimizing the hyperparameters of deep neural networks (DNNs). However, its traditional treatment of DNN performance as a black box poses fundamental limitations for large and computationally expensive data sets, for which training a single model can take weeks. Human experts go beyond this blackbox notion in their manual tuning and exploit cheaper signals about which hyperparameter settings work well: they estimate overall performance based on runs using subsets of the data or initial short runs to weed out bad parameter settings; armed with these tricks, human experts can often outperform Bayesian optimization.
|
| 15 |
+
|
| 16 |
+
Recent extensions of Bayesian optimization and multi-armed bandits therefore also drop the limiting blackbox assumption and exploit the performance of short runs (Swersky et al., 2014; Domhan et al., 2015; Li et al., 2017), performance on small subsets of the data (Klein et al., 2017), and performance on other, related data sets (Swersky et al., 2013; Feurer et al., 2015).
|
| 17 |
+
|
| 18 |
+
While traditional solutions for scalable Bayesian optimization include approximate Gaussian process models (e.g., Hutter et al.; Swersky et al. (2014)) and random forests (Hutter et al., 2011), a recent trend is to exploit the flexible model class of neural networks for this purpose (Snoek et al., 2015; Springenberg et al., 2016). In this paper, we study this model class for the prediction of learning curves. Our contributions in this paper are:
|
| 19 |
+
|
| 20 |
+
1. We study how well Bayesian neural networks can fit learning curves for various architectures and hyperparameter settings, and how reliable their uncertainty estimates are. 2. Building on the parametric learning curve models of Domhan et al. (2015), we develop a specialized neural network architecture with a learning curve layer that improves learning curve predictions. 3. We compare different ways to generate Bayesian neural networks: probabilistic back propagation (Hernández-Lobato and Adams, 2015) and two different stochastic gradient based Markov Chain Monte Carlo (MCMC) methods – stochastic gradient Langevin dynamics (SGLD (Welling and Teh, 2011)) and stochastic gradient Hamiltonian MCMC (SGHMC (Chen et al., 2014)) – for standard Bayesian neural networks and our specialized architecture and show that SGHMC yields better uncertainty estimates.
|
| 21 |
+
|
| 22 |
+
4. We evaluate the predictive quality for both completely new learning curves and for extrapolating partially-observed curves, showing better performance than the parametric function approach by Domhan et al. (2015) at stages were learning curves have not yet converged.
|
| 23 |
+
|
| 24 |
+
5. We extend the recent multi-armed bandit strategy Hyperband (Li et al., 2017) by sampling using our model rather than uniformly at random, thereby enabling it to approach nearoptimal configurations faster than traditional Bayesian optimization.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 1: Example learning curves of random hyperparameter configurations of 4 different iterative machine learning methods: convolutional neural network (CNN), fully connected neural network (FCNet), logistic regression (LR), and variational auto-encoder (VAE). Although different configurations lead to different learning curves, they usually share some characteristics for a certain algorithm and dataset (but vary across these).
|
| 28 |
+
|
| 29 |
+
# 2 PROBABILISTIC PREDICTION OF LEARNING CURVES
|
| 30 |
+
|
| 31 |
+
In this section, we describe a general framework to model learning curves of iterative machine learning methods. We first describe the approach by Domhan et al. (2015) which we will dub LCExtrapolation from here on. Afterwards, we discuss a more general joint model across time steps and hyperparameter values that can exploit similarities between hyperparameter configurations and predict for unobserved learning curves. We also study the observation noise of different hyperparameter configurations and show how we can adapt our model to capture this noise.
|
| 32 |
+
|
| 33 |
+
# 2.1 LEARNING CURVE PREDICTION WITH BASIS FUNCTION
|
| 34 |
+
|
| 35 |
+
An intuitive model for learning curves proposed by Domhan et al. (2015) uses a set of $k$ different parametric functions $\phi _ { i } ( \pmb { \theta } _ { i } , t ) \in \{ \phi _ { 1 } ( \pmb { \theta } _ { 1 } , t ) , . . . , \phi _ { k } ( \pmb { \theta } _ { k } , t ) \}$ to extrapolate learning curves $\left( y _ { 1 } , \ldots , y _ { n } \right)$ from the first $n$ time steps. Each parametric function $\phi _ { i }$ depends on a time step $t \in [ 1 , T ]$ and on a parameter vector $\theta _ { i }$ . The individual functions are combined into a single model by a weighted linear combination
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\hat { f } ( t | \Theta , { \pmb w } ) = \sum _ { i = 1 } ^ { k } w _ { i } \phi _ { i } ( t , \pmb \theta _ { i } ) ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\boldsymbol { \Theta } = ( \theta _ { 1 } , \ldots , \theta _ { k } )$ denotes the combined vector of all parameters $\theta _ { 1 } , \ldots , \theta _ { k }$ , and $\textbf { \em w } =$ $( w _ { 1 } , \ldots , w _ { k } )$ is the concatenated vector of the respective weights of each function. Assuming observation noise around the true but unknown value $f ( t )$ , i.e., assuming $y _ { t } \sim \mathcal { N } ( \hat { f } ( t | \Theta , w ) , \sigma ^ { 2 } )$ , Domhan et al. (2015) define a prior for all parameters ${ \dot { P } } ( { \bf \dot { \Theta } } , w , \sigma ^ { 2 } )$ and use a gradient-free MCMC method (Foreman-Mackey et al., 2013) to obtain $S$ samples, $( \Theta _ { 1 } , \dot { w } _ { 1 } , \sigma _ { 1 } ^ { 2 } ) , \dots , ( \Theta _ { S } , { w } _ { S } , \sigma _ { S } ^ { 2 } )$ , from the posterior
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
P ( \Theta , w , \sigma ^ { 2 } | y _ { 1 } \dots , y _ { n } ) \propto P ( y _ { 1 } , \dots , y _ { n } | \Theta , w , \sigma ^ { 2 } ) P ( \Theta , w , \sigma ^ { 2 } )
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
using the likelihood
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
P ( y _ { 1 } , \dots , y _ { n } | \Theta , w , \sigma ^ { 2 } ) = \prod _ { t = 1 } ^ { n } \mathcal { N } ( y _ { t } ; \hat { f } ( t | \Theta , w ) , \sigma ^ { 2 } ) .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
These samples then yield probabilistic extrapolations of the learning curve for future time steps $m$ with mean and variance predictions
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { c } { \displaystyle \hat { y } _ { m } = \mathbb { E } [ y _ { m } | y _ { 1 } , \dots y _ { n } ] \approx \frac { 1 } { S } \sum _ { s = 1 } ^ { S } \hat { f } ( m | \Theta _ { s } , w _ { s } ) , \mathrm { a n d } } \\ { \displaystyle \mathrm { v a r } ( \hat { y } _ { m } ) \approx \frac { 1 } { S } \sum _ { s = 1 } ^ { S } ( \hat { f } ( m | \Theta _ { s } , w _ { s } ) - \hat { y } _ { m } ) ^ { 2 } + \sum _ { s = 1 } ^ { S } \sigma _ { s } ^ { 2 } . } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
For our experiments, we use the original implementation by Domhan et al. (2015) with one modification: the original code included a term in the likelihood that enforced the prediction at $t = T$ to be strictly greater than the last value of that particular curve. This biases the estimation to never underestimate the accuracy at the asymptote. We found that in some of our benchmarks, this led to instabilities, especially with very noisy learning curves. Removing it cured that problem, and we did not observe any performance degradation on any of the other benchmarks.
|
| 60 |
+
|
| 61 |
+
The ability to include arbitrary parametric functions makes this model very flexible, and Domhan et al. (2015) used it successfully to terminate evaluations of poorly-performing hyperparameters early for various different architectures of neural networks (thereby speeding up Bayesian optimization by a factor of two). However, the model’s major disadvantage is that it does not use previously evaluated hyperparameters at all and therefore can only make useful predictions after observing a substantial initial fraction of the learning curve.
|
| 62 |
+
|
| 63 |
+
# 2.2 LEARNING CURVE PREDICTION WITH BAYESIAN NEURAL NETWORKS
|
| 64 |
+
|
| 65 |
+
In practice, similar hyperparameter configurations often lead to similar learning curves, and modelling this dependence would allow predicting learning curves for new configurations without the need to observe their initial performance. Swersky et al. (2014) followed this approach based on an approximate Gaussian process model. Their Freeze-Thaw method showed promising results for finding good hyperparameters of iterative machine learning algorithms using learning curve prediction to allocate most resources for well-performing configurations during the optimization. The method introduces a special covariance function corresponding to exponentially decaying functions to model the learning curves. This results in an analytically tractable model, but using different functions to account for cases where the learning curves do not converge exponentially is not trivial.
|
| 66 |
+
|
| 67 |
+
Here, we formulate the problem using Bayesian neural networks. We aim to model the validation accuracy $g ( { \pmb x } , t )$ of a configuration $\pmb { x } ~ \in ~ \pmb { \chi } ~ \subset ~ \mathbb { R } ^ { d }$ at time step $t ~ \in ~ ( 0 , 1 ]$ based on noisy observations ${ y ( { \pmb x } , t ) } \ \sim \ \bar { \mathcal { N } } ( { g ( { \pmb x } , t ) , \sigma ^ { 2 } } )$ . For each configuration $_ { \textbf { \em x } }$ trained for $T _ { x }$ time steps, we obtain $T _ { x }$ data points for our model; denoting the combined data by $\mathcal { D } =$ $\{ ( { \pmb x } _ { 1 } , t _ { 1 } , y _ { 1 1 } ) ) , ( { \pmb x } _ { 1 } , t _ { 2 } , y _ { 1 2 } ) , \dots , ( { \pmb x } _ { n } , T _ { x _ { n } } , y _ { n T _ { x _ { n } } } ) \}$ we can then write the joint probability of the data $\mathcal { D }$ and the network weights $W$ as
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
P ( \mathcal { D } , W ) = P ( W ) P ( \sigma ^ { 2 } ) \prod _ { i = 1 } ^ { | D | } \mathcal { N } ( y _ { i } ; \hat { g } ( { \pmb x } _ { i } , t _ { i } | W ) , \sigma ^ { 2 } ) .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\hat { g } ( \pmb { x } _ { i } , t _ { i } | W )$ is the prediction of a neural network. It is intractable to compute the posterior weight distribution $p ( W | \mathcal { D } )$ , but we can use MCMC to sample it, in particular stochastic gradient
|
| 74 |
+
|
| 75 |
+
MCMC methods, such as SGLD (Welling and Teh, 2011) or SGHMC (Chen et al., 2014). Given $M$ samples $W ^ { 1 } , \dots , W ^ { M }$ , we can then obtain the mean and variance of the predictive distribution $p ( g | \mathbf { x } , \bar { t } , \mathcal { D } )$ as
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r l } & { \displaystyle \hat { \mu } ( \pmb { x } , t | \mathcal { D } ) = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \hat { g } ( \pmb { x } , t | W ^ { i } ) , \mathrm { a n d } } \\ & { \displaystyle \widehat { \sigma ^ { 2 } } ( \pmb { x } , t | \mathcal { D } ) = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \left( \hat { g } ( \pmb { x } , t | W ^ { i } ) - \hat { \mu } ( \pmb { x } , t | \mathcal { D } ) \right) ^ { 2 } , } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
respectively. We will write these shorthand as $\hat { \mu } ( { \pmb x } , t )$ and $\widehat { \sigma ^ { 2 } } ( \pmb { x } , t )$ . This is similar to Eqs. 4 and exactly the model that Springenberg et al. (2016) used for (blackbox) Bayesian optimization with Bayesian neural networks; the only difference is in the input to the model: here, there is a data point for every time step of the curve, whereas Springenberg et al. (2016) only used a single data point per curve (for its final time step).
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 2: Example functions generated with our $k = 5$ basis functions (formulas for which are given in Appendix B). For each function, we drew 50 different parameters $\theta _ { i }$ uniformly at random in the output domain of the hidden layer(s) of our model. This illustrates the type of functions used to model the learning curves.
|
| 85 |
+
|
| 86 |
+
# 2.3 HETEROSCEDASTIC NOISE OF HYPERPARAMETER CONFIGURATION
|
| 87 |
+
|
| 88 |
+
In the model described above, we assume homoscedastic noise across hyperparameter configurations. To evaluate how realistic this assumption is, we sampled 40 configurations of a fully connected network (see Section 3.1 for a more detailed description of how the data was generated and Table 2 for the list of hyperparameters) and evaluated each configuration $R = 1 0$ times with different pseudorandom number seeds (see the right panel of Figure 3 for some examples). Figure 3 (left) shows on the vertical axis the noise $\begin{array} { r } { \bar { \sigma ^ { 2 } } ( { \pmb x } , t ) = \frac { 1 } { R } \sum _ { r = 1 } ^ { R } ( y ( { \pmb x } , t ) - \bar { \mu } ( { \pmb x } , t ) ) ^ { 2 } } \end{array}$ and on the horizontal axis the rank of each configuration based on their asymptotic sample mean performance $\begin{array} { r } { 1 ) = \frac { 1 } { R } \sum _ { r = 1 } ^ { R } y ( \pmb { x } , t = 1 ) } \end{array}$ .
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 3: On the left, we plot the noise estimate of 40 different configurations on the FCNet benchmark sorted by their asymptotic mean performance at $t = 1$ . The color indicates the time step $t$ , darker meaning a larger value. On the right, we show the learning curves of 5 different configurations each evaluated 10 times (indicated with the same color) with a different seed.
|
| 92 |
+
|
| 93 |
+
Maybe not surprisingly, the noise seems to correlate with the asymptotic performance of a configuration. The fact that the noise between different configurations varies on different orders of magnitudes suggests a heteroscedastic noise model to best describe this behavior. We incorporate this observation by making the noise dependent on the input data to allow to predict different noise levels for different hyperparameters. In principle, one could also model a $t$ dependent noise, but we could not find the same trend across different datasets.
|
| 94 |
+
|
| 95 |
+
# 2.4 NEW BASIS FUNCTION LAYER FOR LEARNING CURVE PREDICTION WITH BAYESIAN NEURAL NETWORKS
|
| 96 |
+
|
| 97 |
+
We now combine Bayesian neural networks with the parametric functions to incorporate more knowledge about learning curves into the network itself. Instead of obtaining the parameters $\Theta$ and $\pmb { w }$ by sampling from the posterior, we use a Bayesian neural network to learn several mappings simultaneously:
|
| 98 |
+
|
| 99 |
+
1. $\hat { \mu } _ { \infty }$ : $\mathcal X \mathbb R$ , the asymptotic value of the learning curve
|
| 100 |
+
2. $\Theta$ : $\mathcal { X } \to \mathbb { R } ^ { K }$ , the parameters of a parametric function model (see Figure 2 for some example curves from our basis functions)
|
| 101 |
+
3. $v \colon \mathcal { X } \to \mathbb { R } ^ { k }$ , the corresponding weights for each function in the model
|
| 102 |
+
4. $\widehat { \sigma ^ { 2 } }$ : $\mathcal { X } \to \mathbb { R } ^ { + }$ , the observational noise for this hyperparameter configuration
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 4: Our neural network architecture to model learning curves. A common hidden layer is used to simultaneously model $\hat { \mu } _ { \infty }$ , the parameters $\Theta$ of the basis functions, their respective weights $\pmb { w }$ , and the noise $\widehat { \sigma ^ { 2 } }$ .
|
| 106 |
+
|
| 107 |
+
With these quantities, we can compute the likelihood in (3) which allows training the network.
|
| 108 |
+
|
| 109 |
+
Phrased differently, we use a neural network to predict the model parameters $\Theta$ and weights $\pmb { w }$ of our parametric functions, yielding the following form for our network’s mean predictions:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r } { \hat { g } ( \pmb { x } _ { i } , t _ { i } | W ) = \hat { f } ( t _ { i } | \Theta ( \pmb { x } _ { i } , W ) , \pmb { w } ( \pmb { x } _ { i } , W ) ) . } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
A schematic of this is shown in Fig. 4. For training, we will use the same MCMC methods, namely SGLD and SGHMC mentioned above.
|
| 116 |
+
|
| 117 |
+
# 3 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
We now empirically evaluate the predictive performance of Bayesian neural networks, with and without our special learning curve layer. For both networks, we used a 3-layer architecture with tanh activations and 64 units per layer. We also evaluate two different sampling methods for both types of networks: stochastic gradient Langevin dynamics (SGLD) and stochastic gradient Hamiltonian MCMC (SGHMC), following the approach of Springenberg et al. (2016) to automatically adapt the noise estimate and the preconditioning of the gradients.
|
| 120 |
+
|
| 121 |
+
As baselines, we compare to other approaches suitable for this task. Besides the aforementioned work by Domhan et al. (2015), we also compare against random forests Breimann (2001) with empirical variance estimates (Hutter et al., 2014), a Gaussian process (GP) using the learning curve kernel from Swersky et al. (2014), another Bayesian neural network technique called probabilistic back propagation (PBP) (Hernández-Lobato and Adams, 2015), and the simple heuristic of using the last seen value (LastSeenValue) of each learning curve for extrapolation. The last model has been successfully used by Li et al. (2017) despite its simplicity.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 5: Qualitative comparison of the different models. The left panel shows the mean predictions of different methods on the CNN benchmark. All models observed the validation error of the first 12 epochs of the true learning curve (black). On the right, the posterior distributions over the value at 40 epochs is plotted.
|
| 125 |
+
|
| 126 |
+
# 3.1 DATASETS
|
| 127 |
+
|
| 128 |
+
For our empirical evaluation, we generated the following four datasets of learning curves, in each case sampling hyperparameter configurations at random from the hyperparameter spaces detailed in Table 2 in the appendix (see also Section D for some characteristic of these datasets):
|
| 129 |
+
|
| 130 |
+
• CNN: We sampled 256 configurations of 5 different hyperparameters of a 3-layer convolutional neural network (CNN) and trained each of them for 40 epochs on the CIFAR10 (Krizhevsky, 2009) benchmark.
|
| 131 |
+
FCNet: We sampled 4096 configurations of 10 hyperparameters of a 2-layer feed forward neural network (FCNet) on MNIST (LeCun et al., 2001), with batch normalization, dropout and ReLU activation functions, annealing the learning rate over time according to a power function. We trained the neural network for 100 epochs.
|
| 132 |
+
• LR: We sampled 1024 configurations of the 4 hyperparameters of logistic regression (LR) and also trained it for 100 epochs on MNIST. VAE: We sampled 1024 configuration of the 4 hyperparameters of a variational autoencoder (VAE) (Kingma and Welling, 2014). We trained the VAE on MNIST, optimizing the approximation of the lower bound for 300 epochs.
|
| 133 |
+
|
| 134 |
+
# .2 PREDICTING ASYMPTOTIC VALUES OF PARTIALLY OBSERVED CURVES
|
| 135 |
+
|
| 136 |
+
We first study the problem of predicting the asymptotic values of partially-observed learning curves tackled by Domhan et al. (2015). The LC-Extrapolation method by Domhan et al. (2015), the GP, and the last seen value work on individual learning curves and do not allow to model performance across hyperparameter configurations. Thus, we trained them separately on individual partial learning curves. The other models, including our Bayesian neural networks, on the other hand, can use training data from different hyperparameter configurations. Here, we used training data with the same number of epochs for every partial learning curve.1
|
| 137 |
+
|
| 138 |
+
The left panel of Figure 5 visualizes the extrapolation task, showing a learning curve from the CNN dataset and the prediction of the various models trained only using the first 12 of 40 epochs of the learning curve. The right panel shows the corresponding predictive distributions obtained with these models. LastSeenValue does not yield a distribution and uncertainties are not defined.
|
| 139 |
+
|
| 140 |
+
For a more quantitative evaluation, we used all models to predict the asymptotic value of all learning curves, evaluating predictions based on observing between $10 \%$ and $90 \%$ of the learning curves.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=2>CNNMSE·10² ALL</td><td rowspan=1 colspan=2>FCNetMSE-102 ALL</td><td rowspan=1 colspan=1>MSE·10²</td><td rowspan=1 colspan=1>LRALL</td><td rowspan=1 colspan=2>VAEMSE·104 ALL</td></tr><tr><td rowspan=1 colspan=1>SGLD</td><td rowspan=1 colspan=1>1.8±0.9</td><td rowspan=1 colspan=1>0.60±0.25</td><td rowspan=1 colspan=1>4.5±0.6</td><td rowspan=1 colspan=1>0.13±0.05</td><td rowspan=1 colspan=1>1.1 ± 0.3</td><td rowspan=1 colspan=1>0.77±0.08</td><td rowspan=1 colspan=1>4.7 ± 1.7</td><td rowspan=1 colspan=1>2.16 ±0.07</td></tr><tr><td rowspan=1 colspan=1>SGLD-LC</td><td rowspan=1 colspan=1>1.4 ± 0.9</td><td rowspan=1 colspan=1>1.09 ± 0.22</td><td rowspan=1 colspan=1>3.3 ±0.7</td><td rowspan=1 colspan=1>0.54± 0.06</td><td rowspan=1 colspan=1>1.3 ± 0.7</td><td rowspan=1 colspan=1>0.94 ±0.09</td><td rowspan=1 colspan=1>3.1 ± 1.1</td><td rowspan=1 colspan=1>1.55 ± 0.01</td></tr><tr><td rowspan=1 colspan=1>SGHMC</td><td rowspan=1 colspan=1>0.8±0.6</td><td rowspan=1 colspan=1>0.96± 0.15</td><td rowspan=1 colspan=1>1.9 ±0.3</td><td rowspan=1 colspan=1>0.50± 0.04</td><td rowspan=1 colspan=1>0.5±0.2</td><td rowspan=1 colspan=1>1.08±0.05</td><td rowspan=1 colspan=1>3.6± 1.5</td><td rowspan=1 colspan=1>2.34± 0.07</td></tr><tr><td rowspan=1 colspan=1>SGHMC-LC</td><td rowspan=1 colspan=1>0.7±0.6</td><td rowspan=1 colspan=1>1.15 ± 0.34</td><td rowspan=1 colspan=1>2.0±0.3</td><td rowspan=1 colspan=1>0.80±0.05</td><td rowspan=1 colspan=1>0.5±0.2</td><td rowspan=1 colspan=1>1.17 ± 0.08</td><td rowspan=1 colspan=1>1.9 ± 1.1</td><td rowspan=1 colspan=1>1.39 ± 0.65</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 1: In each column we report the mean squared error (MSE) and the average log-likelihood (ALL) of the 16 fold CV learning curve prediction for a neural network without learning curve prediction layer (SGLD and SGHMC) and with our new layer (SGLD-LC and SGHMC-LC).
|
| 145 |
+
|
| 146 |
+
Figure 6 shows the mean squared error between the true asymptotic value and the models’ predictions (left) and the average log-likelihood of the true value given each model as a function of how much of the learning curves has been observed. Note that we removed some methods from the plots to avoid clutter; the same plots with all methods can be found in the supplementary material. We notice several patterns:
|
| 147 |
+
|
| 148 |
+
1. Throughout, our specialized network architecture performs better than the standard Bayesian neural networks, and SGHMC outperformed SGLD (see Appendix C).
|
| 149 |
+
2. PBP shows mixed results for the extrapolated mean, and does not provide reliable uncertainties (also see Appendix C). We hypothesize that this may be due to its linear activation functions.
|
| 150 |
+
3. If no uncertainties are required, LastSeenValue is hard to beat. This is because many configurations approach their final performance quite quickly.
|
| 151 |
+
4. The GP mean predictions are very competitive, but the average log-likelihood indicates overconfidence, especially for short learning curves. We assume that the prior assumption of an exponential function is not flexible enough in practice and that after observing some data points the Gaussian process becomes too certain of its predictions.
|
| 152 |
+
5. The random forest’s mean predictions almost match the quality of the GP. The uncertainty estimates are better, but still too aggressive when only a small fraction of the learning curve was observed. Random forests do not extrapolate and similar to LastSeenValue also achieve a very good mean prediction if the learning curve has almost converged.
|
| 153 |
+
6. Local models for single curves clearly outperform global models for almost complete learning curves. Global models, like our BNN approach, on the other hand, are trained on many configurations and need to generalize across these, yielding somewhat worse performance for this (arguably easy) task.2
|
| 154 |
+
|
| 155 |
+
# 3.3 PREDICTING UNOBSERVED LEARNING CURVES
|
| 156 |
+
|
| 157 |
+
As mentioned before, training a joint model across hyperparameters and time steps allows us to make predictions for completely unobserved learning curves of new configurations. To estimate how well Bayesian neural networks perform in this task, we used the datasets from Section 3.1 and split all of them into 16 folds, allowing us to perform cross-validation of the predictive performance. For each fold, we trained all models on the full learning curves in the training set and let them predict the held-out learning curves.
|
| 158 |
+
|
| 159 |
+
Table 1 shows the mean squared error and the average log-likelihood (both computed for all points in each learning curve) across the 16 folds. We make two observations: firstly, both neural network architectures lead to a reasonable mean squared error and average log-likelihood, for both SGLD and SGHMC. Except on the VAE dataset our learning curve layer seems to improve mean squared error and average log likelihood. Secondly, SGHMC performed better than SGLD, with the latter resulting in predictions with too small variances. Figure 7 visualizes the results for our CNN dataset in more detail, showing that true and predicted accuracies correlate quite strongly.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 6: Assessment of the predictive quality based on partially observed learning curves on all 4 benchmarks. The panels on the left show the mean squared error of the predicted asymptotic value (y-axis) after observing all learning curves up to a given fraction of maximum number of epochs (x-axis). The panels on the right show the average log-likelihood based on the predictive mean and variance of the asymptotic value. Note that LastSeenValue does not provide a predictive variance.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 7: On the horizontal axis, we plot the true value and on the vertical axis the predicted values. Each point is colored by its log-likelihood (the brighter the higher). Our learning curve BNN trained with SGHMC leads to the best mean predictions and assigns the highest likelihood to the test points.
|
| 166 |
+
|
| 167 |
+
# 3.4 MODEL-BASED HYPERBAND
|
| 168 |
+
|
| 169 |
+
In this section, we show how our model can be used to improve hyperparameter optimization of iterative machine learning algorithms. For this, we extended the multi-armed bandit strategy Hyperband (Li et al., 2017), which in each iteration $i$ first samples $N _ { i }$ hyperparameter configurations $\dot { C } \dot { = } \{ { \pmb x } _ { 1 } , \ldots , { \pmb x } _ { N _ { i } } \}$ and then uses successive halving (Jamieson and Talwalkar, 2016) to iteratively discard poorly-performing configurations from $C$ . While the original Hyperband method samples configurations $C$ from a uniform distribution $\mathcal { U }$ over hyperparameter configurations, our extension instead samples them based on our model, with all other parts remaining unchanged. More precisely, we sample $M _ { i } \ > > \ N _ { i }$ configurations uniformly, $\hat { C } = \{ \pmb { x } _ { 1 } , \dotsc , \pmb { x } _ { M _ { i } } \} \sim \mathcal { U }$ , and pick the $N _ { i }$ configurations with the highest predicted asymptotic mean $a ( \pmb { x } ) = \hat { \mu } ( \pmb { x } , t = 1 )$ or upper confidence value $a ( { \pmb x } ) = \hat { \mu } ( { \pmb x } , t = 1 ) \hat { \bf \mu } + \hat { \sigma } ( \hat { \bf \ x } , t = 1 )$ .
|
| 170 |
+
|
| 171 |
+
For a thorough empirical evaluation and to reduce computational requirements we reused the data from Section 3.1 to construct a surrogate benchmark based on a random forest (see Appendix E for more details). After each iteration we report the final performance of the best observed configuration so far, along with the wall clock time that would have been needed for optimizing the true objective function. Reporting the (predicted) wall clock time (rather than the number of iterations) also takes our optimizer’s overhead into account. This is important since one may worry that this overhead may be substantial due to our use of a model; however, as we show it does not harm performance.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 8: Comparison of Hyperband, Hyperband with our model, and standard Bayesian optimization on the CNN benchmark. Hyperband finds a good configuration faster than standard Bayesian optimization, but it only approaches the global optimum quickly when extended with our model.
|
| 175 |
+
|
| 176 |
+
Figure 8 shows the immediate regret on the CNN benchmark as a function of wallclock time, for three optimizers: Hyperband, our model-based extension of Hyperband, as well as standard Bayesian optimization with a Gaussian process (a comparison to additional baselines can be found in Appendix E). Standard Bayesian optimization does not make use of learning curves and thus needs to evaluate each configuration for the full amount of epochs. Nevertheless, since training one configuration to the end takes less time than one round of successive halving, Bayesian optimization produces its first results earlier than Hyperband. In accordance with results by Li et al. (2017), in this experiment Hyperband found a configuration with good performance faster than standard Bayesian optimization, but its random sampling did not suffice to quickly approach the best configuration; given enough time Bayesian optimization performed better. However, extended by our model, Hyperband both found a good configuration fast and approached the global optimum fastest.
|
| 177 |
+
|
| 178 |
+
We would like to emphasize that our model-based extension of Hyperband is not limited to our particular Bayesian neural networks as the underlying model. Since Hyperband stops the majority of the configurations very early, the setting is quite similar to that of very short partially observed learning curves in Section 3.2, with the differences that some configurations have been evaluated for longer and that the model now has to generalize to unseen configurations. For example, for the CNN and LR benchmarks, the experiments in Section 3.2 showed that random forests achieve strong average log-likelihoods for very short partial learning curves, and we would therefore also expect them to work well when combined with Hyperband. However, given our model’s more robust likelihoods and mean squared error values we believe it to be less sensitive to the underlying data. Additionally, we can incorporate more prior knowledge about the general shape of the curves into our model, something that is not easily done for many other model classes.
|
| 179 |
+
|
| 180 |
+
# 4 CONCLUSION
|
| 181 |
+
|
| 182 |
+
We studied Bayesian neural networks for modelling the learning curves of iterative machine learning methods, such as stochastic gradient descent for convolutional neural networks. Based on the parametric learning curve models of Domhan et al. (2015), we also developed a specialized neural network architecture with a learning curve layer that improves learning curve predictions. In future work, we aim to study recurrent neural networks for predicting learning curves and will extend Bayesian optimization methods with Bayesian neural networks (Springenberg et al., 2016) based on our learning curve models.
|
| 183 |
+
|
| 184 |
+
# ACKNOWLEDGMENT
|
| 185 |
+
|
| 186 |
+
This work has partly been supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme under grant no. 716721, by the European Commission under grant no. H2020-ICT-645403-ROBDREAM, and by the German Research Foundation (DFG) under Priority Programme Autonomous Learning (SPP 1527, grant HU 1900/3-1).
|
| 187 |
+
|
| 188 |
+
# REFERENCES
|
| 189 |
+
|
| 190 |
+
E. Brochu, V. Cora, and N. de Freitas. A tutorial on Bayesian optimization of expensive cost functions, with application to active user modeling and hierarchical reinforcement learning. CoRR, 2010.
|
| 191 |
+
J. Snoek, H. Larochelle, and R. P. Adams. Practical Bayesian optimization of machine learning algorithms. In Proc. of NIPS’12, 2012.
|
| 192 |
+
B. Shahriari, K. Swersky, Z. Wang, R. Adams, and N. de Freitas. Taking the human out of the loop: A Review of Bayesian Optimization. Proc. of the IEEE, (1), 12/2015 2016.
|
| 193 |
+
K. Swersky, J. Snoek, and R. Adams. Freeze-thaw Bayesian optimization. CoRR, 2014.
|
| 194 |
+
T. Domhan, J. T. Springenberg, and F. Hutter. Speeding up automatic hyperparameter optimization of deep neural networks by extrapolation of learning curves. In Q. Yang and M. Wooldridge, editors, Proc. of IJCAI’15, 2015.
|
| 195 |
+
L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh, and A. Talwalkar. Hyperband: Bandit-based configuration evaluation for hyperparameter optimization. In Proc. of ICLR’17, 2017.
|
| 196 |
+
A. Klein, S. Falkner, S. Bartels, P. Hennig, and F. Hutter. Fast Bayesian optimization of machine learning hyperparameters on large datasets. In Proc. of AISTATS’17, 2017.
|
| 197 |
+
K. Swersky, J. Snoek, and R. Adams. Multi-task Bayesian optimization. In Proc. of NIPS’13, 2013.
|
| 198 |
+
M. Feurer, T. Springenberg, and F. Hutter. Initializing Bayesian hyperparameter optimization via meta-learning. In Proc. of AAAI’15, 2015.
|
| 199 |
+
F. Hutter, H. Hoos, K. Leyton-Brown, and K. Murphy. Time-bounded sequential parameter optimization.
|
| 200 |
+
F. Hutter, H. Hoos, and K. Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In LION’11, 2011.
|
| 201 |
+
J. Snoek, O. Rippel, K. Swersky, R. Kiros, N. Satish, N. Sundaram, M. M. A. Patwary, Prabhat, and R. P. Adams. Scalable Bayesian optimization using deep neural networks. In Proc. of ICML’15, 2015.
|
| 202 |
+
J. Springenberg, A. Klein, S. Falkner, and F. Hutter. Bayesian optimization with robust Bayesian neural networks. In Proc. of NIPS’16, 2016.
|
| 203 |
+
J. Hernández-Lobato and R. Adams. Probabilistic backpropagation for scalable learning of Bayesian neural networks. In Proc. of ICML’15, 2015.
|
| 204 |
+
M. Welling and Y. Teh. Bayesian learning via stochastic gradient Langevin dynamics. In Proc. of ICML’11, 2011.
|
| 205 |
+
T. Chen, E.B. Fox, and C. Guestrin. Stochastic gradient Hamiltonian Monte Carlo. In Proc. of ICML’14, 2014.
|
| 206 |
+
D. Foreman-Mackey, D. W. Hogg, D. Lang, and J. Goodman. emcee $:$ The MCMC Hammer. PASP, 2013.
|
| 207 |
+
L. Breimann. Random forests. MLJ, 2001.
|
| 208 |
+
F. Hutter, L. Xu, H. Hoos, and K. Leyton-Brown. Algorithm runtime prediction: Methods and evaluation. AIJ, 2014.
|
| 209 |
+
A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 210 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. In S. Haykin and B. Kosko, editors, Intelligent Signal Processing. IEEE Press, 2001. URL http://www.iro.umontreal.ca/\~lisa/pointeurs/lecun-01a.pdf.
|
| 211 |
+
D. Kingma and M. Welling. Auto-encoding variational bayes. In Proc. of ICLR’14, 2014.
|
| 212 |
+
K. Jamieson and A. Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In Proc. of AISTATS’16, 2016.
|
| 213 |
+
K. Eggensperger, F. Hutter, H.H. Hoos, and K. Leyton-Brown. Efficient benchmarking of hyperparameter optimizers via surrogates. In Proc. of AAAI’15, 2015.
|
| 214 |
+
|
| 215 |
+
# A EXPERIMENTAL SETUP – DETAILS
|
| 216 |
+
|
| 217 |
+
Table 2 shows the hyperparameters of our 4 benchmarks described in Section 3.1 and their ranges.
|
| 218 |
+
Table 2: Hyperparameter configuration space of the four different iterative methods. For the FCNet we decayed the learning rate by a $\alpha _ { d e c a y } = ( 1 + \gamma * t ) ^ { - \kappa }$ and also sampled different values for $\gamma$ and $\kappa$ .
|
| 219 |
+
|
| 220 |
+
<table><tr><td></td><td>Name</td><td>Range</td><td>log scale</td></tr><tr><td rowspan="5">CNN</td><td>batch size</td><td>[32, 512]</td><td>1</td></tr><tr><td>number of units layer 1</td><td>[24,210]</td><td>√</td></tr><tr><td>number of units layer 2</td><td>[24,210]</td><td>√</td></tr><tr><td>number of units layer 3</td><td>[24,210]</td><td><</td></tr><tr><td>learning rate</td><td>[10-6,10-0]</td><td>√</td></tr><tr><td rowspan="9">FCNet</td><td>initial learning rate</td><td>[10-6,10°]</td><td>√</td></tr><tr><td>L2 regularization</td><td>[10-8,10-1]</td><td></td></tr><tr><td>batch size</td><td>[32,512]</td><td>√</td></tr><tr><td>Y</td><td>[-3,-1]</td><td></td></tr><tr><td>K</td><td>[0,1]</td><td></td></tr><tr><td>momentum</td><td>[0.3,0.999]</td><td></td></tr><tr><td>number units 1</td><td>[25,122]</td><td></td></tr><tr><td>number units 2</td><td>[25,212]</td><td></td></tr><tr><td>dropout rate layer 1</td><td>[0.0,0.99]</td><td></td></tr><tr><td rowspan="4">LR</td><td>dropout rate layer 2</td><td>[0.0,0.99]</td><td></td></tr><tr><td>learning rate</td><td>[10-6,100]</td><td>√</td></tr><tr><td>L2</td><td>[0.0,1.0]</td><td></td></tr><tr><td>batch size</td><td>[20,2000]</td><td></td></tr><tr><td rowspan="5">VAE</td><td>dropout rate on inputs L</td><td>[0.0,0.75]</td><td></td></tr><tr><td>number of hidden units</td><td>[1,3]</td><td></td></tr><tr><td>batch size</td><td>[32,2048] [16,512]</td><td></td></tr><tr><td>z dimension</td><td></td><td></td></tr><tr><td></td><td>[2,200]</td><td></td></tr></table>
|
| 221 |
+
|
| 222 |
+
# B DESCRIPTION OF THE BASIS FUNCTIONS
|
| 223 |
+
|
| 224 |
+
To reduce complexity, we used a subset of the basis function from Domhan et al. (2015) which we found to be sufficient for learning curve prediction. We adapted these functions to model the residual between the asymptotic value $y _ { \infty }$ and we scaled the parameters $\Theta$ to be in $[ 0 , 1 ]$ . Table 3 shows the exact equations we used.
|
| 225 |
+
|
| 226 |
+
# C PREDICTING ASYMPTOTIC VALUES OF PARTIALLY OBSERVED CURVES
|
| 227 |
+
|
| 228 |
+
Figure 9 shows the mean squared error and the average log-likelihood of predicting the asymptotic value after observing different amounts of the learning curve for all methods. See Section 3.2 in the main text for more details.
|
| 229 |
+
|
| 230 |
+
# D DATASET CHARACTERISTICS
|
| 231 |
+
|
| 232 |
+
Figure 10 shows the distributions over runtimes for all random configurations of different benchmarks. As it can be seen there is a high variance of the runtime between different configurations for all benchmarks and some configurations need order of magnitudes longer than others.
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 9: Assessment of the predictive quality based on partially observed learning curves on all 4 benchmarks. The panels on the left show the mean squared error of the predicted asymptotic value (y-axis) after observing all learning curves up to a given fraction of maximum number of epochs (x-axis). The panels on the right show the average log-likelihood based on the predictive mean and variance of the asymptotic value.
|
| 236 |
+
|
| 237 |
+
Table 3: The formulas of our 5 basis functions.
|
| 238 |
+
|
| 239 |
+
<table><tr><td rowspan=1 colspan=1>Name</td><td rowspan=1 colspan=1>Formula</td></tr><tr><td rowspan=1 colspan=1>vapor pressure</td><td rowspan=1 colspan=1>Φ(t,a,b,c)=e-a-0.1-b.t-11c-lg(t)e--01b</td></tr><tr><td rowspan=1 colspan=1>pow</td><td rowspan=1 colspan=1>(t,a,b)=a·(tb-1)</td></tr><tr><td rowspan=1 colspan=1>log power</td><td rowspan=1 colspan=1>Φ(ta,b,c)=2·[()-(((t)</td></tr><tr><td rowspan=1 colspan=1>exponential</td><td rowspan=1 colspan=1>Φ(t,a,b)=a·[e-10-b -e-10·b·t]</td></tr><tr><td rowspan=1 colspan=1>hill-3</td><td rowspan=1 colspan=1>(t,a,b,c)=a.[(cb.t-b+1)-1-(cb+1)-1]</td></tr></table>
|
| 240 |
+
|
| 241 |
+
Figure 11 shows the empirical cumulative distribution of the asymptotic performance of random configurations. These plots give an intuition about the difficulty of a benchmark as they show how many random configurations one has to sample in order to achieve a good performance.
|
| 242 |
+
|
| 243 |
+
# E OPTIMIZATION ON SURROGATE BENCHMARKS
|
| 244 |
+
|
| 245 |
+
We follow the approach by Eggensperger et al. (2015) and used the generated datasets from Section 3.1 to build surrogates of the objective functions. This allows us to compare different optimizers on this benchmark very efficiently while (approximately) preserving the characteristics of the underlying benchmark. Using surrogates instead of optimizing the real benchmarks allows us to carry out a more thorough empirical evaluation (since single function evaluations are cheap and we therefore can afford more and longer optimization runs). We used random forests as surrogates following Eggensperger et al. (2015) since they do not introduce a bias for our approach (in contrast to, e.g., surrogates based on standard feed forward neural networks trained with stochastic gradient descent ). For each benchmark, we used all configurations to train a random forest predicting the validation accuracy of a configuration at a certain time step as well as the wall clock time for its evaluation.
|
| 246 |
+
|
| 247 |
+
After each round of successive halving, we return the current best observed configuration and its asymptotic performance. For each function evaluation, we predict the accuracy, and the runtime. By adding the optimization overhead, we can predict the wallclock time necessary to optimize the real objective function. Reporting the wallclock time rather than the number of iterations also takes the additional overhead from running our method into account. Furthermore, we argue that the wallclock time is more interesting in practice.
|
| 248 |
+
|
| 249 |
+
As baselines, we compare to Gaussian process based Bayesian optimization with the upper confidence bound acquisition function (GP-BO-UCB) and the (log) expected improvement acquisition function (GP-BO-Log-EI), as well as Bayesian optimization with Bayesian neural networks (BOHAMIANN) (Springenberg et al., 2016). As an additional baseline, we use standard Bayesian neural networks (SGHMC-BNN) inside Hyperband instead of our specialized neural network architecture (SGHMCLCNet). We compare our model-based version of Hyperband against all these baselines with sampling from the asymptotic mean (SGHMC-LCNet-mean-sampling) and the asymptotic upper confidence bound (SGHMC-LCNet-ucb-sampling). Figure 12 shows that our specialized neural network architecture helps to speed up the convergence of Hyperband on the CNN and the FCNet benchmark. For the LR benchmarks our model still improves over Hyperband but does not perform better than Bayesian optimization. Hyperband as well as our method find the optimum already after the first round of successive halving for the VAE benchmark, which leads to an regret of 0.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 10: Distributions over runtimes for different random configurations for the CNN, FCNet, LR and VAE benchmark described in Section 3.One can see that all distributions are long tailed and that especially on the FCNet benchmark some configuration need order of magnitudes longer than others.
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 11: Empirical cumulative distributions for the CNN, FCNet, LR and VAE benchmark.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 12: Different optimizers on a random forests based suggorate of all collected learning curves on different benchmarks. Note how sampling from the model improves Hyperband’s performance by converging to the optimum faster.
|
md/train/S18Su--CW/S18Su--CW.md
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THERMOMETER ENCODING: ONE HOT WAY TO RESIST ADVERSARIAL EXAMPLES
|
| 2 |
+
|
| 3 |
+
Jacob Buckman∗ †, Aurko Roy∗, Colin Raffel, Ian Goodfellow
|
| 4 |
+
Google Brain
|
| 5 |
+
Mountain View, CA
|
| 6 |
+
{buckman, aurkor, craffel, goodfellow}@google.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
It is well known that it is possible to construct “adversarial examples” for neural networks: inputs which are misclassified by the network yet indistinguishable from true data. We propose a simple modification to standard neural network architectures, thermometer encoding, which significantly increases the robustness of the network to adversarial examples. We demonstrate this robustness with experiments on the MNIST, CIFAR-10, CIFAR-100, and SVHN datasets, and show that models with thermometer-encoded inputs consistently have higher accuracy on adversarial examples, without decreasing generalization. State-of-the-art accuracy under the strongest known white-box attack was increased from $9 3 . 2 0 \%$ to $9 4 . 3 0 \%$ on MNIST and $5 0 . 0 0 \%$ to $7 9 . 1 6 \%$ on CIFAR-10. We explore the properties of these networks, providing evidence that thermometer encodings help neural networks to find more-non-linear decision boundaries.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION AND RELATED WORK
|
| 13 |
+
|
| 14 |
+
Adversarial examples are inputs to machine learning models that are intentionally designed to cause the model to produce an incorrect output. The term was introduced by Szegedy et al. (2014) in the context of neural networks for computer vision. In the context of spam and malware detection, such inputs have been studied earlier under the name evasion attacks (Biggio et al., 2013). Adversarial examples are interesting from a scientific perspective, because they demonstrate that even machine learning models that have superhuman performance on I.I.D. test sets fail catastrophically on inputs that are modified even slightly by an adversary. Adversarial examples also raise concerns in the emerging field of machine learning security because malicious attackers could use adversarial examples to cause undesired behavior (Papernot et al., 2016).
|
| 15 |
+
|
| 16 |
+
Unfortunately, there is not yet any known strong defense against adversarial examples. Adversarial examples that fool one model often fool another model, even if the two models are trained on different training examples (corresponding to the same task) or have different architectures (Szegedy et al., 2014), so an attacker can fool a model without access to it. Attackers can improve their success rate by sending inputs to a model, observing its output, and fitting their own own copy of the model to the observed input-output pairs (Papernot et al., 2016). Attackers can also improve their success rate by searching for adversarial examples that fool multiple different models—such adversarial examples are then much more likely to fool the unknown target model (Liu et al., 2016). Szegedy et al. (2014) proposed to defend the model using adversarial training (training on adversarial examples as well as regular examples) but it was not feasible to generate enough adversarial examples in the inner loop of the training process for the method to be effective at the time. Szegedy et al. (2014) used a large number of iterations of L-BFGS to produce their adversarial examples. Goodfellow et al. (2014) developed the fast gradient sign method (FGSM) of generating adversarial examples and demonstrated that adversarial training is effective for reducing the error rate on adversarial examples. A major difficulty of adversarial training is that it tends to overfit to the method of adversarial example generation used at training time. For example, models trained to resist FGSM adversarial examples usually fail to resist L-BFGS adversarial examples. Kurakin et al. (2016) introduced the basic iterative method (BIM) which lies between FGSM and L-BFGS on a curve trading speed for effectiveness (the BIM consists of running FGSM for a medium number of iterations). Adversarial training using BIM still overfits to the BIM, unfortunately, and different iterative methods can still successfully attack the model. Recently, Madry et al. (2017) showed that adversarial training using adversarial examples created by adding random noise before running BIM results in a model that is highly robust against all known attacks on the MNIST dataset. However, it is less effective on more complex datasets, such as CIFAR. A strategy for training networks which are robust to adversarial attacks across all contexts is still unknown. In this work, we demonstrate that thermometer code discretization and one-hot code discretization of real-valued inputs to a model significantly improves its robustness to adversarial attack, advancing the state of the art in this field.
|
| 17 |
+
|
| 18 |
+
# 2 INPUT DISCRETIZATION
|
| 19 |
+
|
| 20 |
+
We propose to break the linear extrapolation behavior of machine learning models by preprocessing the input with an extremely nonlinear function. This function must still permit the machine learning model to function successfully on naturally occurring inputs. The recent success of the PixelRNN model (Oord et al., 2016) has demonstrated that one-hot discrete codes for 256 possible values of color pixels are effective representations for input data. Other extremely nonlinear functions may also defend against adversarial examples, but we focused attention on vector-valued discrete encoding as our nonlinear function because of the evidence from PixelRNN that it would support successful machine learning.
|
| 21 |
+
|
| 22 |
+
Images are often encoded as a 3D tensor of integers in the range [0, 255]. The tensor’s three dimensions correspond to the image’s height, width, and color channels (e.g. three for RGB, one for greyscale). Each value represents an intensity value for a given color at a given horizontal/vertical position. For classification tasks, these values are typically normalized to floating-point approximations in the range (0, 1). Input discretization refers to the process of separating these continuousvalued pixel inputs into a set of non-overlapping buckets, which are each mapped to a fixed binary vector.
|
| 23 |
+
|
| 24 |
+
Past work, for example depth-color-squeezing (Xu et al., 2017), has explored what we will refer to as quantization of inputs as a potential defense against adversarial examples. In that approach, each pixel value is mapped to the low-bit version of its original value, which is a fixed scalar. The key novel aspect of our approach is that rather than replacing a real number with a number of low bit depth, we replace each real number with a binary vector. Different values of the real number activate different bits of the input vector. Multiplying the input vector by the network’s weights thus performs an operation similar to an embedding lookup in a language model, so different input values actually use different parameters of the network. To avoid confusion, we will consistently refer to scalar-toscalar precision reduction as quantization and scalar-to-vector encoding schemes as discretization throughout this work. A comparison of these techniques can be seen in Table 1. Note that, unlike depth-color-squeezing, discretization makes a meaningful change to the model, even when it is configured to use enough discretization levels to avoid losing any information from a traditionally formatted computer vision training set; discretizing each pixel to 256 levels will preserve all of the information contained in the original image. Discretization defends against adversarial examples by changing which parameters of the model are used, and may also discard information if the number of discretization levels is low; quantization can only defend the model by discarding information.
|
| 25 |
+
|
| 26 |
+
<table><tr><td>Real-valued</td><td>Quantized</td><td>Discretized (one-hot)</td><td>Discretized (thermometer)</td></tr><tr><td>0.13</td><td>0.15</td><td>[0100000000]</td><td>[0111111111]</td></tr><tr><td>0.66</td><td>0.65</td><td>[0000001000]</td><td>[0000001111]</td></tr><tr><td>0.92</td><td>0.95</td><td>[0000000001]</td><td>[0000000001]</td></tr></table>
|
| 27 |
+
|
| 28 |
+
Table 1: Examples mapping from continuous-valued inputs to quantized inputs, one-hot codes, and thermometer codes, with ten evenly-spaced levels.
|
| 29 |
+
|
| 30 |
+
# 2.1 DISCRETIZATION AS A DEFENSE
|
| 31 |
+
|
| 32 |
+
In Goodfellow et al. (2014), the authors provide evidence that several network architectures, including LSTMs (Hochreiter & Schmidhuber, 1997), sigmoid networks (Han & Moraga, 1995), and maxout networks (Goodfellow et al., 2013), are vulnerable to adversarial examples due to the empirical fact that, when trained, the loss function of these networks tends to be highly linear with respect to its inputs.
|
| 33 |
+
|
| 34 |
+
We briefly recall the reasoning of Goodfellow et al. (2014). Assume that we have a logistic regressor with weight matrix $w$ . Consider an image $x \in \mathbb { R } ^ { n }$ which is perturbed into $\widetilde { x } = x + \eta$ by some noise $\eta$ such that $\| \eta \| _ { \infty } \le \varepsilon$ for some $\varepsilon$ . The probability that the model assigns to the true class is equal to:
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathbb { L } ( \widetilde { \boldsymbol { x } } ) = \sigma ( \boldsymbol { w } ^ { \top } \widetilde { \boldsymbol { x } } ) = \sigma ( \boldsymbol { w } ^ { \top } ( \boldsymbol { x } + \boldsymbol { \eta } ) ) = \sigma ( \boldsymbol { w } ^ { \top } \boldsymbol { x } + \boldsymbol { w } ^ { \top } \boldsymbol { \eta } )
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
If the perturbation $\eta$ is adversarial, such as in the case where $\begin{array} { r } { \eta _ { i } : = \varepsilon \cdot \mathrm { s i g n } \left( \frac { \partial \mathbb { L } ( x ) } { \partial x _ { i } } \right) } \end{array}$ , then the input to the sigmoid is increased by $\varepsilon \cdot n$ . If $n$ is large, as is typically the case in images and other highdimensional spaces of interest, this linearity implies that even imperceptibly small values of $\varepsilon$ can have a large effect on the model’s prediction, making the model vulnerable to adversarial attacks.
|
| 41 |
+
|
| 42 |
+
Though neural networks in principle have the capacity to represent highly nonlinear functions, networks trained via stochastic gradient descent on real-world datasets tend to converge to mostly-linear solutions. This is illustrated in the empirical studies conducted by Goodfellow et al. (2014). One hypothesis proposed to explain this phenomenon is that the nonlinearities typically used in networks are either piecewise linear, like ReLUs, or approximately linear in the parts of their domain in which training takes place, like the sigmoid function.
|
| 43 |
+
|
| 44 |
+
One potential solution to this problem is to use more non-linear activation functions, such as quadratic or RBF units. Indeed, it was shown by Goodfellow et al. (2014) that such units were more resistant to adversarial perturbations of their inputs. However, these units are difficult to train, and the resulting models do not generalize very well (Goodfellow et al., 2014), sacrificing accuracy on clean examples. As an alternative to introducing highly non-linear activation functions in the network, we propose applying a non-differentiable and non-linear transformation (discretization) to the input, before passing it into the model. A comparison of the input to the model under various regimes can be seen in Figure 1, highlighting the strong non-linearity of discretization techniques.
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 1: Comparison of regular inputs, quantized inputs, and discretized inputs (16 levels, projected to one dimension) on MNIST, adversarially trained with $\varepsilon = 0 . 3$ . The $x$ -axis represents the true pixel value of the image, and the $y$ -axis represents the value that is passed as input to the network after the input transformation has been applied. For real-valued inputs, the inputs to the network are affected linearly by perturbations to the input. Quantized inputs are also affected approximately linearly by perturbations where $\varepsilon$ is greater than the bucket width. Discretizing the input, and then using learned weights to project the discretized value back to a single scalar, we see that the model has learned a highly non-linear function to represent the input in a fashion that is effective for resisting the adversarial perturbations it has seen. When starting at the most common pixel-values for MNIST, 0 and 1, any perturbation of the pixels (where $\varepsilon \le 0 . 3 )$ ) has barely any effect on the input to the network.
|
| 48 |
+
|
| 49 |
+
# 2.2 TYPES OF DISCRETIZATION
|
| 50 |
+
|
| 51 |
+
In this work we consider two approaches to constructing discretized representations $f ( x )$ of the input image $x$ . Assume for the sake of simplicity that the entries of $x$ take values in the continuous domain $[ 0 , 1 ]$ .
|
| 52 |
+
|
| 53 |
+
We first describe a quantization function $b$ . Choose $0 < b _ { 1 } < b _ { 2 } < \cdot \cdot \cdot < b _ { k } = 1$ in some fashion. (In this work, we simply divide the domain evenly, i.e. $\begin{array} { r } { b _ { i } = \frac { i } { k } } \end{array}$ .) For a real number $\theta \in [ 0 , 1 ]$ define $b ( \theta )$ to be the largest index $\alpha \in \{ 1 , \ldots , k \}$ such that $\theta \leq b _ { \alpha }$ .
|
| 54 |
+
|
| 55 |
+
# 2.2.1 ONE-HOT ENCODINGS
|
| 56 |
+
|
| 57 |
+
For an index $j \in \{ 1 , \ldots , k \}$ let $\chi ( j ) \in \mathbb { R } ^ { k }$ be the indicator or one-hot vector of $j$ , i.e.,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\chi ( j ) _ { l } = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { i f ~ } } l = j } \\ { 0 } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right. }
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
The discretization function is defined pixel-wise for a pixel $i \in \{ 1 , \ldots , n \}$ as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
f _ { o n e h o t } ( x _ { i } ) = \chi \left( b ( x _ { i } ) \right) .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
One-hot encodings are simple to compute and understand, and are often used when it is necessary to represent a categorical variable in a neural network. However, one-hot encodings are not well suited for representing categorical variables with an interpretation of ordering between them. Note that the ordering information between two pixels $x _ { i }$ and $x _ { j }$ is lost by applying the transformation $f _ { o n e h o t }$ ; for a pair of pixels $i , j$ whenever $b ( x _ { i } ) \neq b ( x _ { j } ) )$ , we see:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\| \chi ( b ( x _ { i } ) ) \| _ { 2 } = \| \chi ( b ( x _ { j } ) ) \| _ { 2 } = 1 .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
In the case of pixel values, this is not a good inductive bias, as there is a clear reason to believe that neighboring buckets are more similar to each other than distant buckets.
|
| 76 |
+
|
| 77 |
+
# 2.2.2 THERMOMETER ENCODINGS
|
| 78 |
+
|
| 79 |
+
In order to discretize the input image $x$ without losing the relative distance information, we propose thermometer encodings. For an index $j \in \{ 1 , \ldots , k \}$ , let $\tau ( j ) \in \mathbb { R } ^ { k }$ be the thermometer vector defined as
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\tau ( j ) _ { l } = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { i f ~ } } l \geq j } \\ { 0 } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right. }
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Then the discretization function $f$ is defined pixel-wise for a pixel $i \in \{ 1 , \ldots , n \}$ as:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
f _ { t h e r m } ( x ) _ { i } = \tau \left( b ( x _ { i } ) \right) = \mathbb { C } ( f _ { o n e h o t } ( x _ { i } ) )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\mathbb { C }$ is the cumulative sum function, $\mathbb { C } ( c ) _ { l } = \sum _ { j = 0 } ^ { l } c _ { l }$
|
| 92 |
+
|
| 93 |
+
Note that the thermometer encoding preserves pairwise ordering information, i.e., for pixels $i , j$ if $b ( x _ { j } ) \neq b ( x _ { k } )$ and $x _ { i } < x _ { j }$ then
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\left\| \tau ( b ( x _ { i } ) ) \right\| _ { 2 } < \left\| \tau ( b ( x _ { j } ) ) \right\| _ { 2 } .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
# 2.3 WHITE-BOX ATTACKS ON DISCRETIZED INPUTS
|
| 100 |
+
|
| 101 |
+
Discretizing the input makes it difficult to attack the model with standard white-box attack algorithms, such as FGSM (Goodfellow et al., 2014) and PGD (Madry et al., 2017), since it is impossible to backpropagate through our discretization function to determine how to adversarially modify the model’s input. In this section, we describe two novel iterative attacks which allow us to construct adversarial examples for networks trained on discretized inputs.
|
| 102 |
+
|
| 103 |
+
Constructing white-box attacks on discretized inputs serves two primary purposes. First, it allows us to more completely evaluate whether the model is robust to all adversarial attacks, as white-box attacks are typically more powerful than their black-box counterparts. Secondly, adversarial training is typically performed in a white-box fashion, and so in order to utilize and properly compare against the adversarial training techniques of Madry et al. (2017), it is important to have strong white-box attacks.
|
| 104 |
+
|
| 105 |
+
For ease of presentation, we will describe the attacks assuming that $f : \mathbb { R } \to \mathbb { R } ^ { k }$ discretizes inputs into thermometer encodings; in order to attack one-hot encodings, simply replace all instances of $f _ { t h e r m }$ with $f _ { o n e h o t }$ , $\tau$ with $\chi$ , and $\mathbb { C }$ with the identity function I. We represent the adversarial image after $t$ steps of the attack as $z ^ { t }$ , where the value of the ith pixel is $z _ { i } ^ { t }$ .
|
| 106 |
+
|
| 107 |
+
The first attack, Discrete Gradient Ascent (DGA), follows the direction of the gradient of the loss with respect to $f ( x )$ , but is constrained at every step to be a discretized vector. If we have discretized the input image into $k$ -dimensional vectors using the one-hot encoding, this corresponds to moving to a vertex of the simplex $\left( \Delta _ { k } \right) ^ { n }$ at every step. The second attack, Logit-Space Projected Gradient Ascent (LS-PGA), relaxes this assumption, allowing intermediate iterates to be in the interior of the simplex. The final adversarial image is obtained by projecting the final point back to the nearest vertex of the simplex.
|
| 108 |
+
|
| 109 |
+
Note that if the number of attack steps is 1, then the two attacks are equivalent; however, for larger numbers of attack steps, LS-PGA is a generalization of DGA.
|
| 110 |
+
|
| 111 |
+
# 2.3.1 DISCRETE GRADIENT ASCENT (DGA)
|
| 112 |
+
|
| 113 |
+
Following PGD (Madry et al., 2017), we initialize DGA by placing each pixel into a random bucket that is within $\varepsilon$ of the pixel’s true value. At each step of the attack, we look at all buckets that are within $\varepsilon$ of the true value, and select the bucket that is likely to do the most ‘harm’, as estimated by the gradient of setting that bucket’s indicator variable to 1, with respect to the model’s loss at the previous step.
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\begin{array} { r l } & { z _ { i } ^ { 0 } = f _ { t h e r m } ( x _ { i } + U ( - \varepsilon , \varepsilon ) ) } \\ & { \mathrm { h a r m } ( z _ { i } ^ { t } ) _ { l } = \left\{ \begin{array} { l l } { ( z _ { i } ^ { t } - \tau ( l ) ) ^ { \top } \cdot \frac { \partial \mathbb { L } ( z ^ { t } ) } { \partial z _ { i } ^ { t } } } & { \mathrm { i f } \exists ( - \varepsilon \leq \eta \leq \varepsilon ) \quad \mathrm { s . t . } \quad b ( x _ { i } + \eta ) = l } \\ { 0 } & { \mathrm { o t h e r w i s e . } } \end{array} \right. } \\ & { \qquad z _ { i } ^ { t + 1 } = \tau \left( \mathrm { a r g } \operatorname* { m a x } \left( \mathrm { h a r m } \left( z _ { i } ^ { t } \right) \right) \right) } \end{array}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Because the outcome of this optimization procedure will vary depending on the initial random perturbation, we suggest strengthening the attack by re-running it several times and using the perturbation with the greatest loss. The pseudo-code for the DGA attack is given in Section $\mathbf { B }$ of the appendix.
|
| 120 |
+
|
| 121 |
+
# 2.3.2 LOGIT-SPACE PROJECTED GRADIENT ASCENT (LS-PGA)
|
| 122 |
+
|
| 123 |
+
To perform LS-PGA, we soften the discrete encodings into continuous relaxations, and then perform standard Projected Gradient Ascent (PGA) on these relaxed values. We represent the distribution over embeddings as a softmax over logits $u$ , each corresponding to the unnormalized log-weight of a specific bucket’s embedding. To improve the attack, we scale the logits with temperature $T$ , allowing us to trade off between how closely our softmax approximates a true one-hot distribution as in the Gumbel-softmax trick (Jang et al., 2016; Maddison et al., 2016), and how much gradient signal the logits receive. At each step of a multi-step attack, we anneal this value via exponential decay with rate $\delta$ .
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { c } { { z _ { i } ^ { t } = \mathbb C \left( \sigma \left( \frac { u _ { i } ^ { t } } { T ^ { t } } \right) \right) } } \\ { { z _ { i } ^ { f i n a l } = \tau \left( \arg \operatorname* { m a x } \left( u _ { i } ^ { f i n a l } \right) \right) } } \\ { { T ^ { t } = T ^ { t - 1 } \cdot \delta } } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
We initialize each of the logits randomly with values sampled from a standard normal distribution. At each step, we ensure that the model does not assign any probability to buckets which are not within $\varepsilon$ of the true value by fixing the logits to be $- \infty$ . The model’s loss is a continuous function of the logits, so we can simply utilize attacks designed for continuous-valued inputs, in this case PGA
|
| 130 |
+
|
| 131 |
+
with step-size $\xi$ .
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r l } & { u _ { i } ^ { 0 } = \left\{ \begin{array} { l l } { N \left( \mathbf { 0 } ; \mathbf { 1 } \right) } & { \mathrm { i f ~ } \exists ( - \varepsilon \leq \eta \leq \varepsilon ) \quad \mathrm { s . t . } \quad b ( x _ { i } + \eta ) = l } \\ { - \infty } & { \mathrm { o t h e r w i s e . } } \end{array} \right. } \\ & { \left( u _ { i } ^ { t + 1 } \right) _ { l } = \left\{ \begin{array} { l l } { \left( u _ { i } ^ { t } \right) _ { l } + \xi \cdot \mathrm { s i g n } \left( \frac { \partial \mathbb { L } \left( z ^ { t } \right) } { \partial u _ { i } ^ { t } } \right) _ { l } } & { \mathrm { i f ~ } \exists ( - \varepsilon \leq \eta \leq \varepsilon ) \quad \mathrm { s . t . } \quad b ( x _ { i } + \eta ) = l } \\ { - \infty } & { \mathrm { o t h e r w i s e . } } \end{array} \right. } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Because the outcome of this optimization procedure will vary depending on the initial perturbation, we suggest strengthening the attack by re-running it several times and using the perturbation with the greatest loss. The pseudo-code for the LS-PGA attack is given in Section B of the appendix.
|
| 138 |
+
|
| 139 |
+
# 3 EXPERIMENTS
|
| 140 |
+
|
| 141 |
+
We compare models trained with input discretization to state-of-the-art adversarial defenses on a variety of datasets. We match the experimental setup of the prior literature as closely as possible. Rows labeled with “Vanilla (Madry)” give the numbers reported in Madry et al. (2017); other rows contain results of our own experiments, with “Vanilla” containing a direct replication. For our MNIST experiments, we use a convolutional network; for CIFAR-10, CIFAR-100, and SVHN we use a Wide ResNet (Zagoruyko & Komodakis, 2016). We use a network of depth 30 for the CIFAR10 and CIFAR-100 datasets, while for SVHN we use a network of depth 15. The width factor of all the Wide ResNets is set to $k = 4$ . 1 Unless otherwise specified, all quantized and discretized models use 16 levels.
|
| 142 |
+
|
| 143 |
+
We found that in all cases, LS-PGA was strictly more powerful than DGA, so all attacks on discretized models use LS-PGA with $\xi = 0 . 0 1 , \delta = 1 . 2$ , and 1 random restart. To be consistent with Madry et al. (2017), we describe attacks in terms of the maximum $\ell _ { \infty }$ -norm of the attack, $\varepsilon$ . All MNIST experiments used $\varepsilon = 0 . 3$ and 40 steps for iterative attacks; experiments on CIFAR used $\varepsilon = 0 . 0 3 1$ and 7 steps for iterative attacks; experiments on SVHN used $\varepsilon = 0 . 0 4 7$ and 10 steps for iterative attacks. These settings were used for adversarial training, white-box attacks, and blackbox attacks. Figure 3 plots the effectiveness of the iterated PGD/LS-PGA attacks on vanilla and discretized models for MNIST and shows that increasing the number of iterations beyond 40 would have no effect on the performance of the model on $\ell _ { \infty }$ -bounded adversarial examples for MNIST.
|
| 144 |
+
|
| 145 |
+
In Madry et al. (2017), adversarially-trained models are trained using exclusively adversarial inputs. This led to a small but noticeable loss in accuracy on clean examples, dropping from $9 9 . 2 \%$ to $9 8 . 8 \%$ on MNIST and from $9 5 . 2 \%$ to $8 7 . 3 \%$ on CIFAR-10 in return for more robustness towards adversarial examples. Past work has also sometimes performed adversarial training on batches composed of half clean examples and half adversarial examples (Goodfellow et al., 2014; Cisse et al., 2017). To be consistent with Madry et al. (2017), we list experiments on models trained only on adversarial inputs in the main paper; additional experiments on a mix of clean and adversarial inputs can be found in the appendix.
|
| 146 |
+
|
| 147 |
+
We also run experiments exploring the model’s relationship with the number of distinct levels to which we quantize the input before discretizing it, and exploring various settings of hyperparameters for LS-PGA.
|
| 148 |
+
|
| 149 |
+
# 4 RESULTS
|
| 150 |
+
|
| 151 |
+
Our adversarially-trained baseline models were able to approximately replicate the results of Madry et al. (2017). On all datasets, discretizing the inputs of the network dramatically improves resistance to adversarial examples, while barely sacrificing any accuracy on clean examples. Quantized models also beat the baseline, but with lower accuracy on clean examples. Discretization via thermometer encodings outperformed one-hot encodings in most settings. See Tables 2,3,4 and 5 for results on MNIST and CIFAR-10. Additional results on CIFAR-100 and SVHN are included in the appendix.
|
| 152 |
+
|
| 153 |
+
In Figures 2 and 5 (located in appendix), we plot the test-set accuracy across training timesteps for various adversarially trained models on the SVHN and CIFAR-10 datasets, and observe that the discretized models become robust against adversarial examples more quickly.
|
| 154 |
+
|
| 155 |
+
Table 2: Comparison of adversarial robustness to white-box attacks on MNIST .
|
| 156 |
+
|
| 157 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>FGSM</td><td rowspan=1 colspan=1>PGD/LS-PGA</td></tr><tr><td rowspan=2 colspan=1>ereaa</td><td rowspan=2 colspan=1>Vanilla (Madry)VanillaQuantizedOne-hotThermometer</td><td rowspan=2 colspan=1>99.2099.3099.1999.1399.20</td><td rowspan=1 colspan=1>6.40</td><td rowspan=2 colspan=1>-0000</td></tr><tr><td rowspan=1 colspan=1>0.191.1000</td></tr><tr><td rowspan=3 colspan=1>Y1nit apt</td><td rowspan=3 colspan=1>Vanilla (Madry)VanillaQuantizedOne-hotThermometer</td><td rowspan=3 colspan=1>98.8098.6798.7598.6199.03</td><td rowspan=1 colspan=1>95.6096.1796.29</td><td rowspan=3 colspan=1>93.2093.3094.2394.3094.02</td></tr><tr><td rowspan=1 colspan=1>96.22</td></tr><tr><td rowspan=1 colspan=1>95.84</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 3: Comparison of adversarial robustness to black-box attacks on MNIST .
|
| 160 |
+
|
| 161 |
+
<table><tr><td colspan="2" rowspan="2">Source Target</td><td rowspan="2"></td><td colspan="3">Clean</td><td colspan="3">Adv. train</td></tr><tr><td>Vanilla</td><td>One-hot</td><td>Thermometer</td><td>Vanilla</td><td>One-hot</td><td>Thermometer</td></tr><tr><td rowspan="3">Ereaa</td><td rowspan="3">Vanilla Quantized One-hot</td><td>2.04</td><td>36.02</td><td>24.58</td><td>3.48</td><td>80.44</td><td>57.69</td></tr><tr><td>39.22</td><td>32.39</td><td>25.63</td><td>75.02</td><td>75.92</td><td>52.32</td></tr><tr><td>14.57</td><td>6.91</td><td>8.11</td><td>39.02</td><td>39.60</td><td>18.02</td></tr><tr><td rowspan="6">11p1l Apv</td><td rowspan="6">Thermometer Vanilla (Madry)</td><td>41.12</td><td>14.30</td><td>10.98</td><td>61.84</td><td>59.16</td><td>32.93</td></tr><tr><td>=</td><td></td><td>1</td><td>96.0</td><td>=</td><td>1</td></tr><tr><td>Quantized</td><td>97.65</td><td>98.16</td><td>97.14</td><td>95.27 95.31</td><td>96.53</td></tr><tr><td>Vanilla One-hot</td><td>97.62</td><td>98.05</td><td>97.06 95.43</td><td>95.38</td><td>96.23</td></tr><tr><td>97.78</td><td>98.48</td><td>97.87</td><td>96.87</td><td>96.60</td><td>96.87</td></tr><tr><td>Thermometer 98.07</td><td>98.75</td><td>98.02</td><td>97.05</td><td>96.88</td><td>97.13</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Table 4: Comparison of adversarial robustness to white-box attacks on CIFAR-10 .
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>FGSM</td><td rowspan=1 colspan=1>PGD/LS-PGA</td></tr><tr><td rowspan=2 colspan=1>eeeaa</td><td rowspan=2 colspan=1>Vanilla (Madry)VanillaQuantizedOne-hotThermometer</td><td rowspan=2 colspan=1>95.2094.2993.4993.2694.22</td><td rowspan=1 colspan=1>25.10</td><td rowspan=2 colspan=1>4.101.663.5753.1150.50</td></tr><tr><td rowspan=1 colspan=1>46.1543.8952.0748.50</td></tr><tr><td rowspan=1 colspan=1>11p11 'Apv</td><td rowspan=1 colspan=1>Vanilla (Madry)VanillaQuantizedOne-hotThermometer</td><td rowspan=1 colspan=1>87.387.6785.7588.6789.88</td><td rowspan=1 colspan=1>60.359.753.5368.7680.96</td><td rowspan=1 colspan=1>50.041.7842.0967.8379.16</td></tr></table>
|
| 166 |
+
|
| 167 |
+
# 5 DISCUSSION
|
| 168 |
+
|
| 169 |
+
In Goodfellow et al. (2014), the seeming linearity of deep neural networks was shown by visualizing the networks in several different ways. To test our hypothesis that discretization breaks some of this linearity, we replicate these visualizations and contrast them to visualizations of discretized models. See Appendix G for an illustration of these properties.
|
| 170 |
+
|
| 171 |
+
For non-discretized, clean trained models, test-set examples always yield a linear boundary between correct and incorrect classification; in contrast, non-adversarially-trained models have a more interesting parabolic shape (see Figure 9).
|
| 172 |
+
|
| 173 |
+
Table 5: Comparison of adversarial robustness to black-box attacks on CIFAR-10 .
|
| 174 |
+
|
| 175 |
+
<table><tr><td colspan="2" rowspan="2">Source Target</td><td rowspan="2"></td><td colspan="3">Clean</td><td colspan="3">Adv. train</td></tr><tr><td>Vanilla</td><td>One-hot</td><td>Thermometer</td><td>Vanilla</td><td>One-hot</td><td>Thermometer</td></tr><tr><td rowspan="4">evaa</td><td>Vanilla (Madry)</td><td>0.0</td><td>1</td><td>1</td><td>79.7</td><td>1</td><td>1</td></tr><tr><td>Vanilla</td><td>3.38</td><td>60.10</td><td>52.60</td><td>45.48</td><td>37.21</td><td>49.91</td></tr><tr><td>Quantized</td><td>70.54</td><td>62.46</td><td>55.38</td><td>51.74</td><td>45.37</td><td>55.64</td></tr><tr><td>One-hot</td><td>83.00</td><td>56.25</td><td>63.94</td><td>54.59</td><td>49.21</td><td>57.28</td></tr><tr><td rowspan="5">11pl apa</td><td>Thermometer Vanilla (Madry)</td><td>80.33</td><td>66.22</td><td>53.45</td><td>57.04</td><td>51.03</td><td>60.90</td></tr><tr><td></td><td>85.60</td><td>1</td><td>1</td><td>67.0</td><td>1</td><td>1</td></tr><tr><td>Vanilla</td><td>85.60</td><td>74.99</td><td>73.78</td><td>67.0</td><td>50.09</td><td>71.03</td></tr><tr><td>Quantized</td><td>84.56</td><td>82.43</td><td>82.22</td><td>72.52</td><td>72.29</td><td>79.43</td></tr><tr><td>One-hot Thermometer</td><td>86.01 88.25</td><td>77.19 81.59</td><td>77.70 80.80</td><td>61.92 67.96</td><td>60.02 67.43</td><td>72.89 77.68</td></tr></table>
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 2: Comparison of the convergence rate of various adversarially trained models on the SVHN dataset.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 3: Loss for iterated white-box attacks on various models on a randomly chosen data point from MNIST. By step 40, which is where we evaluate, the loss of the point found by iterative attacks has converged.
|
| 182 |
+
|
| 183 |
+
When discretizing the input, we introduce $C _ { w } \cdot C _ { h } \cdot C _ { o } \cdot c \cdot ( k - 1 )$ extra parameters, where $c$ is the number of channels in the image, $k$ is the number of levels of discretization, and $C _ { w } , C _ { h } , C _ { o }$ are the width, height, and output channels of the first convolutional layer. Discretizing using 16 levels introduced $0 . 0 3 \%$ extra parameters for MNIST, $0 . 0 8 \%$ for CIFAR-10 and CIFAR-100, and $2 . 3 \%$ for SVHN. This increase is negligible, so it is likely that the robustness comes from the input discretization, and is not merely a byproduct of having a slightly higher-capacity model.
|
| 184 |
+
|
| 185 |
+
# 6 CONCLUSION
|
| 186 |
+
|
| 187 |
+
Our findings convincingly demonstrate that the use of thermometer encodings, in combination with adversarial training, can reduce the vulnerability of neural network models to adversarial attacks. Our analysis reveals that the resulting networks are significantly less linear with respect to their inputs, supporting the hypothesis of Goodfellow et al. (2014) that many adversarial examples are caused by over-generalization in networks that are too linear.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndi ˇ c, Pavel Laskov, Gior- ´ gio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 387– 402. Springer, 2013.
|
| 192 |
+
|
| 193 |
+
Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In International Conference on Machine Learning, pp. 854–863, 2017.
|
| 194 |
+
|
| 195 |
+
Ian J Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. arXiv preprint arXiv:1302.4389, 2013.
|
| 196 |
+
|
| 197 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 198 |
+
|
| 199 |
+
Jun Han and Claudio Moraga. The influence of the sigmoid function parameters on the speed of backpropagation learning. From Natural to Artificial Neural Computation, pp. 195–201, 1995.
|
| 200 |
+
|
| 201 |
+
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.
|
| 202 |
+
|
| 203 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 204 |
+
|
| 205 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European Conference on Computer Vision, pp. 646–661. Springer, 2016.
|
| 206 |
+
|
| 207 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 208 |
+
|
| 209 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 210 |
+
|
| 211 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
|
| 212 |
+
|
| 213 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. CoRR, abs/1611.02770, 2016. URL http://arxiv.org/abs/ 1611.02770.
|
| 214 |
+
|
| 215 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 216 |
+
|
| 217 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 218 |
+
|
| 219 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759, 2016.
|
| 220 |
+
|
| 221 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against deep learning systems using adversarial examples. arXiv preprint arXiv:1602.02697, 2016.
|
| 222 |
+
|
| 223 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. ICLR, abs/1312.6199, 2014. URL http://arxiv.org/abs/1312.6199.
|
| 224 |
+
|
| 225 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
|
| 226 |
+
|
| 227 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 228 |
+
|
| 229 |
+
# A HYPERPARAMETERS
|
| 230 |
+
|
| 231 |
+
In this section, we describe the hyperparameters used in our experiments. For CIFAR-10 and CIFAR-100 we follow the standard data augmenting scheme as in (Lin et al., 2013; He et al., 2016; Huang et al., 2016; Zagoruyko & Komodakis, 2016): each training image is zero-padded with 4 pixels on each side and randomly cropped to a new $3 2 \times 3 2$ image. The resulting image is randomly flipped with probability 0.5, it’s brightness is adjusted with a delta chosen uniformly at random in the interval $[ - 6 3 , 6 3 )$ and it’s contrast is adjusted using a random contrast factor in the interval [0.2, 1.8]. For MNIST we use the Adam optimizer with a fixed learning rate of $1 \mathrm { e } { - 4 }$ as in Madry et al. (2017). For CIFAR-10 and CIFAR-100 we use the Momentum optimizer with momentum 0.9, $\ell _ { 2 }$ weight decay of $\lambda = 0 . 0 0 0 5$ and an initial learning rate of 0.1 which is annealed by a factor of 0.2 after epochs 60, 120 and 160 respectively as in Zagoruyko & Komodakis (2016). For SVHN we use the same optimizer with initial learning rate of $\mathrm { 1 e { - } 2 }$ which is annealed by a factor of 0.1 after epochs 80 and 120 respectively. We also use a dropout of 0.3 for CIFAR-10, CIFAR-100 and SVHN.
|
| 232 |
+
|
| 233 |
+
# B PSEUDO-CODE
|
| 234 |
+
|
| 235 |
+
The DGA attack is described in Algorithm 2 and the LS-PGA attack is described in Algorithm 3.
|
| 236 |
+
Both these algorithms make use of a getM ask() sub-routine which is described in Algorithm 1.
|
| 237 |
+
|
| 238 |
+
<table><tr><td></td><td>Input: Image x, parameter ε</td></tr><tr><td></td><td>Output: ε-discretized mask around x</td></tr><tr><td>2</td><td>mask ← (0)nxk</td></tr><tr><td>3</td><td>low ← max{0,x - ε}</td></tr><tr><td>4</td><td>high ← min{1,𝑥 +ε}</td></tr><tr><td>5</td><td>for α←O to1by do</td></tr><tr><td>6</td><td>mask ← mask+ fonehot (α * low + (1- α) * high) end</td></tr><tr><td>7</td><td>return mask</td></tr><tr><td></td><td></td></tr></table>
|
| 239 |
+
|
| 240 |
+
Algorithm 1: Sub-routine for getting an $\varepsilon$ -discretized mask of an image.
|
| 241 |
+
|
| 242 |
+
# C ADDITIONAL EXPERIMENTS ON MNIST
|
| 243 |
+
|
| 244 |
+
In this section we list the additional experiments we performed using discretized models on MNIST. The main hyperparameters of Algorithm 3 are the step size $\xi$ used to perform the projected gradient ascent, and the annealing rate of $\delta$ . We found that the choice of these hyperparameters was not critical to the robustness of the model. In particular, we performed experiments with $\xi = 1 . 0$ and $\xi = 0 . 0 0 1$ , and both achieved similar accuracies as in Table 2 and Table 3. Additionally, we found that without annealing, i.e., $\delta = 1 . 0$ , the performance was only slightly worse than with $\delta = 1 . 2$ .
|
| 245 |
+
|
| 246 |
+
We also experimented with discretizing by using percentile information per color channel instead of using uniformly distributed buckets. This did not result in any significant changes in robustness or accuracy for the MNIST dataset.
|
| 247 |
+
|
| 248 |
+
Input: Image $x$ , label $y$ , discretization function $f$ , loss $\mathbb { L } ( \pmb \theta , f ( x ) , y )$ , l attack steps, parameter $\varepsilon$ Output: Adversarial input to the network $z ^ { \prime }$ 1 $\eta U ( - \varepsilon , \varepsilon )$ $ { \vert z _ { 0 } \gets f ( x + \dot { \eta } ) }$ 3 $\mathrm { m a s k } g e t M a s k ( x , \varepsilon )$ for $t \gets 1$ to $l$ do $/ \star$ Loop invariant: $z _ { i } ^ { t }$ is discretized for every pixel i \*/ 5 $\mathrm { g r a d } \nabla _ { z ^ { t - 1 } } \mathbb { L } ( \pmb \theta , z ^ { t - 1 } , y )$ 6 if $f$ is one-hot then 7 $\mathrm { h a r m } _ { l } \gets ( z ^ { t - 1 } - \chi ( l ) ) ^ { \top } \mathrm { g r a d }$ 8 else 9 $\vert \quad \mathrm { h a r m } _ { l } \gets ( z ^ { t - 1 } - \tau ( l ) ) ^ { \top } \mathrm { g r a d }$ 10 end 11 $\mathrm { h a r m } \gets \mathrm { h a r m } * \mathrm { m a s k } - ( 1 - \mathrm { m a s k } ) * \infty$ 12 zt ← f (arg max(harm)) 13 end 14 return z0 ← zl
|
| 249 |
+
|
| 250 |
+
Input: Image $x$ , label $y$ , discretization function $f$ , loss $\mathbb { L } ( \pmb \theta , f ( x ) , y )$ , $l$ attack steps, parameters ε, δ Output: Adversarial input to the network $z ^ { \prime }$ $\mathrm { m a s k } g e t M a s k ( x , \varepsilon )$ $u ^ { 0 } \gets \left( \mathcal { N } ( \mathbf { 0 } ^ { k } ; \mathbf { 1 } ^ { k } ) \right) ^ { n } * \mathrm { m a s k - } \left( 1 - \mathrm { m a s k } \right) * \infty$ 3 T ← 1 if $f$ is one-hot then 5 F ← I 6 else 7 F ← C 8 8 end 9 z 0 ← F σ u 0T 10 for $t \gets 1$ to $l$ do 11 grad ← ∇ut−1 L(θ, zt−1, y) 12 ut ← ut−1 + ξ · sign (grad) 13 z t ← F σ u tT 14 T ← T · δ 15 end 16 return $z ^ { \prime } \gets \tau ( \arg \operatorname* { m a x } ( u _ { i } ^ { l } ) )$
|
| 251 |
+
|
| 252 |
+
Algorithm 2: Discrete Gradient Ascent (DGA)
|
| 253 |
+
Algorithm 3: Logit-Space Projected Gradient Ascent (LS-PGA)
|
| 254 |
+
|
| 255 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>m</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>White-box</td><td rowspan=1 colspan=1>Black-box</td></tr><tr><td rowspan=1 colspan=1>One-hotOne-hotOne-hot</td><td rowspan=1 colspan=1>1.00.0011.0</td><td rowspan=1 colspan=1>1.21.21.0</td><td rowspan=1 colspan=1>93.0893.5093.02</td><td rowspan=1 colspan=1>98.3998.4298.21</td></tr><tr><td rowspan=1 colspan=1>ThermometerThermometerThermometer</td><td rowspan=1 colspan=1>1.00.0011.0</td><td rowspan=1 colspan=1>1.21.21.0</td><td rowspan=1 colspan=1>93.7493.8893.75</td><td rowspan=1 colspan=1>98.4598.2498.22</td></tr></table>
|
| 256 |
+
|
| 257 |
+
Table 6: Comparison of adversarial robustness to white-box attacks on MNIST using 16 levels and with various choices of the hyperparameters $\xi$ and $\delta$ for Algorithm 3. The models are evaluated on white-box attacks and on black-box attacks using a vanilla, clean trained model; both use LS-PGA.
|
| 258 |
+
|
| 259 |
+
Finally, we also trained on a mix of clean and adversarial examples: this resulted in significantly higher accuracy on clean examples, but decreased accuracy on white-box and black-box attacks compared to Tables 2 and 3.
|
| 260 |
+
|
| 261 |
+
<table><tr><td>Model</td><td>Clean</td><td>FGSM</td><td>PGD/LS-PGA</td></tr><tr><td>Vanilla</td><td>99.03</td><td>95.70</td><td>91.36</td></tr><tr><td>One-hot</td><td>99.01</td><td>96.14</td><td>93.77</td></tr><tr><td>Thermometer</td><td>99.13</td><td>96.10</td><td>93.70</td></tr></table>
|
| 262 |
+
|
| 263 |
+
Table 7: Comparison of adversarial robustness to white-box attacks on MNIST using a mix of clean and adversarial examples.
|
| 264 |
+
|
| 265 |
+
<table><tr><td rowspan="2">Source Target</td><td colspan="3">Clean</td><td colspan="3">Adv. train</td></tr><tr><td>Vanilla</td><td>One-hot</td><td>Thermometer</td><td>Vanilla</td><td>One-hot</td><td>Thermometer</td></tr><tr><td>Vanilla</td><td>97.88</td><td>97.87</td><td>96.99</td><td>93.07</td><td>90.97</td><td>96.46</td></tr><tr><td>One-hot</td><td>98.28</td><td>98.83</td><td>98.08</td><td>95.73</td><td>95.96</td><td>97.25</td></tr><tr><td>Thermometer</td><td>98.45</td><td>98.70</td><td>98.08</td><td>96.35</td><td>95.72</td><td>96.97</td></tr></table>
|
| 266 |
+
|
| 267 |
+
Table 8: Comparison of adversarial robustness to black-box attacks on MNIST of various models using a mix of clean and adversarial examples.
|
| 268 |
+
|
| 269 |
+
<table><tr><td></td><td></td><td>White-box</td><td colspan="2">Black-box</td></tr><tr><td>Levels</td><td>Clean</td><td>PGD/LS-PGA</td><td>Vanilla, Clean</td><td>Vanilla, PGD</td></tr><tr><td>One-hot (4) One-hot (8) One-hot (16)</td><td>99.09 99.10 99.14</td><td>92.95 92.65 93.08</td><td>98.23 98.49 98.39</td><td>95.64 96.37</td></tr><tr><td>One-hot (32) One-hot (64)</td><td>99.06 98.89</td><td>93.51 93.63</td><td>98.38 98.35</td><td>96.26 95.78</td></tr><tr><td>Thermometer (4)</td><td></td><td></td><td></td><td>95.74</td></tr><tr><td></td><td>99.11</td><td>92.62</td><td>98.23</td><td>95.67</td></tr><tr><td>Thermometer (8)</td><td>99.08</td><td>93.45</td><td>98.44</td><td>95.93</td></tr><tr><td>Thermometer(16)</td><td>99.07</td><td>93.88</td><td>98.24</td><td>95.28</td></tr><tr><td>Thermometer (32)</td><td>99.02</td><td>94.14</td><td>98.24</td><td>95.49</td></tr><tr><td>Thermometer (64)</td><td>99.00</td><td>94.62</td><td>98.33</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>95.71</td></tr></table>
|
| 270 |
+
|
| 271 |
+
Table 9: Comparison of adversarial robustness on MNIST as the number of levels of discretization is varied. All models are trained mix of adversarial examples and clean examples.
|
| 272 |
+
|
| 273 |
+
# D ADDITIONAL EXPERIMENTS ON CIFAR-10
|
| 274 |
+
|
| 275 |
+
In this section we list the additional experiments we performed on CIFAR-10. Firstly, we trained models on a mix of both clean and adversarial examples. The results for mixed training are listed in Tables 10 and 11; as expected it has lower accuracy on adversarial examples, but higher accuracy on clean examples, compared to training on only adversarial examples (Tables 4 and 5).
|
| 276 |
+
|
| 277 |
+
<table><tr><td>Model</td><td>Clean</td><td>FGSM</td><td>PGD/LS-PGA</td></tr><tr><td>Vanilla</td><td>87.16</td><td>54.50</td><td>34.71</td></tr><tr><td>One-hot</td><td>92.19</td><td>58.87</td><td>58.96</td></tr><tr><td>Thermometer</td><td>92.32</td><td>66.60</td><td>65.67</td></tr></table>
|
| 278 |
+
|
| 279 |
+
Table 10: Comparison of adversarial robustness to white-box attacks on CIFAR-10 of various models using a mix of regular and adversarial training.
|
| 280 |
+
|
| 281 |
+
<table><tr><td rowspan="2">Source Target</td><td colspan="3">Clean</td><td colspan="3">Adv. train</td></tr><tr><td>Vanilla</td><td>One-hot</td><td>Thermometer</td><td>Vanilla</td><td>One-hot</td><td>Thermometer</td></tr><tr><td colspan="2">Vanilla</td><td>83.62</td><td>82.06</td><td>74.31</td><td>52.83</td><td>58.73</td><td>65.24</td></tr><tr><td colspan="2">One-hot</td><td>88.16</td><td>75.11</td><td>75.49</td><td>61.89</td><td>59.17</td><td>69.73</td></tr><tr><td colspan="2">Thermometer</td><td>87.50</td><td>75.91</td><td>74.84</td><td>61.39</td><td>58.51</td><td>68.22</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 11: Comparison of adversarial robustness to black-box attacks on CIFAR-10 of various models using a mix of clean and adversarial examples.
|
| 284 |
+
|
| 285 |
+
In order to explore whether the number of levels of discretization affected the performance of the model, we trained several models which varied this number. As expected, we found that models with fewer levels had worse accuracy on clean examples, likely because there was not enough information to correctly classify the image, but greater robustness to adversarial examples, likely because larger buckets mean a greater chance that a given perturbation will not yield any change in input to the network (Xu et al., 2017). Results can be seen in Tables 12, and are visualized in Figure 4.
|
| 286 |
+
|
| 287 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>White-box</td><td rowspan=1 colspan=2>Black-box</td></tr><tr><td rowspan=1 colspan=1>Levels</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>PGD/LS-PGA</td><td rowspan=1 colspan=1>Vanilla, Clean</td><td rowspan=1 colspan=1>Vanilla, PGD</td></tr><tr><td rowspan=1 colspan=1>Vanilla (Madry)</td><td rowspan=1 colspan=1>87.3</td><td rowspan=1 colspan=1>50.00</td><td rowspan=1 colspan=1>85.60</td><td rowspan=1 colspan=1>67.00</td></tr><tr><td rowspan=1 colspan=1>One-hot (4)One-hot (8)One-hot (16)One-hot (32)One-hot (64)</td><td rowspan=1 colspan=1>83.6785.6288.5488.5689.63</td><td rowspan=1 colspan=1>59.5961.9867.8367.8265.63</td><td rowspan=1 colspan=1>83.0384.9286.0185.6986.94</td><td rowspan=1 colspan=1>72.0372.1061.9266.6465.77</td></tr><tr><td rowspan=1 colspan=1>Thermometer (4)Thermometer (8)Thermometer (16)Thermometer (32)Thermometer (64)</td><td rowspan=1 colspan=1>84.4785.1789.8890.3089.95</td><td rowspan=1 colspan=1>61.8867.2379.1672.9169.37</td><td rowspan=1 colspan=1>83.6483.4188.2586.0683.85</td><td rowspan=1 colspan=1>72.9671.1167.9659.3251.82</td></tr></table>
|
| 288 |
+
|
| 289 |
+
Table 12: Comparison of adversarial robustness on CIFAR-10 as the number of levels of discretization is varied. All models are trained only on adversarial examples.
|
| 290 |
+
|
| 291 |
+
# E EXPERIMENTS ON CIFAR-100
|
| 292 |
+
|
| 293 |
+
We list the experimental results on CIFAR-100 in Table 13. We choose $\xi = 0 . 0 1$ and $\delta = 1 . 2$ for the LS-PGA attack hyperparameters. For the discretized models, we used 16 levels. All adversarially trained models were trained on a mix of clean and adversarial examples.
|
| 294 |
+
|
| 295 |
+
Table 13: Comparison of adversarial robustness on CIFAR-100. All adversarially trained models were trained on a mix of clean and adversarial examples.
|
| 296 |
+
|
| 297 |
+
<table><tr><td rowspan="2">Target</td><td rowspan="2">Source</td><td rowspan="2">Clean</td><td rowspan="2">White-box PGD/LS-PGA</td><td colspan="2">Black-box</td></tr><tr><td>Vanilla, Clean-trained</td><td>Vanilla, PGD-trained</td></tr><tr><td>evaaa</td><td>Vanilla One-hot</td><td>74.32</td><td>0</td><td>0.4</td><td>9.40</td></tr><tr><td rowspan="3"></td><td>Thermometer</td><td>73.25</td><td>16.55</td><td>55.72</td><td>19.33</td></tr><tr><td></td><td>74.44</td><td>16.50</td><td>50.33</td><td>18.49</td></tr><tr><td>Vanilla</td><td>64.46</td><td>6.02</td><td>7.46</td><td>11.77</td></tr><tr><td rowspan="2">A</td><td>One-hot</td><td>66.54</td><td>25.11</td><td>63.09</td><td>42.46</td></tr><tr><td>Thermometer</td><td>68.44</td><td>28.14</td><td>63.21</td><td>41.97</td></tr></table>
|
| 298 |
+
|
| 299 |
+
# F EXPERIMENTS ON SVHN
|
| 300 |
+
|
| 301 |
+
We list the experimental results on SVHN in Table 14. All adversarially trained models were trained only on adversarial examples.
|
| 302 |
+
|
| 303 |
+
<table><tr><td rowspan="2">Target</td><td rowspan="2">Source</td><td></td><td>White-box</td><td colspan="2">Black-box</td></tr><tr><td>Clean</td><td>PGD/LS-PGA</td><td>Vanilla, Clean-trained</td><td>Vanilla, PGD-trained</td></tr><tr><td>erea</td><td>Vanilla</td><td>97.90</td><td>6.99</td><td>73.94</td><td>42.04</td></tr><tr><td rowspan="3"></td><td>One-hot</td><td>97.59</td><td>56.02</td><td>75.77</td><td>41.59</td></tr><tr><td>Thermometer</td><td>97.87</td><td>56.37</td><td>78.04</td><td>41.69</td></tr><tr><td>Vanilla</td><td>94.79</td><td>59.63</td><td>81.24</td><td>46.77</td></tr><tr><td rowspan="2">A</td><td>One-hot</td><td>95.12</td><td>87.34</td><td>83.84</td><td>43.40</td></tr><tr><td>Thermometer</td><td>97.74</td><td>94.77</td><td>84.97</td><td>48.67</td></tr></table>
|
| 304 |
+
|
| 305 |
+
Table 14: Comparison of adversarial robustness on SVHN.
|
| 306 |
+
|
| 307 |
+
# G SUPPLEMENTARY FIGURES
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
In Figure 4 we plot the effect of increasing the levels of discretization for the MNIST and CIFAR-10 datasets.
|
| 311 |
+
Figure 4: The effect of increasing the number of distinct discretization levels on the accuracy of the model on MNIST and CIFAR-10. (4a) shows the accuracy on on MNIST for discretized models trained on a mix of legitimate and adversarial examples. (4b) shows the accuracy on CIFAR-10 for discretized models trained only on adversarial examples.
|
| 312 |
+
|
| 313 |
+
In Figure 5 we plot the convergence rate of clean trained and adversarially trained models on the CIFAR-10 dataset. Note that thermometer encoded inputs converge much faster in accuracy on both clean and adversarial inputs.
|
| 314 |
+
|
| 315 |
+
Figure 6 plots the norm of the gradient as a function of the number of iterations of the attack on MNIST. Note that the gradient vanishes at around 40 iterations, which coincides with the loss stabilizing in Figure 3.
|
| 316 |
+
|
| 317 |
+
In Figure 7, we create a linear interpolation between a clean image and an adversarial example, and then continue to extrapolate along this line, evaluating probability of each class at each point. In models trained on unquantized inputs, the class probabilities are all mostly piecewise linear in both the positive and negative directions. In contrast, the discretized model has a much more jagged and irregular shape.
|
| 318 |
+
|
| 319 |
+
In Figure 8, we plot the error for different models on various values of $\varepsilon$ . The discretized models are extremely robust to all values less-than-or-equal-to the values that they have been exposed to during training. However, beyond this threshold, discretized models collapse immediately, while real-valued models still maintain some semblance of robustness. This exposes a weakness of the discretization approach; the same nonlinearity that helps it learn to become robust to all attacks it sees during training-time causes its behavior is unpredictable beyond that.
|
| 320 |
+
|
| 321 |
+
However, we believe that the fact that the performance of thermometer-encoded models degrades more quickly than that of vanilla models beyond the training epsilon is a significant weakness in practice, but no worse than other defenses. The “standard setting” for the adversarial example problem (in which we constrain the L-infinity norm of the perturbed image to an epsilon ball around the original image) was designed to ensure that any adversarially-perturbed image is still recognizable as its original image by a human. However, this artificial constraint excludes many other potential attacks that also result in human-recognizable images. State-of-the art defenses in the standard setting can still be easily defeated by non-standard attacks; for an example of this, see appendix A of ICLR submission “Adversarial Spheres”. A “larger epsilon” attack is just one special case of a “non-standard” attack. If we permit non-standard attacks, a fair comparison would show that all current approaches are easily breakable. There is nothing special about the “larger epsilon” attack that makes a vulnerability to this non-standard attack in particular more problematic than vulnerabilities to other non-standard attacks.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 5: Comparison of the convergence rate of various adversarially trained models on the CIFAR-10 dataset. The discretized models use 16 levels per color channel. (5a) shows the accuracy on clean examples, while (5b) shows the accuracy on white-box PGD/LS-PGA examples, in wall-clock time.
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 6: Gradient norm for iterated white-box attacks on various models on a randomly chosen data point from MNIST. (6a) shows the gradient norm on discretized models as a function of steps of LS-PGA, while (6b) shows the gradient norm on a vanilla model as a function of steps of PGD.
|
| 328 |
+
|
| 329 |
+
In Figures 9, 10 , 11, 12 , 13 and 14 we plot several examples of church-window plots for MNIST (Goodfellow et al., 2014). Each plot is crafted by taking several test-set images, calculating the vector corresponding to an adversarial attack on each image, and then choosing an additional random orthogonal direction. In each plot, the clean image is at the center and corresponds to the color white, the $x$ -axis corresponds to the magnitude of a perturbation in the adversarial direction, and the $y$ -axis corresponds to the magnitude of a perturbation in the orthogonal direction. Note that we use the same random seed to generate the test set examples and the adversarial directions across different church-window plots.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 7: Linear extrapolation plot as in Goodfellow et al. (2014) for MNIST. (7a) shows the behavior of a vanilla model while (7b) for a discretized model using 16 levels and thermometer encoding. The $\varepsilon$ -bound is $[ - 1 . 5 , 1 . 5 ]$ .
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 8: Plot showing the accuracy of various adversarially trained models on MNIST with $\varepsilon =$ 0.3 (8a) and on CIFAR-10 with $\varepsilon = 0 . 0 3 1$ (8b), when attacked with increasing values of $\varepsilon$ using PGD/LS-PGA.
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure 9: Church-window plots of clean-trained models on MNIST. The $x$ -axis of each sub-plot represents the adversarial direction, while the $y$ -axis represents a random orthogonal direction. The correct class is represented by white. Every row in the plot contains a training data point chosen uniformly at random, while each column uses a different random orthogonal vector for the $y$ -axis. The $\varepsilon$ bound for both axes is $[ - 1 . 0 , 1 . 0 ]$ . Notice the almost-linear decision boundaries on nondiscretized models.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 10: Church-window plots of adversarially-trained models on MNIST, trained on only adversarial examples. The $x$ -axis of each sub-plot represents the adversarial direction, while the $y$ -axis represents a random orthogonal direction. The correct class is represented by white. Every row in the plot contains a training data point chosen uniformly at random, while each column uses a different random orthogonal vector for the $y$ -axis. The $\varepsilon$ bound for both axes is $[ - 1 . 0 , 1 . 0 ]$ .
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 11: Church-window plots of adversarially-trained models on MNIST, trained using a mix of clean and adversarial examples. The $x$ -axis of each sub-plot represents the adversarial direction, while the $y$ -axis represents a random orthogonal direction. The correct class is represented by white. Every row in the plot contains a training data point chosen uniformly at random, while each column uses a different random orthogonal vector for the $y$ -axis. The $\varepsilon$ bound for both axes is $[ - 1 . 0 , 1 . 0 ]$ . Notice the almost-linear decision boundaries on non-discretized models.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 12: Church-window plots of clean-trained models on CIFAR-10. The $x$ -axis of each sub-plot represents the adversarial direction, while the $y$ -axis represents a random orthogonal direction. The correct class is represented by white. Every row in the plot contains a training data point chosen uniformly at random, while each column uses a different random orthogonal vector for the $y$ -axis. The $\varepsilon$ bound for both axes is $[ - 1 . 0 , 1 . 0 ]$ . Notice the almost-linear decision boundaries on nondiscretized models.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 13: Church-window plots of adversarially-trained models on CIFAR-10, trained on only adversarial examples. The $x$ -axis of each sub-plot represents the adversarial direction, while the $y \cdot$ -axis represents a random orthogonal direction. The correct class is represented by white. Every row in the plot contains a training data point chosen uniformly at random, while each column uses a different random orthogonal vector for the $y$ -axis. The $\varepsilon$ bound for both axes is $[ - 1 . 0 , 1 . 0 ]$ .
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 14: Church-window plots of adversarially-trained models on CIFAR-10, trained using a mix of clean and adversarial examples. The $x$ -axis of each sub-plot represents the adversarial direction, while the $y$ -axis represents a random orthogonal direction. The correct class is represented by white. Every row in the plot contains a training data point chosen uniformly at random, while each column uses a different random orthogonal vector for the $y$ -axis. The $\varepsilon$ bound for both axes is $[ - 1 . 0 , 1 . 0 ]$ . Notice the almost-linear decision boundaries on non-discretized models.
|
md/train/S191YzbRZ/S191YzbRZ.md
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PROTOTYPE MATCHING NETWORKS FOR LARGE-SCALE MULTI-LABEL GENOMIC SEQUENCE CLASSIFICATION
|
| 2 |
+
|
| 3 |
+
# ABSTRACT
|
| 4 |
+
|
| 5 |
+
One of the fundamental tasks in understanding genomics is the problem of predicting Transcription Factor Binding Sites (TFBSs). With more than hundreds of Transcription Factors (TFs) as labels, genomic-sequence based TFBS prediction is a challenging multi-label classification task. There are two major biological mechanisms for TF binding: (1) sequence-specific binding patterns on genomes known as “motifs” and (2) interactions among TFs known as co-binding effects. In this paper, we propose a novel deep architecture, the Prototype Matching Network (PMN) to mimic the TF binding mechanisms. Our PMN model automatically extracts prototypes (“motif”-like features) for each TF through a novel prototypematching loss. Borrowing ideas from few-shot matching models, we use the notion of support set of prototypes and an LSTM to learn how TFs interact and bind to genomic sequences. On a reference TFBS dataset with 2.1 million genomic sequences, the PMN significantly outperforms baselines and validates our design choices empirically. To our knowledge, this is the first deep learning architecture that introduces prototype learning and considers TF-TF interactions for large scale TFBS prediction. Not only is the proposed architecture accurate, but it also models the underlying biology.
|
| 6 |
+
|
| 7 |
+
# 1 INTRODUCTION
|
| 8 |
+
|
| 9 |
+
Genomic sequences build the basis of a large body of research on understanding the biological processes in living organisms. Enabling machines to read and comprehend genomes is a longstanding and unfulfilled goal of computational biology. One of the fundamental task to understand genomes is the problem of predicting Transcription Factor Binding Sites (TFBSs), attracting much attention over the years (Consortium et al., 2012). Transcription Factors (TFs) are proteins which bind (i.e., attach) to DNA and control whether a gene is expressed or not. Patterns of how different genes expressed or not expressed control many important biological phenomena, including diseases such as cancer. Therefore accurate models for identifying and describing the binding sites of TFs are essential in understanding cells.
|
| 10 |
+
|
| 11 |
+
Owing to the development of chromatin immunoprecipitation and massively parallel DNA sequencing (ChIP-seq) technologies (Park, 2009), maps of genome-wide binding sites are currently available for multiple TFs in a few cell types across human and mouse genomes via the ENCODE (Consortium et al., 2012) database. However, ChIP-seq experiments are slow and expensive; they have not been performed for many important cell types or organisms. Therefore, computational methods to identify TFBS accurately remain essential for understanding the functioning and evolution of genomes.
|
| 12 |
+
|
| 13 |
+
An important feature of TFs is that they typically bind to sequence-specific patterns on genomes, known as “motifs” (Mitchell, 1989). Motifs are essentially a blueprint, or a “prototype” which a TF searches for in order to bind. However, motifs are only one part in determining whether or not a TF will bind to specific locations. If a TF binds in the absence of its motif, or it does not bind in the presence of its motif, then it is likely there are some external causes such as an interaction with another TF, known as co-binding effects in biology (Wang et al., 2012). This indicates that when designing a genomic-sequence based TFBS predictor, we should consider two modeling challenges: (1) how to automatically extract “motifs”-like features and (2) how to model the co-binding patterns and consider such patterns in predicting TFBSs. In this paper, we address both proposing a novel deep-learning model: prototype matching network (PMN).
|
| 14 |
+
|
| 15 |
+
To address the first challenge of motif learning and matching, many bioinformatics studies tried to predict TFBSs by constructing motifs using position weight matrices (PWMs) which best represented the positive binding sites. To test a sequence for binding, the sequence is compared against the PWMs to see if there is a close match (Stormo, 2000). PWM-matching was later outperformed by convolutional neural network (CNN) and CNN-variant models that can learn PWM-like filters Alipanahi et al. (2015a). Different from basic CNNs, our proposed PMN is inspired by the idea of “prototype-matching” (Wallis et al., 2008; Krotov & Hopfield, 2016). These studies refer to the CNN type of model as the “feature-matching” mode of pattern recognition. While pure feature matching has proven effective, studies have shown a “prototype effect” where objects are likely recognized as a whole using a similarity measure from a blurred prototype representation, and prototypes do not necessarily match the object precisely (Wallis et al., 2008). It is plausible that humans use a combination of feature matching and prototype matching where feature-matching is used to construct a prototype for testing unseen samples (Krotov & Hopfield, 2016). For TFBS prediction, the underlying biology evidently favors computation models that can learn “prototypes” (i.e. effective motifs). Although motifs are indirectly learned in convolutional layers, existing deep learning studies of TFBS (details in Section 3) have not considered the angle of “motif-matching” using a similarity measure. We, instead, propose a novel prototype-matching loss to learn prototype embedding automatically for each TF involved in the data.
|
| 16 |
+
|
| 17 |
+
None of the previous deep-learning studies for TFBS predictions have considered tackling the second challenge of including the co-binding effects among TFs in data modeling. From a machine learning angle, the genomic sequence based TFBS prediction is a multi-label sequence classification task. Rather than learning a prediction model for each TF (i.e., each label) predicting if the TF will bind or not on input, a joint model is ideal for outputting how a genomic sequence input is attached by a set of TFs (i.e., labels). The so-called “co-binding effects” connect deeply to how to model the dependency and combinations of TFs (labels). Multi-label classification is receiving increasing attention in deep learning (Wang et al., 2016; Guo & Gu, 2011; Wei et al., 2014) (detailed review in Section 3). Modeling the multi-label formulation for TFBS is an extremely challenging task because the number of labels (TFs) is in hundreds to thousands (e.g. 1,391 TFs in Vaquerizas et al. (2009)). The classic solution for multi-label classification using the powerset idea (i.e., the set of all subsets of the label set) is clearly not feasible (Tsoumakas & Katakis, 2006). Possible prior information about TF-TF interactions is unknown or limited in the biology literature.
|
| 18 |
+
|
| 19 |
+
To tackle these obstacles, our proposed model PMN borrows ideas from the memory network and attention literature. Vinyals et al. (2016) proposed a “matching network” model where they train a differentiable nearest neighbor model to find the closest matching image from a support set on a new unseen image. They use a CNN to extract features and then match those features against the support set images. We replace this support set of images with a learned support set of prototypes from the large-scale training set of TFBS prediction, and we use this support set to match against a new test sample. The key difference is that our PMN model is not for few-shot learning and we seek to learn the support set (prototypes). Vinyals et al. (2016) uses an attentionLSTM to model how a test sample matches to different items in the support set through softmax based attention. Differently, we use what we call a combinationLSTM to model how the embedding of a test sample matches to a combination of relevant prototypes. Using multiple “hops”, the combinationLSTM updates the embedding of the input sequence by searching for which TFs (prototypes) are more relevant in the label combination. Instead of explicitly modeling interactions among labels, we try to use the combinationLSTM to mimic the underlying biology. The combinationLSTM tries to learn prototype embedding and represent high-order label combinations through a weighted sum of prototype embedding. This weighted summation can model many “co-binding effects” reported in the biology literature (Wang et al., 2012) (details in Section 2).
|
| 20 |
+
|
| 21 |
+
In summary, we propose a novel PMN model by combining few-shot matching and prototype feature learning. To our knowledge, this is the first deep learning architecture to model TF-TF interactions in an end-to-end model. In addition, this is also the first paper to introduce large scale prototype learning using a deep learning architecture. On a reference TFBS dataset with 2.1 million genomic sequences, PMN significantly outperforms the state-of-the-art TFBS prediction baselines. We validate the learned prototypes through an existing database about TF-TF interactions. The TF groups obtained by clustering prototype embedding evidently captures the “cooperative effects” that has not been modeled by previous TFBS prediction works.
|
| 22 |
+
|
| 23 |
+
The main contributions of our model are:
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Prototype Matching Network (PMN) Model. On the left is an overview of the model. The input sequence $x$ is encoded as $\hat { x }$ using $f$ (3-layer CNN). $\hat { x }$ is then matched against the learned prototypes using the combinationLSTM for $K$ “hops” so that it can update its output based on TF interactions for this input sequence. The final output $\hat { y }$ is based on a concatenation of the final updated sequence vector $h ^ { K }$ from the LSTM, and final read vector $r ^ { K }$ from the matching. On the right is a closer look at the internal aspects of the combinationLSTM.
|
| 27 |
+
|
| 28 |
+
• We propose a novel model by combining few-shot matching with large-scale prototype feature learning.
|
| 29 |
+
• We design a novel prototype-matching loss to learn “motif”-like features in deep learning, which is important for the TFBS prediction task.
|
| 30 |
+
• We extend matching models from the few-shot single-label task to a large-scale multi-label task for genomic sequence classification.
|
| 31 |
+
• We implement an attention LSTM module to model label interactions in a novel way.
|
| 32 |
+
• Our model favors design choices mimicking the underlying biological processes. We think such modeling strategies are more fundamental especially on datasets from biology.
|
| 33 |
+
|
| 34 |
+
# 2 PROTOTYPE MATCHING NETWORKS
|
| 35 |
+
|
| 36 |
+
# 2.1 MODEL OVERVIEW
|
| 37 |
+
|
| 38 |
+
Given a DNA sequence $x$ (composed of characters A,C,G,T) of length $T$ , we want to classify $x$ as a positive or negative binding site for each transcription factor $T F _ { 1 } , T F _ { 2 } , . . . , T F _ { \ell }$ in our dataset (i.e. multi-label binary classification). To do this, we seek to match $x$ to a bank of $\ell$ learned TF prototype vectors, $\{ p _ { 1 } , . . . , \stackrel { . } { p _ { \ell } } \}$ , where each prototype is loosely representative of a motif. In addition, since TFs may bind or not bind based on other TFs, we model the interactions among TFs in order to make a prediction. An overview of our model can be seen in Figure 1.
|
| 39 |
+
|
| 40 |
+
# 2.2 EMBEDDING THE SEQUENCE AND PROTOTYPES
|
| 41 |
+
|
| 42 |
+
The input sequence $\boldsymbol { x } \in \mathbb { R } ^ { 4 \times t }$ is encoded using a function $f$ (3-layer CNN, which has shown to be sufficient for genomic feature extraction) to produce sequence embedding $\hat { x } \in \mathbb R ^ { d }$ :
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
{ \hat { x } } = f ( x )
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
Each prototype vector $p _ { i } \in \mathbb { R } ^ { d }$ is learned via a lookup table with a constant input integer at each position (e.g. 1 as input to the first position and $t$ as input to position $t$ ). I.e. the prototypes are produced by a multiplication of the identity matrix I and the learned lookup table matrix $W \in$ $\mathbb { R } ^ { | T F s | \times d }$ .
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
P = \mathrm { I } W
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
Since our learned prototypes, $p _ { i }$ are randomly initialized, we introduce a prototype matching loss ${ \mathcal { L } } _ { p }$ , which forces a prototype to correspond to a specific TF. Our prototype matching loss is explained in section 2.4.
|
| 55 |
+
|
| 56 |
+
2.3 LSTM TO LEARN LABEL INTERACTIONS AND TO UPDATE THE SEQUENCE EMBEDDING
|
| 57 |
+
|
| 58 |
+
Once we have the sequence and prototype embedding vectors, we want to compare the sequence to the prototypes to get binding site probabilities for each TF. The main idea is that we want to modify the sequence embedding $\hat { x }$ conditioned on matching against the prototypes. Since interactions among TFs influence binding, we cannot simply match the sequence to the prototypes. To obtain TF interactions, we use an LSTM (combinationLSTM), similar to the attention LSTM (attLSTM) in Vinyals et al. (2016). Our combinationLSTM is what does the actual matching for classification, whereas Vinyals et al. (2016) use the output of the attLSTM to make the final matching prediction. The combinationLSTM uses $K$ “hops” to process the prototypes $p _ { 1 } , p _ { 2 } , . . . , p _ { \ell }$ by matching against an updated sequence embedding $\hat { h } ^ { k }$ . The hops allow the combinationLSTM to update the output vector based on which TFs match simultaneously. At each hop, the LSTM accepts a constant $\hat { x }$ , a concatenation of the previous LSTM hidden state $\bar { h } ^ { k - 1 }$ and read vector r $r ^ { k - 1 }$ , as well as the previous LSTM cell output $c ^ { k - 1 }$ . $h ^ { 0 }$ and $c ^ { 0 }$ are initialized with zeros, and $r ^ { 0 }$ is initialized with the mean of all prototype vectors, ${ \frac { 1 } { | p | } } \sum _ { i } ^ { | p | } p _ { i }$ .
|
| 59 |
+
|
| 60 |
+
The output hidden state $\hat { h } ^ { k }$ is matched against each prototype using cosine similarity, producing a similarity score. Since this similarity is in the range [-1,1], we feed this output through sigmoid function, weighted by hyperparameter $\epsilon$ (we use $\scriptstyle \epsilon = 2 0$ ) to produce the similarity score $w _ { i } ^ { k }$ at hop $k$ in [0,1]. The read vector $r$ is updated by a weighted sum of the prototype vectors using the matching scores. At each hop, $h ^ { k }$ is updated using the current LSTM output hidden state and the sequence embedding.
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r l } & { \hat { h } ^ { k } , c ^ { k } = \mathrm { L S T M } ( \hat { x } , [ h ^ { k - 1 } ; r ^ { k - 1 } ] , c ^ { k - 1 } ) } \\ & { \quad \quad h ^ { k } = \hat { h } ^ { k } + \hat { x } } \\ & { \quad \quad r ^ { k } = \displaystyle \sum _ { i = 1 } ^ { \lfloor p \rfloor } w _ { i } ^ { k } p _ { i } } \\ & { \quad \quad w _ { i } ^ { k } = 1 / \big ( 1 + e ^ { - \epsilon c ( \hat { h } ^ { k } , p _ { i } ) } \big ) } \\ & { \quad \quad c ( u , v ) = \frac { u \cdot v } { | | u | | _ { 2 } | | v | | _ { 2 } } } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
In the TFBS task, eq. 5 is the important factor for modelling TF combinations. The output vector $r$ can model multiple prototypes matching at once through a linear combination. Furthermore, the LSTM with $K$ hops is needed because of the fact that a TF binding may influence other TFs in a sequential manner. For example, if $T F _ { i }$ matches to $\hat { h } ^ { k }$ in the first hop, $r ^ { k }$ is then used to output $\hat { h } ^ { k + 1 }$ which can match to $T F _ { j }$ at the next hop. In this case, $\hat { h } ^ { k + 1 }$ is a joint representation of $\hat { x }$ and the current matched prototypes, represented by $r ^ { k }$ . At each hop, the LSTM fine-tunes $w ^ { k }$ in order to find $T F$ binding combinations.
|
| 67 |
+
|
| 68 |
+
The final output $\hat { y } \in \mathbb { R } ^ { | T F s | } .$ is computed from a concatenation of the final hidden state and read vectors $[ h ^ { k } ; r ^ { K } ]$ after the $K ^ { t h }$ hop using a linear transform and an element-wise sigmoid function to get a probability of binding for each TF. :
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { l } { { o = W ( [ h ^ { K } ; r ^ { K } ] ) } } \\ { { \hat { y } = 1 / ( 1 + e ^ { - o } ) } } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
# 2.4 CLASSIFICATION AND PROTOTYPE MATCHING LOSS FUNCTIONS
|
| 75 |
+
|
| 76 |
+
To classify a sequence, we use a standard binary cross entropy loss between each label $y _ { i }$ for $T F _ { i }$ and the corresponding $T F _ { i }$ output $\hat { y } _ { i }$ , which we call the classification loss, $\mathcal { L } _ { c }$ , for each label.
|
| 77 |
+
|
| 78 |
+
We also introduce a prototype matching loss ${ \mathcal { L } } _ { p }$ , which forces a prototype to correspond to a specific TF since prototypes are learned from random initializations. The prototype matching loss works by using an $\mathrm { L _ { 2 } }$ between the true label $y _ { i }$ for $T F _ { i }$ and the final matching weight $w _ { i } ^ { K }$ between updated sequence $h ^ { K }$ and prototype $p _ { i }$ . This loss forces a prototype to match to all of its positive binding sequences. Each $\dot { w } _ { i } ^ { K }$ is from the final prototype matching weights after the $K ^ { t h }$ hop from Eq (6).
|
| 79 |
+
|
| 80 |
+
Table 1: Comparison of previous deep-learning studies for TFBS and three closely related deep learning papers in the recent literature. The columns indicate properties: (1) whether the study has a joint deep architecture for multi-label prediction or not, (2) if the study learns prototype features (”motifs” in the TFBS literature), (3) whether the study models how input samples match prototypes, (4) if it uses RNN to model high-order combinations of labels, and finally (5) if the method considers current sample inputs for modeling label combinations. All previous TFBS studies do not model label interactions. PMN combines several key strategies from deep learning literature including: (a) learning label-specific prototype embedding (Snell et al., 2017) through prototype-matching loss, (b) using RNN to model higher-order label combinations (Wang et al., 2016), and (c) using LSTM to model such combinations dynamically (conditioned on the current input) (Vinyals et al., 2016). PMN is the only model that exhibits all desirable properties.
|
| 81 |
+
|
| 82 |
+
<table><tr><td>Method</td><td>Multi-Label Joint Model</td><td>Task</td><td>Prototypes (Motifs) perLabel</td><td>Prototype Matching Loss</td><td>RNN for Label Combinations (Co-Binding)</td><td>Dynamic Label Combinations</td></tr><tr><td rowspan="4">DeepBind (Alipanahi et al.,2015a) DeepSEA (Zhou & Troyanskaya,2015) DanQ(Quang& Xie,2016)</td><td>×</td><td>TFBS</td><td>×</td><td>×</td><td>×</td><td>×</td></tr><tr><td>√</td><td>TFBS</td><td>×</td><td>×</td><td>×</td><td>×</td></tr><tr><td>√</td><td>TFBS</td><td>×</td><td>×</td><td>×</td><td>×</td></tr><tr><td>X1</td><td>TFBS</td><td>√</td><td>×</td><td>×</td><td>×</td></tr><tr><td>TFImpute(Qin& Feng,2017) CNN-RNN (Wang et al.,2016)</td><td>√</td><td>Image</td><td>√</td><td>×</td><td>√</td><td>×</td></tr><tr><td>Memory-Matching (Vinyals et al.,2016)</td><td>×</td><td>FewShot</td><td>×</td><td>√</td><td>x2</td><td>大</td></tr><tr><td>Prototypical-Network (Snell et al., 2017)</td><td>×</td><td>FewShot</td><td>√</td><td>×</td><td>×</td><td>×</td></tr><tr><td>Prototype Matching Network: (this paper)</td><td>√</td><td>TFBS</td><td>√</td><td>√</td><td>√</td><td>√</td></tr></table>
|
| 83 |
+
|
| 84 |
+
The important thing is that the loss is computed from the final weights $w ^ { K }$ . This allows the LSTM to attend to certain TFs at different hops before making its final decision, modeling the co-binding of TFs. The hyperparameter $\lambda$ controls the amount that each prototype is mapped to a specific TF. $\lambda { = } 0$ corresponds to random prototypes since we are not forcing $p _ { i }$ to match to a specific sequence.
|
| 85 |
+
|
| 86 |
+
Thus, the final loss $\mathcal { L }$ is a summation of both the classification loss and the prototype matching loss:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r l } & { \mathcal { L } = - \mathcal { L } _ { c } - \lambda \mathcal { L } _ { p } } \\ & { \mathcal { L } _ { c } = \displaystyle \sum _ { i } ^ { | p | } ( y _ { i } \log \hat { y } _ { i } + ( 1 - y _ { i } ) \log ( 1 - \hat { y } _ { i } ) ) } \\ & { \mathcal { L } _ { p } = \displaystyle \sum _ { i } ^ { | p | } ( y _ { i } - w _ { i } ^ { K } ) ^ { 2 } } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
# 2.5 TRAINING
|
| 93 |
+
|
| 94 |
+
We trained our model using Adam (Kingma & Ba, 2014) with a batch size of 512 sequences for 40 epochs. Our results were based on the test set results from the best performing validation epoch. We use dropout (Srivastava et al., 2014) for regularization.
|
| 95 |
+
|
| 96 |
+
# 3 RELATED WORKS
|
| 97 |
+
|
| 98 |
+
Deep learning in bioinformatics: Deep learning is steadily gaining popularity in the bioinformatics community. This trend is credited to their ability to extract meaningful representations from large datasets. For instance, multiple recent studies have successfully used deep learning for modeling protein sequences (Lin et al., 2016; Zhou & Troyanskaya, 2014), modeling DNA sequences (Alipanahi et al., 2015b; Lanchantin et al., 2016), predicting gene expression (Singh et al., 2016), as well as understanding the effects of non-coding variants (Zhou & Troyanskaya, 2015; Quang & Xie, 2016)).
|
| 99 |
+
|
| 100 |
+
Previous Studies of TFBS and more: Previous techniques for predicting TFBS include many sequence-motif based computational approaches that typically use position-based sequence information (Stormo, 2000). Relying on a set of known transcription factor binding sites (TFBSs) for a given
|
| 101 |
+
|
| 102 |
+
TF, the binding preference is generally represented in the form of a position weight matrix (PWM) (Stormo, 2013; Mathelier et al., 2013) (also called position-specific scoring matrix) derived from a position frequency matrix (PFM). Recently this technique was outperformed by different variations of deep convolutional models (Alipanahi et al., 2015b; Lanchantin et al., 2016; Quang & Xie, 2016; Shrikumar et al., 2017). While motif-based PWMs are compact and interpretable, they can under-fit ChIP-seq data by failing to capture subtle but detectable and important sequence signals, such as direct DNA-binding preferences of certain TFs, cofactor binding sequences, accessibility signals, or other discriminative sequence features (Arvey et al., 2012; Le et al., 2017).
|
| 103 |
+
|
| 104 |
+
Table 1 summarizes four most relevant deep learning studies of TFBS in the literature. Alipanahi et al. (2015b) was the first to use a deep learning based approach to predict TFBSs. They showed that a 1-layer CNN could outperform baseline motif matching approaches which used position weight matrices Machanick & Bailey (2011). Zhou & Troyanskaya (2015) used a similar method to predict the effects of variants in noncoding regions of the genome, where TFBS prediction was an intermediate step to predict variant effects. They used a 3-layer CNN model to predict 919 chromatin labels (including 690 TFBS labels). Quang & Xie (2015) extended this model using a bidirectional LSTM on top of the CNN outputs to model interactions among motifs. Note that this is not modeling interactions among labels (TFs), but rather among sequence features. Qin & Feng (2017) uses a similar lookup table approach for learning a representation for a TF, but their implementation is for transferring between cell lines where the target cell line has no experimental data. However, ChIP-seq experiments are relatively cheap given a specific TF and sequence of interest. We are more interested in modeling the underlying biology.
|
| 105 |
+
|
| 106 |
+
Aside from deep learning models, there have been other works to model joint dependencies among TFs Kazemian et al. (2011); He et al. (2009); Gautier et al. (2008); Sinha & He (2007). Our primary goal is to extend previous deep learning methods to better model co-binding, thus we do not compare against these approaches.
|
| 107 |
+
|
| 108 |
+
The formulation of TFBS prediction belongs to a general category of “biological sequence classification”. Sequence analysis plays an important role in the field of bioinformatics. Various methods have previously been proposed, including generative (e.g., Hidden Markov Models-HMMs) and discriminative approaches. Among the discriminative approaches, string kernel methods provide some of the most accurate results, such as for remote protein fold and homology detections (Leslie & Kuang, 2004; Kuksa et al., 2008). We omit a full survey of this topic due to its vast body of previous literature and loose connection to our TFBS formulations.
|
| 109 |
+
|
| 110 |
+
Memory Matching Network and Attention RNN: Attention in combination with RNNs has been successfully used for many tasks Bahdanau et al. (2014). Various methods have extended the single step attention approach to attention with multiple ‘hops’ Sukhbaatar et al. (2015); Kumar et al. (2016). For example, for the Question Answering task, Kumar et al. (2016) introduced the Dynamic Memory Network which uses an iterative attention process coupled with an RNN over multiple ‘episodes’. Kumar et al. (2016) show that the attention gets more focused over successive hops or ‘episodes’ over the input, reaffirming the need for recurrent episodes. Most of these models are for sequential inputs. For tasks that involve a set (i.e., no order) as input or/and as output, Vinyals et al. (2015) introduced a general framework employing a similar content based attention with associative memory. To deal with non-sequential inputs, the input elements are stored as a unordered external memory. It uses an LSTM coupled with a dynamic attention mechanism over the memory vectors. After ‘K’ hops of the LSTM, the final output/memory retrieved from the process block does not depend on the ordering of the input elements. Vinyals et al. (2016) leverage this set framework for few-shot learning by introduce the “matching network” (MN) model. The MN model learns nearest neighbor classifier to find the closest matching image from a support set on a new unseen image. To this end, they use the same ‘process’ block from Vinyals et al. (2015) with modifications to incorporate ‘matching’. In each hop over the support set, they ‘match’ or compare the hidden state of the attLSTM with each of the support set elements. They use the output of the attLSTM to do the final support set matching.
|
| 111 |
+
|
| 112 |
+
In our model, we use a set of learned prototype vectors instead of the support set of images. Both our model and the MN model uses an LSTM to learn the interactions among the items in the support set. However, the MN model uses a softmax attention and we use a sigmoid attention (due to the multi-label output). We compare a baseline model using a softmax attention (details in section 4.1).
|
| 113 |
+
|
| 114 |
+
Table 2: Comparison to similar matching models
|
| 115 |
+
|
| 116 |
+
<table><tr><td></td><td>Task</td><td>Output</td><td>Comparison</td><td>Support Set</td></tr><tr><td>Vinyals et al. 2015</td><td>Few shot</td><td>Single task</td><td>Cosine Similarity</td><td>Individual support set images</td></tr><tr><td>Snell et al. 2017</td><td>Few shot</td><td>Single task</td><td>Squared Euclidean</td><td>Mean of each class from support set</td></tr><tr><td>Ours</td><td>Large-scale</td><td>Multi-task</td><td>Cosine Similarity</td><td>Learned prototype for each class</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Prototype Features and Prototypical Networks: While standard deep learning architectures have proven to work in many tasks, most operate under the feature-matching theory of pattern recognition where an input is decomposed into a set of features, and then are compared with those stored in the memory (Krotov & Hopfield, 2016). Prototype theory, on the other hand, proposes that objects are recognized as a whole and prototypes do not necessarily match the object precisely (Wallis et al., 2008). In this sense, the prototypes are blurred abstract representations which include all of the object’s features. Krotov & Hopfield (2016) show that pattern recognition is likely a combination of both feature-matching and prototype-matching. Transcription factors bind to motifs on DNA sequences, which we view as prototypes, the blurred features are constructed from a CNN (featurematching). Our method is motivated by the prototype-matching theory, where instead of searching for exact features to match against, the model tests an unseen sample against a set of prototypes using a defined similarity metric to make a classification.
|
| 119 |
+
|
| 120 |
+
Snell et al. (2017) introduces prototypical networks for zero and one-shot learning, which assumes that the data points belonging to a particular class cluster around a single prototype. This prototype is representative for its class. In this model, each prototype embedding is the average embedding of all examples belonging to a certain class. This method is equivalent to a linear classifier if the Euclidean distance metric is used. While this method successfully learns a single prototype embedding for each class, it does not utilize a recurrent-attention mechanism over the support set. The prototypes in their method are restricted to the average embedding of its class and do not consider interactions among classes. Instead, our prototypes are the learned embedding for each label and play important roles in modelling the interactions among labels. Rippel et al. (2015) proposed a method for learning $\mathbf { k }$ -prototypes within each class, instead of just one. This in turn requires a $\mathbf { k }$ -means classifier to first group the intra-class embeddings before separating inter-class embeddings.
|
| 121 |
+
|
| 122 |
+
Multi-label Classification in Deep Learning: Multi-label classification is receiving increasing attention in image classification and object recognition. In a multi-label classification task, multiple labels may be assigned to each instance. A problem transformation method for multilabel classification considers each different set of labels as a single label. Thus, it learns a binary classifier for every element in the powerset of the labels (Tsoumakas & Katakis, 2006). However, this may not be feasible in the case of a large number of labels. The most common and a more feasible problem transformation method learns a binary classifier for each label(Tsoumakas & Katakis, 2006).Gong et al. (2013) use ranking to train deep convolutional neural networks for multi-label image classification. In Hypotheses-CNN-Pooling (Wei et al., 2014), the output results from different hypotheses are aggregated with max pooling. These models treat the labels independently from each other. However, modeling the dependencies or co-occurrences of the labels is essential to gain a complete understanding of the image. To this end, Read et al. (2009) propose a chaining method to model label correlations. Xue et al. (2011), Ghamrawi & McCallum (2005) and Guo & Gu (2011) use graphical models to capture these dependencies. However, these approaches only model low order label correlations and can be computationally expensive. Wang et al. (2016) is the state-of-the-art multi-label study for object recognition. To characterize the high-order label dependencies, this model leverages the ability of an LSTM to model long-term dependency in a sequence. Briefly, the label prediction is treated as an ‘ordered prediction path’. This prediction path is essentially modeled by the RNN. While the CNN is used to extract image features, the RNN model takes the current label prediction as input at each time step and generates an embedding for the next predicted label. Although the RNN utilizes its hidden state to model the label dependencies, it is not dynamically conditioned on input samples. StarSpace Wu et al. (2017) is a method to learn entity embeddings in the input space which can handle multi-label outputs. Our method is different in that it extracts relationships directly among the outputs rather than in the input space.
|
| 123 |
+
|
| 124 |
+
Table 3: Dataset Overall Summary. In each split, about $40 \%$ of its samples have more than 1 TF binding (i.e. a combination of TFs binding together), and each sample has an average of about 5.7 TFs binding.
|
| 125 |
+
|
| 126 |
+
<table><tr><td>Split</td><td>Total Samples</td><td>Co-Binding Samples</td><td>Mean # of TFs Binding Per Sample</td></tr><tr><td>Train</td><td>1446320</td><td>797475</td><td>5.62</td></tr><tr><td>Valid</td><td>331884</td><td>186509</td><td>5.75</td></tr><tr><td>Test</td><td>306297</td><td>170329</td><td>5.85</td></tr></table>
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 2: Dataset Per-TF Summary. For each TF, the left y-axis shows the percentage of positive samples this TF has out of all possible samples. For each TF, the right y-axis shows the percentage of positive samples which also have another TF binding.
|
| 130 |
+
|
| 131 |
+
# 4 EXPERIMENTS
|
| 132 |
+
|
| 133 |
+
# 4.1 DATASETS AND EXPERIMENTAL SETUP FOR TFBS PREDICTION
|
| 134 |
+
|
| 135 |
+
Dataset: We constructed our own dataset from ChIP-seq experiments in the ENCODE project database (Consortium et al., 2012). ChIP-seq experiments give binding affinity p-values for certain locations in the human genome for a specific cell type. We divided the entire human genome up into 200-length sequences, using a sliding window of 50 basepairs. We then extracted the 200-length windows surrounding the peak locations for 86 transcription factors in the human lymphoblastoid cell line (GM12878). Any peak with a measured p-value of at least 1 was considered a positive binding peak (it is important to note that we could get better results by setting a higher treshold, but we were interested in modelling all potential peaks). For each window in the genome, if any of the TF windows have a $5 5 0 \%$ overlap, we consider this a positive binding site window. We discard all windows with no TFs binding, resulting in a total of 2,084,501 binding site windows, or about $14 \%$ of the human genome.
|
| 136 |
+
|
| 137 |
+
Data Statistics: We use windows in chromosomes 1, 8, and 21 as a validation set (331,884 sequences), chromosomes 3, 12, and 17 as a test set (306,297 sequences), and the rest as training (1,446,320 sequences). The number of positive training windows for each TF ranges from 793 ( $1 \%$ of training samples) to 380,824 $23 \%$ of training samples). The validation and test splits have similar percentages. About $40 \%$ of the windows have more than 1 TF binding to it, and each window has about 5 TFs binding. A overview summary of the dataset is shown in Table 3 and a per-TF summary of the dataset is shown in Figure 2.
|
| 138 |
+
|
| 139 |
+
Model Variations: To test the PMN model on our TFBS dataset, we constructed 3 model variations
|
| 140 |
+
|
| 141 |
+
1. CNN As commonly used in previous models (Quang & Xie, 2015; Lanchantin et al., 2016), we use a baseline 3-layer CNN model. We use $\{ 5 1 2 , 2 5 6 , 1 2 8 \}$ kernels of widths $\{ 9 , 5 , 3 \}$ at the 3 layers, respectively. The output of the CNN is maxpooled across the length, resulting in a final output vector of size 128. This architecture is used for both the single-label and multi-label CNN models.
|
| 142 |
+
|
| 143 |
+
Table 4: TFBS Prediction Across 86 TFs in GM12878 Cell Line. We compare our PMN model to two CNN baseline models (single-label and multi-label). We use the same CNN model and extend it using prototypes and the combinationLSTM to create our PMN model. $\lambda$ represents the weighting of the prototype loss in eq. 10. Results are shown using statistics across all 86 TFs, where our PMN model outperforms the CNN models based on all 3 metrics used. The PMN also outperforms both CNN models significantly using a pairwise t-test.
|
| 144 |
+
|
| 145 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">auROC</td><td colspan="3">auPR</td><td colspan="3">Recall at 50% FDR</td></tr><tr><td>Mean</td><td>Std.</td><td>%Increase over single</td><td>Mean</td><td>Std.</td><td>%Increase over single</td><td>Mean</td><td>Std.</td><td>%Increase over single</td></tr><tr><td>CNN (single-label)</td><td>0.820</td><td>0.072</td><td>-</td><td>0.263</td><td>0.123</td><td></td><td>0.224</td><td>0.198</td><td></td></tr><tr><td>CNN (multi-label)</td><td>0.831</td><td>0.055</td><td>1.37</td><td>0.257</td><td>0.113</td><td>-2.52</td><td>0.215</td><td>0.186</td><td>-4.00</td></tr><tr><td>PMN (λ=1), no LSTM</td><td>0.830</td><td>0.057</td><td>1.30</td><td>0.267</td><td>0.116</td><td>1.22</td><td>0.231</td><td>0.197</td><td>3.09</td></tr><tr><td>PMN (入=1), softmax att</td><td>0.834</td><td>0.057</td><td>1.70</td><td>0.272</td><td>0.115</td><td>3.36</td><td>0.243</td><td>0.194</td><td>8.48</td></tr><tr><td>PMN (入=0), sigmoid att</td><td>0.837</td><td>0.055</td><td>2.13</td><td>0.271</td><td>0.113</td><td>3.00</td><td>0.229</td><td>0.186</td><td>1.92</td></tr><tr><td>PMN (入=0.5), sigmoid att</td><td>0.839</td><td>0.055</td><td>2.38</td><td>0.272</td><td>0.113</td><td>3.36</td><td>0.235</td><td>0.187</td><td>4.73</td></tr><tr><td>PMN (入=1), sigmoid att</td><td>0.840</td><td>0.054</td><td>2.45</td><td>0.270</td><td>0.114</td><td>2.47</td><td>0.234</td><td>0.187</td><td>4.17</td></tr></table>
|
| 146 |
+
|
| 147 |
+
2. PMN no LSTM To demonstrate the effectiveness of the combinationLSTM module, we implement a PMN with no LSTM to iteratively update its weightings. In this model, we use eq. 5-9, except that we replace $\hat { h } ^ { k }$ in eq. 9 with $\hat { x }$ since there is no LSTM. The output (eq. 11) is then a concatenation of $r$ and $\hat { x }$ . We still use the full prototype loss $\lambda = 1$ ) in this model.
|
| 148 |
+
|
| 149 |
+
3. PMN, softmax att Since softmax attention is typically used in attention models, we explored using a softmax function to replace eq. 6 from $k = 0$ until $k = K - 1$ , and then an elementwise sigmoid function (i.e. eq. 6) for the final output since it is multi-label classification.
|
| 150 |
+
|
| 151 |
+
4. PMN, sigmoid att The full PMN model utilizes the LSTM module in eq. 6 over $K$ hops. We implement 3 variations of the prototype loss $( \lambda = 0 , \lambda = 0 . 5 , \lambda = 1 )$ , where $\lambda = 0$ represents no prototype loss, or random prototypes. We observed that $\lambda > 1$ did not result in improved results.
|
| 152 |
+
|
| 153 |
+
We then extended the baseline CNN to use the learned prototypes $p _ { i }$ , and prototype matching LSTM (combinationLSTM). We call the combination of the CNN, prototypes, and combinationLSTM a PMN. We use $K = 5$ hops for the combinationLSTM because each sample has on average 5 positive label outputs. We also compared against a baseline single-task model for each TF, which assumes no interactions among TFs.
|
| 154 |
+
|
| 155 |
+
Metrics: We use three separate metrics which are commonly used in large scale TFBS prediction. Since our labels are very unbalanced, we use area under ROC curve (auROC). However, auROC may not give a fair evaluation in unbalanced datasets (Lever et al., 2016; Ching et al., 2017). So we also use area under precision-call curve (auPR), and recall at $50 \%$ false discovery rate.
|
| 156 |
+
|
| 157 |
+
# 4.2 LARGE-SCALE TFBS CLASSIFICATION RESULTS
|
| 158 |
+
|
| 159 |
+
Table 4 shows the results of our models across the 86 TF labels. The joint CNN (multi-label) model outperformed the single label CNN models in auROC and auPR. The main advantage of the joint model is that it is faster than an individual model for each TF. The joint model’s improvement over the single-task models was not significant (p-value $< 0 . 0 5$ ) based on a one-tailed pairwise t-test. This is presumably because the joint model finds motifs similar among all motifs, but it doesn’t model interactions among TF labels.
|
| 160 |
+
|
| 161 |
+
The PMN model outperformed both baseline CNN models in all 3 metrics. In addition, the improvement of the PMN over both CNN models was significant using a one-tailed pairwise t-test. We hypothesize that the combinationLSTM module accurately models co-binding better, leading to an increase in performance.
|
| 162 |
+
|
| 163 |
+
In Figure 3, we show the per-epoch mean auROC results of the PMN vs CNN model. There are two important factors to note from this plot. First, the PMN models all outperform the baseline CNN. Second, the PMN models converge faster than the CNN. We hypothesize that the prototypes and similarity measure help the model generalize quickly. We assume this is the case since prototype matching models have been shown to work in few-shot cases (Vinyals et al., 2016; Snell et al., 2017).
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 3: TFBS Per-Epoch Mean auROC (Left: Train, Right: Test)
|
| 167 |
+
|
| 168 |
+
Table 5: Column “TF-A” represents a TF in one of the clusters obtained from hierarchical clustering. The subsequent column contains TFs that belong to the same cluster and, according to TRRUST database (Han et al., 2015), share target genes with TF-A. Remaining columns show the number of overlapping target genes between each TF and TF-A pair as well as their p-values for TF-TF cooperativity obtained from TRRUST. An interesting thing to note here is that in Cluster 1 and 2, TF that is away from TF-A in the cluster has lower p-value than the TF that is closer.
|
| 169 |
+
|
| 170 |
+
<table><tr><td rowspan=1 colspan=1>Cluster</td><td rowspan=1 colspan=1>TF-A</td><td rowspan=1 colspan=1>TFssharingtargets</td><td rowspan=1 colspan=1>No.oftargetgenes</td><td rowspan=1 colspan=1>P-value</td></tr><tr><td rowspan=3 colspan=1>1</td><td rowspan=3 colspan=1>MYC</td><td rowspan=1 colspan=1>EP300</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>1.08E-10</td></tr><tr><td rowspan=1 colspan=1>USF1</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5.77E-04</td></tr><tr><td rowspan=1 colspan=1>E2F4</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3.93E-04</td></tr><tr><td rowspan=3 colspan=1>2</td><td rowspan=3 colspan=1>RELA</td><td rowspan=1 colspan=1>PAX5</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>8.86E-10</td></tr><tr><td rowspan=1 colspan=1>ATF2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>6.10E-04</td></tr><tr><td rowspan=1 colspan=1>CREBP</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>5.04E-04</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>ATF2</td><td rowspan=1 colspan=1>CREB1</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>2.69E-12</td></tr><tr><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>YY1</td><td rowspan=1 colspan=1>MAF</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>7.03E-04</td></tr><tr><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>STAT5A</td><td rowspan=1 colspan=1>BRCA1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>8.54E-04</td></tr><tr><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>MAX</td><td rowspan=1 colspan=1>STAT3</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>9.47E-04</td></tr></table>
|
| 171 |
+
|
| 172 |
+
This is also validated in TFs with the smallest amount of samples. In the $1 0 \mathrm { T F s }$ with the smallest amount of samples, the PMN $\lambda = 1 \AA$ ) has a $1 . 8 6 \%$ increase in mean auROC over the CNN. In the 10 TFs with the largest amount of samples, however, the PMN only results in an increase of $0 . 9 4 \%$ .
|
| 173 |
+
|
| 174 |
+
Biological Validation of Learned Prototype Embedding: In our PMN model, we are learning a prototype for each TF that represents “motif”-like features for that TF. Each prototype is processed by the combinationLSTM which is capturing the information about TFs that bind simultaneously (or TF-TF cooperativity). Thus, we hypothesize that our prototype not only learns its TF embedding but should also reflect the TF-TF cooperativity. This information is biologically relevant as it answers a critical question in the field - “What TFs work together (or cooperate) to regulate a particular gene of interest?”. To test this hypothesis, we performed hierarchical cluster analysis on the prototypes for the 86 TFs and obtained multiple clusters containing 2 or more TFs (Figure in Appendix). Next, we searched TFs from each cluster in a reference database of human transcriptional regulatory interactions called TRRUST (Han et al., 2015). For each TF, say “TF-A”, in its database, TRRUST displays a list of TFs that regulate the same target genes as TF-A. It also shows the measures of the significance of their cooperativity as p-values, using protein-protein interactions derived from major databases. Having no expert knowledge in biology, we found some interesting results that are summarized in Table 5. We found pairs of TFs (in Clusters 1-6), whose prototypes had been clustered together, to have significant (p-value $< 0 . 0 0 0 1$ ) cooperativity curated in TRRUST database. These observations indicate that each prototype is learning sufficient combinatorial information that allows the clustering algorithm to group the TFs that cooperate during gene regulation. Therefore, the learned prototypes are not only guiding the model to better predictions but are capturing an embedding that can provide insights into the TF-TF cooperativity in the actual biological scenario.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSION
|
| 177 |
+
|
| 178 |
+
Sequence analysis plays an important role in the field of bioinformatics. A prominent task is to understand how Transcription Factor proteins (TFs) bind to DNA. Researchers in biology hypothesize that each TF searches for certain sequence patterns on genome to bind to, known as “motifs”. Accordingly we propose a novel prototype matching network (PMN) for learning motif-like prototype features. On a support set of learned prototypes, we use a combinationLSTM for modeling label dependencies. The combinationLSTM tries to learn and mimic the underlying biological effects among labels (e.g. co-binding). Our results on a dataset of 2.1 million genomic strings show that the prototype matching model outperforms baseline variations not having prototype-matching or not using the combinationLSTM. This empirically validates our design choices to favor those mimicking the underlying biological mechanisms.
|
| 179 |
+
|
| 180 |
+
Our PMN model is a general classification approach and not tied to the TFBS applications. We show this generality by applying it on the MNIST dataset and obtain convincing results in Appendix Section 7.1. MNIST differs from TFBS prediction in its smaller training size as well as in its multi-class properties. We plan a few future directions to extend the PMN. First, TFBSs vary across different cell types, cell stages and genomes. Extending PMN for considering the knowledge transfer is especially important for unannotated cellular contexts (e.g., cell types of rare diseases or rare organisms). Another direction is to add more domain-specific features. While we show that using prototype matching and the combinationLSTM can help modelling TF combinations, there are additional raw feature extraction methods that we could add in order to obtain better representations of genomics sequences. These include reverse complement sequence inputs or convolutional parameter sharing (Shrikumar et al., 2017), or an RNN to model lower level spatial interactions (Quang & Xie, 2015; Lanchantin et al.) among motifs.
|
| 181 |
+
|
| 182 |
+
# 6 ACKNOWLEDGEMENTS
|
| 183 |
+
|
| 184 |
+
We would like to thank Dr. Chongzhi Zang from the University of Virginia Medical School for helping generate the datasets and for the helpful discussions.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Babak Alipanahi, Andrew Delong, Matthew T Weirauch, and Brendan J Frey. Predicting the sequence specificities of DNA-and RNA-binding proteins by deep learning. 33(8):831–838, 2015a.
|
| 189 |
+
|
| 190 |
+
Babak Alipanahi, Andrew Delong, Matthew T Weirauch, and Brendan J Frey. Predicting the sequence specificities of dna-and rna-binding proteins by deep learning. Nature Publishing Group, 2015b.
|
| 191 |
+
|
| 192 |
+
Aaron Arvey, Phaedra Agius, William Stafford Noble, and Christina Leslie. Sequence and chromatin determinants of cell-type–specific transcription factor binding. Genome research, 22(9):1723–1734, 2012.
|
| 193 |
+
|
| 194 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 195 |
+
|
| 196 |
+
Travers Ching, Daniel S Himmelstein, Brett K Beaulieu-Jones, Alexandr A Kalinin, Brian T Do, Gregory P Way, Enrico Ferrero, Paul-Michael Agapow, Wei Xie, Gail L Rosen, et al. Opportunities and obstacles for deep learning in biology and medicine. bioRxiv, pp. 142760, 2017.
|
| 197 |
+
|
| 198 |
+
ENCODE Project Consortium et al. An integrated encyclopedia of dna elements in the human genome. Nature, 489(7414):57–74, 2012.
|
| 199 |
+
|
| 200 |
+
Arnaud Gautier, Alexandre Juillerat, Christian Heinis, Ivan Reis Correa, Maik Kindermann, Florent ˆ Beaufils, and Kai Johnsson. An engineered protein tag for multiprotein labeling in living cells. Chemistry & biology, 15(2):128–136, 2008.
|
| 201 |
+
|
| 202 |
+
Nadia Ghamrawi and Andrew McCallum. Collective multi-label classification. In Proceedings of the 14th ACM international conference on Information and knowledge management, pp. 195–200. ACM, 2005.
|
| 203 |
+
|
| 204 |
+
Yunchao Gong, Yangqing Jia, Thomas Leung, Alexander Toshev, and Sergey Ioffe. Deep convolutional ranking for multilabel image annotation. arXiv preprint arXiv:1312.4894, 2013.
|
| 205 |
+
|
| 206 |
+
Yuhong Guo and Suicheng Gu. Multi-label classification using conditional dependency networks. In IJCAI Proceedings-International Joint Conference on Artificial Intelligence, volume 22, pp. 1300, 2011.
|
| 207 |
+
|
| 208 |
+
Heonjong Han, Hongseok Shim, Donghyun Shin, Jung Eun Shim, Yunhee Ko, Junha Shin, Hanhae Kim, Ara Cho, Eiru Kim, Tak Lee, et al. Trrust: a reference database of human transcriptional regulatory interactions. Scientific reports, 5:11432, 2015.
|
| 209 |
+
|
| 210 |
+
Min He, Yi Wang, and Wei Li. Ppi finder: a mining tool for human protein-protein interactions. PloS one, 4(2):e4554, 2009.
|
| 211 |
+
|
| 212 |
+
Majid Kazemian, Michael H Brodsky, and Saurabh Sinha. Genome surveyor 2.0: cis-regulatory analysis in drosophila. Nucleic acids research, 39(suppl 2):W79–W85, 2011.
|
| 213 |
+
|
| 214 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 215 |
+
|
| 216 |
+
Dmitry Krotov and John J Hopfield. Dense associative memory for pattern recognition. In Advances in Neural Information Processing Systems, pp. 1172–1180, 2016.
|
| 217 |
+
|
| 218 |
+
Pavel P Kuksa, Pai-Hsi Huang, and Vladimir Pavlovic. Scalable algorithms for string kernels with inexact matching. In NIPS, pp. 881–888, 2008.
|
| 219 |
+
|
| 220 |
+
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 International Conference on Machine Learning, pp. 1378–1387, 2016.
|
| 221 |
+
|
| 222 |
+
Jack Lanchantin, Ritambhara Singh, Beilun Wang, and Yanjun Qi. Deep motif dashboard: Visualizing and understanding genomic sequences using deep neural networks.
|
| 223 |
+
|
| 224 |
+
Jack Lanchantin, Ritambhara Singh, Beilun Wang, and Yanjun Qi. Deep motif dashboard: Visualizing and understanding genomic sequences using deep neural networks. arXiv preprint arXiv:1608.03644, 2016.
|
| 225 |
+
|
| 226 |
+
Daniel D Le, Tyler C Shimko, Arjun K Aditham, Allison M Keys, Yaron Orenstein, and Polly Fordyce. Comprehensive, high-resolution binding energy landscapes reveal context dependencies of transcription factor binding. bioRxiv, 2017. doi: 10.1101/193904. URL https://www. biorxiv.org/content/early/2017/09/26/193904.
|
| 227 |
+
|
| 228 |
+
Christina Leslie and Rui Kuang. Fast string kernels using inexact matching for protein sequences. The Journal of Machine Learning Research, 5:1435–1455, 2004.
|
| 229 |
+
|
| 230 |
+
Jake Lever, Martin Krzywinski, and Naomi Altman. Points of significance: Model selection and overfitting. Nature Methods, 13(9):703��704, 2016.
|
| 231 |
+
|
| 232 |
+
Zeming Lin, Jack Lanchantin, and Yanjun Qi. Must-cnn: A multilayer shift-and-stitch deep convolutional architecture for sequence-based protein structure prediction. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
|
| 233 |
+
|
| 234 |
+
Philip Machanick and Timothy L Bailey. Meme-chip: motif analysis of large dna datasets. Bioinformatics, 27(12):1696–1697, 2011.
|
| 235 |
+
|
| 236 |
+
Anthony Mathelier, Xiaobei Zhao, Allen W Zhang, Franc¸ois Parcy, Rebecca Worsley-Hunt, David J Arenillas, Sorana Buchman, Chih-yu Chen, Alice Chou, Hans Ienasescu, et al. Jaspar 2014: an extensively expanded and updated open-access database of transcription factor binding profiles. Nucleic acids research, pp. gkt997, 2013.
|
| 237 |
+
|
| 238 |
+
Pamela J Mitchell. Transcriptional regulation in mammalian cells by sequence-specific dna binding proteins. 1989.
|
| 239 |
+
|
| 240 |
+
Peter J Park. Chip–seq: advantages and challenges of a maturing technology. Nature Reviews Genetics, 10(10):669–680, 2009.
|
| 241 |
+
|
| 242 |
+
Qian Qin and Jianxing Feng. Imputation for transcription factor binding predictions based on deep learning. PLoS computational biology, 13(2):e1005403, 2017.
|
| 243 |
+
|
| 244 |
+
Daniel Quang and Xiaohui Xie. Danq: a hybrid convolutional and recurrent deep neural network for quantifying the function of dna sequences. pp. 032821. Cold Spring Harbor Labs Journals, 2015.
|
| 245 |
+
|
| 246 |
+
Daniel Quang and Xiaohui Xie. Danq: a hybrid convolutional and recurrent deep neural network for quantifying the function of dna sequences. Nucleic acids research, 44(11):e107–e107, 2016.
|
| 247 |
+
|
| 248 |
+
Jesse Read, Bernhard Pfahringer, Geoff Holmes, and Eibe Frank. Classifier chains for multi-label classification. Machine Learning and Knowledge Discovery in Databases, pp. 254–269, 2009.
|
| 249 |
+
|
| 250 |
+
Oren Rippel, Manohar Paluri, Piotr Dollar, and Lubomir Bourdev. Metric learning with adaptive density discrimination. arXiv preprint arXiv:1511.05939, 2015.
|
| 251 |
+
|
| 252 |
+
Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Reverse-complement parameter sharing improves deep learning models for genomics. bioRxiv, pp. 103663, 2017.
|
| 253 |
+
|
| 254 |
+
Ritambhara Singh, Jack Lanchantin, Gabriel Robins, and Yanjun Qi. Deepchrome: deep-learning for predicting gene expression from histone modifications. Bioinformatics, 32(17):i639–i648, 2016.
|
| 255 |
+
|
| 256 |
+
Saurabh Sinha and Xin He. Morph: probabilistic alignment combined with hidden markov models of cis-regulatory modules. PLoS computational biology, 3(11):e216, 2007.
|
| 257 |
+
|
| 258 |
+
Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175, 2017.
|
| 259 |
+
|
| 260 |
+
Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1):1929–1958, 2014.
|
| 261 |
+
|
| 262 |
+
Gary D Stormo. Dna binding sites: representation and discovery. Bioinformatics, 16(1):16–23, 2000.
|
| 263 |
+
|
| 264 |
+
Gary D Stormo. Modeling the specificity of protein-dna interactions. Quantitative Biology, 1(2): 115–130, 2013.
|
| 265 |
+
|
| 266 |
+
Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In Advances in neural information processing systems, pp. 2440–2448, 2015.
|
| 267 |
+
|
| 268 |
+
Grigorios Tsoumakas and Ioannis Katakis. Multi-label classification: An overview. International Journal of Data Warehousing and Mining, 3(3), 2006.
|
| 269 |
+
|
| 270 |
+
Juan M Vaquerizas, Sarah K Kummerfeld, Sarah A Teichmann, and Nicholas M Luscombe. A census of human transcription factors: function, expression and evolution. Nature Reviews Genetics, 10 (4):252–263, 2009.
|
| 271 |
+
|
| 272 |
+
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015.
|
| 273 |
+
|
| 274 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016.
|
| 275 |
+
|
| 276 |
+
Guy Wallis, Ulrike E Siebeck, Kellie Swann, Volker Blanz, and Heinrich H Bulthoff. The prototype ¨ effect revisited: Evidence for an abstract feature model of face recognition. Journal of Vision, 8(3): 20–20, 2008.
|
| 277 |
+
|
| 278 |
+
Jiang Wang, Yi Yang, Junhua Mao, Zhiheng Huang, Chang Huang, and Wei Xu. Cnn-rnn: A unified framework for multi-label image classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2285–2294, 2016.
|
| 279 |
+
|
| 280 |
+
Jie Wang, Jiali Zhuang, Sowmya Iyer, XinYing Lin, Troy W Whitfield, Melissa C Greven, Brian G Pierce, Xianjun Dong, Anshul Kundaje, Yong Cheng, et al. Sequence features and chromatin structure around the genomic regions bound by 119 human transcription factors. Genome research, 22(9):1798–1812, 2012.
|
| 281 |
+
|
| 282 |
+
Yunchao Wei, Wei Xia, Junshi Huang, Bingbing Ni, Jian Dong, Yao Zhao, and Shuicheng Yan. Cnn: Single-label to multi-label. arXiv preprint arXiv:1406.5726, 2014.
|
| 283 |
+
|
| 284 |
+
Ledell Wu, Adam Fisch, Sumit Chopra, Keith Adams, Antoine Bordes, and Jason Weston. Starspace: Embed all the things! arXiv preprint arXiv:1709.03856, 2017.
|
| 285 |
+
|
| 286 |
+
Xiangyang Xue, Wei Zhang, Jie Zhang, Bin Wu, Jianping Fan, and Yao Lu. Correlative multi-label multi-instance image annotation. In Computer Vision (ICCV), 2011 IEEE International Conference on, pp. 651–658. IEEE, 2011.
|
| 287 |
+
|
| 288 |
+
Jian Zhou and Olga G Troyanskaya. Deep supervised and convolutional generative stochastic network for protein secondary structure prediction. arXiv preprint arXiv:1403.1347, 2014.
|
| 289 |
+
|
| 290 |
+
Jian Zhou and Olga G Troyanskaya. Predicting effects of noncoding variants with deep learning-based sequence model. volume 12, pp. 931–934. Nature Publishing Group, 2015.
|
| 291 |
+
|
| 292 |
+
# 7 APPENDIX
|
| 293 |
+
|
| 294 |
+
# 7.1 MNIST
|
| 295 |
+
|
| 296 |
+
To validate the learned prototype matching on another task, we compare our PMN model against a standard CNN model on the MNIST dataset. We use a 3-layer CNN with $\{ 3 2 , 3 2 , 3 2 \}$ kernels of sizes $\{ 5 , 5 , 5 \}$ at the 3 layers, respectively.
|
| 297 |
+
|
| 298 |
+
For the MNIST experiments, the PMN models do not show a drastic improvement over the baseline CNN. The results are shown in Table 6. However, we do note that based on the per-epoch plots in Figure 4, the PMN models do converge faster than the baseline CNN. In addition, we show in figure 5 that the PMN embeddings are better separated than the CNN embeddings. This is likely due to the fact that the PMN uses a similarity metric, and the fact that it can update its embedding based on which number prototypes it matches to. In other words, if an image looks similar to several numbers (e.g. “5” and $\mathbf { \vec { \nabla } } ^ { 6 }$ ), the PMN can update its output based on which one it matches more to. Note that although we train using a prototype loss for each class, we do not constrain the matching to only match to one prototype.
|
| 299 |
+
|
| 300 |
+
Table 6: MNIST using 3-Layer CNN
|
| 301 |
+
|
| 302 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>CNN</td><td>99.37</td></tr><tr><td>PMN (λ = 0)</td><td>99.43</td></tr><tr><td>PMN (λ = 0.5)</td><td>99.39</td></tr><tr><td>PMN (λ= 1)</td><td>99.50</td></tr></table>
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 4: MNIST Per-Epoch Accuracy (Left: Train, Right: Test)
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure 5: 2d T-SNE Embedding of final output vector before classification. Left: CNN, Right: PMN
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
Figure 6: Hierarchical clustering of prototypes of 86 TFs.
|
md/train/S19dR9x0b/S19dR9x0b.md
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ALTERNATING MULTI-BIT QUANTIZATION FORRECURRENT NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Chen $\mathbf { X } \mathbf { u } ^ { 1 , }$ ∗, Jianqiang $\mathbf { Y a o } ^ { 2 }$ , Zhouchen Lin1,3,†, Wenwu $\mathbf { O u } ^ { 2 }$ , Yuanbin $\mathbf { C a o ^ { 4 } }$ , Zhirong Wang2, Hongbin Zha1,3
|
| 4 |
+
|
| 5 |
+
1 Key Laboratory of Machine Perception (MOE), School of EECS, Peking University, Ch
|
| 6 |
+
2 Search Algorithm Team, Alibaba Group, China
|
| 7 |
+
3 Cooperative Medianet Innovation Center, Shanghai Jiao Tong University, China
|
| 8 |
+
4 AI-LAB, Alibaba Group, China
|
| 9 |
+
|
| 10 |
+
xuen@pku.edu.cn,tianduo@taobao.com,zlin@pku.edu.cn,santong.oww@taobao.com lingzun.cyb@alibaba-inc.com, qingfeng@taobao.com,zha@cis.pku.edu.cn
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Recurrent neural networks have achieved excellent performance in many applications. However, on portable devices with limited resources, the models are often too large to deploy. For applications on the server with large scale concurrent requests, the latency during inference can also be very critical for costly computing resources. In this work, we address these problems by quantizing the network, both weights and activations, into multiple binary codes $\{ - 1 , + 1 \}$ . We formulate the quantization as an optimization problem. Under the key observation that once the quantization coefficients are fixed the binary codes can be derived efficiently by binary search tree, alternating minimization is then applied. We test the quantization for two well-known RNNs, i.e., long short term memory (LSTM) and gated recurrent unit (GRU), on the language models. Compared with the full-precision counter part, by 2-bit quantization we can achieve ${ \sim } 1 6 \times$ memory saving and ${ \sim } 6 \times$ real inference acceleration on CPUs, with only a reasonable loss in the accuracy. By 3-bit quantization, we can achieve almost no loss in the accuracy or even surpass the original model, with ${ \sim } 1 0 . 5 \times$ memory saving and ${ \sim } 3 \times$ real inference acceleration. Both results beat the exiting quantization works with large margins. We extend our alternating quantization to image classification tasks. In both RNNs and feedforward neural networks, the method also achieves excellent performance.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Recurrent neural networks (RNNs) are specific type of neural networks which are designed to model the sequence data. In last decades, various RNN architectures have been proposed, such as LongShort-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) and Gated Recurrent Units Cho et al. (2014). They have enabled the RNNs to achieve state-of-art performance in many applications, e.g., language models (Mikolov et al., 2010), neural machine translation (Sutskever et al., 2014; Wu et al., 2016), automatic speech recognition (Graves et al., 2013), image captions (Vinyals et al., 2015), etc. However, the models often build on high dimensional input/output,e.g., large vocabulary in language models, or very deep inner recurrent networks, making the models have too many parameters to deploy on portable devices with limited resources. In addition, RNNs can only be executed sequentially with dependence on current hidden states. This causes large latency during inference. For applications in the server with large scale concurrent requests, e.g., on-line machine translation and speech recognition, large latency leads to limited requests processed per machine to meet the stringent response time requirements. Thus much more costly computing resources are in demand for RNN based models.
|
| 19 |
+
|
| 20 |
+
To alleviate the above problems, several techniques can be employed, i.e., low rank approximation (Sainath et al., 2013; Jaderberg et al., 2014; Lebedev et al., 2014; Tai et al., 2016), sparsity (Liu et al., 2015; Han et al., 2015; 2016; Wen et al., 2016), and quantization. All of them are build on the redundancy of current networks and can be combined. In this work, we mainly focus on quantization based methods. More precisely, we are to quantize all parameters into multiple binary codes $\{ - 1 , + 1 \}$ .
|
| 21 |
+
|
| 22 |
+
The idea of quantizing both weights and activations is firstly proposed by (Hubara et al., 2016a). It has shown that even 1-bit binarization can achieve reasonably good performance in some visual classification tasks. Compared with the full precision counterpart, binary weights reduce the memory by a factor of 32. And the costly arithmetic operations between weights and activations can then be replaced by cheap XNOR and bitcount operations(Hubara et al., 2016a), which potentially leads to much acceleration. Rastegari et al. (2016) further incorporate a real coefficient to compensate for the binarization error. They apply the method to the challenging ImageNet dataset and achieve better performance than pure binarization in (Hubara et al., 2016a). However, it is still of large gap compared with the full precision networks. To bridge this gap, some recent works (Hubara et al., 2016b; Zhou et al., 2016; 2017) further employ quantization with more bits and achieve plausible performance. Meanwhile, quite an amount of works, e.g., (Courbariaux et al., 2015; Li et al., 2016; Zhu et al., 2017; Guo et al., 2017), quantize the weights only. Although much memory saving can be achieved, the acceleration is very limited in modern computing devices (Rastegari et al., 2016).
|
| 23 |
+
|
| 24 |
+
Among all existing quantization works, most of them focus on convolutional neural networks (CNNs) while pay less attention to RNNs. As mentioned earlier, the latter is also very demanding. Recently, (Hou et al., 2017) showed that binarized LSTM with preconditioned coefficients can achieve promising performance in some easy tasks such as predicting the next character. However, for RNNs with large input/output, e.g., large vocabulary in language models, it is still very challenging for quantization. Both works of Hubara et al. (2016b) and Zhou et al. (2017) test the effectiveness of their multi-bit quantized RNNs to predict the next word. Although using up to 4-bits, the results with quantization still have noticeable gap with those with full precision. This motivates us to find a better method to quantize RNNs. The main contribution of this work is as follows:
|
| 25 |
+
|
| 26 |
+
(a) We formulate the multi-bit quantization as an optimization problem. The binary codes $\{ - 1 , + 1 \}$ are learned instead of rule-based. For the first time, we observe that the codes can be optimally derived by the binary search tree once the coefficients are knowns in advance, see, e.g., Algorithm 1. Thus the whole optimization is eased by removing the discrete unknowns, which are very difficult to handle.
|
| 27 |
+
(b) We propose to use alternating minimization to tackle the quantization problem. By separating the binary codes and real coefficients into two parts, we can solve the subproblem efficiently when one part is fixed. With proper initialization, we only need two alternating cycles to get high precision approximation, which is effective enough to even quantize the activations on-line.
|
| 28 |
+
(c) We systematically evaluate the effectiveness of our alternating quantization on language models. Two well-known RNN structures, i.e., LSTM and GRU, are tested with different quantization bits. Compared with the full-precision counterpart, by 2-bit quantization we can achieve ${ \sim } 1 6 \times$ memory saving and ${ \sim } 6 \times$ real inference acceleration on CPUs, with a reasonable loss on the accuracy. By 3-bit quantization, we can achieve almost no loss in accuracy or even surpass the original model with ${ \sim } 1 0 . 5 \times$ memory saving and ${ \sim } 3 \times$ real inference acceleration. Both results beat the exiting quantization works with large margins. To illustrate that our alternating quantization is very general to extend, we apply it to image classification tasks. In both RNNs and feedforward neural networks, the technique still achieves very plausible performance.
|
| 29 |
+
|
| 30 |
+
# 2 EXISTING MULTI-BIT QUANTIZATION METHODS
|
| 31 |
+
|
| 32 |
+
Before introducing our proposed multi-bit quantization, we first summarize existing works as follows:
|
| 33 |
+
|
| 34 |
+
(a) Uniform quantization method (Rastegari et al., 2016; Hubara et al., 2016b) firstly scales its value in the range $x \in [ - 1 , 1 ]$ . Then it adopts the following $k$ -bit quantization:
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
q _ { k } ( x ) = 2 \left( { \frac { \mathrm { r o u n d } [ ( 2 ^ { k } - 1 ) ( { \frac { x + 1 } { 2 } } ) ] } { 2 ^ { k } - 1 } } - { \frac { 1 } { 2 } } \right) ,
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
after which the method scales back to the original range. Such quantization is rule based thus is very easy to implement. The intrinsic benefit is that when computing inner product of two quantized vectors, it can employ cheap bit shift and count operations to replace costly multiplications and additions operations. However, the method can be far from optimum when quantizing non-uniform data, which is believed to be the trained weights and activations of deep neural network (Zhou et al., 2017).
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 1: Illustration of the optimal 2-bit quantization when $\alpha _ { 1 }$ and $\alpha _ { 2 }$ ${ \bf \tilde { \alpha } } _ { 1 } \geq { \alpha _ { 2 } } , { \bf \tilde { \alpha } } _ { \bf \tilde { \alpha } } { \bf \Psi } $ ) are known in advance. The values are quantized into $- \alpha _ { 1 } - \alpha _ { 2 }$ , $- \alpha _ { 1 } + \alpha _ { 2 }$ , $\alpha _ { 1 } - \alpha _ { 2 }$ , and $\alpha _ { 1 } + \alpha _ { 2 }$ , respectively. And the partition intervals are optimally separated by the middle points of adjacent quantization codes, i.e., $- \alpha _ { 1 } , 0$ , and $\alpha _ { 1 }$ , correspondingly.
|
| 44 |
+
|
| 45 |
+
(b) Balanced quantization (Zhou et al., 2017) alleviates the drawbacks of the uniform quantization by firstly equalizing the data. The method constructs $2 ^ { k }$ intervals which contain roughly the same percentage of the data. Then it linearly maps the center of each interval to the corresponding quantization code in (1). Although sounding more reasonable than the uniform one, the affine transform on the centers can still be suboptimal. In addition, there is no guarantee that the evenly spaced partition is more suitable if compared with the non-evenly spaced partition for a specific data distribution.
|
| 46 |
+
|
| 47 |
+
(c) Greedy approximation (Guo et al., 2017) instead tries to learn the quantization by tackling the following problem:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\operatorname* { m i n } _ { \{ \alpha _ { i } , \mathbf { b } _ { i } \} _ { i = 1 } ^ { k } } \left\| \mathbf { w } - \sum _ { i = 1 } ^ { k } \alpha _ { i } \mathbf { b } _ { i } \right\| ^ { 2 } , \quad \mathrm { w i t h } \quad \mathbf { b } _ { i } \in \{ - 1 , + 1 \} ^ { n } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
For $k = 1$ , the above problem has a closed-form solution (Rastegari et al., 2016). Greedy approximation extends to $k$ -bit $k > 1 ,$ ) quantization by sequentially minimizing the residue. That is
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\operatorname* { m i n } _ { \alpha _ { i } , \mathbf { b } _ { i } } \left\| \mathbf { r } _ { i - 1 } - \alpha _ { i } \mathbf { b } _ { i } \right\| ^ { 2 } , \quad \mathrm { w i t h } \quad \mathbf { r } _ { i - 1 } = \mathbf { w } - \sum _ { j = 1 } ^ { i - 1 } \alpha _ { j } \mathbf { b } _ { j } .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Then the optimal solution is given as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\alpha _ { i } = { \frac { 1 } { n } } \| \mathbf { r } _ { i - 1 } \| _ { 1 } \quad { \mathrm { a n d } } \quad \mathbf { b } _ { i } = \mathrm { s i g n } ( \mathbf { r } _ { i - 1 } ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Greedy approximation is very efficient to implement in modern computing devices. Although not able to reach a high precision solution, the formulation of minimizing quantization error is very promising.
|
| 66 |
+
|
| 67 |
+
(d) Refined greedy approximation (Guo et al., 2017) extends to further decrease the quantization error. In the $j$ -th iteration after minimizing problem (3), the method adds one extra step to refine all computed $\{ \alpha _ { i } \} _ { i = 1 } ^ { j }$ with the least squares solution:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
[ \alpha _ { 1 } , \ldots , \alpha _ { j } ] = \left( ( \mathbf { B } _ { j } ^ { T } \mathbf { B } _ { j } ) ^ { - 1 } \mathbf { B } _ { j } ^ { T } \mathbf { w } \right) ^ { T } , \quad \mathrm { w i t h } \quad \mathbf { B } _ { j } = [ \mathbf { b } _ { 1 } , \ldots , \mathbf { b } _ { j } ] ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
In experiments of quantizing the weights of CNN, the refined approximation is verified to be better than the original greedy one. However, as we will show later, the refined method is still far from satisfactory for quantization accuracy.
|
| 74 |
+
|
| 75 |
+
Besides the general multi-bit quantization as summarized above, Li et al. (2016) propose ternary quantization by extending 1-bit binarization with one more feasible state, 0. It does quantization by tackling $\operatorname* { m i n } _ { \alpha }$ ,t $\| \mathbf { w } - \alpha \mathbf { t } \| _ { 2 } ^ { 2 }$ with $\mathbf { t } \in \{ - 1 , 0 , + 1 \} ^ { n }$ . However, no efficient algorithm is proposed in (Li et al., 2016). They instead empirically set the entries $w$ with absolute scales less than $0 . 7 / n \| \mathbf { w } \| _ { 1 }$ to 0 and binarize the left entries as (4). In fact, ternary quantization is a special case of the 2-bit quantization in (2), with an additional constraint that $\alpha _ { 1 } = \alpha _ { 2 }$ . When the binary codes are fixed, the optimal coefficient $\alpha _ { 1 }$ (or $\alpha _ { 2 }$ ) can be derived by least squares solution similar to (5).
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 2: Illustration of binary search tree to determine the optimal quantization.
|
| 79 |
+
|
| 80 |
+
# Algorithm 1: Binary Search Tree (BST) to determine to optimal code
|
| 81 |
+
|
| 82 |
+
BST $( w , \mathbf { v } )$ $\{ w$ is the real value to be quantized} { $\mathbf { v }$ is the vector of quantization codes in ascending order} $m = \mathrm { l e n g t h } ( \mathbf { v } )$ 2 if $m = = 1$ then 3 return $\mathbf { v } _ { 1 }$ 4 end 5 if $w \ge ( v _ { m / 2 } + v _ { m / 2 + 1 } ) / 2$ then 6 BST $( w , \mathbf { v } _ { m / 2 + 1 : m } )$ ) 7 else 8 BST( w, v1:m/2) 9 end
|
| 83 |
+
|
| 84 |
+
In parallel to the binarized quantization discussed here, vector quantization is applied to compress the weights for feedforward neural networks (Gong et al., 2014; Han et al., 2016). Different from ours where all weights are directly constraint to $\{ - 1 , + 1 \}$ , vector quantization learns a small codebook by applying k-means clustering to the weights or conducting product quantization. The weights are then reconstructed by indexing the codebook. It has been shown that by such a technique, the number of parameters can be reduced by an order of magnitude with limited accuracy loss (Gong et al., 2014). It is possible that the multi-bit quantized binary weight can be further compressed by using the product quantization.
|
| 85 |
+
|
| 86 |
+
# 3 OUR ALTERNATING MULTI-BIT QUANTIZATION
|
| 87 |
+
|
| 88 |
+
Now we introduce our quantization method. We tackle the same minimization problem as (2). For simplicity, we firstly consider the problem with $k = 2$ . Suppose that $\alpha _ { 1 }$ and $\alpha _ { 2 }$ are known in advance with $\alpha _ { 1 } \geq \alpha _ { 2 } \geq 0$ , then the quantization codes are restricted to $\mathbf { v } = \{ - \alpha _ { 1 } - \alpha _ { 2 } , - \alpha _ { 1 } + \alpha _ { 2 } , \alpha _ { 1 } -$ $\alpha _ { 2 } , \alpha _ { 1 } + \alpha _ { 2 } \}$ . For any entry $w$ of w in problem (2), its quantization code is determined by the least distance to all codes. Consequently, we can partition the number axis into 4 intervals. And each interval corresponds to one particular quantization code. The common point of two adjacent intervals then becomes the middle point of the two quantization codes, i.e., $- \alpha _ { 1 } , 0$ , and $\alpha _ { 1 }$ . Fig. 1 gives an illustration.
|
| 89 |
+
|
| 90 |
+
For the general $k$ -bit quantization, suppose that $\{ \alpha _ { i } \} _ { i = 1 } ^ { k }$ are known and we have all possible codes in ascending order, i.e., $\begin{array} { r } { \mathbf { v } = \{ - \sum _ { i = 1 } ^ { k } \alpha _ { i } } \end{array}$ , . $\textstyle \ldots , \sum _ { i = 1 } ^ { k } \alpha _ { i } \}$ . Similarly, we can partition the number axis into $2 ^ { k }$ intervals, in which the boundaries are determined by the centers of two adjacent codes in $\mathbf { v }$ , i.e., $\{ ( v _ { i } + v _ { i + 1 } ) / 2 \} _ { i = 1 } ^ { 2 ^ { k } - 1 }$ . However, directly comparing per entry with all the boundaries needs $2 ^ { k }$ comparisons, which is very inefficient. Instead, we can make use of the ascending property in $\mathbf { v }$ . Hierarchically, we partition the codes of $\mathbf { v }$ evenly into two ordered sub-sets, i.e., $\mathbf { v } _ { 1 : m / 2 }$ and $\mathbf { v } _ { m / 2 + 1 : m }$ with $m$ defined as the length of $\mathbf { v }$ . If $w < ( v _ { m / 2 } + v _ { m / 2 + 1 } ) / 2$ , its feasible codes are then optimally restricted to $\mathbf { v } _ { 1 : m / 2 }$ . And if $w \ge ( v _ { m / 2 } + v _ { m / 2 + 1 } ) / 2$ , its feasible codes become $\mathbf { v } _ { m / 2 + 1 : m }$ By recursively evenly partition the ordered feasible codes, we can then efficiently determine the
|
| 91 |
+
|
| 92 |
+
# Algorithm 2: Alternating Multi-bit Quantization
|
| 93 |
+
|
| 94 |
+
Require :Ensure : on weight $\mathbf { w } \in \mathbb { R } ^ { n }$ , number of bits $k$ , total iterations $T$ $\{ \alpha _ { i } , \mathbf { \bar { b } } _ { i } \} _ { i = 1 } ^ { k }$
|
| 95 |
+
1 Greedy Initialize $\{ \alpha _ { i } , \mathbf { b } _ { i } \} _ { i = 1 } ^ { k }$ as (4)
|
| 96 |
+
2 for iter $ 1$ to $T$ do
|
| 97 |
+
3 Update $\{ \alpha _ { i } \} _ { i = 1 } ^ { k }$ as (5)
|
| 98 |
+
4 Construct $\mathbf { v }$ of all feasible codes in accending order
|
| 99 |
+
5 Update $\{ { \bf b } _ { i } \} _ { i = 1 } ^ { k }$ as Algorithm 1.
|
| 100 |
+
6 end
|
| 101 |
+
|
| 102 |
+
optimal code for per entry by only $k$ comparisons. The whole procedure is in fact a binary search tree. We summarize it in Algorithm 1. Note that once getting the quantization code, it is straightforward to map to the binary code b. Also, by maintaining a mask vector with the same size as w to indicate the partitions, we could operate BST for all entries simultaneously. To give a better illustration, we give a binary tree example for $k = 2$ in Fig. 2. Note that for $k = 2$ , we can even derive the optimal codes by a closed form solution, i.e., $\mathbf { b } _ { 1 } = \mathrm { s i g n } ( \mathbf { w } )$ and $\mathbf { b } _ { 2 } = \mathrm { s i g n } ( \mathbf { w } - \alpha _ { 1 } \mathbf { b } _ { 1 } )$ with $\alpha _ { 1 } \geq \alpha _ { 2 } \geq 0$ .
|
| 103 |
+
|
| 104 |
+
Under the above observation, let us reconsider the refined greedy approximation (Guo et al., 2017) introduced in Section 2. After modification on the computed $\{ \alpha _ { i } \} _ { i = 1 } ^ { j }$ as (5), $\{ { \bf b } _ { i } \} _ { i = 2 } ^ { j }$ are no longer optimal while the method keeps all of them fixed. To improve the refined greedy approximation, alternating minimizing $\{ \alpha _ { i } \} _ { i = 1 } ^ { k }$ and $\{ { \bf b } _ { i } \} _ { i = 1 } ^ { k }$ becomes a natural choice. Once getting $\{ { \bf b } _ { i } \} _ { i = 1 } ^ { k }$ as described above, we can optimize $\{ \alpha _ { i } \} _ { i = 1 } ^ { k }$ as (5). In real experiments, we find that by greedy initialization as (4), only two alternating cycles is good enough to find high precision quantization. For better illustration, we summarize our alternating minimization in Algorithm 2. For updating $\{ \alpha _ { i } \} _ { i = 1 } ^ { k }$ , we need $2 k ^ { 2 } n$ binary operations and $k n$ non-binary operations. Combining kn non-binary operations to determine the binary code, for total $T$ alternating cycles, we thus need $2 T k ^ { 2 } n$ binary operations and $2 ( T + 1 ) k n$ non-binary operations to quantize $\mathbf { w } \in \mathbb { R } ^ { n }$ into $k$ -bit, with the extra $2 k n$ corresponding to greedy initialization.
|
| 105 |
+
|
| 106 |
+
# 4 APPLY ALTERNATING MULTI-BIT QUANTIZATION TO RNNS
|
| 107 |
+
|
| 108 |
+
Implementation. We firstly introduce the implementation details for quantizing RNN. For simplicity, we consider the one layer LSTM for language model. The goal is to predict the next word indexed by $t$ in a sequence of one-hot word tokens $( y _ { 1 } ^ { * } , \dots , y _ { N } ^ { * } )$ as follows:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r l } & { \mathbf { x } _ { t } = \mathbf { W } _ { e } ^ { T } \mathbf { y } _ { t - 1 } ^ { * } , } \\ & { \mathbf { i } _ { t } , \mathbf { f } _ { t } , \mathbf { 0 } _ { t } , \mathbf { g } _ { t } = \sigma ( \mathbf { W } _ { i } \mathbf { x } _ { t } + \mathbf { b } _ { i } + \mathbf { W } _ { h } \mathbf { h } _ { t - 1 } + \mathbf { b } _ { h } ) , } \\ & { \mathbf { c } _ { t } = \mathbf { f } _ { t } \odot \mathbf { c } _ { t - 1 } + \mathbf { i } _ { t } \odot \mathbf { g } _ { t } , \quad \mathbf { h } _ { t } = \mathbf { o } _ { t } \odot \operatorname { t a n h } ( \mathbf { c } _ { t } ) , } \\ & { \mathbf { y } _ { t } = \operatorname { s o f t m a x } ( \mathbf { W } _ { s } \mathbf { h } _ { t } + \mathbf { b } _ { s } ) . } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $\sigma$ represents the activation function. In the above formulation, the multiplication between the weight matrices and the vectors $\mathbf { x } _ { t }$ and $\mathbf { h } _ { t }$ occupy most of the computation. This is also where we apply quantization to. For the weight matrices, We do not apply quantization on the full but rather row by row. During the matrix vector product, we can firstly execute the binary multiplication. Then element-wisely multiply the obtained binary vector with the high precision scaling coefficients. Thus little extra computation results while much more freedom is brought to better approximate the weights. We give an illustration on the left part of Fig. 3. Due to one-hot word tokens, $\mathbf { x } _ { t }$ corresponds to one specific row in the quantized ${ \mathbf W } _ { e }$ . It needs no more quantization. Different from the weight matrices, $\mathbf { h } _ { t }$ depends on the input, which needs to be quantized on-line during inference. For consistent notation with existing work, e.g., (Hubara et al., 2016b; Zhou et al., 2017), we also call quantizing on $\mathbf { h } _ { t }$ as quantizing on activation.
|
| 115 |
+
|
| 116 |
+
For $\mathbf { W } \in \mathbb { R } ^ { m \times n }$ and $\mathbf { h } _ { t } \in \mathbb { R } ^ { n }$ , the standard matrix-vector product needs $2 m n$ operations. For the quantized product between $k _ { w }$ -bit $\mathbf { W }$ and $k _ { h }$ -bit $\mathbf { h _ { t } }$ , we have $2 k _ { w } k _ { h } m n + 4 k _ { h } ^ { 2 } n$ binary operations and $6 k _ { h } n + 2 k _ { w } k _ { h } m$ non-binary operations, where $6 k _ { h } n$ corresponds to the cost of alternating approximation $T = 2$ ) and $2 k _ { w } k _ { h } m$ corresponds to the final product with coefficients. As the binary multiplication operates in 1 bit, whereas the full precision multiplication operates in 32 bits, despite the feasible implementations, the acceleration can be $3 2 \times$ in theory. For alternating quantization here, the overall theoretical acceleration is thus computed as γ = 2mn132 (2kwkhmn+4k2nn)+6khn+2kwkhm . Suppose that LSTM has hidden states $n = 1 0 2 4$ , then we have $\mathbf { W } _ { h } \in \mathbb { R } ^ { 4 0 9 6 \times 1 0 2 4 }$ . The acceleration ratio becomes roughly $7 . 5 \times$ for $( k _ { h } , k _ { w } ) = ( 2 , 2 )$ and $3 . 5 \times$ for $( k _ { h } , k _ { w } ) = ( 3 , 3 )$ . In addition to binary operations, the acceleration in real implementations can be largely affected by the size of the matrix, where much memory reduce can result in better utilizing in the limited faster cache. We implement the binary multiplication kernel in CPUs. Compared with the much optimized Intel Math Kernel Library (MKL) on full precision matrix vector multiplication, we can roughly achieve $6 \times$ for $( k _ { h } , k _ { w } ) = ( \bar { 2 } , 2 )$ and $3 \times$ for $( \bar { k } _ { h } , k _ { w } ) = ( 3 , 3 )$ . For more details, please refer to Appendix A.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 3: Illustration of quantized matrix vector multiplication (left part). The matrix is quantized row by row, which provides more freedom to approximate while adds little extra computation. By reformulating as the right part, we can make full use of the intrinsic parallel binary matrix vector multiplication for further acceleration.
|
| 120 |
+
|
| 121 |
+
As indicated in the left part of Fig. 3, the binary multiplication can be conducted sequentially by associativity. Although the operation is suitable for parallel computing by synchronously conducting the multiplication, this needs extra effort for parallelization. We instead concatenate the binary codes as shown in the right part of Fig. 3. Under such modification, we are able to make full use of the much optimized inner parallel matrix multiplication, which gives the possibility for further acceleration. The final result is then obtained by adding all partitioned vectors together, which has little extra computation.
|
| 122 |
+
|
| 123 |
+
Training. As firstly proposed by Courbariaux et al. (2015), during the training of quantized neural network, directly adding the moderately small gradients to quantized weights will result in no change on it. So they maintain a full precision weight to accumulate the gradients then apply quantization in every mini-batch. In fact, the whole procedure can be mathematically formulated as a bi-level optimization (Colson et al., 2007) problem:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { r l } { \displaystyle \operatorname* { m i n } _ { \mathbf { w } , \{ \alpha _ { i } , \mathbf { b } _ { i } \} _ { i = 1 } ^ { k } } f ( \sum _ { i = 1 } ^ { k } \alpha _ { i } \mathbf { b } _ { i } ) } & { } \\ { s . t . } & { \{ \alpha _ { i } , \mathbf { b } _ { i } \} _ { i = 1 } ^ { k } = \arg \operatorname* { m i n } _ { \{ \alpha _ { i } ^ { \prime } , \mathbf { b } _ { i } ^ { \prime } \} _ { i = 1 } ^ { k } } \| \mathbf { w } - \displaystyle \sum _ { i = 1 } ^ { k } \alpha _ { i } ^ { \prime } \mathbf { b } _ { i } ^ { \prime } \| ^ { 2 } . } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
Denote the quantized weight as $\begin{array} { r } { \hat { \mathbf { w } } = \sum _ { i = 1 } ^ { k } \alpha _ { i } \mathbf { b } _ { i } } \end{array}$ . In the forward propagation, we derive wˆ from the full precision w in the lower-level problem and apply it to the upper-level function $f ( \cdot )$ , i.e., RNN in this paper. During the backward propagation, the derivative $\frac { \partial f } { \partial \hat { \bf w } }$ is propagated back to w through the lower-level function. Due to the discreteness of $\mathbf { b } _ { i }$ , it is very hard to model the implicit dependence2015), i.e., $\hat { \mathbf { w } }$ w. So we also adopt the “straight-through estimate” as (. To compute the derivative on the quantized hidden state urbariaux et al.,, the same trick $\begin{array} { r } { \frac { \partial f } { \partial \mathbf { w } } = \frac { \partial f } { \partial \hat { \mathbf { w } } } } \end{array}$ $\mathbf { h } _ { t }$ is applied. During the training, we find the same phenomenon as Hubara et al. (2016b) that some entries of w can grow very large, which become outliers and harm the quantization. Here we simply clip w in the range of $[ - 1 , 1 ]$ .
|
| 130 |
+
|
| 131 |
+
Table 1: Measurement on the approximation of different quantization methods, e.g., Uniform (Hubara et al., 2016b), Balanced (Zhou et al., 2017), Greedy (Guo et al., 2017), Refined (Guo et al., 2017), and our Alternating method, see Section 2. We apply these methods to quantize the full precision pre-trained weight of LSTM on the PTB dataset. The best values are in bold. W-bits represents the number of weight bits and FP denotes full precision.
|
| 132 |
+
|
| 133 |
+
<table><tr><td rowspan=1 colspan=4>Relative MSE</td><td rowspan=1 colspan=4>Testing PPW</td></tr><tr><td rowspan=1 colspan=1>W-Bits</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>FP</td></tr><tr><td rowspan=1 colspan=1>Uniform</td><td rowspan=1 colspan=1>1.070</td><td rowspan=1 colspan=1>0.404</td><td rowspan=1 colspan=1>0.302</td><td rowspan=1 colspan=1>283.2</td><td rowspan=1 colspan=1>227.3</td><td rowspan=1 colspan=1>216.3</td><td rowspan=5 colspan=1>89.8</td></tr><tr><td rowspan=1 colspan=1>Balanced</td><td rowspan=1 colspan=1>0.891</td><td rowspan=1 colspan=1>0.745</td><td rowspan=1 colspan=1>0.702</td><td rowspan=1 colspan=1>10287.6</td><td rowspan=1 colspan=1>9106.4</td><td rowspan=1 colspan=1>8539.8</td></tr><tr><td rowspan=1 colspan=1>Greedy</td><td rowspan=1 colspan=1>0.146</td><td rowspan=1 colspan=1>0.071</td><td rowspan=1 colspan=1>0.042</td><td rowspan=1 colspan=1>118.9</td><td rowspan=1 colspan=1>99.4</td><td rowspan=1 colspan=1>95.0</td></tr><tr><td rowspan=1 colspan=1>Refined</td><td rowspan=1 colspan=1>0.137</td><td rowspan=1 colspan=1>0.060</td><td rowspan=1 colspan=1>0.030</td><td rowspan=1 colspan=1>105.3</td><td rowspan=1 colspan=1>95.4</td><td rowspan=1 colspan=1>93.1</td></tr><tr><td rowspan=1 colspan=1>Alternating (ours)</td><td rowspan=1 colspan=1>0.125</td><td rowspan=1 colspan=1>0.043</td><td rowspan=1 colspan=1>0.019</td><td rowspan=1 colspan=1>103.1</td><td rowspan=1 colspan=1>93.8</td><td rowspan=1 colspan=1>91.4</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 2: Quantization on the full precision pre-trained weight of GRU on the PTB dataset.
|
| 136 |
+
|
| 137 |
+
<table><tr><td rowspan=1 colspan=4>Relative MSE</td><td rowspan=1 colspan=4>Testing PPW</td></tr><tr><td rowspan=1 colspan=1>W-Bits</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>FP</td></tr><tr><td rowspan=1 colspan=1>Uniform</td><td rowspan=1 colspan=1>6.138</td><td rowspan=1 colspan=1>3.920</td><td rowspan=1 colspan=1>3.553</td><td rowspan=1 colspan=1>3161906.6</td><td rowspan=1 colspan=1>771259.6</td><td rowspan=1 colspan=1>715781.9</td><td rowspan=5 colspan=1>92.5</td></tr><tr><td rowspan=1 colspan=1>Balanced</td><td rowspan=1 colspan=1>1.206</td><td rowspan=1 colspan=1>1.054</td><td rowspan=1 colspan=1>1.006</td><td rowspan=1 colspan=1>2980.4</td><td rowspan=1 colspan=1>3396.3</td><td rowspan=1 colspan=1>3434.1</td></tr><tr><td rowspan=1 colspan=1>Greedy</td><td rowspan=1 colspan=1>0.377</td><td rowspan=1 colspan=1>0.325</td><td rowspan=1 colspan=1>0.304</td><td rowspan=1 colspan=1>135.7</td><td rowspan=1 colspan=1>105.5</td><td rowspan=1 colspan=1>99.2</td></tr><tr><td rowspan=1 colspan=1>Refined</td><td rowspan=1 colspan=1>0.128</td><td rowspan=1 colspan=1>0.055</td><td rowspan=1 colspan=1>0.030</td><td rowspan=1 colspan=1>111.6</td><td rowspan=1 colspan=1>99.1</td><td rowspan=1 colspan=1>97.0</td></tr><tr><td rowspan=1 colspan=1>Alternating (ours)</td><td rowspan=1 colspan=1>0.120</td><td rowspan=1 colspan=1>0.044</td><td rowspan=1 colspan=1>0.021</td><td rowspan=1 colspan=1>110.3</td><td rowspan=1 colspan=1>97.3</td><td rowspan=1 colspan=1>95.2</td></tr></table>
|
| 138 |
+
|
| 139 |
+
# 5 EXPERIMENTS ON THE LANGUAGE MODELS
|
| 140 |
+
|
| 141 |
+
In this section, we conduct quantization experiments on language models. The two most well-known recurrent neural networks, i.e., LSTM (Hochreiter & Schmidhuber, 1997) and GRU (Cho et al., 2014), are evaluated. As they are to predict the next word, the performance is measured by perplexity per word (PPW) metric. For all experiments, we initialize with the pre-trained model and using vanilla SGD. The initial learning rate is set to 20. Every epoch we evaluate on the validation dataset and record the best value. When the validation error exceeds the best record, we decrease learning rate by a factor of 1.2. Training is terminated once the learning rate less than 0.001 or reaching the maximum epochs, i.e., 80. The gradient norm is clipped in the range $[ - 0 . 2 5 , 0 . 2 5 ]$ . We unroll the network for 30 time steps and regularize it with the standard dropout (probability of dropping out units equals to 0.5) (Zaremba et al., 2014). For simplicity of notation, we denote the methods using uniform, balanced, greedy, refined greedy, and our alternating quantization as Uniform, Balanced, Greedy, Refined, and Alternating, respectively.
|
| 142 |
+
|
| 143 |
+
Peen Tree Bank. We first conduct experiments on the Peen Tree Bank (PTB) corpus (Marcus et al., 1993), using the standard preprocessed splits with a 10K size vocabulary (Mikolov, 2012). The PTB dataset contains 929K training tokens, 73K validation tokens, and 82K test tokens. For fair comparison with existing works, we also use LSTM and GRU with 1 hidden layer of size 300. To have a glance at the approximation ability of different quantization methods as detailed in Section 2, we firstly conduct experiments by directly quantizing the trained full precision weight (neither quantization on activation nor retraining). Results on LSTM and GRU are shown in Table 1 and Table 2, respectively. The left parts record the relative mean squared error of quantized weight matrices with full precision one. We can see that our proposed Alternating can get much lower error across all varying bit. We also measure the testing PPW for the quantized weight as shown in the right parts of Table 1 and 2. The results are in consistent with the left part, where less errors result in lower testing PPW. Note that Uniform and Balanced quantization are rule-based and not aim at minimizing the error. Thus they can have much worse result by direct approximation. We also repeat the experiment on other datasets. For both LSTM and GRU, the results are very similar to here.
|
| 144 |
+
|
| 145 |
+
Table 3: Testing PPW of multi-bit quantized LSTM and GRU on the PTB dataset. W-Bits and A-Bits represent the number of weight and activation bits, respectively.
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan=1 colspan=6>LSTM</td><td rowspan=1 colspan=5>GRU</td></tr><tr><td rowspan=1 colspan=1>W-Bits /A-Bits</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>2/3</td><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>4/4</td><td rowspan=1 colspan=1>FP/FP</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>2/3</td><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>4/4</td><td rowspan=1 colspan=1>FP/FP</td></tr><tr><td rowspan=1 colspan=1>Uniform</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>220</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>97</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>Balanced</td><td rowspan=1 colspan=1>126</td><td rowspan=1 colspan=1>123</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>114</td><td rowspan=1 colspan=1>107</td><td rowspan=1 colspan=1>142</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>116</td><td rowspan=1 colspan=1>100</td></tr><tr><td rowspan=1 colspan=1>Refined</td><td rowspan=1 colspan=1>100.3</td><td rowspan=1 colspan=1>95.6</td><td rowspan=1 colspan=1>91.3</td><td rowspan=1 colspan=1>二</td><td rowspan=2 colspan=1>89.8</td><td rowspan=1 colspan=1>105.1</td><td rowspan=1 colspan=1>100.3</td><td rowspan=1 colspan=1>95.9</td><td rowspan=1 colspan=1>二</td><td rowspan=2 colspan=1>92.5</td></tr><tr><td rowspan=1 colspan=1>Alternating (ours)</td><td rowspan=1 colspan=1>95.8</td><td rowspan=1 colspan=1>91.9</td><td rowspan=1 colspan=1>87.9</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>101.2</td><td rowspan=1 colspan=1>97.0</td><td rowspan=1 colspan=1>92.9</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Table 4: Testing PPW of multi-bit quantized LSTM and GRU on the WikiText-2 dataset.
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan=1 colspan=5>LSTM</td><td rowspan=1 colspan=4>GRU</td></tr><tr><td rowspan=1 colspan=1>W-Bits / A-Bits</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>2/3</td><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>FP/FP</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>2/3</td><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>FP/FP</td></tr><tr><td rowspan=1 colspan=1>Refined</td><td rowspan=1 colspan=1>108.7</td><td rowspan=1 colspan=1>105.8</td><td rowspan=1 colspan=1>102.2</td><td rowspan=2 colspan=1>100.1</td><td rowspan=1 colspan=1>117.2</td><td rowspan=1 colspan=1>114.1</td><td rowspan=1 colspan=1>111.8</td><td rowspan=2 colspan=1>106.7</td></tr><tr><td rowspan=1 colspan=1>Alternating (ours)</td><td rowspan=1 colspan=1>106.1</td><td rowspan=1 colspan=1>102.7</td><td rowspan=1 colspan=1>98.7</td><td rowspan=1 colspan=1>113.7</td><td rowspan=1 colspan=1>110.2</td><td rowspan=1 colspan=1>106.4</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 5: Testing PPW of multi-bit quantized LSTM and GRU on the Text8 dataset.
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan=1 colspan=5>LSTM</td><td rowspan=1 colspan=4>GRU</td></tr><tr><td rowspan=1 colspan=1>W-Bits / A-Bits</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>2/3</td><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>FP/FP</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>2/3</td><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>FP/FP</td></tr><tr><td rowspan=1 colspan=1>Refined</td><td rowspan=1 colspan=1>135.6</td><td rowspan=1 colspan=1>122.3</td><td rowspan=1 colspan=1>110.2</td><td rowspan=2 colspan=1>101.1</td><td rowspan=1 colspan=1>135.8</td><td rowspan=1 colspan=1>126.9</td><td rowspan=1 colspan=1>118.3</td><td rowspan=2 colspan=1>111.6</td></tr><tr><td rowspan=1 colspan=1>Alternating (ours)</td><td rowspan=1 colspan=1>108.8</td><td rowspan=1 colspan=1>105.1</td><td rowspan=1 colspan=1>98.8</td><td rowspan=1 colspan=1>124.5</td><td rowspan=1 colspan=1>118.7</td><td rowspan=1 colspan=1>114.0</td></tr></table>
|
| 156 |
+
|
| 157 |
+
We then conduct experiments by quantizing both weights and activations. We train with the batch size 20. The final result is shown in Table 3. Besides comparing with the existing works, we also conduct experiment for Refined as a competitive baseline. We do not include Greedy as it is already shown to be much inferior to the refined one, see, e.g., Table 1 and 2. As Table 3 shows, our full precision model can attain lower PPW than the existing works. However, when considering the gap between quantized model with the full precision one, our alternating quantized neural network is still far better than existing works, i.e., Uniform (Hubara et al., 2016b) and Balanced (Zhou et al., 2017). Compared with Refined, our Alternating quantization can achieve compatible performance using 1-bit less quantization on weights or activations. In other words, under the same tolerance of accuracy drop, Alternating executes faster and uses less memory than Refined. We can see that our $3 / 3$ weights/activations quantized LSTM can achieve even better performance than full precision one. A possible explanation is due to the regularization introduced by quantization (Hubara et al., 2016b).
|
| 158 |
+
|
| 159 |
+
WikiText-2 (Merity et al., 2017) is a dataset released recently as an alternative to PTB. It contains 2088K training, 217K validation, and 245K test tokens, and has a vocabulary of 33K words, which is roughly 2 times larger in dataset size, and 3 times larger in vocabulary than PTB. We train with one layer’s hidden state of size 512 and set the batch size to 100. The result is shown in Table 4. Similar to PTB, our Alternating can use 1-bit less quantization to attain compatible or even lower PPW than Refined.
|
| 160 |
+
|
| 161 |
+
Text8. In order to determine whether Alternating remains effective with a larger dataset, we perform experiments on the Text8 corpus (Mikolov et al., 2014). Here we follow the same setting as (Xie et al., 2017). The first 90M characters are used for training, the next 5M for validation, and the final 5M for testing, resulting in 15.3M training tokens, 848K validation tokens, and 855K test tokens. We also preprocess the data by mapping all words which appear 10 or fewer times to the unknown token, resulting in a 42K size vocabulary. We train LSTM and GRU with one hidden layer of size 1024 and set the batch size to 100. The result is shown in Table 5. For LSTM on the left part, Alternating achieves excellent performance. By only 2-bit quantization on weights and activations, it exceeds Refined with 3-bit. The 2-bit result is even better than that reported in (Xie et al., 2017), where LSTM adding noising schemes for regularization can only attain 110.6 testing PPW. For GRU on the right part, although Alternating is much better than Refined, the 3-bit quantization still has gap with full precision one. We attribute that to the unified setting of hyper-parameters across all experiments. With specifically tuned hyper-parameters on this dataset, one may make up for that gap.
|
| 162 |
+
|
| 163 |
+
Note that our alternating quantization is a general technique. It is not only suitable for language models here. For a comprehensive verification, we apply it to image classification tasks. In both RNNs and feedforward neural networks, our alternating quantization also achieves the lowest testing error among all compared methods. Due to space limitation, we deter the results to Appendix B.
|
| 164 |
+
|
| 165 |
+
# 6 CONCLUSIONS
|
| 166 |
+
|
| 167 |
+
In this work, we address the limitations of RNNs, i.e., large memory and high latency, by quantization. We formulate the quantization by minimizing the approximation error. Under the key observation that some parameters can be singled out when others fixed, a simple yet effective alternating method is proposed. We apply it to quantize LSTM and GRU on language models. By 2-bit weights and activations, we achieve only a reasonably accuracy loss compared with full precision one, with ${ \sim } 1 6 \times$ reduction in memory and ${ \sim } 6 \times$ real acceleration on CPUs. By 3-bit quantization, we can attain compatible or even better result than the full precision one, with ${ \sim } 1 0 . 5 \times$ reduction in memory and ${ \sim } 3 \times$ real acceleration. Both beat existing works with a large margin. We also apply our alternating quantization to image classification tasks. In both RNNs and feedforward neural networks, the method can still achieve very plausible performance.
|
| 168 |
+
|
| 169 |
+
# 7 ACKNOWLEDGEMENTS
|
| 170 |
+
|
| 171 |
+
We would like to thank the reviewers for their suggestions on the manuscript. Zhouchen Lin is supported by National Basic Research Program of China (973 Program) (grant no. 2015CB352502), National Natural Science Foundation (NSF) of China (grant nos. 61625301 and 61731018), Qualcomm, and Microsoft Research Asia. Hongbin Zha is supported by Natural Science Foundation (NSF) of China (No. 61632003).
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv:1406.1078, 2014.
|
| 176 |
+
|
| 177 |
+
Benoît Colson, Patrice Marcotte, and Gilles Savard. An overview of bilevel optimization. Annals of Operations Research, 153(1):235–256, 2007.
|
| 178 |
+
|
| 179 |
+
Tim Cooijmans, Nicolas Ballas, César Laurent, Çaglar Gülçehre, and Aaron Courville. Recurrent ˘ batch normalization. In ICLR, 2017.
|
| 180 |
+
|
| 181 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In NIPS, pp. 3123–3131, 2015.
|
| 182 |
+
|
| 183 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv:1412.6115, 2014.
|
| 184 |
+
|
| 185 |
+
Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In ICASSP, pp. 6645–6649. IEEE, 2013.
|
| 186 |
+
|
| 187 |
+
Yiwen Guo, Anbang Yao, Hao Zhao, and Yurong Chen. Network sketching: Exploiting binary structure in deep cnns. In CVPR, 2017.
|
| 188 |
+
|
| 189 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In NIPS, pp. 1135–1143, 2015.
|
| 190 |
+
|
| 191 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In ICLR, 2016.
|
| 192 |
+
|
| 193 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 9(8): 1735–1780, 1997.
|
| 194 |
+
|
| 195 |
+
Lu Hou, Quanming Yao, and James T Kwok. Loss-aware binarization of deep networks. In ICLR, 2017.
|
| 196 |
+
|
| 197 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In NIPS, pp. 4107–4115. 2016a.
|
| 198 |
+
|
| 199 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv:1609.07061, 2016b.
|
| 200 |
+
|
| 201 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pp. 448–456, 2015.
|
| 202 |
+
|
| 203 |
+
Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv:1405.3866, 2014.
|
| 204 |
+
|
| 205 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 206 |
+
|
| 207 |
+
Vadim Lebedev, Yaroslav Ganin, Maksim Rakhuba, Ivan Oseledets, and Victor Lempitsky. Speedingup convolutional neural networks using fine-tuned cp-decomposition. arXiv:1412.6553, 2014.
|
| 208 |
+
|
| 209 |
+
Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv:1605.04711, 2016.
|
| 210 |
+
|
| 211 |
+
Zefan Li, Bingbing Ni, Wenjun Zhang, Xiaokang Yang, and Wen Gao. Performance guaranteed network acceleration via high-order residual quantization. In ICCV, pp. 2584–2592, 2017.
|
| 212 |
+
|
| 213 |
+
Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky. Sparse convolutional neural networks. In CVPR, pp. 806–814, 2015.
|
| 214 |
+
|
| 215 |
+
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.
|
| 216 |
+
|
| 217 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In ICLR, 2017.
|
| 218 |
+
|
| 219 |
+
Tomáš Mikolov. Statistical Language Models Based on Neural Networks. PhD thesis, Brno University of Technology, 2012.
|
| 220 |
+
|
| 221 |
+
Tomáš Mikolov, Martin Karafiát, Lukáš Burget, Jan Cernocký, and Sanjeev Khudanpur. Recurrent ˇ neural network based language model. In INTERSPEECH, pp. 1045–1048, 2010.
|
| 222 |
+
|
| 223 |
+
Tomáš Mikolov, Armand Joulin, Sumit Chopra, Michael Mathieu, and Marc’Aurelio Ranzato. Learning longer memory in recurrent neural networks. arXiv:1412.7753, 2014.
|
| 224 |
+
|
| 225 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: Imagenet classification using binary convolutional neural networks. In ECCV, pp. 525–542. Springer, 2016.
|
| 226 |
+
|
| 227 |
+
Tara N Sainath, Brian Kingsbury, Vikas Sindhwani, Ebru Arisoy, and Bhuvana Ramabhadran. Lowrank matrix factorization for deep neural network training with high-dimensional output targets. In ICASSP, pp. 6655–6659. IEEE, 2013.
|
| 228 |
+
|
| 229 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 230 |
+
|
| 231 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, pp. 3104–3112, 2014.
|
| 232 |
+
|
| 233 |
+
Cheng Tai, Tong Xiao, Yi Zhang, Xiaogang Wang, and Weinan E. Convolutional neural networks with low-rank regularization. In ICLR, 2016.
|
| 234 |
+
|
| 235 |
+
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In CVPR, pp. 3156–3164, 2015.
|
| 236 |
+
|
| 237 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In NIPS, pp. 2074–2082, 2016.
|
| 238 |
+
|
| 239 |
+
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:1609.08144, 2016.
|
| 240 |
+
|
| 241 |
+
Ziang Xie, Sida I Wang, Jiwei Li, Daniel Lévy, Aiming Nie, Dan Jurafsky, and Andrew Y Ng. Data noising as smoothing in neural network language models. In ICLR, 2017.
|
| 242 |
+
|
| 243 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv:1409.2329, 2014.
|
| 244 |
+
|
| 245 |
+
Shu-Chang Zhou, Yu-Zhi Wang, He Wen, Qin-Yao He, and Yu-Heng Zou. Balanced quantization: An effective and efficient approach to quantized neural networks. Journal of Computer Science and Technology, 32(4):667–682, 2017.
|
| 246 |
+
|
| 247 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv:1606.06160, 2016.
|
| 248 |
+
|
| 249 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. In ICLR, 2017.
|
| 250 |
+
|
| 251 |
+
# APPENDIX
|
| 252 |
+
|
| 253 |
+
# A BINARY MATRIX VECTOR MULTIPLICATION IN CPUS
|
| 254 |
+
|
| 255 |
+
Table 6: Computing time of the binary matrix vector multiplication in CPUs, where Quant represents the cost to execute our alternating quantization on-line.
|
| 256 |
+
|
| 257 |
+
<table><tr><td rowspan=1 colspan=1>Weight Size</td><td rowspan=1 colspan=1>W-Bits / A-Bits</td><td rowspan=1 colspan=1>Total (ms)</td><td rowspan=1 colspan=1>Quant (ms)</td><td rowspan=1 colspan=1>Quant / Total</td><td rowspan=1 colspan=1>Acceleration</td></tr><tr><td rowspan=3 colspan=1>4096 × 1024</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>0.07</td><td rowspan=1 colspan=1>20%</td><td rowspan=1 colspan=1>5.6x</td></tr><tr><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>0.72</td><td rowspan=1 colspan=1>0.11</td><td rowspan=1 colspan=1>15%</td><td rowspan=1 colspan=1>2.7x</td></tr><tr><td rowspan=1 colspan=1>FP/FP</td><td rowspan=1 colspan=1>1.95</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>1.0×</td></tr><tr><td rowspan=3 colspan=1>42000 × 1024</td><td rowspan=1 colspan=1>2/2</td><td rowspan=1 colspan=1>3.17</td><td rowspan=1 colspan=1>0.07</td><td rowspan=1 colspan=1>2.2%</td><td rowspan=1 colspan=1>6.0×</td></tr><tr><td rowspan=1 colspan=1>3/3</td><td rowspan=1 colspan=1>6.46</td><td rowspan=1 colspan=1>0.11</td><td rowspan=1 colspan=1>1.7%</td><td rowspan=1 colspan=1>3.0x</td></tr><tr><td rowspan=1 colspan=1>FP/FP</td><td rowspan=1 colspan=1>19.10</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1.0x</td></tr></table>
|
| 258 |
+
|
| 259 |
+
In this section, we discuss the implementation of the binary multiplication kernel in CPUs. The binary multiplication is divided into two steps: Entry-wise XNOR operation (corresponding to entry-wise product in the full precision multiplication) and bit count operation for accumulation (corresponding to compute the sum of all multiplied entries in the full precision multiplication). We test it on Intel Xeon E5-2682 v4 $@$ 2.50 GHz CPU. For the XNOR operation, we use the Single instruction, multiple data (SIMD) _mm256 _xor_ps, which can execute 256 bit simultaneously. For the bit count operation, we use the function _popcnt64 (Note that this step can further be accelerated by the up-coming instruction _mm512 _popcnt_epi64 , which can execute 512 bits simultaneously. Similarly, the XNOR operation can also be further accelerated by the up-coming _mm512 _xor_ps instruction to execute 512 bits simultaneously). We compare with the much optimized Intel Math Kernel Library (MKL) on full precision matrix vector multiplication and execute all codes in the single-thread mode. We conduct two scales of experiments: a matrix of size $4 0 9 6 \times 1 0 2 4$ multiplying a vector of size 1024 and a matrix of size $4 2 0 0 0 \times 1 0 2 4$ multiplying a vector of size 1024, which respectively correspond to the hidden state product ${ \bf W } _ { h } \mathbf h _ { t - 1 }$ and the softmax layer $\mathbf { W } _ { s } \mathbf { h } _ { t }$ for Text8 dataset during inference with batch size of 1 (See Eq. (6)). The results are shown in Table 6. We can see that our alternating quantization step only accounts for a small portion of the total executing time, especially for the larger scale matrix vector multiplication. Compared with the full precision one, the binary multiplication can roughly achieve $6 \times$ acceleration with 2-bit quantization and $3 \times$ acceleration with 3-bit quantization. Note that this is only a simple test on CPU. Our alternating quantization method can also be extended to GPU, ASIC, and FPGA.
|
| 260 |
+
|
| 261 |
+
# B IMAGE CLASSIFICATION
|
| 262 |
+
|
| 263 |
+
Sequential MNIST. As a simple illustration to show that our alternating quantization is not limited for texts, we conduct experiments on the sequential MNIST classification task (Cooijmans et al., 2017). The dataset consists of a training set of 60K and a test set of 10K $2 8 \times 2 8$ gray-scale images. Here we divide the last 5000 training images for validation. In every time, we sequentially use one row of the image as the input $( 2 8 \times 1 )$ , which results in a total of 28 time steps. We use 1 hidden layer’s LSTM of size 128 and the same optimization hyper-parameters as the language models. Besides the weights and activations, the inputs are quantized. The testing error rates for 1-bit input, 2-bit weight, and 2-bit activation are shown in 7, where our alternating quantized method still achieves plausible performance in this task.
|
| 264 |
+
|
| 265 |
+
MLP on MNIST. The alternating quantization proposed in this work is a general technique. It is not only suitable for RNNs, but also for feed-forward neural networks. As an example, we firstly conduct a classification task on MNIST and compare with existing work (Li et al., 2017). The method proposed in (Li et al., 2017) is intrinsically a greedy multi-bit quantization method. For fair comparison, we follow the same setting. We use the MLP consisting of 3 hidden layers of 4096 units and an L2-SVM output layer. No convolution, preprocessing, data augmentation or pre-training is used. We also use ADAM (Kingma & Ba, 2015) with an exponentially decaying learning rate and Batch Normalization (Ioffe & Szegedy, 2015) with a batch size 100. The testing error rates for 2-bit input, 2-bit weight, and 1-bit activation are shown in Table 8. Among all the compared multi-bit quantization methods, our alternating one achieves the lowest testing error.
|
| 266 |
+
|
| 267 |
+
Table 7: Testing error rate of LSTM on MNIST with 1-bit input, 2-bit weight, and 2-bit activation.
|
| 268 |
+
|
| 269 |
+
<table><tr><td>Methods</td><td>Testing Error Rate</td></tr><tr><td>Full Precision</td><td>1.10%</td></tr><tr><td>Refined (Guo et al., 2017)</td><td>1.39 %</td></tr><tr><td>Alternating (ours)</td><td>1.19 %</td></tr></table>
|
| 270 |
+
|
| 271 |
+
Table 8: Testing error rate of MLP on MNIST with 2-bit input, 2-bit weight, and 1-bit activation.
|
| 272 |
+
|
| 273 |
+
<table><tr><td>Methods</td><td>Testing Error Rate</td></tr><tr><td>Full Precision</td><td>0.97%</td></tr><tr><td>Greedy (reported in (Li et al., 2017))</td><td>1.25 %</td></tr><tr><td>Refined (Guo et al., 2017)</td><td>1.22 %</td></tr><tr><td>Alternating (ours)</td><td>1.13 %</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 9: Testing error rate of CNN on CIFAR-10 with 2-bit weight and 1-bit activation.
|
| 276 |
+
|
| 277 |
+
<table><tr><td>Methods</td><td>Testing Error Rate</td></tr><tr><td>Full Precision (reported in (Hou et al., 2017))</td><td>11.90 %</td></tr><tr><td> XNOR-Net (1-bit weight & activation, reported in (Hou et al., 2017))</td><td>12.62 %</td></tr><tr><td>Refined (Guo et al., 2017)</td><td>12.08 %</td></tr><tr><td>Alternating (ours)</td><td>11.70 %</td></tr></table>
|
| 278 |
+
|
| 279 |
+
CNN on CIFAR-10. We then conduct experiments on CIFAR-10 and follow the same setting as (Hou et al., 2017). That is, we use 45000 images for training, another 5000 for validation, and the remaining 10000 for testing. The images are preprocessed with global contrast normalization and ZCA whitening. We also use the VGG-like architecture (Simonyan & Zisserman, 2015):
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
( 2 \times 1 2 8 ~ \mathrm { C 3 } ) - \mathrm { M P 2 - ( 2 \times 2 5 6 ~ \mathrm { C 3 } ) - M P 2 - ( 2 \times 5 1 2 ~ \mathrm { C 3 } ) - M P 2 - ( 2 \times 1 0 2 4 ~ \mathrm { F C } ) - 1 0 ~ \mathrm { S V M } }
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
where C3 is a $3 \times 3$ convolution layer, and MP2 is a $2 \times 2$ max-pooling layer. Batch Normalization, with a mini-batch size of 50, and ADAM are used. The maximum number of epochs is 200. The learning rate starts at 0.02 and decays by a factor of 0.5 after every 30 epochs. The testing error rates for 2-bit weight and 1-bit activation are shown in Table 9, where our alternating method again achieves the lowest test error rate among all compared quantization methods.
|
md/train/S19eAF9ee/S19eAF9ee.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STRUCTURED SEQUENCE MODELING WITH GRAPH CONVOLUTIONAL RECURRENT NETWORKS
|
| 2 |
+
|
| 3 |
+
Youngjoo Seo EPFL, Switzerland youngjoo.seo@epfl.ch
|
| 4 |
+
|
| 5 |
+
Michael Defferrard¨
|
| 6 |
+
EPFL, Switzerland
|
| 7 |
+
michael.defferrard@epfl.ch
|
| 8 |
+
Pierre Vandergheynst
|
| 9 |
+
EPFL, Switzerland
|
| 10 |
+
pierre.vandergheynst@epfl.ch
|
| 11 |
+
Xavier Bresson
|
| 12 |
+
EPFL, Switzerland
|
| 13 |
+
xavier.bresson@epfl.ch
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
This paper introduces Graph Convolutional Recurrent Network (GCRN), a deep learning model able to predict structured sequences of data. Precisely, GCRN is a generalization of classical recurrent neural networks (RNN) to data structured by an arbitrary graph. Such structured sequences can represent series of frames in videos, spatio-temporal measurements on a network of sensors, or random walks on a vocabulary graph for natural language modeling. The proposed model combines convolutional neural networks (CNN) on graphs to identify spatial structures and RNN to find dynamic patterns. We study two possible architectures of GCRN, and apply the models to two practical problems: predicting moving MNIST data, and modeling natural language with the Penn Treebank dataset. Experiments show that exploiting simultaneously graph spatial and dynamic information about data can improve both precision and learning speed.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Many real-world data can be cast as structured sequences, with spatio-temporal sequences being a special case. A well-studied example of spatio-temporal data are videos, where succeeding frames share temporal and spatial structures. Many works, such as Donahue et al. (2015); Karpathy & FeiFei (2015); Vinyals et al. (2015), leveraged a combination of CNN and RNN to exploit such spatial and temporal regularities. Their models are able to process possibly time-varying visual inputs for variable-length prediction. These neural network architectures consist of combining a CNN for visual feature extraction followed by a RNN for sequence learning. Such architectures have been successfully used for video activity recognition, image captioning and video description.
|
| 22 |
+
|
| 23 |
+
More recently, interest has grown in properly fusing the CNN and RNN models for spatio-temporal sequence modeling. Inspired by language modeling, Ranzato et al. (2014) proposed a model to represent complex deformations and motion patterns by discovering both spatial and temporal correlations. They showed that prediction of the next video frame and interpolation of intermediate frames can be achieved by building a RNN-based language model on the visual words obtained by quantizing the image patches. Their highest-performing model, recursive CNN (rCNN), uses convolutions for both inputs and states. Shi et al. (2015) then proposed the convolutional LSTM network (convLSTM), a recurrent model for spatio-temporal sequence modeling which uses 2D-grid convolution to leverage the spatial correlations in input data. They successfully applied their model to the prediction of the evolution of radar echo maps for precipitation nowcasting.
|
| 24 |
+
|
| 25 |
+
The spatial structure of many important problems may however not be as simple as regular grids. For instance, the data measured from meteorological stations lie on a irregular grid, i.e. a network of heterogeneous spatial distribution of stations. More challenging, the spatial structure of data may not even be spatial, as it is the case for social or biological networks. Eventually, the interpretation that sentences can be regarded as random walks on vocabulary graphs, a view popularized by Mikolov et al. (2013), allows us to cast language analysis problems as graph-structured sequence models.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Illustration of the proposed GCRN model for spatio-temporal prediction of graph-structured data. The technique combines at the same time CNN on graphs and RNN. RNN can be easily exchanged with LSTM or GRU networks.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 2: Illustration of the neighborhood on an 8-nearest-neighbor grid graph. Isotropic spectral filters of support $K$ have access to nodes at most at $K - 1$ hops.
|
| 32 |
+
|
| 33 |
+
This work leverages on the recent models of Defferrard et al. (2016); Ranzato et al. (2014); Shi et al. (2015) to design the GCRN model for modeling and predicting time-varying graph-based data. The core idea is to merge CNN for graph-structured data and RNN to identify simultaneously meaningful spatial structures and dynamic patterns. A generic illustration of the proposed GCRN architecture is given by Figure 1.
|
| 34 |
+
|
| 35 |
+
# 2 PRELIMINARIES
|
| 36 |
+
|
| 37 |
+
# 2.1 STRUCTURED SEQUENCE MODELING
|
| 38 |
+
|
| 39 |
+
Sequence modeling is the problem of predicting the most likely future length- $K$ sequence given the previous $J$ observations:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\hat { x } _ { t + 1 } , \ldots , \hat { x } _ { t + K } = \operatorname * { a r g m a x } _ { x _ { t + 1 } , \ldots , x _ { t + K } } P ( x _ { t + 1 } , \ldots , x _ { t + K } | x _ { t - J + 1 } , \ldots , x _ { t } ) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $x _ { t } ~ \in ~ \mathbf { D }$ is an observation at time $t$ and $\mathbf { D }$ denotes the domain of the observed features. The archetypal application being the $n$ -gram language model (with $n = J + 1 ,$ ), where $P ( x _ { t + 1 } | x _ { t - J + 1 } , . . . , x _ { t } )$ models the probability of word $x _ { t + 1 }$ to appear conditioned on the past $J$ words in the sentence (Graves, 2013).
|
| 46 |
+
|
| 47 |
+
In this paper, we are interested in special structured sequences, i.e. sequences where features of the observations $x _ { t }$ are not independent but linked by pairwise relationships. Such relationships are universally modeled by weighted graphs.
|
| 48 |
+
|
| 49 |
+
Data $x _ { t }$ can be viewed as a graph signal, i.e. a signal defined on an undirected and weighted graph $\mathcal { G } = ( \nu , \mathcal { E } , A )$ , where $\nu$ is a finite set of $| \nu | = n$ vertices, $\mathcal { E }$ is a set of edges and $A \in \mathbb { R } ^ { n \times n }$ is a weighted adjacency matrix encoding the connection weight between two vertices. A signal $x _ { t } : \mathcal { V } \overset { \cdot } { } \mathbb { R } ^ { d _ { x } }$ defined on the nodes of the graph may be regarded as a matrix $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { n \times d _ { \boldsymbol { x } } }$ whose column $i$ is the $d _ { x }$ -dimensional value of $x _ { t }$ at the $i ^ { t h }$ node. While the number of free variables in a structured sequence of length $K$ is in principle $\mathcal { O } ( n ^ { K } d _ { x } { } ^ { K } )$ , we seek to exploit the structure of the space of possible predictions to reduce the dimensionality and hence make those problems more tractable.
|
| 50 |
+
|
| 51 |
+
# 2.2 LONG SHORT-TERM MEMORY
|
| 52 |
+
|
| 53 |
+
A special class of recurrent neural networks (RNN) that prevents the gradient from vanishing too quickly is the popular long short-term memory (LSTM) introduced by Hochreiter & Schmidhuber (1997). This architecture has proven stable and powerful for modeling long-range dependencies in various general-purpose sequence modeling tasks (Graves, 2013; Srivastava et al., 2015; Sutskever et al., 2014). A fully-connected LSTM (FC-LSTM) may be seen as a multivariate version of LSTM where the input $x _ { t } \in \mathbb { R } ^ { d _ { x } }$ , cell output $h _ { t } \in [ - 1 , 1 ] ^ { d _ { h } }$ and states $c _ { t } \in \mathbb { R } ^ { d _ { h } }$ are all vectors. In this paper, we follow the FC-LSTM formulation of Graves (2013), that is:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r l } & { i = \sigma ( W _ { x i } x _ { t } + W _ { h i } h _ { t - 1 } + w _ { c i } \odot c _ { t - 1 } + b _ { i } ) , } \\ & { f = \sigma ( W _ { x f } x _ { t } + W _ { h f } h _ { t - 1 } + w _ { c f } \odot c _ { t - 1 } + b _ { f } ) , } \\ & { c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot \operatorname { t a n h } ( W _ { x c } x _ { t } + W _ { h c } h _ { t - 1 } + b _ { c } ) , } \\ & { o = \sigma ( W _ { x o } x _ { t } + W _ { h o } h _ { t - 1 } + w _ { c o } \odot c _ { t } + b _ { o } ) , } \\ & { h _ { t } = o \odot \operatorname { t a n h } ( c _ { t } ) , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\odot$ denotes the Hadamard product, $\sigma ( \cdot )$ the sigmoid function $\sigma ( x ) ~ = ~ 1 / ( 1 + e ^ { - x } )$ and $i , f , o \in [ 0 , 1 ] ^ { d _ { h } }$ are the input, forget and output gates. The weights $W _ { x }$ $\ l _ { \cdot } \in \mathbb { R } ^ { d _ { h } \times d _ { x } }$ , $\dot { W } _ { h \cdot } \in \mathbb { R } ^ { d _ { h } \times d _ { h } }$ , $w _ { c } . \in \mathbb { R } ^ { d _ { h } }$ and biases $b _ { i } , \bar { b } _ { f } , b _ { c } , \bar { b _ { o } } \in \mathbb { R } ^ { d _ { h } }$ are the model parameters.1 Such a model is called fullyconnected because the dense matrices $W _ { x }$ · and $W _ { h }$ · linearly combine all the components of $x$ and $h$ . The optional peephole connections $w _ { c }$ · $\odot c _ { t }$ , introduced by Gers & Schmidhuber (2000), have been found to improve performance on certain tasks.
|
| 60 |
+
|
| 61 |
+
# 2.3 CONVOLUTIONAL NEURAL NETWORKS ON GRAPHS
|
| 62 |
+
|
| 63 |
+
Generalizing convolutional neural networks (CNNs) to arbitrary graphs is a recent area of interest. Two approaches have been explored in the literature: (i) a generalization of the spatial definition of a convolution (Masci et al., 2015; Niepert et al., 2016) and (ii), a multiplication in the graph Fourier domain by the way of the convolution theorem (Bruna et al., 2014; Defferrard et al., 2016). Masci et al. (2015) introduced a spatial generalization of CNNs to 3D meshes. The authors used geodesic polar coordinates to define convolution operations on mesh patches, and formulated a deep learning architecture which allows comparison across different meshes. Hence, this method is tailored to manifolds and is not directly generalizable to arbitrary graphs. Niepert et al. (2016) proposed a spatial approach which may be decomposed in three steps: (i) select a node, (ii) construct its neighborhood and (iii) normalize the selected sub-graph, i.e. order the neighboring nodes. The extracted patches are then fed into a conventional 1D Euclidean CNN. As graphs generally do not possess a natural ordering (temporal, spatial or otherwise), a labeling procedure should be used to impose it. Bruna et al. (2014) were the first to introduce the spectral framework described below in the context of graph CNNs. The major drawback of this method is its $\mathcal { O } ( n ^ { 2 } )$ complexity, which was overcome with the technique of Defferrard et al. (2016), which offers a linear complexity $\mathcal { O } ( | \mathcal { E } | )$ and provides strictly localized filters. Kipf & Welling (2016) took a first-order approximation of the spectral filters proposed by Defferrard et al. (2016) and successfully used it for semi-supervised classification of nodes. While we focus on the framework introduced by Defferrard et al. (2016), the proposed model is agnostic to the choice of the graph convolution operator $^ { \ast _ { \mathcal { G } } }$ .
|
| 64 |
+
|
| 65 |
+
As it is difficult to express a meaningful translation operator in the vertex domain (Bruna et al., 2014; Niepert et al., 2016), Defferrard et al. (2016) chose a spectral formulation for the convolution operator on graph $^ { \ast _ { \mathcal { G } } }$ . By this definition, a graph signal $x \in \overline { { \mathbb { R } ^ { n \times d _ { x } } } }$ is filtered by a non-parametric kernel $g _ { \theta } ( \Lambda ) = \mathrm { d i a g } ( \theta )$ , where $\boldsymbol { \theta } \in \mathbb { R } ^ { n }$ is a vector of Fourier coefficients, as
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
y = g _ { \theta } * _ { \mathcal { G } } x = g _ { \theta } ( L ) x = g _ { \theta } ( U \Lambda U ^ { T } ) x = U g _ { \theta } ( \Lambda ) U ^ { T } x \in \mathbb { R } ^ { n \times d _ { x } } ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $U \in \mathbb { R } ^ { n \times n }$ is the matrix of eigenvectors and $\boldsymbol { \Lambda } \in \mathbb { R } ^ { n \times n }$ the diagonal matrix of eigenvalues of the normalized graph Laplacian $\bar { L } \ = \ I _ { n } - D ^ { - 1 / 2 } A D ^ { - 1 / 2 } \ = U \bar { \Lambda } U ^ { T } \ \in \ \mathbb { R } ^ { n \times n }$ , where $I _ { n }$ is the identity matrix and $D \in \mathbb { R } ^ { n \times n }$ is the diagonal degree matrix with $D _ { i i } = \textstyle \sum _ { j } A _ { i j }$ (Chung, 1997). Note that the signal $x$ is filtered by $g _ { \boldsymbol { \theta } }$ with an element-wise multiplication of its graph Fourier transform $U ^ { T } x$ with $g _ { \theta }$ (Shuman et al., 2013). Evaluating (3) is however expensive, as the multiplication with $U$ is $\mathcal { O } ( n ^ { 2 } )$ . Furthermore, computing the eigendecomposition of $L$ might be prohibitively expensive for large graphs. To circumvent this problem, Defferrard et al. (2016) parametrizes $g _ { \theta }$ as a truncated expansion, up to order $K - 1$ , of Chebyshev polynomials $T _ { k }$ such that
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
g _ { \theta } ( \Lambda ) = \sum _ { k = 0 } ^ { K - 1 } \theta _ { k } T _ { k } ( \tilde { \Lambda } ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where the parameter $\theta \in \mathbb { R } ^ { K }$ is a vector of Chebyshev coefficients and $T _ { k } ( \tilde { \Lambda } ) \ \in \ \mathbb { R } ^ { n \times n }$ is the Chebyshev polynomial of order $k$ evaluated at $\tilde { \Lambda } = 2 \Lambda / \lambda _ { m a x } - I _ { n }$ . The graph filtering operation can then be written as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
y = g _ { \theta } * _ { \mathcal { G } } x = g _ { \theta } ( L ) x = \sum _ { k = 0 } ^ { K - 1 } \theta _ { k } T _ { k } ( \tilde { L } ) x ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $T _ { k } ( \tilde { L } ) \in \mathbb { R } ^ { n \times n }$ is the Chebyshev polynomial of order $k$ evaluated at the scaled Laplacian $\tilde { L } = 2 L / \lambda _ { m a x } - I _ { n }$ . Using the stable recurrence relation $T _ { k } ( x ) = 2 x T _ { k - 1 } ( x ) - T _ { k - 2 } ( x )$ with $T _ { 0 } = 1$ and $T _ { 1 } = x$ , one can evaluate (5) in $\mathcal { O } ( K \vert \mathcal { E } \vert )$ operations, i.e. linearly with the number of edges. Note that as the filtering operation (5) is an order $K$ polynomial of the Laplacian, it is $K$ -localized and depends only on nodes that are at maximum $K$ hops away from the central node, the $K$ -neighborhood. The reader is referred to Defferrard et al. (2016) for details and an in-depth discussion.
|
| 84 |
+
|
| 85 |
+
# 3 RELATED WORKS
|
| 86 |
+
|
| 87 |
+
Shi et al. (2015) introduced a model for regular grid-structured sequences, which can be seen as a special case of the proposed model where the graph is an image grid where the nodes are well ordered. Their model is essentially the classical FC-LSTM (2) where the multiplications by dense matrices $W$ have been replaced by convolutions with kernels $W$ :
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r l } & { i = \sigma ( W _ { x i } * x _ { t } + W _ { h i } * h _ { t - 1 } + w _ { c i } \odot c _ { t - 1 } + b _ { i } ) , } \\ & { f = \sigma ( W _ { x f } * x _ { t } + W _ { h f } * h _ { t - 1 } + w _ { c f } \odot c _ { t - 1 } + b _ { f } ) , } \\ & { c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot \operatorname { t a n h } ( W _ { x c } * x _ { t } + W _ { h c } * h _ { t - 1 } + b _ { c } ) , } \\ & { o = \sigma ( W _ { x o } * x _ { t } + W _ { h o } * h _ { t - 1 } + w _ { c o } \odot c _ { t } + b _ { o } ) , } \\ & { h _ { t } = o \odot \operatorname { t a n h } ( c _ { t } ) , } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $^ *$ denotes the 2D convolution by a set of kernels. In their setting, the input tensor $\boldsymbol { x } _ { t } ~ \in$ $\mathbb { R } ^ { n _ { r } \times n _ { c } \times d _ { x } }$ is the observation of $d _ { x }$ measurements at time $t$ of a dynamical system over a spatial region represented by a grid of $n _ { r }$ rows and $n _ { c }$ columns. The model holds spatially distributed hidden and cell states of size $d _ { h }$ given by the tensors $c _ { t } , h _ { t } \ \in \ \mathbb { R } ^ { n _ { r } \times n _ { c } \times d _ { h } }$ . The size $m$ of the convolutional kernels $W _ { h . \cdot } \in \mathbb { R } ^ { m \times \bar { m } \times d _ { h } \times \bar { d } _ { h } }$ and $W _ { x }$ · $\in \mathbb { R } ^ { m \times m \times d _ { h } \times d _ { x } }$ determines the number of parameters, which is independent of the grid size $n _ { r } \times n _ { c }$ . Earlier, Ranzato et al. (2014) proposed a similar RNN variation which uses convolutional layers instead of fully connected layers. The hidden state at time $t$ is given by
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
h _ { t } = \operatorname { t a n h } ( \sigma ( W _ { x 2 } \ast \sigma ( W _ { x 1 } \ast x _ { t } ) ) + \sigma ( W _ { h } \ast h _ { t - 1 } ) ) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where the convolutional kernels $W _ { h } \in \mathbb { R } ^ { d _ { h } \times d _ { h } }$ are restricted to filters of size 1x1 (effectively a fully connected layer shared across all spatial locations).
|
| 100 |
+
|
| 101 |
+
Observing that natural language exhibits syntactic properties that naturally combine words into phrases, Tai et al. (2015) proposed a model for tree-structured topologies, where each LSTM has access to the states of its children. They obtained state-of-the-art results on semantic relatedness and sentiment classification. Liang et al. (2016) followed up and proposed a variant on graphs. Their sophisticated network architecture obtained state-of-the-art results for semantic object parsing on four datasets. In those models, the states are gathered from the neighborhood by way of a weighted sum with trainable weight matrices. Those weights are however not shared across the graph, which would otherwise have required some ordering of the nodes, alike any other spatial definition of graph convolution. Moreover, their formulations are limited to the one-neighborhood of the current node, with equal weight given to each neighbor.
|
| 102 |
+
|
| 103 |
+
Motivated by spatio-temporal problems like modeling human motion and object interactions, Jain et al. (2016) developed a method to cast a spatio-temporal graph as a rich RNN mixture which essentially associates a RNN to each node and edge. Again, the communication is limited to directly connected nodes and edges.
|
| 104 |
+
|
| 105 |
+
The closest model to our work is probably the one proposed by Li et al. (2015), which showed stat-of-the-art performance on a problem from program verification. Whereas they use the iterative procedure of the Graph Neural Networks (GNNs) model introduced by Scarselli et al. (2009) to propagate node representations until convergence, we instead use the graph CNN introduced by Defferrard et al. (2016) to diffuse information across the nodes. While their motivations are quite different, those models are related by the fact that a spectral filter defined as a polynomial of order $K$ can be implemented as a $K$ -layer GNN.2
|
| 106 |
+
|
| 107 |
+
# 4 PROPOSED GCRN MODELS
|
| 108 |
+
|
| 109 |
+
We propose two GCRN architectures that are quite natural, and investigate their performances in real-world applications in Section 5.
|
| 110 |
+
|
| 111 |
+
Model 1. The most straightforward definition is to stack a graph CNN, defined as (5), for feature extraction and an LSTM, defined as (2), for sequence learning:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r l } & { x _ { t } ^ { \mathrm { { C N N } } } = { \mathrm { C N N } } _ { \mathscr { G } } ( x _ { t } ) } \\ & { \qquad i = \sigma \big ( { W _ { x i } } { x _ { t } ^ { \mathrm { { C N N } } } } + { W _ { h i } } { h _ { t - 1 } } + { w _ { c i } } \odot { c _ { t - 1 } } + { b _ { i } } \big ) , } \\ & { f = \sigma \big ( { W _ { x f } } { x _ { t } ^ { { \mathrm { C N N } } } } + { W _ { h f } } { h _ { t - 1 } } + { w _ { c f } } \odot { c _ { t - 1 } } + { b _ { f } } \big ) , } \\ & { c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot { \mathrm { t a n h } } ( { W _ { x c } } { x _ { t } ^ { \mathrm { { C N N } } } } + { W _ { h c } } { h _ { t - 1 } } + { b _ { c } } \big ) , } \\ & { o = \sigma \big ( { W _ { x o } } { x _ { t } ^ { { \mathrm { C N N } } } } + { W _ { h o } } { h _ { t - 1 } } + { w _ { c o } } \odot { c _ { t } } + { b _ { o } } \big ) , } \\ & { h _ { t } = o \odot { \mathrm { t a n h } } \big ( { c _ { t } } \big ) . } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
In that setting, the input matrix $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { n \times d _ { \boldsymbol { x } } }$ may represent the observation of $d _ { x }$ measurements at time $t$ of a dynamical system over a network whose organization is given by a graph $\mathcal { G }$ . $\boldsymbol { x } _ { t } ^ { \mathrm { C N N } }$ is the output of the graph CNN gate. For a proof of concept, we simply choose here $\begin{array} { r } { x _ { t } ^ { \mathrm { { C N N } } } = W ^ { \mathrm { { C N N } } } * _ { \mathcal { G } } x _ { t } . } \end{array}$ , where $W ^ { \mathrm { C N N } } \in \mathbf { \bar { \Gamma } } \mathbb { R } ^ { K \times d _ { x } \times \mathbf { \bar { d } } _ { x } }$ are the Chebyshev coefficients for the graph convolutional kernels of support $K$ . The model also holds spatially distributed hidden and cell states of size $d _ { h }$ given by the matrices $c _ { t } , h _ { t } \in \mathbb { R } ^ { n \times d _ { h } }$ . Peepholes are controlled by $w _ { c } . \in \mathbb { R } ^ { n \times d _ { h } }$ . The weights $V _ { h \cdot } \in \mathbb { R } ^ { d _ { h } \times d _ { h } }$ and $W _ { x }$ · $\mathbf { \Sigma } \in \mathbb { R } ^ { d _ { h } \times d _ { x } }$ are the parameters of the fully connected layers. An architecture such as (8) may be enough to capture the data distribution by exploiting local stationarity and compositionality properties as well as the dynamic properties.
|
| 118 |
+
|
| 119 |
+
Model 2. To generalize the convLSTM model (6) to graphs we replace the Euclidean 2D convolution $^ *$ by the graph convolution $^ { \ast _ { \mathcal { G } } }$ :
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r l } & { i = \sigma ( W _ { x i } \ast _ { \mathcal { G } } x _ { t } + W _ { h i } \ast _ { \mathcal { G } } h _ { t - 1 } + w _ { c i } \odot c _ { t - 1 } + b _ { i } ) , } \\ & { f = \sigma ( W _ { x f } \ast _ { \mathcal { G } } x _ { t } + W _ { h f } \ast _ { \mathcal { G } } h _ { t - 1 } + w _ { c f } \odot c _ { t - 1 } + b _ { f } ) , } \\ & { c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot \operatorname { t a n h } ( W _ { x c } \ast _ { \mathcal { G } } x _ { t } + W _ { h c } \ast _ { \mathcal { G } } h _ { t - 1 } + b _ { c } ) , } \\ & { o = \sigma ( W _ { x o } \ast _ { \mathcal { G } } x _ { t } + W _ { h o } \ast _ { \mathcal { G } } h _ { t - 1 } + w _ { c o } \odot c _ { t } + b _ { o } ) , } \\ & { h _ { t } = o \odot \operatorname { t a n h } ( c _ { t } ) . } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
In that setting, the support $K$ of the graph convolutional kernels defined by the Chebyshev coefficients $W _ { h }$ · $\doteq \mathbb { R } ^ { K \times d _ { h } ^ { \bullet } \times d _ { h } }$ and $W _ { x }$ · $\breve { \in \mathbb { R } ^ { K \times d _ { h } \times d _ { x } } }$ determines the number of parameters, which is independent of the number of nodes $n$ . To keep the notation simple, we write $W _ { x i } * _ { \mathcal { G } } x _ { t }$ to mean a graph convolution of $x _ { t }$ with $d _ { h } d _ { x }$ filters which are functions of the graph Laplacian $L$ parametrized by $K$ Chebyshev coefficients, as noted in (4) and (5). In a distributed computing setting, $K$ controls the communication overhead, i.e. the number of nodes any given node $i$ should exchange with in order to compute its local states.
|
| 126 |
+
|
| 127 |
+
The proposed blend of RNNs and graph CNNs is not limited to LSTMs and is straightforward to apply to any kind of recursive networks. For example, a vanilla RNN $h _ { t } = \operatorname { t a n h } ( W _ { x } x _ { t } + W _ { h } h _ { t - 1 } )$
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Architecture</td><td>Structure</td><td>Filter size</td><td>Parameters</td><td>Runtime</td><td>Test(w/o Rot)</td><td>Test(Rot)</td></tr><tr><td>FC-LSTM</td><td>N/A</td><td>N/A</td><td>142,667,776</td><td>N/A</td><td>4832</td><td>=</td></tr><tr><td>LSTM+CNN</td><td>N/A</td><td>5×5</td><td>13,524,496</td><td>2.10</td><td>3851</td><td>4339</td></tr><tr><td>LSTM+CNN</td><td>N/A</td><td>9×9</td><td>43,802,128</td><td>6.10</td><td>3903</td><td>4208</td></tr><tr><td>LSTM+GCNN</td><td>knn=8</td><td>K=3</td><td>1,629,712</td><td>0.82</td><td>3866</td><td>4367</td></tr><tr><td>LSTM+GCNN</td><td>knn=8</td><td>K=5</td><td>2,711,056</td><td>1.24</td><td>3495</td><td>3932</td></tr><tr><td>LSTM+GCNN</td><td>knn=8</td><td>K=7</td><td>3,792,400</td><td>1.61</td><td>3400</td><td>3803</td></tr><tr><td>LSTM+GCNN</td><td>knn=8</td><td>K=9</td><td>4,873,744</td><td>2.15</td><td>3395</td><td>3814</td></tr><tr><td>LSTM+GCNN</td><td>knn=4</td><td>K=7</td><td>3,792,400</td><td>1.61</td><td>3446</td><td>3844</td></tr><tr><td>LSTM+GCNN</td><td>knn=16</td><td>K=7</td><td>3,792,400</td><td>1.61</td><td>3578</td><td>3963</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Table 1: Comparison between models. Runtime is the time spent per each mini-batch in seconds. Test cross-entropies correspond to moving MNIST, and rotating and moving MNIST. LSTM $\cdot +$ GCNN is Model 2 defined in (9). Cross-entropy of FC-LSTM is taken from Shi et al. (2015).
|
| 132 |
+
|
| 133 |
+
would be modified as
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
h _ { t } = \operatorname { t a n h } ( W _ { x } * _ { \mathcal { G } } x _ { t } + W _ { h } * _ { \mathcal { G } } h _ { t - 1 } ) ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
and a Gated Recurrent Unit (GRU) (Cho et al., 2014) as
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r l } & { z = \sigma ( W _ { x z } \ast _ { \mathcal { G } } x _ { t } + W _ { h z } \ast _ { \mathcal { G } } h _ { t - 1 } ) , } \\ & { r = \sigma ( W _ { x r } \ast _ { \mathcal { G } } x _ { t } + W _ { h r } \ast _ { \mathcal { G } } h _ { t - 1 } ) , } \\ & { \tilde { h } = \operatorname { t a n h } ( W _ { x h } \ast _ { \mathcal { G } } x _ { t } + W _ { h h } \ast _ { \mathcal { G } } ( r \odot h _ { t - 1 } ) ) , } \\ & { h _ { t } = z \odot h _ { t - 1 } + ( 1 - z ) \odot \tilde { h } . } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
As demonstrated by Shi et al. (2015), structure-aware LSTM cells can be stacked and used as sequence-to-sequence models using an architecture composed of an encoder, which processes the input sequence, and a decoder, which generates an output sequence. A standard practice for machine translation using RNNs (Cho et al., 2014; Sutskever et al., 2014).
|
| 146 |
+
|
| 147 |
+
# 5 EXPERIMENTS
|
| 148 |
+
|
| 149 |
+
# 5.1 SPATIO-TEMPORAL SEQUENCE MODELING ON MOVING-MNIST
|
| 150 |
+
|
| 151 |
+
For this synthetic experiment, we use the moving-MNIST dataset generated by Shi et al. (2015). All sequences are 20 frames long (10 frames as input and 10 frames for prediction) and contain two handwritten digits bouncing inside a $6 4 \times 6 4$ patch. Following their experimental setup, all models are trained by minimizing the binary cross-entropy loss using back-propagation through time (BPTT) and RMSProp with a learning rate of $1 0 ^ { - 3 }$ and a decay rate of 0.9. We choose the best model with early-stopping on validation set. All implementations are based on their Theano code and dataset.3 The adjacency matrix $A$ is constructed as a $\mathbf { k }$ -nearest-neighbor (knn) graph with Euclidean distance and Gaussian kernel between pixel locations. For a fair comparison with Shi et al. (2015) defined in (6), all GCRN experiments are conducted with Model 2 defined in (9), which is the same architecture with the 2D convolution $^ *$ replaced by a graph convolution $^ { \ast _ { \mathcal { G } } }$ . To further explore the impact of the isotropic property of our filters, we generated a variant of the moving MNIST dataset where digits are also rotating (see Figure 4).
|
| 152 |
+
|
| 153 |
+
Table 1 shows the performance of various models: (i) the baseline FC-LSTM from Shi et al. (2015), (ii) the 1-layer LSTM $^ +$ CNN from Shi et al. (2015) with different filter sizes, and (iii) the proposed LSTM+graph CNN(GCNN) defined in (9) with different supports $K$ . These results show the ability of the proposed method to capture spatio-temporal structures. Perhaps surprisingly, GCNNs can offer better performance than regular CNNs, even when the domain is a 2D grid and the data is images, the problem CNNs were initially developed for. The explanation is to be found in the differences between 2D filters and spectral graph filters. While a spectral filter of support $K = 3$ corresponds to the reach of a patch of size $5 \times 5$ (see Figure 2), the difference resides in the isotropic nature of the former and the number of parameters: $K = 3$ for the former and $5 ^ { 2 } = 2 5$ for the later.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 3: Cross-entropy on validation set: Left: performance of graph CNN with various filter support $K$ . Right: performance w.r.t. graph construction.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: Qualitative results for moving MNIST, and rotating and moving MNIST. First row is the input sequence, second the ground truth, and third and fourth are the predictions of the $\mathrm { L S T M + C N N } ( 5 \times 5 )$ and $\mathrm { L S T M + G C N N } ( k n n = 8 , K = 7 )$ .
|
| 160 |
+
|
| 161 |
+
Table 1 indeed shows that LS $\mathrm { T M } { + } \mathrm { C N N } ( 5 \times 5 )$ rivals $\mathrm { L S T M + G C N N }$ with $K = 3$ . However, when increasing the filter size to $9 \times 9$ or $K = 5$ , the GCNN variant clearly outperforms the CNN variant. This experiment demonstrates that graph spectral filters can obtain superior performance on regular domains with much less parameters thanks to their isotropic nature, a controversial property. Indeed, as the nodes are not ordered, there is no notion of an edge going up, down, on the right or on the left. All edges are treated equally, inducing some sort of rotation invariance. Additionally, Table 1 shows that the computational complexity of each model is linear with the filter size, and Figure 3 shows the learning dynamic of some of the models.
|
| 162 |
+
|
| 163 |
+
# 5.2 NATURAL LANGUAGE MODELING ON PENN TREEBANK
|
| 164 |
+
|
| 165 |
+
The Penn Treebank dataset has 1,036,580 words. It was pre-processed in Zaremba et al. (2014) and split4 into a training set of $9 2 9 \mathrm { k }$ words, a validation set of 73k words, and a test set of ${ 8 2 } \mathrm { k }$ words. The size of the vocabulary of this corpus is 10,000. We use the gensim library5 to compute a word2vec model (Mikolov et al., 2013) for embedding the words of the dictionary in a 200-dimensional space. Then we build the adjacency matrix of the word embedding using a 4-nearest neighbor graph with cosine distance. Figure 6 presents the computed adjacency matrix, and its 3D visualization. We used the hyperparameters of the small configuration given by the code6 based on Zaremba et al. (2014): the size of the data mini-batch is 20, the number of temporal steps to unroll is 20, the dimension of the hidden state is 200. The global learning rate is 1.0 and the norm of the gradient is bounded by 5. The learning decay function is selected to be $\mathrm { 0 . 5 ^ { m a x ( 0 , \# e p o c h - 4 ) } }$ . All experiments have 13 epochs, and dropout value is 0.75. For Zaremba et al. (2014), the input representation $x _ { t }$ can be either the 200-dim embedding vector of the word, or the 10,000-dim one-hot representation of the word. For
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
|
| 169 |
+
Figure 5: Learning dynamic of LSTM with and without graph structure and dropout regularization.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Architecture</td><td>Representation</td><td>Parameters</td><td>Train Perplexity</td><td>Test Perplexity</td></tr><tr><td>Zaremba et al. (2014) code6</td><td>embedding</td><td>681,800</td><td>36.96</td><td>117.29</td></tr><tr><td>Zaremba et al. (2014) code6</td><td>one-hot</td><td>34,011,600</td><td>53.89</td><td>118.82</td></tr><tr><td>LSTM</td><td>embedding</td><td>681,800</td><td>48.38</td><td>120.90</td></tr><tr><td>LSTM</td><td>one-hot</td><td>34,011,600</td><td>54.41</td><td>120.16</td></tr><tr><td>LSTM, dropout</td><td>one-hot</td><td>34,011,600</td><td>145.59</td><td>112.98</td></tr><tr><td>GCRN-M1</td><td>one-hot</td><td>42,011,602</td><td>18.49</td><td>177.14</td></tr><tr><td>GCRN-M1, dropout</td><td>one-hot</td><td>42,011,602</td><td>114.29</td><td>98.67</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 2: Comparison of models in terms of perplexity. Zaremba et al. (2014) code6 is ran as benchmark algorithm. The original Zaremba et al. (2014) code used as input representation for $x _ { t }$ the 200-dim embedding representation of words, computed here by the gensim library5. As our model runs on the 10,000-dim one-hot representation of words, we also ran Zaremba et al. (2014) code on this representation. We re-implemented Zaremba et al. (2014) code with the same architecture and hyperparameters. We remind that GCRN-M1 refers to GCRN Model 1 defined in (8).
|
| 174 |
+
|
| 175 |
+
our models, the input representation is a one-hot representation of the word. This choice allows us to use the graph structure of the words.
|
| 176 |
+
|
| 177 |
+
Table 2 reports the final train and test perplexity values for each investigated model and Figure 5 plots the perplexity value vs. the number of epochs for the train and test sets with and without dropout regularization. Numerical experiments show:
|
| 178 |
+
|
| 179 |
+
1. Given the same experimental conditions in terms of architecture and no dropout regularization, the standalone model of LSTM is more accurate than LSTM using the spatial graph information (120.16 vs. 177.14), extracted by graph CNN with the GCRN architecture of Model 1, Eq. (8).
|
| 180 |
+
2. However, using dropout regularization, the graph LSTM model overcomes the standalone LSTM with perplexity values 98.67 vs. 112.98.
|
| 181 |
+
3. The use of spatial graph information found by graph CNN speeds up the learning process, and overfits the training dataset in the absence of dropout regularization. The graph structure likely acts a constraint on the learning system that is forced to move in the space of language topics.
|
| 182 |
+
4. We performed the same experiments with LSTM and Model 2 defined in (9). Model 1 significantly outperformed Model 2, and Model 2 did worse than standalone LSTM. This bad performance may be the result of the large increase of dimensionality in Model 2, as the dimension of the hidden and cell states changes from 200 to 10,000, the size of the vocabulary. A solution would be to downsize the data dimensionality, as done in Shi et al. (2015) in the case of image data.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 6: Left: adjacency matrix of word embeddings. Right: 3D visualization of words’ structure.
|
| 188 |
+
|
| 189 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 190 |
+
|
| 191 |
+
This work aims at learning spatio-temporal structures from graph-structured and time-varying data. In this context, the main challenge is to identify the best possible architecture that combines simultaneously recurrent neural networks like vanilla RNN, LSTM or GRU with convolutional neural networks for graph-structured data. We have investigated here two architectures, one using a stack of CNN and RNN (Model 1), and one using convLSTM that considers convolutions instead of fully connected operations in the RNN definition (Model 2). We have then considered two applications: video prediction and natural language modeling. Model 2 has shown good performances in the case of video prediction, by improving the results of Shi et al. (2015). Model 1 has also provided promising performances in the case of language modeling, particularly in terms of learning speed. It has been shown that (i) isotropic filters, maybe surprisingly, can outperform classical 2D filters on images while requiring much less parameters, and (ii) that graphs coupled with graph CNN and RNN are a versatile way of introducing and exploiting side-information, e.g. the semantic of words, by structuring a data matrix.
|
| 192 |
+
|
| 193 |
+
Future work will investigate applications to data naturally structured as dynamic graph signals, for instance fMRI and sensor networks. The graph CNN model we have used is rotationally-invariant and such spatial property seems quite attractive in real situations where motion is beyond translation. We will also investigate how to benefit of the fast learning property of our system to speed up language modeling models. Eventually, it will be interesting to analyze the underlying dynamical property of generic RNN architectures in the case of graphs. Graph structures may introduce stability to RNN systems, and prevent them to express unstable dynamic behaviors.
|
| 194 |
+
|
| 195 |
+
# ACKNOWLEDGMENT
|
| 196 |
+
|
| 197 |
+
This research was supported in part by the European Union’s H2020 Framework Programme (H2020-MSCA-ITN-2014) under grant No. 642685 MacSeNet, and Nvidia equipment grant.
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral Networks and Locally Connected Networks on Graphs. In International Conference on Learning Representations (ICML), 2014.
|
| 202 |
+
|
| 203 |
+
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. arXiv:1406.1078, 2014.
|
| 204 |
+
|
| 205 |
+
F. R. K. Chung. Spectral Graph Theory. American Mathematical Society, 1997.
|
| 206 |
+
|
| 207 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with ¨ fast localized spectral filtering. In Advances in Neural Information Processing Systems (NIPS), 2016.
|
| 208 |
+
|
| 209 |
+
Jeffrey Donahue, Lisa Anne Hendricks, Sergio Guadarrama, Marcus Rohrbach, Subhashini Venugopalan, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks for visual recognition and description. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 210 |
+
|
| 211 |
+
Felix A Gers and Jurgen Schmidhuber. Recurrent nets that time and count. In ¨ IEEE-INNS-ENNS International Joint Conference on Neural Networks, 2000.
|
| 212 |
+
|
| 213 |
+
Alex Graves. Generating sequences with recurrent neural networks. arXiv:1308.0850, 2013.
|
| 214 |
+
|
| 215 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 1997.
|
| 216 |
+
|
| 217 |
+
Ashesh Jain, Amir R. Zamir, Silvio Savarese, and Ashutosh Saxena. Structural-RNN: Deep Learning on SpatioTemporal Graphs. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 218 |
+
|
| 219 |
+
Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 220 |
+
|
| 221 |
+
Thomas N. Kipf and Max Welling. Semi-Supervised Classification with Graph Convolutional Networks. arXiv:1609.02907, 2016.
|
| 222 |
+
|
| 223 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 224 |
+
|
| 225 |
+
Xiaodan Liang, Xiaohui Shen, Jiashi Feng, Liang Lin, and Shuicheng Yan. Semantic object parsing with graph lstm. arXiv:1603.07063, 2016.
|
| 226 |
+
|
| 227 |
+
Jonathan Masci, Davide Boscaini, Michael M. Bronstein, and Pierre Vandergheynst. Geodesic convolutional neural networks on riemannian manifolds. In IEEE International Conference on Computer Vision (ICCV) Workshops, 2015.
|
| 228 |
+
|
| 229 |
+
T. Mikolov, K. Chen, G. Corrado, and J. Dean. Estimation of Word Representations in Vector Space. In International Conference on Learning Representations (ICLR), 2013.
|
| 230 |
+
|
| 231 |
+
Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning Convolutional Neural Networks for Graphs. In International Conference on Machine Learning (ICML), 2016.
|
| 232 |
+
|
| 233 |
+
MarcAurelio Ranzato, Arthur Szlam, Joan Bruna, Michael Mathieu, Ronan Collobert, and Sumit Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv:1412.6604, 2014.
|
| 234 |
+
|
| 235 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 2009.
|
| 236 |
+
|
| 237 |
+
Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-kin Wong, and Wang-chun Woo. Convolutional LSTM Network: A Machine Learning Approach for Precipitation Nowcasting. In Advances in Neural Information Processing Systems (NIPS), 2015.
|
| 238 |
+
|
| 239 |
+
D. Shuman, S. Narang, P. Frossard, A. Ortega, and P. Vandergheynst. The Emerging Field of Signal Processing on Graphs: Extending High-Dimensional Data Analysis to Networks and other Irregular Domains. IEEE Signal Processing Magazine, 2013.
|
| 240 |
+
|
| 241 |
+
Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In International Conference on Machine Learning (ICML), 2015.
|
| 242 |
+
|
| 243 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems (NIPS), 2014.
|
| 244 |
+
|
| 245 |
+
Kai Sheng Tai, Richard Socher, and Christopher D. Manning. Improved semantic representations from treestructured long short-term memory networks. In Association for Computational Linguistics (ACL), 2015.
|
| 246 |
+
|
| 247 |
+
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 248 |
+
|
| 249 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv:1409.2329, 2014.
|
md/train/S1AG8zYeg/S1AG8zYeg.md
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SENTENCE ORDERING USING RECURRENT NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Lajanugen Logeswaran, Honglak Lee & Dragomir Radev
|
| 4 |
+
|
| 5 |
+
Department of EECS
|
| 6 |
+
University of Michigan
|
| 7 |
+
Ann Arbor, MI 48109, USA
|
| 8 |
+
{llajan,honglak,radev}@umich.edu
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Modeling the structure of coherent texts is a task of great importance in NLP. The task of organizing a given set of sentences into a coherent order has been commonly used to build and evaluate models that understand such structure. In this work we propose an end-to-end neural approach based on the recently proposed set to sequence mapping framework to address the sentence ordering problem. Our model achieves state-of-the-art performance in the order discrimination task on two datasets widely used in the literature. We also consider a new interesting task of ordering abstracts from conference papers and research proposals and demonstrate strong performance against recent methods. Visualizing the sentence representations learned by the model shows that the model has captured high level logical structure in these paragraphs. The model also learns rich semantic sentence representations by learning to order texts, performing comparably to recent unsupervised representation learning methods in the sentence similarity and paraphrase detection tasks.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Modeling the structure of coherent texts is one of the central problems in NLP. A well written piece of text has a particular high level logical and topical structure to it. The actual word and sentence choices as well as their transitions come together to convey the purpose of the text. Our overarching goal is to build models that can learn such structure by learning to arrange a given set of sentences to make coherent text.
|
| 17 |
+
|
| 18 |
+
The sentence ordering task finds several applications. Multi-document Summarization (MDS) and retrieval based question answering involve extracting information from multiple source documents and organizing the content into a coherent summary. Since the relative ordering about sentences that come from different sources can be unclear, being able to automatically evaluate a particular order and/or finding the optimal order is essential. Barzilay and Elhadad (2002) discuss the importance of an explicit ordering component in MDS systems. Their experiments show that finding an acceptable ordering can enhance user comprehension.
|
| 19 |
+
|
| 20 |
+
Models that learn to order text fragments can also be used as models of coherence. Automated essay scoring (Miltsakaki and Kukich, 2004; Burstein et al., 2010) is an application that can benefit from such a coherence model. Coherence is one of the key elements on which student essays are evaluated in standardized writing tests such as GRE (ETS). Apart from its importance and applications, our motivation to address this problem also stems from its stimulating nature. It can be considered as a jigsaw puzzle of sorts in the language domain.
|
| 21 |
+
|
| 22 |
+
Our approach to the problem of modeling coherence is driven by recent successes in 1) capturing semantics using distributed representations and 2) using RNNs for sequence modeling tasks.
|
| 23 |
+
|
| 24 |
+
Success in unsupervised approaches for learning embeddings for textual entities from large text corpora altered the way NLP problems are studied today. These embeddings have been shown to capture syntactic and semantic information as well as higher level analogical structure. These methods have been adopted to learn vector representations of sentences, paragraphs and entire documents. Embedding based approaches allow models to be trained end-to-end from scratch with no handcrafting.
|
| 25 |
+
|
| 26 |
+
Recurrent Neural Networks (RNNs) have become the de facto approach to sequence learning and mapping problems in recent times. The Sequence to sequence mapping framework (Sutskever et al., 2014), as well as several of its variants have fuelled RNN based approaches to a wide variety of problems including language modeling, language generation, machine translation, question answering and many others.
|
| 27 |
+
|
| 28 |
+
Vinyals et al. (2015a) recently showed that the order in which tokens of the input sequence are fed to seq2seq models has a significant impact on the performance of the model. In particular, for problems such as sorting which involve a source set (as opposed to a sequence), the optimal order to feed the tokens is not clear. They introduce an attention mechanism over the input tokens which allows the model to learn a soft input order. This is called the read, process and write (or set to sequence) framework. The read block maps the input tokens to a fixed length vector representation. The process block is an RNN encoder which, at each time step, attends to the input token embeddings and computes an attention readout, appending it to the current hidden state. The write block is an RNN which produces the target sequence conditioned on the representation produced by the process block.
|
| 29 |
+
|
| 30 |
+
In this work we propose an RNN based approach to the sentence ordering problem which exploits the set to sequence framework. A word level RNN encoder produces sentence embeddings. A sentence level set encoder RNN iteratively attends to these embeddings (process block above) and constructs a representation of the context. Initialized with this representation, a sentence level pointer network RNN points to the next sentence candidates.
|
| 31 |
+
|
| 32 |
+
The most widely studied task relevant to sentence ordering and coherence modeling in the literature is the order discrimination task. Given a document and a permuted version of it, the task involves identifying the more coherent ordering of the two. Our proposed model achieves state of the art performance on two benchmark datasets for this task, outperforming several classical approaches and more recent data-driven approaches.
|
| 33 |
+
|
| 34 |
+
Addressing the more challenging task of ordering a given collection of sentences, we consider the novel and interesting task of ordering sentences from abstracts of conference papers and research grants. Our model strongly outperforms previous work on this task. We visualize the learned sentence representations and show that our model captures high level discourse structure. We provide visualizations that aid understanding what information in the sentences the model uses to identify the next sentence. We also study the quality of the sentence representations learned by the model by training the model on a large text corpus and show that these embeddings are comparable to recent unsupervised methods in capturing semantics.
|
| 35 |
+
|
| 36 |
+
In summary our key contributions are as follows,
|
| 37 |
+
|
| 38 |
+
• We propose an end to end trainable model based on the set to sequence framework to address the challenging problem of organizing a given collection of sentences in a coherent order. • We consider the novel task of understanding structure in abstract paragraphs and demonstrate state of the art results in order discrimination and sentence ordering tasks. • We demonstrate that the proposed model is capable of learning semantic representations of sentences that are comparable to recently proposed methods for learning such representations.
|
| 39 |
+
|
| 40 |
+
# 2 RELATED WORK
|
| 41 |
+
|
| 42 |
+
Coherence modeling and sentence ordering The coherence modeling and sentence ordering tasks have been approached by closely related techniques. Most approaches propose a measure of coherence and formulate the ordering problem as finding an order with maximal coherence. Recurring themes from prior work include linguistic features, centering theory, local and global coherence.
|
| 43 |
+
|
| 44 |
+
Local coherence has been modeled by considering properties of a local window of sentences such as sentence similarity and sentence transition structure. Foltz et al. (1998) represent words using vectors of co-occurent counts and sentences as a mean of these word vectors. Sentence similarity is defined as the cosine distance between sentence vectors and text coherence is modeled as a normalized sum of similarity scores of adjacent sentences. Lapata (2003) represents sentences by vectors of linguistic features and learn the transition probabilities from one set of features to another in adjacent sentences. A popular model of coherence is the Entity-Grid model Barzilay and Lapata (2008) which captures local coherence by modeling patterns of entity distributions in the discourse. Sentences are represented by the syntactic roles of entities appearing in the document and entity transition frequencies in successive sentences are treated as features that are are used to train a ranking SVM. These two approaches find motivation from ideas in centering theory (Grosz et al., 1995) which state that nouns and entities in coherent discourses exhibit certain patterns.
|
| 45 |
+
|
| 46 |
+
Global models of coherence typically use an HMM to model document structure. The content model proposed by Barzilay and Lee (2004) represents topics in a particular domain as states in an HMM. State transitions capture possible presentation orderings within the domain. Words of a sentence are modeled using a topic-specific language model. The content model has inspired several subsequent work to combine the strengths of local and global models. Elsner et al. (2007) combine the entity model and the content model using a non-parametric HMM. Soricut and Marcu (2006) use several models as feature functions and define a log linear model to assign probability to a given text. Louis and Nenkova (2012) attempt to capture the intentional structure in documents using syntax as a proxy for the communicative goal of a sentence. Syntax features such as parse tree production rules and constituency tags at a particular tree depth were used.
|
| 47 |
+
|
| 48 |
+
Unlike previous approaches, we do not employ any handcrafted features and adopt an embedding based approach. Local coherence is taken into account by having a next sentence prediction component in the model and global dependencies are naturally captured by an RNN. We demonstrate that our model is able to capture both logical and topical structure by evaluating its performance on different types of data.
|
| 49 |
+
|
| 50 |
+
Data-driven approaches Neural approaches have gained attention more recently. Li and Hovy (2014) model sentences as embeddings derived from recurrent/recursive neural nets and train a feedforward neural network that takes an input window of sentence embeddings and outputs a probability which represents the coherence of the sentence window. Coherence evaluation is performed by sliding the window over the text and aggregating the score. Li and Jurafsky (2016) study the same model in a larger scale task and also consider a sequence to sequence approach where the model is trained to generate the next sentence given the current sentence and vice versa. Chen et al. (2016) also propose a sentence embedding based approach where they model the probability that one sentence should come before another and define coherence based on the likelihood of the relative order of every pair of sentences. We believe these models are limited by the fact that they are local in nature and our experiments show that exploiting larger contexts can be very beneficial.
|
| 51 |
+
|
| 52 |
+
Hierarchical RNNs for document modeling Word level and sentence level RNNs have been used in a hierarchical fashion for modeling documents in prior work. Li et al. (2015b) proposed a hierarchical document autoencoder which has potential to be used in generation and summarization applications. More relevant to our work is a similar model (but without an encoder) considered by Lin et al. (2015). A sentence level RNN predicts the bag of words in the next sentence given the previous sentences and a word level RNN predicts the word sequence conditioned on the sentence level RNN hidden state. The model has a structure similar to the content model of Barzilay and Lee (2004) with RNNs playing the roles of the HMM and the bigram language model. Our model has a hierarchical nature in that a sentence level RNN operates over words of a sentence and a document level RNN operates over sentence embeddings.
|
| 53 |
+
|
| 54 |
+
Combinatorial optimization with RNNs Vinyals et al. (2015a) equip sequence to sequence models with the capability to handle input and output sets, and discuss experiments on sorting, language modeling and parsing. Their goal is to show that input and output orderings can matter in these tasks, which is demonstrated using several small scale experiments. Our work exploits this framework to address the challenging problem of modeling logical and hierarchical structure in text. Vinyals et al. (2015b) proposed pointer-networks, aimed at combinatorial optimization problems where the output dictionary size depends on the number of input elements. We use a pointer-network that points to each of the next sentence candidates as the decoder.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 1: Model Overview: Illustration of the sentence encoder and single time-step computations in encoder and decoder. $s _ { i }$ ’s represent sentence embeddings derived from the sentence encoder. Attention weights are computed for the sentences based on their embeddings and the current hidden state. In the encoder an attention readout is concatenated with the LSTM output to form the next hidden state. The decoder uses the attention weights for prediction.
|
| 58 |
+
|
| 59 |
+
# 3 APPROACH
|
| 60 |
+
|
| 61 |
+
Our proposed model is inspired by the way a human would solve this task. First, the model attempts to read the sentences to capture the semantics of the sentences as well as the general context of the paragraph. Given this knowledge, the model attempts to pick the sentences one by one sequentially till exhaustion.
|
| 62 |
+
|
| 63 |
+
Our model is based on the read, process and write framework proposed by Vinyals et al. (2015a) briefly discussed in section 1. We use the encoder-decoder terminology that is more common in the literature in the following discussion.
|
| 64 |
+
|
| 65 |
+
The model is comprised of a sentence encoder RNN, an encoder RNN and a decoder RNN (figure 1). An RNN sentence encoder takes as input the words of a sentence $s$ sequentially and computes an embedding representation of the sentence (Figure 1a). Henceforth, we shall use $s$ to refer to a sentence or its embedding interchangeably. The embeddings $\{ s _ { 1 } , s _ { 2 } , . . . , s _ { n } \}$ of a given set of $n$ sentences constitute the sentence memory, available to be accessed by subsequent components.
|
| 66 |
+
|
| 67 |
+
The encoder is identical to the originally proposed process block and is defined by equations 1-5 (See Figure 1b). Following the regular LSTM hidden state $( h _ { \mathrm { e n c } } ^ { t - 1 } , c _ { \mathrm { e n c } } ^ { t - 1 } )$ update, the hidden state is concatenated with an attention readout vector $s _ { \mathrm { a t t } } ^ { t }$ , and this concatenated vector is treated as the hidden state for the next time step (Equation 5). Attention probabilities are computed by composing the hidden state with embeddings of the candidate sentences through a scoring function $f$ and taking the softmax (Equations 2, 3). This process is iterated for a number of times, called the number of read cycles. As described in Vinyals et al. (2015a) the encoder has the desirable property of being invariant to the order in which the sentence embeddings reside in the memory. The LSTM used here does not take any inputs (input is clamped to zero).
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } & { \tilde { h } _ { \mathrm { e n c } } ^ { t } , c _ { \mathrm { e n c } } ^ { t } = \mathrm { L S T M } ( h _ { \mathrm { e n c } } ^ { t - 1 } , c _ { \mathrm { e n c } } ^ { t - 1 } ) } \\ & { \qquad e _ { \mathrm { e n c } } ^ { t , i } = f ( s _ { i } , \tilde { h } _ { \mathrm { e n c } } ^ { t } ) ; i \in \{ 1 , . . . , n \} } \\ & { \qquad a _ { \mathrm { e n c } } ^ { t } = \mathrm { S o f t m a x } ( e _ { \mathrm { e n c } } ^ { t } ) } \\ & { \qquad s _ { \mathrm { a t t } } ^ { t } = \displaystyle \sum _ { i = 1 } ^ { n } a _ { \mathrm { e n c } } ^ { t , i } s _ { i } } \\ & { \qquad k _ { \mathrm { e n c } } ^ { t } = \widetilde { [ h } _ { \mathrm { e n c } } ^ { t } , ~ s _ { \mathrm { a t t } } ^ { t } ] } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The decoder is a pointer network that takes a similar form with a few differences (equations 6-8, Figure 1c). The LSTM takes the embedding of the previous sentence also as input: At training time the correct order of sentences $( s _ { o _ { 1 } } , s _ { o _ { 2 } } , . . . , \bar { s } _ { o _ { n } } ) = ( \bar { x } ^ { 1 } , x ^ { 2 } , . . . , x ^ { n } )$ is known $\scriptstyle { \dot { o } }$ represents the correct order) and $x ^ { t - 1 }$ is used as the input. At test time the predicted assignment $\hat { x } ^ { t - 1 }$ is used instead. This makes concatenating the attention readout to the hidden state somewhat redundant (verified empirically), and hence it is omitted. The attention computation is identical to that of the encoder. The initial state of the decoder LSTM is initialized with the final hidden state of the encoder as in sequence to sequence models.1 $x ^ { 0 }$ is a vector of zeros. Figure 1 illustrates the single time-step computation in the encoder and decoder.
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r l } & { h _ { \mathrm { d e c } } ^ { t } , c _ { \mathrm { d e c } } ^ { t } = \mathrm { L S T M } ( h _ { \mathrm { d e c } } ^ { t - 1 } , c _ { \mathrm { d e c } } ^ { t - 1 } , x ^ { t - 1 } ) } \\ & { ~ e _ { \mathrm { d e c } } ^ { t , i } = f ( s _ { i } , h _ { \mathrm { d e c } } ^ { t } ) ; i \in \{ 1 , . . . , n \} ~ } \\ & { ~ a _ { \mathrm { d e c } } ^ { t } = \mathrm { S o f t m a x } ( e _ { \mathrm { d e c } } ^ { t } ) } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
The attention probability $a _ { \mathrm { d e c } } ^ { t , i }$ is interpreted as the probability for $s _ { i }$ being the correct sentence choice at position $t$ , conditioned on the previous sentence assignments $p ( S _ { t } = s _ { i } | S _ { 1 } , . . . , S _ { t - 1 } )$ .
|
| 80 |
+
|
| 81 |
+
# 3.1 SCORING FUNCTION
|
| 82 |
+
|
| 83 |
+
We consider two choices for the scoring functions $f$ in our experiments. The first one is a single hidden layer feed-forward net that takes $s , h$ as inputs and outputs a score
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
f ( s , h ) = W ^ { \prime } { \operatorname { t a n h } } ( W [ s ; h ] + b ) + b ^ { \prime }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $W , b , W ^ { \prime } , b ^ { \prime }$ are learnable parameters. This scoring function takes a discriminative approach in classifying the next sentence. Note that the structure of this scoring function is similar to the window network in Li and Hovy (2014). While they used a local window of sentences to capture context, this scoring function exploits the RNN hidden state to score sentence candidates.
|
| 90 |
+
|
| 91 |
+
We also consider a bilinear scoring function
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
f ( s , h ) = s ^ { T } ( W h + b )
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Compared to the previous scoring function, this takes a generative approach of trying to regress the next sentence given the current hidden state $\left( W h + b \right)$ and enforcing that it be most similar to the correct next sentence. We observed that this scoring function led to learning better sentence representations (section 4.4).
|
| 98 |
+
|
| 99 |
+
# 3.2 TRAINING OBJECTIVE
|
| 100 |
+
|
| 101 |
+
The model is trained with the maximum likelihood objective:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\operatorname* { m a x } \sum _ { x \in D } \sum _ { t = 1 } ^ { | x | } \log p ( x ^ { t } | x ^ { 1 } , . . . , x ^ { t - 1 } )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $D$ denotes the training set and each training instance is given by an ordered document of sentences $x = ( x ^ { 1 } , . . . , x ^ { | x | } )$ . We also considered an alternative structured margin loss which imposes less penalty for assigning high scores to sentence candidates that are close to the correct sentence in the source document instead of uniformly penalizing all incorrect sentence candidates. However, the softmax output with cross entropy loss consistently performed better.
|
| 108 |
+
|
| 109 |
+
# 3.3 COHERENCE MODELING
|
| 110 |
+
|
| 111 |
+
We define the coherence score of an arbitrary partial/complete assignment $( s _ { p _ { 1 } } , . . . , s _ { p _ { k } } )$ to the first $k$ sentence positions as
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\sum _ { i = 1 } ^ { k } \log p ( S _ { i } = s _ { p _ { i } } | S _ { 1 } = s _ { p _ { 1 } } , . . . , S _ { i - 1 } = s _ { p _ { i - 1 } } )
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $S _ { 1 } , . . , S _ { k }$ are random variables representing the sentence assignment to positions 1 through $k$ . The conditional probabilities are derived from the network. This is our measure of comparing the coherence of different renderings of a document. It is also used as a heuristic during decoding.
|
| 118 |
+
|
| 119 |
+
Table 1: Statistics of data used in our experiments. For the first two datasets, the test set size\* is the number of permutation pairs used for order discrimination experiments.
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="4">Length Statistics</td><td colspan="3">Data Split</td><td rowspan="2">Types</td></tr><tr><td>Min</td><td>Mode</td><td>Mean</td><td>Max</td><td>Train</td><td>Val</td><td>Test</td></tr><tr><td>Accidents</td><td>6</td><td>11</td><td>11.6</td><td>19</td><td>100</td><td>-</td><td>1986*</td><td>5,140</td></tr><tr><td>Earthquakes</td><td>3</td><td>7</td><td>10.4</td><td>31</td><td>100</td><td>1</td><td>1956*</td><td>3,775</td></tr><tr><td>NIPS abstracts</td><td>2</td><td>7</td><td>6</td><td>15</td><td>2448</td><td>409</td><td>402</td><td>18,696</td></tr><tr><td>AAN abstracts</td><td>1</td><td>4</td><td>5</td><td>20</td><td>8569</td><td>962</td><td>2626</td><td>40,288</td></tr><tr><td>NSF abstracts</td><td>2</td><td>7</td><td>8.9</td><td>40</td><td>96070</td><td>10185</td><td>21580</td><td>373,909</td></tr></table>
|
| 122 |
+
|
| 123 |
+
# 4 EXPERIMENTAL RESULTS
|
| 124 |
+
|
| 125 |
+
# 4.1 MODEL TRAINING
|
| 126 |
+
|
| 127 |
+
For all tasks discussed in this section we train the model with the same objective (equation 11) on the training data relevant to the task. We used the single hidden layer MLP scoring function for the order discrimination and sentence ordering tasks. Models are trained end-to-end.
|
| 128 |
+
|
| 129 |
+
Model parameters. We use pre-trained 300 dimensional GloVe word embeddings (Pennington et al., 2014). All LSTMs use a hidden layer size of 1000 and the MLP in section 9 has a hidden layer size of 500. The number of read cycles in the encoder is set to 10. The same model architecture is used across all experiments.
|
| 130 |
+
|
| 131 |
+
Preprocessing. The nltk sentence tokenizer was used for word tokenization. The GloVe vocabulary was used as the reference vocabulary. Any word not in the vocabulary is checked for a case insensitive match. If a token is hyphenated, we check if the constituent words are in the vocabulary. In the AAN abstracts data (section 4.3.1), some words tend to have a hyphen in the middle because of word hyphenation across lines in the original document. Hence we also check if stripping hyphens produces a vocabulary word. If all checks fail, and a token appears in the training set above a certain frequency, it is added to the vocabulary.
|
| 132 |
+
|
| 133 |
+
Learning . We used a batch size of 10 and the Adam optimizer (Kingma and Ba, 2014) with a base learning rate of 5e-4 for all experiments. Early stopping is used for regularization.
|
| 134 |
+
|
| 135 |
+
# 4.2 ORDER DISCRIMINATION
|
| 136 |
+
|
| 137 |
+
Finding the optimal ordering is a difficult problem when a large number of sentences are required to be rearranged or when there is inherent ambiguity in the ordering of the sentences. For this reason, the ordering problem is commonly formulated as the following binary classification task. Given a reference paragraph and a permuted version of it, the more coherently organized one needs to be identified (Barzilay and Lapata, 2008).
|
| 138 |
+
|
| 139 |
+
# 4.2.1 DATA
|
| 140 |
+
|
| 141 |
+
We consider data from two different domains that have been widely used for this task in previous work since Barzilay and Lee (2004); Barzilay and Lapata (2008). The ACCIDENTS data (aka AIRPLANE data) is a set of aviation accident reports from the National Transportation Safety Board’s database. The EARTHQUAKES data comprises newspaper articles from the North American News Text Corpus. In each of the above datasets the training and test sets include 100 articles as well as approximately 20 permutations of each article. Further statistics about the data are shown in table 1.
|
| 142 |
+
|
| 143 |
+
# 4.2.2 RESULTS
|
| 144 |
+
|
| 145 |
+
Table 2 compares the performance of our model against prior approaches. We compare results against traditional approaches in the literature as well as some recent data-driven approaches (See section 2 for more details). The entity grid model provides a strong baseline on the ACCIDENTS dataset, only outperformed by our model and Li and Jurafsky (2016) . On the EARTHQUAKE data the window approach of Li and Hovy (2014) and Li and Jurafsky (2016) perform strongly. Our approach outperforms prior models on both datasets, achieving near perfect performance on the Earthquakes dataset.
|
| 146 |
+
|
| 147 |
+
Table 2: Mean Accuracy comparison on the Accidents and Earthquakes data for the order discrimination task. Reference results obtained from the respective publications.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Methods</td><td>ACCIDENTS</td><td>EARTHQUAKES</td></tr><tr><td>Barzilay and Lapata (2008)</td><td>0.904</td><td>0.872</td></tr><tr><td>Louis and Nenkova (2012)</td><td>0.842</td><td>0.957</td></tr><tr><td>Guinaudeau and Strube (2013)</td><td>0.846</td><td>0.635</td></tr><tr><td>Liand Hovy (2014) -Recurrent</td><td>0.840</td><td>0.951</td></tr><tr><td>Li and Hovy (2014) - Recursive</td><td>0.864</td><td>0.976</td></tr><tr><td>Li and Jurafsky (2016)</td><td>0.930</td><td>0.992</td></tr><tr><td>Ours</td><td>0.944</td><td>0.997</td></tr></table>
|
| 150 |
+
|
| 151 |
+
While these datasets have been widely used in the literature, they are quite formulaic in nature and are no longer challenging. We hence turn to the more challenging task of ordering a given collection of sentences to make a coherent document.
|
| 152 |
+
|
| 153 |
+
# 4.3 SENTENCE ORDERING
|
| 154 |
+
|
| 155 |
+
In this task we directly address the ordering problem. We do not assume the availability of a set of candidate orderings to choose from and instead attempt to find a good ordering from all possible permutations of the sentences.
|
| 156 |
+
|
| 157 |
+
The difficulty of the ordering problem depends on the nature of the text as well as the length of paragraphs considered. Evaluation on text from arbitrary text sources makes it difficult to interpret the results, since it may not be clear whether to attribute the observed performance to a deficient model or ambiguity in next sentence choices due to many plausible orderings.
|
| 158 |
+
|
| 159 |
+
Text summaries are a suitable source of data for this task. They often exhibit a clear flow of ideas and have minimal redundancy. We specifically look at abstracts of conference papers and NSF research proposals. This data has several favorable properties. Abstracts usually have a particular high level format - They start out with a brief introduction, a description of the problem addressed and proposed approach and conclude with performance remarks. This would allow us to identify if the model is capable of capturing high level logical structure. Second, abstracts have an average length of about 10, making the ordering task more accessible. Furthermore, this also gives us a significant amount of data to train and test our models.
|
| 160 |
+
|
| 161 |
+
# 4.3.1 DATA
|
| 162 |
+
|
| 163 |
+
NIPS Abstracts. We consider abstracts from NIPS papers in the past 10 years. We parsed 3280 abstracts from paper pdfs and obtained 3259 abstracts after omitting erroneous extracts. The dataset was split into years 2005-2013 for training and years 2014, 2015 respectively for validation and testing2.
|
| 164 |
+
|
| 165 |
+
ACL Abstracts. A second source of abstracts we consider are papers from the ACL Anthology Network (AAN) corpus (Radev et al., 2009) of ACL papers. At the time of retrieval, the corpus had publications up to year 2013. We extracted abstracts from the text parses using simple keyword matching for the strings ‘Abstract’ and ‘Introduction’. Our extraction is successful for 12,157 articles. Most of the failures occur for older papers due to improper formatting and OCR issues. We use all extracts of papers published up to year 2010 for training, year 2011 for validation and years 2012-2013 for testing. We additionally merge words hyphenated at the edges of paragraph boundaries.
|
| 166 |
+
|
| 167 |
+
NSF Abstracts. We also evaluate our model on the NSF Research Award Abstracts dataset (Lichman, 2013). This dataset comprises abstracts from a diverse set of scientific areas in contrast to the previous two sources of data and the abstracts are also lengthier, making this dataset more challenging. Years 1990-1999 were used for training, 2000 for validation and 2001-2003 for testing. We capped the parses of the abstracts to a maximum length of 40 sentences. Unsuccessful parses and parses of excessive length were discarded. Further details about the datasets are provided in table 1.
|
| 168 |
+
|
| 169 |
+
Table 3: Comparison against prior methods on the abstracts data.
|
| 170 |
+
|
| 171 |
+
<table><tr><td rowspan="2"></td><td colspan="2">NIPS Abstracts</td><td colspan="2">AAN Abstracts</td><td colspan="2">NSF Abstracts</td></tr><tr><td>Accuracy</td><td>T</td><td>Accuracy</td><td>T</td><td>Accuracy</td><td>T</td></tr><tr><td>Random</td><td>15.59</td><td>0</td><td>19.36</td><td>0</td><td>9.46</td><td>0</td></tr><tr><td>Entity Grid (Barzilay and Lapata, 2008)</td><td>20.10</td><td>0.09</td><td>21.82</td><td>0.10</td><td>1</td><td>-</td></tr><tr><td>Seq2seq (Uni) (Li and Jurafsky,2016)</td><td>27.18</td><td>0.27</td><td>36.62</td><td>0.40</td><td>13.68</td><td>0.10</td></tr><tr><td>Window network (Li and Hovy,2014)</td><td>41.76</td><td>0.59</td><td>50.87</td><td>0.65</td><td>18.67</td><td>0.28</td></tr><tr><td>RNN Decoder</td><td>48.22</td><td>0.67</td><td>52.06</td><td>0.66</td><td>25.79</td><td>0.48</td></tr><tr><td>Proposed model</td><td>51.55</td><td>0.72</td><td>58.06</td><td>0.73</td><td>28.33</td><td>0.51</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 4.3.2 METRICS
|
| 174 |
+
|
| 175 |
+
We use the following metrics to evaluate performance on this task. Accuracy measures how often the absolute position of a sentence was correctly predicted. Being a too stringent measure, it penalizes correctly predicted subsequences that are shifted. Another metric widely used in the literature is Kendall’s tau $\left( \tau \right)$ , computed as $1 - 2 \times$ (number of inversions)/ $\binom { n } { 2 }$ , where the number of inversions is the number of pairs in the predicted sequence with incorrect relative order and $n$ is the length of the sequence. Lapata (2006) discusses that this metric reliably correlates with human judgements.
|
| 176 |
+
|
| 177 |
+
# 4.3.3 BASELINES
|
| 178 |
+
|
| 179 |
+
Entity Grid. Our first baseline is the Entity Grid model of Barzilay and Lapata (2008). We use the Stanford parser (Klein and Manning, 2003) to get constituency trees for all sentences in our datasets. We derive entity grid representations for the parsed sentences using the Brown Coherence Toolkit.3 A ranking SVM is trained to score correct orderings higher than incorrect orderings as in the original work. We used 20 permutations per document as training data. Since the entity grid representation only provides a means of feature extraction we evaluate the model in the ordering setting as follows. We choose 1000 random permutations for each document, one of them being the correct order, and pick the order with maximum coherence. We experimented with transitions of length at most 3 in the entity-grid.
|
| 180 |
+
|
| 181 |
+
Sequence to sequence. The second baseline we consider is a sequence to sequence model which is trained to predict the next sentence given the current sentence. Li and Jurafsky (2016) consider similar methods and our model is same as the uni-directional model in their work. These methods were shown to yield sentence embeddings that have competitive performance in several semantic tasks in Kiros et al. (2015).
|
| 182 |
+
|
| 183 |
+
Window Network. We consider the window approach of Li and Hovy (2014) and Li and Jurafsky (2016) which demonstrated strong performance in the order discrimination task as our third baseline. We adopt the same coherence score interpretation considered by the authors in the above work. In both the above models we consider a special embedding vector which is padded at the beginning of a paragraph and learned during training. This vector allows us to identify the initial few sentences during greedy decoding.
|
| 184 |
+
|
| 185 |
+
RNN Decoder. Another baseline we consider is our proposed model without the encoder. The decoder hidden state is initialized with zeros. We observed that using a special start symbol as for the other baselines helped obtain better performance with this model. However, a start symbol did not help when the model is equipped with an encoder as the hidden state initialization alone was good enough.
|
| 186 |
+
|
| 187 |
+
We do not place emphasis on the particular search algorithm in this work and thus use beam search using the coherence score heuristic for all models. A beam size of 100 was used. During decoding, sentence candidates that have been already chosen are pruned from the beam. All RNNs use a hidden layer size of 1000. For the window network we used a window size of 3 and a hidden layer size of 2000. We initialize all models with pre-trained GloVe word embeddings.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 2: t-SNE embeddings of representations learned by the model for sentences from the test set. The embeddings are color coded by the position of the sentence in the document it appears.
|
| 191 |
+
|
| 192 |
+
# 4.3.4 RESULTS
|
| 193 |
+
|
| 194 |
+
We assess the performance of our model against baseline methods in table 3. The window network performs strongly compared to the other baselines. Our model does better by a significant margin by exploiting global context, demonstrating that global context is important to be successful in this task.
|
| 195 |
+
|
| 196 |
+
While the Entity-Grid model has been fairly successful for the order discrimination task in the past we observe that it fails to discriminate between a large number of candidates. One reason could be that the feature representation is fairly less sensitive to local changes in sentence order (such as swapping adjacent sentences). We did not use coreference resolution for computing the entity-grids due to the computational overhead. This could potentially improve results by a few percentage points. The computational expense of obtaining parse trees and constructing grids on a large amount of data prohibited us from experimenting with this model on the NSF abstracts data.
|
| 197 |
+
|
| 198 |
+
The sequence to sequence model falls short of the window network in performance. Interestingly, Li and Jurafsky (2016) observe that the seq2seq model outperforms the window network in an order discrimination task on wikipedia data. However, the wikipedia data considered in their work has an order of magnitude more data that the datasets considered here, and that could have potentially helped the generative model. These models are also expensive during inference since they involve computing and sampling from word distributions.
|
| 199 |
+
|
| 200 |
+
In Figure 3 we attempt to visualize the sentence representations learned by the sentence encoder in our model. The figure shows 2-dimensional t-SNE embeddings of test set sentences from each of the datasets color coded by their positions in the source abstract. This shows that the model learns high-level structure in the documents, generalizing well to unseen documents. The structure is less apparent in the NSF data which we presume is because of the data diversity and longer documents. While approaches based on the content model of Barzilay and Lee (2004) attempt to explicitly capture topics by discovering clusters in sentences, we observe that the neural approach implicitly discovers such structure.
|
| 201 |
+
|
| 202 |
+
# 4.4 LEARNED SENTENCE REPRESENTATIONS
|
| 203 |
+
|
| 204 |
+
One of the original motivations for this work is the question whether we can learn high quality sentence representations by learning to model text coherence. To address this question we trained our model on a large dataset of paragraphs. We chose the BookCorpus dataset (Kiros et al., 2015) for this purpose. We trained the model with two key changes from the models trained on the abstracts data - 1) In addition to the sentences in the paragraph being considered, we added more contrastive sentences from other paragraphs as well. 2) We use the bilinear scoring function. These techniques helped obtain better representations when training on large amounts of data.
|
| 205 |
+
|
| 206 |
+
To evaluate the quality of the sentence embeddings derived from the model, we use the evaluation pipeline of Kiros et al. (2015) for tasks that involve understanding sentence semantics. These evaluations are performed by training a classifier on top of the embeddings derived from the model so that the performance is indicative of the quality of sentence representations. We consider the semantic relatedness and paraphrase detection tasks. Our results are presented in tables 4a, 4b. Results for only uni-directional versions of different models are discussed here for a reasonable comparison.
|
| 207 |
+
|
| 208 |
+
Table 4: Performance comparison for the semantic similarity (SICK dataset) and paraphrase detection (MSR paraphrase corpus) tasks. In each table the first section shows some best performing supervised methods in the literature. The second section shows models relevant to the skip-thought model. The third section shows our models.
|
| 209 |
+
(a) Sentence similarity
|
| 210 |
+
|
| 211 |
+
<table><tr><td>Method</td><td>r</td><td>p</td><td>MSE</td></tr><tr><td colspan="4">Purely supervised methods</td></tr><tr><td>DT-RNN (Tai et al., 2015)</td><td>0.792</td><td>0.732</td><td>0.382</td></tr><tr><td>LSTM (Tai et al.,2015)</td><td>0.853</td><td>0.791</td><td>0.283</td></tr><tr><td>DT-LSTM (Tai et al.,2015)</td><td>0.868</td><td>0.808</td><td>0.253</td></tr><tr><td colspan="4">Classifier trained on sentence embeddings</td></tr><tr><td>skip-bow (Kiros et al.,2015)</td><td>0.782</td><td>0.724</td><td>0.398</td></tr><tr><td>uni-skip (Kiros et al., 2015)</td><td>0.848</td><td>0.778</td><td>0.287</td></tr><tr><td>Ordering model</td><td>0.807</td><td>0.742</td><td>0.356</td></tr><tr><td>+BoW</td><td>0.842</td><td>0.775</td><td>0.299</td></tr><tr><td>+ uni-skip</td><td>0.860</td><td>0.795</td><td>0.270</td></tr></table>
|
| 212 |
+
|
| 213 |
+
(b) Paraphrase detection
|
| 214 |
+
|
| 215 |
+
<table><tr><td>Method</td><td>Acc F1</td></tr><tr><td>Purely supervised methods</td><td>83.6</td></tr><tr><td>Socher et al. (2011) Madnani et al. (2012) Ji and Eisenstein (2013)</td><td>76.8 77.4 84.1 80.4</td></tr><tr><td> Classifier trained on sentence embeddings</td><td>86.0</td></tr><tr><td>skip-bow (Kiros et al., 2015) uni-skip (Kiros et al., 2015)</td><td>67.8 80.3 73.0 81.9</td></tr><tr><td>Ordering model</td><td>72.3</td></tr><tr><td>+BoW + uni-skip</td><td>81.0 74.0 81.9 74.9 82.5</td></tr></table>
|
| 216 |
+
|
| 217 |
+
Skip-thought vectors are learned by predicting both the previous and next sentences given the current sentence. Following suit, we train two models - one predicting the correct order in the forward direction and another in the backward direction. Note that the sentence level RNN is still unidirectional in both cases. The numbers shown for the ordering model were obtained by concatenating the representations obtained from the two models.
|
| 218 |
+
|
| 219 |
+
Concatenating the above representation with the bag of words representation (using the fine-tuned word embeddings) of the sentence further improves performance4. We believe the reason to be that the ordering model can choose to pay less attention to specific lexical information and instead focus on the high level document structure. Hence the two representations can be seen as capturing complementary semantics. Adding the skip-thought embedding features as well improves performance further.
|
| 220 |
+
|
| 221 |
+
Our model has several key advantages over the skip-thought model. The skip-thought model has a word-level reconstruction objective and requires training with large softmax output layers. This limits the size of the vocabulary and makes training very time consuming (they use a vocabulary size of $2 0 \mathrm { k }$ and report 2 weeks of training). Our model achieves comparable performance and does not have such a word reconstruction component. We are able to train with a large vocabulary of $4 0 0 \mathrm { k }$ words and the above results were obtained with a training time of 2 days.
|
| 222 |
+
|
| 223 |
+
A conceptual issue surrounding word-level reconstruction is that it forces the model to predict both the meaning and syntax of the target sentence. This makes learning difficult since there are numerous ways of expressing the same idea in syntax. In our model we instead let the model discover features from a sentence which are both predictive (of the next sentence) and predictable (from the previous sentences) and interpret these set of features as a meaning representation. We believe this is an important distinction and hope to study these models further in the context of learning syntax independent semantic representations of sentences.
|
| 224 |
+
|
| 225 |
+
# 5 CONCLUSION
|
| 226 |
+
|
| 227 |
+
In this work we considered the challenging problem of coherently organizing a given set of sentences. Our RNN based model performs strongly compared to baseline methods as well as prior work on sentence ordering and order discrimination tasks. We further demonstrated that the model captures high level document structure and learns useful sentence representations when trained on large amounts of data. Our approach to the ordering problem deviates from most prior work that use handcrafted features. However, exploiting linguistic features for next sentence classification can potentially further improve performance on the task. Entity distribution patterns can provide useful features about named entities that are treated as out of vocabulary words. The ordering problem can be further studied at higher level discourse units such as paragraphs, sections and chapters.
|
| 228 |
+
|
| 229 |
+
# REFERENCES
|
| 230 |
+
|
| 231 |
+
Automated scoring of writing quality. URL https://www.ets.org/research/topics/ as_nlp/writing_quality. Accessed: 2016-11-1.
|
| 232 |
+
|
| 233 |
+
R. Barzilay and N. Elhadad. Inferring strategies for sentence ordering in multidocument news summarization. Journal of Artificial Intelligence Research, pages 35–55, 2002.
|
| 234 |
+
|
| 235 |
+
R. Barzilay and M. Lapata. Modeling local coherence: An entity-based approach. Computational Linguistics, 34(1):1–34, 2008.
|
| 236 |
+
|
| 237 |
+
R. Barzilay and L. Lee. Catching the drift: Probabilistic content models, with applications to generation and summarization. arXiv preprint cs/0405039, 2004.
|
| 238 |
+
|
| 239 |
+
J. Burstein, J. Tetreault, and S. Andreyev. Using entity-based features to model coherence in student essays. In Human language technologies: The 2010 annual conference of the North American chapter of the Association for Computational Linguistics, pages 681–684. Association for Computational Linguistics, 2010.
|
| 240 |
+
|
| 241 |
+
X. Chen, X. Qiu, and X. Huang. Neural sentence ordering. arXiv preprint arXiv:1607.06952, 2016.
|
| 242 |
+
|
| 243 |
+
M. Elsner, J. L. Austerweil, and E. Charniak. A unified local and global model for discourse coherence. In HLT-NAACL, pages 436–443, 2007.
|
| 244 |
+
|
| 245 |
+
P. W. Foltz, W. Kintsch, and T. K. Landauer. The measurement of textual coherence with latent semantic analysis. Discourse processes, 25(2-3):285–307, 1998.
|
| 246 |
+
|
| 247 |
+
B. J. Grosz, S. Weinstein, and A. K. Joshi. Centering: A framework for modeling the local coherence of discourse. Computational linguistics, 21(2):203–225, 1995.
|
| 248 |
+
|
| 249 |
+
C. Guinaudeau and M. Strube. Graph-based local coherence modeling. In ACL (1), pages 93–103, 2013.
|
| 250 |
+
|
| 251 |
+
Y. Ji and J. Eisenstein. Discriminative improvements to distributional sentence similarity. In EMNLP, pages 891–896, 2013.
|
| 252 |
+
|
| 253 |
+
Y. Ji, T. Cohn, L. Kong, C. Dyer, and J. Eisenstein. Document context language models. In International Conference on Learning Representations, Poster Paper, volume abs/1511.03962, 2015.
|
| 254 |
+
|
| 255 |
+
D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 256 |
+
|
| 257 |
+
R. Kiros, Y. Zhu, R. R. Salakhutdinov, R. Zemel, R. Urtasun, A. Torralba, and S. Fidler. Skip-thought vectors. In Advances in Neural Information Processing Systems, pages 3276–3284, 2015.
|
| 258 |
+
|
| 259 |
+
D. Klein and C. D. Manning. Accurate unlexicalized parsing. In Proceedings of the 41st Annual Meeting on Association for Computational Linguistics-Volume 1, pages 423–430. Association for Computational Linguistics, 2003.
|
| 260 |
+
|
| 261 |
+
M. Lapata. Probabilistic text structuring: Experiments with sentence ordering. In Proceedings of the 41st Annual Meeting on Association for Computational Linguistics-Volume 1, pages 545–552. Association for Computational Linguistics, 2003.
|
| 262 |
+
|
| 263 |
+
M. Lapata. Automatic evaluation of information ordering: Kendall’s tau. Computational Linguistics, 32(4):471–484, 2006.
|
| 264 |
+
|
| 265 |
+
J. Li and E. H. Hovy. A model of coherence based on distributed sentence representation. In EMNLP, pages 2039–2048, 2014.
|
| 266 |
+
|
| 267 |
+
J. Li and D. Jurafsky. Neural net models for open-domain discourse coherence. arXiv preprint arXiv:1606.01545, 2016.
|
| 268 |
+
J. Li, X. Chen, E. Hovy, and D. Jurafsky. Visualizing and understanding neural models in nlp. arXiv preprint arXiv:1506.01066, 2015a.
|
| 269 |
+
J. Li, M.-T. Luong, and D. Jurafsky. A hierarchical neural autoencoder for paragraphs and documents. arXiv preprint arXiv:1506.01057, 2015b.
|
| 270 |
+
M. Lichman. UCI machine learning repository, 2013. URL http://archive.ics.uci.edu/ ml.
|
| 271 |
+
R. Lin, S. Liu, M. Yang, M. Li, M. Zhou, and S. Li. Hierarchical recurrent neural network for document modeling. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 899–907, 2015.
|
| 272 |
+
A. Louis and A. Nenkova. A coherence model based on syntactic patterns. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pages 1157–1168. Association for Computational Linguistics, 2012.
|
| 273 |
+
N. Madnani, J. Tetreault, and M. Chodorow. Re-examining machine translation metrics for paraphrase identification. In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 182–190. Association for Computational Linguistics, 2012.
|
| 274 |
+
E. Miltsakaki and K. Kukich. Evaluation of text coherence for electronic essay scoring systems. Natural Language Engineering, 10(01):25–55, 2004.
|
| 275 |
+
J. Pennington, R. Socher, and C. D. Manning. Glove: Global vectors for word representation. In EMNLP, volume 14, pages 1532–43, 2014.
|
| 276 |
+
D. R. Radev, M. T. Joseph, B. Gibson, and P. Muthukrishnan. A Bibliometric and Network Analysis of the field of Computational Linguistics. Journal of the American Society for Information Science and Technology, 2009.
|
| 277 |
+
R. Socher, E. H. Huang, J. Pennin, C. D. Manning, and A. Y. Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection. In Advances in Neural Information Processing Systems, pages 801–809, 2011.
|
| 278 |
+
R. Soricut and D. Marcu. Discourse generation using utility-trained coherence models. In Proceedings of the COLING/ACL on Main conference poster sessions, pages 803–810. Association for Computational Linguistics, 2006.
|
| 279 |
+
I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112, 2014.
|
| 280 |
+
K. S. Tai, R. Socher, and C. D. Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075, 2015.
|
| 281 |
+
O. Vinyals, S. Bengio, and M. Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015a.
|
| 282 |
+
O. Vinyals, M. Fortunato, and N. Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pages 2674–2682, 2015b.
|
| 283 |
+
|
| 284 |
+
Table 5: Visualizing salient words.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>In this paper,we propose a new method for semantic class induction . First ,we introduce a generative model of sentences ,based on dependency trees and which takes into account homonymy Our model can thus be seen as a generalization of Brown clustering . Second , we describe an efficient algorithm to perform inference and learning in this model . Third ,we apply our proposed method on two large datasets (108 tokens ,105 words types ),and demonstrate that classes induced by our algorithm improve performance over Brown clustering on the task of semisupervised supersense tagging and named entity recognition .</td></tr><tr><td>Representation learning is a promising technique for discovering features that allow supervised classifiers to generalize from a source domain dataset to arbitrary new domains We present a novel, formal statement of the representation learning task . We argue that because the task is computationally intractable in general,it is important for arepresentation learner to be able to incorporate expert knowledge during its search for helpful features . Leveraging the Posterior Regularization framework ,we develop an architecture for incorporating biases into</td></tr><tr><td>learners identify significantly better sets offeatures than unbiased learners,resulting inarelative reduction in error of more than 16% forboth tasks ,with respect to existing state-of-the-art representation learning techniques. We present an approach for detecting salient (important)dates in texts in order to automatically build event timelines from a search query(e.g . the name of an event or person,etc .). This work was carried out on a corpus of newswire texts in English provided by the Agence France Presse</td></tr><tr><td>(AFP). In order to extract salient dates that warrant inclusion in an event timeline ,we first recognize and normalize temporal expressons in texts and then use a machine-learning approach to extract salient dates that relate to a particular topic . We focused only on extracting the dates and not the events to which they are related . The paper aims to come up with a system that examines the degree of semantic equivalence between two</td></tr><tr><td>sentences. At the core of the paper is the attempt to grade the similarity of two sentences by finding the maximal weighted bipartite match between the tokens of the two sentences . The tokens include single words,or multiwords in case of Named Entitites ,adjectivally and numerically modified words. Two token similarity measures are used for the task -WordNet based similarity,and a statistical word similarity</td></tr></table>
|
| 287 |
+
|
| 288 |
+
# A WORD INFLUENCE
|
| 289 |
+
|
| 290 |
+
We attempt to understand what text level clues the model captures to perform the ordering task. Some techniques for visualizing neural network models in the context of text applications are discussed in Li et al. (2015a). Drawing inspiration from this work, we use gradients of prediction decisions with respect to the words of the correct sentence as a proxy for the salience of each word.
|
| 291 |
+
|
| 292 |
+
For each time step during decoding we do the following. Assume the sentence assignments for all previous time steps have been correct. let $h$ be the current hidden state in this setting and $s = ( w _ { 1 } , . . . , w _ { n } )$ be the correct next sentence candidate, the $w _ { i }$ being its words. The score for this sentence is defined as $e = f ( s , h )$ (See equation 7). The importance of word $w _ { i }$ in predicting $s$ as the correct next sentence is interpreted as $\big | \big | \frac { \partial e } { \partial w _ { i } } \big | \big |$ . We assume $h$ to be fixed and only backpropagate gradients through the sentence encoder.
|
| 293 |
+
|
| 294 |
+
Table 5 shows visualizations of a few selected abstracts. Words expressed in darker shades correspond to higher gradient norms. In the first example the model seems to be using the word clues ‘first’, ‘second’ and ‘third’. A similar observation was made by Chen et al. (2016) in their experiments. In the second example we observe that the model has paid attention to phrases such as ‘We present’, ‘We argue’ which are typical of abstract texts. The model has also focused on the word ‘representation’
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
(b) Accuracy of predicting the correct sentence at a given position.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure 3: Performance with respect to paragraph length and sentence position - NIPS abstracts test data.
|
| 301 |
+
|
| 302 |
+
(a) $\tau$ scores of order predictions on paragraphs of a given length.
|
| 303 |
+
|
| 304 |
+
appearing in the first two sentences. Similarly in the third example, the words ‘salient’ and ‘dates’ have been attended to. In the last example, the words ‘token’, ‘tokens’, ‘tokenization’ have received attention. We believe that these observations link to ideas from centering theory which state that entity distributions in coherent discourses adhere to certain patterns. The model has implicitly learned learned these patterns with no syntax annotations or handcrafted features.
|
| 305 |
+
|
| 306 |
+
# B PERFORMANCE ANALYSIS
|
| 307 |
+
|
| 308 |
+
Figure 3a shows the average $\tau$ for the models on the NIPS abstracts test set for a given paragraph length. The performance of local approaches dies down fairly quickly as we can expect and face difficulties handling lengthy paragraphs. Our model attempts to maintain consistent performance with increasing paragraph size with a more gradual decline in performance.
|
| 309 |
+
|
| 310 |
+
Figure 3b compares the average prediction accuracy for a given sentence position in the test set. It is interesting to observe that all models fair well in predicting the first sentence. The greedy decoding procedure also contributes to the decline in performance as we move right. Our model remains more robust compared to the other two methods.
|
| 311 |
+
|
| 312 |
+
Another trend to be observed is that as the context size increases (2 for next sentence generation, 3 for window network, complete sentential history for our model) the performance decline is more gradual.
|
| 313 |
+
|
| 314 |
+
(a) Classify 1 of 2 - Accuracy
|
| 315 |
+
|
| 316 |
+
<table><tr><td></td><td>NIPS</td><td>AAN</td><td>NSF</td></tr><tr><td>Entity Grid</td><td>0.712</td><td>0.660</td><td>=</td></tr><tr><td>Seq2seq (Uni)</td><td>0.890</td><td>0.888</td><td></td></tr><tr><td>Window network</td><td>0.944</td><td>0.942</td><td>0.936</td></tr><tr><td>RNNDecoder</td><td>0.964</td><td>0.952</td><td>0.972</td></tr><tr><td>Proposed model</td><td>0.970</td><td>0.955</td><td>0.982</td></tr></table>
|
| 317 |
+
|
| 318 |
+
(b) Classify 1 of 100 - Accuracy
|
| 319 |
+
|
| 320 |
+
<table><tr><td></td><td>NIPS</td><td>AAN</td><td>NSF</td></tr><tr><td>Entity Grid</td><td>0.070</td><td>0.102</td><td>=</td></tr><tr><td>Seq2seq (Uni)</td><td>0.171</td><td>0.290</td><td>=</td></tr><tr><td>Window network</td><td>0.385</td><td>0.470</td><td>0.300</td></tr><tr><td>RNN Decoder</td><td>0.516</td><td>0.541</td><td>0.647</td></tr><tr><td>Proposed model</td><td>0.566</td><td>0.581</td><td>0.710</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Table 7: Accuracy (of predicting sentence position) and $\tau$ metrics for the 1 of 100 classification task.
|
| 323 |
+
|
| 324 |
+
<table><tr><td rowspan="2"></td><td colspan="2">NIPS Abstracts</td><td colspan="2">AAN Abstracts</td><td colspan="2">NSF Abstracts</td></tr><tr><td>Accuracy</td><td>T</td><td>Accuracy</td><td>T</td><td>Accuracy</td><td>T</td></tr><tr><td>Entity Grid</td><td>21.30</td><td>0.12</td><td>23.22</td><td>0.11</td><td></td><td></td></tr><tr><td>Seq2seq (Uni)</td><td>38.36</td><td>0.40</td><td>48.47</td><td>0.50</td><td>=</td><td>=</td></tr><tr><td>Window network</td><td>59.20</td><td>0.67</td><td>64.02</td><td>0.71</td><td>44.65</td><td>0.46</td></tr><tr><td>RNN Decoder</td><td>67.05</td><td>0.73</td><td>68.54</td><td>0.74</td><td>79.01</td><td>0.76</td></tr><tr><td>Proposed model</td><td>72.25</td><td>0.79</td><td>72.25</td><td>0.77</td><td>83.85</td><td>0.81</td></tr></table>
|
| 325 |
+
|
| 326 |
+
# C ADDITIONAL EXPERIMENTAL RESULTS
|
| 327 |
+
|
| 328 |
+
# C.1 CLASSIFICATION EXPERIMENTS FOR ABSTRACTS DATA
|
| 329 |
+
|
| 330 |
+
Classify 1 of 2 (Pairwise ranking). We create a random permutation for each document (different from the correct order) and compute the pairwise classification accuracy. The mean result over 100 such experiments is reported in table 6a.
|
| 331 |
+
|
| 332 |
+
Classify 1 of N. In this experiment we consider a pool of $\Nu = 1 0 0$ permutations where one of them is the correct order and the rest are random permutations. We compute coherence scores of all orderings in the pool and pick the best one. Table 6b reports how accurately each model identified the correct order. Table 7 computes the same metrics in table 3 for the orders that were chosen by the model.
|
| 333 |
+
|
| 334 |
+
The performance gaps are not significant for the first experiment. However, they are more pronounced in the second experiment. The reason is because in the binary classification setting, a majority of the permutations will be very different from the correct order, and the models can discriminate well for these cases. However, when choosing from a large set of permutations the models need to be sensitive to permutations which deviate from the correct ordering by a small amount (Eg: only two sentences out of place from correct order). Models incapable of discriminating at this finer level perform tend to perform poorly.
|
| 335 |
+
|
| 336 |
+
Note that the second experiment is closer to the practical task of finding an appropriate presentation ordering for a given collection of sentences, while taking the decoding algorithm out of the picture.
|
| 337 |
+
|
| 338 |
+
# C.2 ORDER DISCRIMINATION - PENN TREEBANK DATASET
|
| 339 |
+
|
| 340 |
+
We perform order discrimination experiments on the Penn Treebank dataset. The experimental protocol is identical to that of Ji et al. (2015). The standard train, dev, test split was used. The vocabulary comprises the most 10,000 frequent words and an additional special symbol representing low frequency words. A bootstrapping procedure is used for evaluation - 1000 test sets are generated by randomly sampling with replacement 155 documents from the test set and constructing a random permutation different from the correct order for each sampled document. We used the same model hyperparameters described in section 4.1. We did not use pre-trained word embeddings for fair comparison with the reference method. Performance statistics are computed over the 1000 bootstrapped test sets. Table 8 shows a performance comparison.
|
| 341 |
+
|
| 342 |
+
A key difference of this dataset compared to the other datasets is that the documents are more open domain and they are significantly longer. Our model performs strongly despite these differences.
|
| 343 |
+
|
| 344 |
+
Table 8: Order discrimination on PTB dataset. Reference results re-printed from Ji et al. (2015).
|
| 345 |
+
|
| 346 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Accuracy</td></tr><tr><td>Mean (%)</td><td>Standard deviation (%)</td></tr><tr><td>Hierarchical RNNLM (Lin et al., 2015)</td><td>75.32</td><td>4.42</td></tr><tr><td>DCLM (Ji et al., 2015)</td><td>83.26</td><td>3.77</td></tr><tr><td>Proposed model</td><td>90.25</td><td>2.38</td></tr></table>
|
| 347 |
+
|
| 348 |
+
Table 9: Impact of using contrastive sentences and the bilinear scoring function for learning sentence representations.
|
| 349 |
+
|
| 350 |
+
<table><tr><td rowspan="2">Contrastive Sentences</td><td rowspan="2">Scoring Function</td><td colspan="3">Semantic Relatedness</td><td colspan="2">Paraphrase detection</td></tr><tr><td>r</td><td>p</td><td>MSE</td><td>Acc</td><td>F1</td></tr><tr><td>No</td><td>MLP</td><td>0.631</td><td>0.568</td><td>0.613</td><td>0.687</td><td>0.791</td></tr><tr><td>No</td><td>Bilinear</td><td>0.650</td><td>0.609</td><td>0.588</td><td>0.681</td><td>0.785</td></tr><tr><td>Yes</td><td>MLP</td><td>0.718</td><td>0.648</td><td>0.494</td><td>0.689</td><td>0.785</td></tr><tr><td>Yes</td><td>Bilinear</td><td>0.787</td><td>0.727</td><td>0.387</td><td>0.712</td><td>0.804</td></tr></table>
|
| 351 |
+
|
| 352 |
+
# C.3 SENTENCE REPRESENTATION LEARNING TASK
|
| 353 |
+
|
| 354 |
+
We briefly discussed two techniques in section 4.4 that helped obtain better sentence representations.
|
| 355 |
+
|
| 356 |
+
• Adding contrastive sentence candidates for the decoder • The bilinear scoring function
|
| 357 |
+
|
| 358 |
+
Table 9 shows results of ablative experiments which demonstrate the effect of these ideas. Each experimental setting indicates whether or not contrastive sentences were used and the type of scoring function employed. Note that these models were trained to predict the correct order of sentences only in the forward direction (as opposed to the results reported in table 4 where two models were trained to predict the order in the forward and backward directions and the representations were concatenated). Models were chosen using the validation set of the relevant task.
|
| 359 |
+
|
| 360 |
+
We observe the trend that adding contrastive sentences or switching from the MLP to the bilinear scoring function produces a sharp improvement in the result for the semantic relatedness task. Although the performance differences are less significant in the paraphrase detection task when the individual factors are changed, we observe an overall performance gain by using contrastive sentences and the bilinear scoring function.
|
| 361 |
+
|
| 362 |
+
This confirms our intuition that adding contrastive sentences makes the task more challenging and leads to better representations being learned. Similarly, the bilinear scoring function takes a generative approach of trying to regress the next sentence as opposed to the MLP scoring function which treats the prediction task as purely discriminative, and hence encourages the learning of better representations.
|
| 363 |
+
|
| 364 |
+
# D MODEL DETAILS
|
| 365 |
+
|
| 366 |
+
The LSTM update in equation 1 of the paper
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
h _ { t } , c _ { t } = L S T M ( h _ { t - 1 } , c _ { t - 1 } )
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
is as follows.
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\begin{array} { r l } & { i _ { t } = \sigma \big ( W _ { i } h _ { t - 1 } + b _ { i } \big ) } \\ & { f _ { t } = \sigma \big ( W _ { f } h _ { t - 1 } + b _ { f } \big ) } \\ & { o _ { t } = \sigma \big ( W _ { o } h _ { t - 1 } + b _ { o } \big ) } \\ & { \hat { c } _ { t } = \mathrm { t a n h } \big ( W _ { c } h _ { t - 1 } + b _ { c } \big ) } \\ & { c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot \hat { c } _ { t } } \\ & { h _ { t } = o _ { t } \odot \mathrm { t a n h } \big ( c _ { t } \big ) } \end{array}
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
where $W _ { \{ i , f , o , c \} } , b _ { \{ i , f , o , c \} }$ are learnable parameters.
|
| 379 |
+
|
| 380 |
+
The LSTM update in equation 6
|
| 381 |
+
|
| 382 |
+
is given by the following.
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
h _ { t } , c _ { t } = L S T M ( h _ { t - 1 } , c _ { t - 1 } , x _ { t - 1 } )
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array} { r l } & { i _ { t } = \sigma \big ( W _ { h i } h _ { t - 1 } + W _ { x i } x _ { t - 1 } + b _ { i } \big ) } \\ & { f _ { t } = \sigma \big ( W _ { h f } h _ { t - 1 } + W _ { x f } x _ { t - 1 } + b _ { f } \big ) } \\ & { o _ { t } = \sigma \big ( W _ { h o } h _ { t - 1 } + W _ { x o } x _ { t - 1 } + b _ { o } \big ) } \\ & { \hat { c } _ { t } = \mathrm { t a n h } \big ( W _ { h c } h _ { t - 1 } + W _ { x c } x _ { t - 1 } + b _ { c } \big ) } \\ & { c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot \hat { c } _ { t } } \\ & { h _ { t } = o _ { t } \odot \mathrm { t a n h } \big ( c _ { t } \big ) } \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
where $W _ { \{ h i , h f , h o , h c \} } , W _ { \{ x i , x f , x o , x c \} } , b _ { \{ i , f , o , c \} }$ are learnable parameters.
|
md/train/S1ANxQW0b/S1ANxQW0b.md
ADDED
|
@@ -0,0 +1,747 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MAXIMUM A POSTERIORI POLICY OPTIMISATION
|
| 2 |
+
|
| 3 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos,
|
| 4 |
+
Nicolas Heess, Martin Riedmiller
|
| 5 |
+
DeepMind, London, UK
|
| 6 |
+
{aabdolmaleki,springenberg,tassa,munos,heess,riedmiller}@google.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
We introduce a new algorithm for reinforcement learning called Maximum aposteriori Policy Optimisation (MPO) based on coordinate ascent on a relativeentropy objective. We show that several existing methods can directly be related to our derivation. We develop two off-policy algorithms and demonstrate that they are competitive with the state-of-the-art in deep reinforcement learning. In particular, for continuous control, our method outperforms existing methods with respect to sample efficiency, premature convergence and robustness to hyperparameter settings.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Model free reinforcement learning algorithms can acquire sophisticated behaviours by interacting with the environment while receiving simple rewards. Recent experiments (Mnih et al., 2015; Jaderberg et al., 2016; Heess et al., 2017) successfully combined these algorithms with powerful deep neural-network approximators while benefiting from the increase of compute capacity.
|
| 15 |
+
|
| 16 |
+
Unfortunately, the generality and flexibility of these algorithms comes at a price: They can require a large number of samples and – especially in continuous action spaces – suffer from high gradient variance. Taken together these issues can lead to unstable learning and/or slow convergence. Nonetheless, recent years have seen significant progress, with improvements to different aspects of learning algorithms including stability, data-efficiency and speed, enabling notable results on a variety of domains, including locomotion (Heess et al., 2017; Peng et al., 2016), multi-agent behaviour (Bansal et al., 2017) and classical control (Duan et al., 2016).
|
| 17 |
+
|
| 18 |
+
Two types of algorithms currently dominate scalable learning for continuous control problems: First, Trust-Region Policy Optimisation (TRPO; Schulman et al. 2015) and the derivative family of Proximal Policy Optimisation algorithms (PPO; Schulman et al. 2017b). These policy-gradient algorithms are on-policy by design, reducing gradient variance through large batches and limiting the allowed change in parameters. They are robust, applicable to high-dimensional problems, and require moderate parameter tuning, making them a popular first choice (Ho & Ermon, 2016). However, as on-policy algorithms, they suffer from poor sample efficiency.
|
| 19 |
+
|
| 20 |
+
In contrast, off-policy value-gradient algorithms such as the Deep Deterministic Policy Gradient (DDPG, Silver et al. 2014; Lillicrap et al. 2016), Stochastic Value Gradient (SVG, Heess et al. 2015), and the related Normalized Advantage Function formulation (NAF, Gu et al. 2016b) rely on experience replay and learned (action-)value functions. These algorithms exhibit much better data efficiency, approaching the regime where experiments with real robots are possible (Gu et al., 2016a; Andrychowicz et al., 2017). While also popular, these algorithms can be difficult to tune, especially for high-dimensional domains like general robot manipulation tasks.
|
| 21 |
+
|
| 22 |
+
In this paper we propose a novel off-policy algorithm that benefits from the best properties of both classes. It exhibits the scalability, robustness and hyperparameter insensitivity of on-policy algorithms, while offering the data-efficiency of off-policy, value-based methods.
|
| 23 |
+
|
| 24 |
+
To derive our algorithm, we take advantage of the duality between control and estimation by using Expectation Maximisation (EM), a powerful tool from the probabilistic estimation toolbox, in order to solve control problems. This duality can be understood as replacing the question “what are the actions which maximise future rewards?” with the question “assuming future success in maximising rewards, what are the actions most likely to have been taken?”. By using this estimation objective we have more control over the policy change in both E and M steps, yielding robust learning. We show below that several algorithms, including TRPO, can be directly related to this perspective. We leverage the fast convergence properties of EM-style coordinate ascent by alternating a nonparametric data-based E-step which re-weights state-action samples, with a supervised, parametric M-step using deep neural networks.
|
| 25 |
+
|
| 26 |
+
We evaluate our algorithm on a broad spectrum of continuous control problems including a 56 DoF humanoid body. All experiments used the same optimisation hyperparameters 1. Our algorithm shows remarkable data efficiency often solving the tasks we consider an order of magnitude faster than the state-of-the-art. A video of some resulting behaviours can be found here dropbox.com/s/pgcmjst7t0zwm4y/MPO.mp4.
|
| 27 |
+
|
| 28 |
+
# 2 BACKGROUND AND NOTATION
|
| 29 |
+
|
| 30 |
+
# 2.1 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Casting Reinforcement Learning (RL) as an inference problem has a long history dating back at least two decades (Dayan & Hinton, 1997). The framework presented here is inspired by a variational inference perspective on RL that has previously been utilised in multiple studies; c.f. Dayan & Hinton (1997); Neumann (2011); Deisenroth et al. (2013); Rawlik et al. (2012); Levine & Koltun (2013); Florensa et al. (2017).
|
| 33 |
+
|
| 34 |
+
Particular attention has been paid to obtaining maximum entropy policies as the solution to an inference problem. The penalisation of determinism can be seen encouraging both robustness and simplicity. Among these are methods that perform trajectory optimisation using either linearised dynamics (Todorov, 2008; Toussaint, 2009; Levine & Koltun, 2013) or general dynamics as in path integral control (Kappen, 2005; Theodorou et al., 2010). In contrast to these algorithms, here we do not assume the availability of a transition model and avoid on-policy optimisation. A number of other authors have considered the same perspective but in a model-free RL setting (Neumann, 2011; Peters et al., 2010a; Florensa et al., 2017; Daniel et al., 2016) or inverse RL problems (Ziebart et al., 2008). These algorithms are more directly related to our work and can be cast in the same (EM-like) alternating optimisation scheme on which we base our algorithm. However, they typically lack the maximisation (M)-step – with the prominent exception of REPS, AC-REPS, $\mathrm { P \bar { I } ^ { 2 } }$ -GPS and MDGPS (Peters et al., 2010a; Wirth et al., 2016; Chebotar et al., 2016; Montgomery & Levine, 2016) to which our algorithm is closely related as outlined below. An interesting recent addition to these approaches is an EM-perspective on the PoWER algorithm (Roux, 2016) which uses the same iterative policy improvement employed here, but commits to parametric inference distributions and avoids an exponential reward transformation, resulting in a harder to optimise lower bound.
|
| 35 |
+
|
| 36 |
+
As an alternative to these policy gradient inspired algorithms, the class of recent algorithms for soft Q-learning (e.g. Rawlik et al. (2012); Haarnoja et al. (2017); Fox et al. (2016) parameterise and estimate a so called “soft” Q-function directly, implicitly inducing a maximum entropy policy. A perspective that can also be extended to hierarchical policies (Florensa et al., 2017), and has recently been used to establish connections between Q-learning and policy gradient methods (O’Donoghue et al., 2016; Schulman et al., 2017a). In contrast, we here rely on a parametric policy, our bound and derivation is however closely related to the definition of the soft (entropy regularised) Q-function.
|
| 37 |
+
|
| 38 |
+
A line of work, that is directly related to the “RL as inference” perspective, has focused on using information theoretic regularisers such as the entropy of the policy or the Kullback-Leibler divergence (KL) between policies to stabilise standard RL objectives. In fact, most state-of-the-art policy gradient algorithms fall into this category. For example see the entropy regularization terms used in Mnih et al. (2016) or the KL constraints employed by work on trust-region based methods (Schulman et al., 2015; 2017b; Gu et al., 2017; Wang et al., 2017). The latter methods introduce a trust region constraint, defined by the KL divergence between the new policy and the old policy, so that the expected KL divergence over state space is bounded. From the perspective of this paper these trust-region based methods can be seen as optimising a parametric E-step, as in our algorithm, but are “missing” an explicit M-step.
|
| 39 |
+
|
| 40 |
+
Finally, the connection between RL and inference has been invoked to motivate work on exploration. The most prominent examples for this are formed by work on Boltzmann exploration such as Kaelbling et al. (1996); Perkins & Precup (2002); Sutton (1990); O’Donoghue et al. (2017), which can be connected back to soft Q-learning (and thus to our approach) as shown in Haarnoja et al. (2017).
|
| 41 |
+
|
| 42 |
+
# 2.2 MARKOV DECISION PROCESSES
|
| 43 |
+
|
| 44 |
+
We consider the problem of finding an optimal policy $\pi$ for a discounted reinforcement learning (RL) problem; formally characterized by a Markov decision process (MDP). The MDP consists of: continuous states $s$ , actions $a$ , transition probabilities $p ( s _ { t + 1 } | s _ { t } , a _ { t } )$ – specifying the probability of transitioning from state $s _ { t }$ to $s _ { t + 1 }$ under action $a _ { t } \textrm { -- }$ , a reward function $r ( s , a ) \in \mathbb { R }$ as well as the discounting factor $\gamma \in [ 0 , 1 )$ . The policy $\pi ( a | s , \theta )$ (with parameters $\pmb { \theta }$ ) is assumed to specify a probability distribution over action choices given any state and – together with the transition probabilities – gives rise to the stationary distribution $\mu _ { \pi } ( s )$ .
|
| 45 |
+
|
| 46 |
+
Using these basic quantities we can now define the notion of a Markov sequence or trajec$\overline { { \tau } } _ { \pi } ~ = ~ \{ ( s _ { 0 } , a _ { 0 } ) \} \ldots ( s _ { T } , a _ { T } ) \}$ by following the policy ; and the expected return $\pi$ $\begin{array} { r } { \tau _ { \pi } ~ \sim ~ p _ { \pi } ( \tau ) } \end{array}$ with. We $\begin{array} { r } { p _ { \pi } ( \tau ) = p ( s _ { 0 } ) \prod _ { t > 0 } p ( s _ { t + 1 } \vert s _ { t } , a _ { t } ) \pi ( a _ { t } \vert s _ { t } ) ; } \end{array}$ $\begin{array} { r } { \mathbb { E } _ { \tau _ { \pi } } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , s _ { t } ) ] } \end{array}$ will use the shorthand $r _ { t } = r ( s _ { t } , a _ { t } )$ .
|
| 47 |
+
|
| 48 |
+
# 3 MAXIMUM A POSTERIORI POLICY OPTIMISATION
|
| 49 |
+
|
| 50 |
+
Our approach is motivated by the well established connection between RL and probabilistic inference. This connection casts the reinforcement learning problem as that of inference in a particular probabilistic model. Conventional formulations of RL aim to find a trajectory that maximizes expected reward. In contrast, inference formulations start from a prior distribution over trajectories, condition a desired outcome such as achieving a goal state, and then estimate the posterior distribution over trajectories consistent with this outcome.
|
| 51 |
+
|
| 52 |
+
A finite-horizon undiscounted reward formulation can be cast as inference problem by constructing a suitable probabilistic model via a likelihood function $p ( O = 1 | \tau ) \propto \mathrm { e x p } ( \Sigma _ { t } r _ { t } / \alpha )$ , where $\alpha$ is a temperature parameter. Intuitively, $O$ can be interpreted as the event of obtaining maximum reward by choosing an action; or the event of succeeding at the RL task (Toussaint, 2009; Neumann, 2011). With this definition we can define the following lower bound on the likelihood of optimality for the policy $\pi$ :
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { l } { \displaystyle \log p _ { \pi } ( O = 1 ) = \log \int p _ { \pi } ( \tau ) p ( O = 1 | \tau ) d \tau \geq \int q ( \tau ) \big [ \log p ( O = 1 | \tau ) + \log \frac { p _ { \pi } ( \tau ) } { q ( \tau ) } \big ] d \tau } \\ { \displaystyle \qquad = \mathbb { E } _ { q } \Big [ \sum _ { t } r _ { t } / \alpha \Big ] - \mathrm { K L } \Big ( q ( \tau ) | | p _ { \pi } ( \tau ) \Big ) = \mathcal { I } ( q , \pi ) , } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $p _ { \pi }$ is the trajectory distribution induced by policy $\pi ( a | s )$ as described in section 2.2 and $q ( \tau )$ is an auxiliary distribution over trajectories that will discussed in more detail below. The lower bound $\mathcal { I }$ is the evidence lower bound (ELBO) which plays an important role in the probabilistic modeling literature. It is worth already noting here that optimizing (2) with respect to $q$ can be seen as a regularized RL problem.
|
| 59 |
+
|
| 60 |
+
An important motivation for transforming a RL problem into an inference problem is that this allows us draw from the rich toolbox of inference methods: For instance, $\mathcal { I }$ can be optimized with the familiy of expectation maximization (EM) algorithms which alternate between improving $\mathcal { I }$ with respect to $q$ and $\pi$ . In this paper we follow classical (Dayan & Hinton, 1997) and more recent works (e.g. Peters et al. 2010b; Levine & Koltun 2013; Daniel et al. 2016; Wirth et al. 2016) and cast policy search as a particular instance of this family. Our algorithm then combines properties of existing approaches in this family with properties of recent off-policy algorithms for neural networks.
|
| 61 |
+
|
| 62 |
+
The algorithm alternates between two phases which we refer to as E and M step in reference to an EM-algorithm. The E-step improves $\mathcal { I }$ with respect to $q$ . Existing EM policy search approaches perform this step typically by reweighting trajectories with sample returns (Kober & Peters, 2009) or via local trajectory optimization (Levine & Koltun, 2013). We show how off-policy deep RL techniques and value-function approximation can be used to make this step both scalable as well as data efficient. The M-step then updates the parametric policy in a supervised learning step using the reweighted state-action samples from the E-step as targets.
|
| 63 |
+
|
| 64 |
+
These choices lead to the following desirable properties: (a) low-variance estimates of the expected return via function approximation; (b) low-sample complexity of value function estimate via robust off-policy learning; (c) minimal parametric assumption about the form of the trajectory distribution in the E-step; (d) policy updates via supervised learning in the M step; (e) robust updates via hard trust-region constraints in both the E and the M step.
|
| 65 |
+
|
| 66 |
+
# 3.1 POLICY IMPROVEMENT
|
| 67 |
+
|
| 68 |
+
The derivation of our algorithm then starts from the infinite-horizon analogue of the KL-regularized expected reward objective from Equation (2). In particular, we consider variational distributions $q ( \tau )$ that factor in the same way as $p _ { \pi }$ , i.e. $\begin{array} { r } { q ( \tau ) = \bar { p } ( s _ { 0 } ) \prod _ { t > 0 } p ( s _ { t + 1 } | s _ { t } , a _ { t } ) q ( a _ { t } | s _ { t } ) } \end{array}$ which yields:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathcal { I } ( \boldsymbol { q } , \theta ) = \mathbb { E } _ { \boldsymbol { q } } \Big [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \big [ r _ { t } - \alpha \mathbf { K L } \big ( \boldsymbol { q } ( \boldsymbol { a } | s _ { t } ) \| \pi ( \boldsymbol { a } | s _ { t } , \theta ) \big ) \big ] \Big ] + \log p ( \theta ) .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Note that due to the assumption about the structure of $q ( \tau )$ the $\mathrm { K L }$ over trajectories decomposes into a KL over the individual state-conditional action distributions. This objective has also been considered e.g. by Haarnoja et al. (2017); Schulman et al. (2017a). The additional $\log p ( \pmb \theta )$ term is a prior over policy parameters and can be motivated by a maximum a-posteriori estimation problem (see appendix for more details).
|
| 75 |
+
|
| 76 |
+
We also define the regularized Q-value function associated with (3) as
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
Q _ { \theta } ^ { q } ( s , a ) = r _ { 0 } + \mathbb { E } _ { q ( \tau ) , s _ { 0 } = s , a _ { 0 } = a } \left[ \sum _ { t \geq 1 } ^ { \infty } \gamma ^ { t } \big [ r _ { t } - \alpha \mathrm { K L } ( q _ { t } \| \pi _ { t } ) \big ] \right] ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
with $\mathrm { K L } \big ( q _ { t } | | \pi _ { t } \big ) = \mathrm { K L } \big ( q ( a | s _ { t } ) \big ) \| \pi ( a | s _ { t } , \pmb { \theta } ) \big )$ . Note that $\mathrm { K L } \big ( q _ { 0 } | | \pi _ { 0 } \big )$ and $p ( \theta )$ are not part of the Q-function as they are not a function of the action.
|
| 83 |
+
|
| 84 |
+
We observe that optimizing $\mathcal { I }$ with respect to $q$ is equivalent to solving an expected reward RL problem with augmented reward $\begin{array} { r } { \tilde { r } _ { t } = r _ { t } - \alpha \log \frac { q ( a _ { t } | s _ { t } ) } { \pi ( a _ { t } | s _ { t } , \pmb { \theta } ) } } \end{array}$ . In this view $\pi$ represents a default policy towards which $q$ is regularized – i.e. the current best policy. The MPO algorithm treats $\pi$ as the primary object of interest. In this case $q$ serves as an auxiliary distribution that allows optimizing $\mathcal { I }$ via alternate coordinate ascent in $q$ and $\pi _ { \pmb { \theta } }$ , analogous to the expectation-maximization algorithm in the probabilistic modelling literature. In our case, the E-step optimizes $\mathcal { I }$ with respect to $q$ while the M-step optimizes $\mathcal { I }$ with respect to $\pi$ . Different optimizations in the $\mathrm { E }$ -step and M-step lead to different algorithms. In particular, we note that for the case where $p ( \pmb \theta )$ is an uninformative prior a variant of our algorithm has a monotonic improvement guarantee as show in the Appendix A.
|
| 85 |
+
|
| 86 |
+
# 3.2 E-STEP
|
| 87 |
+
|
| 88 |
+
In the E-step of iteration $i$ we perform a partial maximization of $\mathcal { I } ( \boldsymbol { q } , \boldsymbol { \theta } )$ with respect to $q$ given $\theta = \theta _ { i }$ . We start by setting $q = \pi _ { \pmb { \theta } _ { i } }$ and estimate the unregularized action-value function:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
Q _ { \theta _ { i } } ^ { q } ( s , a ) = Q _ { \theta _ { i } } ( s , a ) = \mathbb { E } _ { \tau _ { \pi _ { i } } , s _ { 0 } = s , a _ { 0 } = a } \left[ \sum _ { t } ^ { \infty } \gamma ^ { t } r _ { t } \right] ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
since $\mathrm { K L } ( q | | \pi _ { i } ) = 0$ . In practice we estimate $Q _ { \pmb { \theta } _ { i } }$ from off-policy data (we refer to Section 4 for details about the policy evaluation step). This greatly increases the data efficiency of our algorithm. Given $Q _ { \pmb { \theta } _ { i } }$ we improve the lower bound $\mathcal { I }$ w.r.t. $q$ by first expanding $Q _ { \theta _ { i } } ( s , a )$ via the regularized Bellman operator $\begin{array} { r } { T ^ { \pi , q } = \mathbb { E } _ { q ( a \mid s ) } \Big [ r ( s , a ) - \alpha \mathbf { K L } ( q \| \pi _ { i } ) + \gamma \mathbb { E } _ { p ( s ^ { \prime } \mid s , a ) } [ V _ { \pmb { \theta } _ { i } } ( s ^ { \prime } ) ] \Big ] . } \end{array}$ , and optimize the “one-step” KL regularised objective
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { l } { \displaystyle \mathop { \operatorname* { m a x } } _ { \boldsymbol { q } } \bar { \mathcal { T } } _ { s } ( \boldsymbol { q } , \theta _ { i } ) = \mathop { \operatorname* { m a x } } _ { \boldsymbol { q } } T ^ { \pi , { q } } Q _ { \theta _ { i } } ( s , \boldsymbol { a } ) } \\ { \displaystyle \mathop { \quad = } \mathop { \operatorname* { m a x } } _ { \boldsymbol { q } } \mathbb { E } _ { \boldsymbol { \mu } ( s ) } \Big [ \mathbb { E } _ { \boldsymbol { q } ( \cdot \vert s ) } [ Q _ { \theta _ { i } } ( s , \boldsymbol { a } ) ] - \alpha \mathbf { K } \mathbf { L } ( \boldsymbol { q } \| \pi _ { i } ) \Big ] , } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
since $V _ { \pmb { \theta } _ { i } } ( s ) = \mathbb { E } _ { q ( a | s } [ Q _ { \pmb { \theta } _ { i } } ( s , a ) ]$ and thus $Q _ { \pmb { \theta } _ { i } } ( s , a ) = r ( s , a ) + \gamma V _ { \pmb { \theta } _ { i } } ( s ) .$ .
|
| 101 |
+
|
| 102 |
+
Maximizing Equation (6), thus obtaining $q _ { i } = \arg \operatorname* { m a x } \bar { \mathcal { I } } ( q , \theta _ { i } )$ , does not fully optimize $\mathcal { I }$ since we treat $Q _ { \theta _ { i } }$ as constant with respect to $q$ . An intuitive interpretation $q _ { i }$ is that it chooses the softoptimal action for one step and then resorts to executing policy $\pi$ . In the language of the EM algorithm this optimization implements a partial E-step. In practice we also choose $\mu _ { q }$ to be the stationary distribution as given through samples from the replay buffer.
|
| 103 |
+
|
| 104 |
+
# CONSTRAINED E-STEP
|
| 105 |
+
|
| 106 |
+
The reward and the KL terms are on an arbitray relative scale. This can make it difficult to choose $\alpha$ . We therefore replace the soft KL regularization with a hard constraint with parameter $\epsilon$ , i.e,
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r l } & { \underset { q } { \operatorname* { m a x } } \mathbb { E } _ { \boldsymbol { \mu } ( s ) } \left[ \mathbb { E } _ { q ( a \mid s ) } \left[ Q _ { \boldsymbol { \theta } _ { i } } ( s , a ) \right] \right] } \\ & { s . t . \mathbb { E } _ { \boldsymbol { \mu } ( s ) } \left[ { \mathbf { K L } } ( q ( a \mid s ) , \pi ( a \mid s , \boldsymbol { \theta } _ { i } ) ) \right] < \epsilon . } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
If we choose to explicitly parameterize $q ( a | s ) -$ option 1 below – the resulting optimisation is similar to that performed by the recent TRPO algorithm for continuous control (Schulman et al., 2015); only in an off-policy setting. Analogously, the unconstrained objective (6) is similar to the objective used by PPO (Schulman et al., 2017b). We note, however, that the KL is reversed when compared to the KL used by TRPO and PPO.
|
| 113 |
+
|
| 114 |
+
To implement (7) we need to choose a form for the variational policy $q ( a | s )$ . Two options arise:
|
| 115 |
+
|
| 116 |
+
1. We can use a parametric variational distribution $q ( a | s , \pmb \theta ^ { q } )$ , with parameters $\pmb { \theta } ^ { q }$ , and optimise Equation (7) via the likelihood ratio or action-value gradients. This leads to an algorithm similar to TRPO/PPO and an explicit M-step becomes unnecessary (see. Alg. 3). 2. We can choose a non-parametric representation of $q ( a | s )$ given by one probability factor per sample. To achieve generalization in state space we then fit a parametric policy in the M-step.
|
| 117 |
+
|
| 118 |
+
Fitting a parametric policy in the M-step is a supervised learning problem, allowing us to employ various regularization techniques at that point. It also makes it easier to enforce the hard KL constraint.
|
| 119 |
+
|
| 120 |
+
# NON PARAMETRIC VARIATIONAL DISTRIBUTION
|
| 121 |
+
|
| 122 |
+
In the non-parametric case we can obtain the optimal sample based $q$ distribution – the solution to Equation (7) – in closed form (see the appendix for a full derivation), as,
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
q _ { i } ( a | s ) \propto \pi ( a | s , \pmb { \theta } _ { i } ) \exp \Big ( \frac { Q _ { \theta _ { i } } ( s , a ) } { \eta ^ { * } } \Big ) ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where we can obtain $\eta ^ { * }$ by minimising the following convex dual function,
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
g ( \eta ) = \eta \epsilon + \eta \int \mu ( s ) \log \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp \Big ( \frac { Q _ { \theta _ { i } } ( s , a ) } { \eta } \Big ) d a d s ,
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
after the optimisation of which we can evaluate $q _ { i } ( a | s )$ on given samples.
|
| 135 |
+
|
| 136 |
+
This optimization problem is similar to the one solved by relative entropy policy search (REPS) (Peters et al., 2010a) with the difference that we optimise only for the conditional variational distribution $q ( a | s )$ instead of a joint distribution $\scriptstyle q ( a , s )$ – effectively fixing $\mu _ { q } ( s )$ to the stationary distribution given by previously collected experience – and we use the $\mathrm { Q }$ function of the old policy to evaluate the integral over $a$ . While this might seem unimportant it is crucial as it allows us to estimate the integral over actions with multiple samples without additional environment interaction. This greatly reduces the variance of the estimate and allows for fully off-policy learning at the cost of performing only a partial optimization of $\mathcal { I }$ as described above.
|
| 137 |
+
|
| 138 |
+
# 3.3 M-STEP
|
| 139 |
+
|
| 140 |
+
Given $q _ { i }$ from the E-step we can optimize the lower bound $\mathcal { I }$ with respect to $\pmb \theta$ to obtain an updated policy $\pmb { \theta } _ { i + 1 } = \arg \operatorname* { m a x } _ { \pmb { \theta } } \mathcal { I } ( q _ { i } , \pmb { \theta } )$ . Dropping terms independent of $\pmb { \theta }$ this entails solving for the solution of
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
\operatorname* { m a x } _ { \theta } \mathcal { I } ( q _ { i } , \theta ) = \operatorname* { m a x } _ { \theta } \mathbb { E } _ { \mu _ { q } ( s ) } \Big [ \mathbb { E } _ { q ( a | s ) } \Big [ \log \pi ( a | s , \theta ) \Big ] \Big ] + \log p ( \theta ) ,
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
which corresponds to a weighted maximum a-posteriroi estimation (MAP) problem where samples are weighted by the variational distribution from the E-step. Since this is essentially a supervised learning step we can choose any policy representation in combination with any prior for regularisation. In this paper we set $p ( \pmb \theta )$ to a Gaussian prior around the current policy, i.e, $\begin{array} { r } { p ( \pmb { \theta } ) \approx \mathcal { N } \Big ( \mu = \pmb { \theta } _ { i } , \Sigma = \frac { F _ { \pmb { \theta } _ { i } } } { \lambda } \Big ) } \end{array}$ , where $\pmb \theta _ { i }$ are the parameters of the current policy distribution, $F _ { \pmb { \theta } _ { i } }$ is the empirical Fisher information matrix and $\lambda$ is a positive scalar. As shown in the appendix this suggests the following generalized M-step:
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\operatorname* { m a x } _ { \pi } \mathbb { E } _ { \mu _ { q } ( s ) } \Big [ \mathbb { E } _ { q ( a | s ) } \Big [ \log \pi ( a | s , \pmb { \theta } ) \Big ] - \lambda \mathrm { K L } \Big ( \pi ( a | s , \pmb { \theta } _ { i } ) , \pi ( a | s , \pmb { \theta } ) \Big ) \Big ]
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
which can be re-written as the hard constrained version:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\begin{array} { r } { \underset { \pi } { \operatorname* { m a x } } \mathbb { E } _ { \mu _ { q } ( s ) } \left[ \mathbb { E } _ { q ( a | s ) } \left[ \log \pi ( a | s , \pmb { \theta } ) \right] \right] } \\ { s . t . \mathbb { E } _ { \mu _ { q } ( s ) } \left[ { \mathbf { K L } } ( \pi ( a | s , \pmb { \theta } _ { i } ) , \pi ( a | s , \pmb { \theta } ) ) \right] < \epsilon . } \end{array}
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
This additional constraint minimises the risk of overfitting the samples, i.e. it helps us to obtain a policy that generalises beyond the state-action samples used for the optimisation. In practice we have found the KL constraint in the M step to greatly increase stability of the algorithm. We also note that in the E-step we are using the reverse, mode-seeking, KL while in the M-step we are using the forward, moment-matching, KL which reduces the tendency of the entropy of the parametric policy to collapse. This is in contrast to other RL algorithms that use M-projection without KL constraint to fit a parametric policy (Peters et al., 2010a; Wirth et al., 2016; Chebotar et al., 2016; Montgomery & Levine, 2016). Using KL constraint in M-step has also been shown effective for stochastic search algorithms (Abdolmaleki et al., 2017).
|
| 159 |
+
|
| 160 |
+
# 4 POLICY EVALUATION
|
| 161 |
+
|
| 162 |
+
Our method is directly applicable in an off-policy setting. For this, we have to rely on a stable policy evaluation operator to obtain a parametric representation of the Q-function $Q _ { \theta } ( s , a )$ . We make use of the policy evaluation operator from the Retrace algorithm Munos et al. (2016), which we found to yield stable policy evaluation in practice2. Concretely, we fit the Q-function $Q _ { \theta _ { i } } ( s , a , \phi )$ as represented by a neural network, with parameters $\phi$ , by minimising the squared loss:
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\begin{array} { l } { \displaystyle \mathop { \operatorname* { m i n } } _ { \phi } L ( \phi ) = \mathop { \operatorname* { m i n } } _ { \phi } \mathbb { E } _ { \mu _ { b } ( s ) , b ( a | s ) } \left[ \left( Q _ { \theta _ { i } } ( s _ { t } , a _ { t } , \phi ) - Q _ { t } ^ { \mathrm { r e t } } \right) ^ { 2 } \right] , \mathrm { w i t h } } \\ { \displaystyle Q _ { t } ^ { \mathrm { r e t } } = Q _ { \phi ^ { \prime } } ( s _ { t } , a _ { t } ) + \sum _ { j = t } ^ { \infty } \gamma ^ { j - t } \Big ( \prod _ { k = t + 1 } ^ { j } c _ { k } \Big ) \left[ r ( s _ { j } , a _ { j } ) + \mathbb { E } _ { \pi ( a | s _ { j + 1 } ) } [ Q _ { \phi ^ { \prime } } ( s _ { j + 1 } , a ) ] - Q _ { \phi ^ { \prime } } ( s _ { j } , a _ { j } ) \right] , } \\ { \displaystyle c _ { k } = \operatorname* { m i n } \Big ( 1 , \frac { \pi ( a _ { k } | s _ { k } ) } { b ( a _ { k } | s _ { k } ) } \Big ) , } \end{array}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
where $Q _ { \phi ^ { \prime } } ( s , a )$ denotes the output of a target Q-network, with parameters $\phi ^ { \prime }$ , that we copy from the current parameters $\phi$ after each M-step. We truncate the infinite sum after $N$ steps by bootstrapping with $Q _ { \phi ^ { \prime } }$ (rather than considering a $\lambda$ return). Additionally, $b ( a | s )$ denotes the probabilities of an arbitrary behaviour policy. In our case we use an experience replay buffer and hence $b$ is given by the action probabilities stored in the buffer; which correspond to the action probabilities at the time of action selection.
|
| 169 |
+
|
| 170 |
+
# 5 EXPERIMENTS
|
| 171 |
+
|
| 172 |
+
For our experiments we evaluate our MPO algorithm across a wide range of tasks. Specifically, we start by looking at the continuous control tasks of the DeepMind Control Suite (Tassa et al. (2018), see Figure 1), and then consider the challenging parkour environments recently published in Heess et al. (2017). In both cases we use a Gaussian distribution for the policy whose mean and covariance are parameterized by a neural network (see appendix for details). In addition, we present initial experiments for discrete control using ATARI environments using a categorical policy distribution (whose logits are again parameterized by a neural network) in the appendix.
|
| 173 |
+
|
| 174 |
+
# 5.1 EVALUATION ON CONTROL SUITE
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 1: Control Suite domains used for benchmarking. Top: Acrobot, Ball-in-cup, Cart-pole, Cheetah, Finger, Fish, Hopper. Bottom: Humanoid, Manipulator, Pendulum, Point-mass, Reacher, Swimmers (6 and 15 links), Walker.
|
| 178 |
+
|
| 179 |
+
The suite of continuous control tasks that we are evaluating against contains 18 tasks, comprising a wide range of domains including well known tasks from the literature. For example, the classical cart-pole and acrobot dynamical systems, 2D and Humanoid walking as well as simple low-dimensional planar reaching and manipulation tasks. This suite of tasks was built in python on top of mujoco and will also be open sourced to the public by the time of publication.
|
| 180 |
+
|
| 181 |
+
While we include plots depicting the performance of our algorithm on all tasks below; comparing it against the state-of-the-art algorithms in terms of data-efficiency. We want to start by directing the attention of the reader to a more detailed evaluation on three of the harder tasks from the suite.
|
| 182 |
+
|
| 183 |
+
5.1.1 DETAILED ANALYSIS ON WALKER-2D, ACROBOT, HOPPER
|
| 184 |
+
|
| 185 |
+
We start by looking at the results for the classical Acrobot task (two degrees of freedom, one continuous action dimension) as well as the 2D walker (which has 12 degrees of freedom and thus a 12 dimensional action space and a 21 dimensional state space) and the hopper standing task. The reward in the Acrobot task is the distance of the robots end-effector to an upright position of the underactuated system. For the walker task it is given by the forward velocity, whereas in the hopper the requirement is to stand still.
|
| 186 |
+
|
| 187 |
+
Figure 2 shows the results for this task obtained by applying our algorithm MPO as well as several ablations – in which different parts were removed from the MPO optimization – and two baselines: our implementation of Proximal Policy Optimization (PPO) (Schulman et al., 2017b) and DDPG. The hyperparameters for MPO were kept fixed for all experiments in the paper (see the appendix for hyperparameter settings).
|
| 188 |
+
|
| 189 |
+
As a first observation, we can see that MPO gives stable learning on all tasks and, thanks to its fully off-policy implementation, is significantly more sample efficient than the on-policy PPO baseline. Furthermore, we can observe that changing from the non-parametric variational distribution to a parametric distribution3 (which, as described above, can be related to PPO) results in only a minor asymptotic performance loss but slowed down optimisation and thus hampered sample efficiency; which can be attributed to the fact that the parametric $q$ distribution required a stricter KL constraint. Removing the automatically tuned KL constraint and replacing it with a manually set entropy regulariser then yields an off-policy actor-critic method with Retrace. This policy gradient method still uses the idea of estimating the integral over actions – and thus, for a gradient based optimiser, its likelihood ratio derivative – via multiple action samples (as judged by a Q-Retrace critic). This idea has previously been coined as using the expected policy gradient (EPG) (Ciosek & Whiteson, 2017) and we hence denote the corresponding algorithm with EPG $^ +$ Retrace, which no-longer follows the intuitions of the MPO perspective. $\mathrm { E P G } + .$ Retrace performed well when the correct entropy regularisation scale is used. This, however, required task specific tuning (c.f. Figure 4 where this hyperparameter was set to the one that performed best in average across tasks). Finally using only a single sample to estimate the integral (and hence the likelihood ratio gradient) results in an actor-critic variant with Retrace that is the least performant off-policy algorithm in our comparison.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 2: Ablation study of the MPO algorithm and comparison to common baselines from the literature on three domains from the control suite. We plot the median performance over 10 experiments with different random seeds.
|
| 193 |
+
|
| 194 |
+
# 5.1.2 COMPLETE RESULTS ON THE CONTROL SUITE
|
| 195 |
+
|
| 196 |
+
The results for MPO (non-parameteric) – and a comparison to an implementation of state-of-the-art algorithms from the literature in our framework – on all the environments from the control suite that we tested on are shown in Figure 4. All tasks have rewards that are scaled to be between 0 and 1000. We note that in order to ensure a fair comparison all algorithms ran with exactly the same network configuration, used a single learner (no distributed computation), used the same optimizer and were tuned w.r.t. their hyperparameters for best performance across all tasks. We refer to the appendix for a complete description of the hyperparameters. Our comparison is made in terms of data-efficiency.
|
| 197 |
+
|
| 198 |
+
From the plot a few trends are readily apparent: i) We can clearly observe the advantage in terms of data-efficiency that methods relying on a Q-critic obtain over the PPO baseline. This difference is so extreme that in several instances the PPO baseline converges an order of magnitude slower than the off-policy algorithms and we thus indicate the asymptotic performance of each algorithm of PPO and DDPG (which also improved significantly later during training in some instances) with a colored star in the plot; ii) the difference between the MPO results and the (expected) policy gradient (EPG) with entropy regularisation confirm our suspicion from Section 5.1.1: finding a good setting for the entropy regulariser that transfers across environments without additional constraints on the policy distribution is very difficult, leading to instabilities in the learning curves. In contrast to this the MPO results appear to be stable across all environments; iii) Finally, in terms of data-efficiency the methods utilising Retrace obtain a clear advantage over DDPG. The single learner vanilla DDPG implementation learns the lower dimensional environments quickly but suffers in terms of learning speed in environments with sparse rewards (finger, acrobot) and higher dimensional action spaces. Overall, MPO is able to solve all environments using surprisingly moderate amounts of data. On average less than 1000 trajectories (or $1 0 ^ { 6 }$ samples) are needed to reach the best performance.
|
| 199 |
+
|
| 200 |
+
# 5.2 HIGH-DIMENSIONAL CONTINUOUS CONTROL
|
| 201 |
+
|
| 202 |
+
Next we turn to evaluating our algorithm on two higher-dimensional continuous control problems; humanoid and walker. To make computation time bearable in these more complicated domains we utilize a parallel variant of our algorithm: in this implementation K learners are all independently collecting data from an instance of the environment. Updates are performed at the end of each collected trajectory using distributed synchronous gradient descent on a shared set of policy and Q-function parameters (we refer to the appendix for an algorithm description). The results of this experiment are depicted in Figure 3.
|
| 203 |
+
|
| 204 |
+
For the Humanoid running domain we can observe a similar trend to the experiments from the previous section: MPO quickly finds a stable running policy, outperforming all other algorithms in terms of sample efficiency also in this high-dimensional control problem.
|
| 205 |
+
|
| 206 |
+
The case for the Walker-2D parkour domain (where we compare against a PPO baseline) is even more striking: where standard PPO requires approximately 1M trajectories to find a good policy MPO finds a solution that is asymptotically no worse than the PPO solution in in about 70k trajectories (or 60M samples), resulting in an order of magnitude improvement. In addition to the walker experiment we have also evaluated MPO on the Parkour domain using a humanoid body (with 22 degrees of freedom) which was learned successfully (not shown in the plot, please see the supplementary video).
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 3: MPO on high-dimensional control problems (Parkour Walker2D and Humanoid walking from control suite).
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
|
| 213 |
+
# 5.3 DISCRETE CONTROL
|
| 214 |
+
|
| 215 |
+
As a proof of concept – showcasing the robustness of our algorithm and its hyperparameters – we performed an experiment on a subset of the games contained contained in the "Arcade Learning Environment" (ALE) where we used the same hyperparameter settings for the KL constraints as for the continuous control experiments. The results of this experiment can be found in the Appendix.
|
| 216 |
+
|
| 217 |
+
# 6 CONCLUSION
|
| 218 |
+
|
| 219 |
+
We have presented a new off-policy reinforcement learning algorithm called Maximum a-posteriori Policy Optimisation (MPO). The algorithm is motivated by the connection between RL and inference and it consists of an alternating optimisation scheme that has a direct relation to several existing algorithms from the literature. Overall, we arrive at a novel, off-policy algorithm that is highly data efficient, robust to hyperparameter choices and applicable to complex control problems. We demonstrated the effectiveness of MPO on a large set of continuous control problems.
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
Figure 4: Complete comparison of results for the control suite. We plot the median performance over 10 random seeds together with 5 and $95 \%$ quantiles (shaded area). Note that for DDPG we only plot the median to avoid clutter in the plots. For DDPG and PPO final performance is marked by a star).
|
| 223 |
+
|
| 224 |
+
# REFERENCES
|
| 225 |
+
|
| 226 |
+
Abbas Abdolmaleki, Bob Price, Nuno Lau, Luis Paulo Reis, Gerhard Neumann, et al. Deriving and improving cma-es with information geometric trust regions. Proceedings of the Genetic and Evolutionary Computation Conference, 2017.
|
| 227 |
+
|
| 228 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay, 2017.
|
| 229 |
+
|
| 230 |
+
Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition, 2017.
|
| 231 |
+
|
| 232 |
+
Marc G. Bellemare, Will Dabney, and Rémi Munos. A distributional perspective on reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning, ICML, 2017.
|
| 233 |
+
|
| 234 |
+
Yevgen Chebotar, Mrinal Kalakrishnan, Ali Yahya, Adrian Li, Stefan Schaal, and Sergey Levine. Path integral guided policy search. CoRR, abs/1610.00529, 2016.
|
| 235 |
+
|
| 236 |
+
Kamil Ciosek and Shimon Whiteson. Expected policy gradients. CoRR, abs/1706.05374, 2017.
|
| 237 |
+
|
| 238 |
+
C. Daniel, G. Neumann, O. Kroemer, and J. Peters. Hierarchical relative entropy policy search. Journal of Machine Learning Research (JMLR), 2016.
|
| 239 |
+
|
| 240 |
+
Peter Dayan and Geoffrey E Hinton. Using expectation-maximization for reinforcement learning. Neural Computation, 9(2):271–278, 1997.
|
| 241 |
+
|
| 242 |
+
Marc Peter Deisenroth, Gerhard Neumann, Jan Peters, et al. A survey on policy search for robotics. Foundations and Trends in Robotics, 2(1-2):1–142, 2013.
|
| 243 |
+
|
| 244 |
+
Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pp. 1329– 1338. JMLR.org, 2016. URL http://dl.acm.org/citation.cfm?id $=$ 3045390. 3045531.
|
| 245 |
+
|
| 246 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. CoRR, abs/1704.03012, 2017.
|
| 247 |
+
|
| 248 |
+
Roy Fox, Ari Pakman, and Naftali Tishby. Taming the noise in reinforcement learning via soft updates. In Proceedings of the Thirty-Second Conference on Uncertainty in Artificial Intelligence UAI, 2016.
|
| 249 |
+
|
| 250 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation. arXiv preprint arXiv:1610.00633, 2016a.
|
| 251 |
+
|
| 252 |
+
Shixiang Gu, Tim Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning (ICML), 2016b.
|
| 253 |
+
|
| 254 |
+
Shixiang Gu, Timothy Lillicrap, Zoubin Ghahramani, Richard E. Turner, and Sergey Levine. Qprop: Sample-efficient policy gradient with an off-policy critic. In 5th International Conference on Learning Representations (ICLR), 2017.
|
| 255 |
+
|
| 256 |
+
Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. CoRR, abs/1702.08165, 2017.
|
| 257 |
+
|
| 258 |
+
Nicolas Heess, Gregory Wayne, David Silver, Tim Lillicrap, Tom Erez, and Yuval Tassa. Learning continuous control policies by stochastic value gradients. In Advances in Neural Information Processing Systems (NIPS), pp. 2926–2934, 2015.
|
| 259 |
+
|
| 260 |
+
Nicolas Heess, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, Ali Eslami, Martin Riedmiller, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
|
| 261 |
+
|
| 262 |
+
Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4565–4573. Curran Associates, Inc., 2016. URL http://papers. nips.cc/paper/6391-generative-adversarial-imitation-learning. pdf.
|
| 263 |
+
|
| 264 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks, 2016.
|
| 265 |
+
|
| 266 |
+
Leslie Pack Kaelbling, Michael L. Littman, and Andrew P. Moore. Reinforcement learning: A survey. Journal of Artificial Intelligence Research, 4:237–285, 1996.
|
| 267 |
+
|
| 268 |
+
H J Kappen. Path integrals and symmetry breaking for optimal control theory. Journal of Statistical Mechanics: Theory and Experiment, 2005.
|
| 269 |
+
|
| 270 |
+
Jens Kober and Jan Peters. Policy search for motor primitives in robotics. In Advances in neural information processing systems, pp. 849–856, 2009.
|
| 271 |
+
|
| 272 |
+
Sergey Levine and Vladlen Koltun. Variational policy search via trajectory optimization. In Advances in Neural Information Processing Systems, pp. 207–215, 2013.
|
| 273 |
+
|
| 274 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. International Conference on Learning Representations (ICLR), 2016.
|
| 275 |
+
|
| 276 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 277 |
+
|
| 278 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy P Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning (ICML), 2016.
|
| 279 |
+
|
| 280 |
+
William Montgomery and Sergey Levine. Guided policy search as approximate mirror descent. CoRR, abs/1607.04614, 2016. URL http://arxiv.org/abs/1607.04614.
|
| 281 |
+
|
| 282 |
+
Rémi Munos, Tom Stepleton, Anna Harutyunyan, and Marc G. Bellemare. Safe and efficient offpolicy reinforcement learning. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems (NIPS), 2016.
|
| 283 |
+
|
| 284 |
+
Gerhard Neumann. Variational inference for policy search in changing situations. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 817–824, 2011.
|
| 285 |
+
|
| 286 |
+
Brendan O’Donoghue, Rémi Munos, Koray Kavukcuoglu, and Volodymyr Mnih. PGQ: combining policy gradient and q-learning. CoRR, abs/1611.01626, 2016.
|
| 287 |
+
|
| 288 |
+
Brendan O’Donoghue, Ian Osband, Rémi Munos, and Volodymyr Mnih. The uncertainty bellman equation and exploration. CoRR, abs/1709.05380, 2017. URL http://arxiv.org/abs/ 1709.05380.
|
| 289 |
+
|
| 290 |
+
Xue Bin Peng, Glen Berseth, and Michiel van de Panne. Terrain-adaptive locomotion skills using deep reinforcement learning. ACM Transactions on Graphics (Proc. SIGGRAPH 2016), 2016.
|
| 291 |
+
|
| 292 |
+
Theodore J. Perkins and Doina Precup. A convergent form of approximate policy iteration. In Advances in Neural Information Processing Systems 15 (NIPS). MIT Press, Cambridge, MA, 2002.
|
| 293 |
+
|
| 294 |
+
Jan Peters, Katharina Mülling, and Yasemin Altün. Relative entropy policy search. In Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence (AAAI), 2010a.
|
| 295 |
+
|
| 296 |
+
Jan Peters, Katharina Mülling, and Yasemin Altun. Relative entropy policy search. In AAAI. Atlanta, 2010b.
|
| 297 |
+
|
| 298 |
+
Konrad Rawlik, Marc Toussaint, and Sethu Vijayakumar. On stochastic optimal control and reinforcement learning by approximate inference. In (R:SS 2012), 2012. Runner Up Best Paper Award.
|
| 299 |
+
|
| 300 |
+
Nicolas Le Roux. Efficient iterative policy optimization. CoRR, abs/1612.08967, 2016. URL http://arxiv.org/abs/1612.08967.
|
| 301 |
+
|
| 302 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning (ICML), 2015.
|
| 303 |
+
|
| 304 |
+
John Schulman, Pieter Abbeel, and Xi Chen. Equivalence between policy gradients and soft qlearning. CoRR, abs/1704.06440, 2017a.
|
| 305 |
+
|
| 306 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017b. URL http://arxiv.org/abs/ 1707.06347.
|
| 307 |
+
|
| 308 |
+
David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In International Conference on Machine Learning (ICML), 2014.
|
| 309 |
+
|
| 310 |
+
Richard S Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In International Conference on Machine Learning (ICML), pp. 216–224, 1990.
|
| 311 |
+
|
| 312 |
+
Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. Deepmind control suite, 2018. URL http://arxiv.org/abs/1801.00690.
|
| 313 |
+
|
| 314 |
+
Evangelos Theodorou, Jonas Buchli, and Stefan Schaal. A generalized path integral control approach to reinforcement learning. Journal of Machine Learning Research (JMLR), 2010.
|
| 315 |
+
|
| 316 |
+
Emanuel Todorov. General duality between optimal control and estimation. In Proceedings of the 47th IEEE Conference on Decision and Control, CDC 2008, December 9-11, 2008, Cancún, México, pp. 4286–4292, 2008.
|
| 317 |
+
|
| 318 |
+
Ahmed Touati, Pierre-Luc Bacon, Doina Precup, and Pascal Vincent. Convergent tree-backup and retrace with function approximation. CoRR, abs/1705.09322, 2017. URL http://arxiv. org/abs/1705.09322.
|
| 319 |
+
|
| 320 |
+
Marc Toussaint. Robot trajectory optimization using approximate inference. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pp. 1049–1056, 2009. ISBN 978-1-60558-516-1.
|
| 321 |
+
|
| 322 |
+
Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Rémi Munos, Koray Kavukcuoglu, and Nando de Freitas. Sample efficient actor-critic with experience replay. 5th International Conference on Learning Representations (ICLR), 2017.
|
| 323 |
+
|
| 324 |
+
Christian Wirth, Johannes Furnkranz, and Gerhard Neumann. Model-free preference-based reinforcement learning. In 30th AAAI Conference on Artificial Intelligence, AAAI 2016, pp. 2222– 2228, 2016.
|
| 325 |
+
|
| 326 |
+
Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, pp. 1433–1438, 2008.
|
| 327 |
+
|
| 328 |
+
# A PROOF OF MONOTONIC IMPROVEMENT FOR THE KL-REGULARIZED POLICY OPTIMIZATION PROCEDURE
|
| 329 |
+
|
| 330 |
+
In this section we prove a monotonic improvement guarantee for KL-regularized policy optimization via alternating updates on $\pi$ and $q$ under the assumption that the prior on $\theta$ is uninformative.
|
| 331 |
+
|
| 332 |
+
# A.1 REGULARIZED REINFORCEMENT LEARNING
|
| 333 |
+
|
| 334 |
+
Let $\pi$ be an arbitrary policy. For any other policy $q$ such that, for all $x , a , \{ \pi ( a | x ) > 0 \} \implies$ $\{ q ( a | x ) > 0 \}$ , define the $\pi$ -regularized reward for policy $q$ :
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
r _ { \alpha } ^ { \pi , q } ( x , a ) = r ( x , a ) - \alpha \log \frac { q ( a | x ) } { \pi ( a | x ) } ,
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
where $\alpha > 0$ .
|
| 341 |
+
|
| 342 |
+
Bellman operators: Define the $\pi$ -regularized Bellman operator for policy $q$
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\begin{array} { r } { T _ { \alpha } ^ { \pi , q } V ( x ) = \mathbb { E } _ { a \sim q ( \cdot | x ) } \Big [ r _ { \alpha } ^ { \pi , q } ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ( y ) \Big ] , } \end{array}
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
and the non-regularized Bellman operator for policy $q$
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
T ^ { q } V ( x ) = \mathbb { E } _ { a \sim q ( \cdot | x ) } \Big [ r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ( y ) \Big ] .
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
Value function: Define the $\pi$ -regularized value function for policy $q$ as
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
V _ { \alpha } ^ { \pi , q } ( \boldsymbol { x } ) = \mathbb { E } _ { q } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } r _ { \alpha } ^ { \pi , q } ( \boldsymbol { x } _ { t } , a _ { t } ) | \boldsymbol { x } _ { 0 } = \boldsymbol { x } , q \Big ] .
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
and the non-regularized value function
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
V ^ { q } ( x ) = \mathbb { E } _ { q } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } r ( x _ { t } , a _ { t } ) | x _ { 0 } = x , q \Big ] .
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
Proposition 1. For any $q , \pi , V$ , we have $V _ { \alpha } ^ { \pi , q } \leq V ^ { q }$ and $T _ { \alpha } ^ { \pi , q } V \le T ^ { q } V$ . Indeed
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\mathbb { E } _ { q } \Big [ \log \frac { q \big ( a _ { t } | x _ { t } \big ) } { \pi \big ( a _ { t } | x _ { t } \big ) } \Big ] = K L \big ( q ( \cdot | x _ { t } ) \| \pi ( \cdot | x _ { t } ) \big ) \geq 0 .
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
Optimal value function and policy Define the optimal regularized value function: $V _ { \alpha } ^ { \pi , * } ( x ) =$ $\operatorname* { m a x } _ { q } V _ { \alpha } ^ { \pi , q } ( x )$ , and the optimal (non-regularized) value function: $V ^ { * } ( x ) = \operatorname* { m a x } _ { q } V ^ { q } ( x )$ .
|
| 373 |
+
|
| 374 |
+
The optimal policy of the $\pi$ -regularized problem $q _ { \alpha } ^ { \pi , * } ( \cdot | x ) = \arg \operatorname* { m a x } _ { q } V _ { \alpha } ^ { \pi , q } ( x )$ and the optimal policy of the non-regularized problem $q ^ { * } ( \cdot | x ) = \arg \operatorname* { m a x } _ { q } V ^ { q }$ .
|
| 375 |
+
|
| 376 |
+
Proposition 2. We have that $V _ { \alpha } ^ { \pi , q }$ is the unique fixed point of $T _ { \alpha } ^ { \pi , q }$ , and $V ^ { q }$ is the unique fixed point of $T ^ { q }$ . Thus we have the following Bellman equations: For all $x \in X$ ,
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { r c l } { { V _ { \alpha } ^ { \pi , q } ( x ) } } & { { = } } & { { \displaystyle \sum _ { a } q ( a | x ) \Big [ r _ { \alpha } ^ { \pi , q } ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V _ { \alpha } ^ { \pi , q } ( y ) \big ] \Big ] } } \\ { { } } & { { } } & { { } } \\ { { V ^ { q } ( x ) } } & { { = } } & { { \displaystyle \sum _ { a } q ( a | x ) \Big [ r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V ^ { q } ( y ) \big ] \Big ] } } \\ { { } } & { { } } & { { } } \\ { { V _ { \alpha } ^ { \pi , * } ( x ) } } & { { = } } & { { \displaystyle r _ { \alpha } ^ { \pi , q _ { \alpha } ^ { \pi , * } } ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V _ { \alpha } ^ { \pi , * } ( y ) \big ] f o r a l l a \in A , } } \\ { { } } & { { } } & { { } } \\ { { V ^ { * } ( x ) } } & { { = } } & { { \displaystyle \operatorname* { m a x } _ { a \in A } \Big [ r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } \big [ V ^ { * } ( y ) \big ] \Big ] . } } \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
Notice that (16) holds for all actions $a \in A$ , and not in expectation w.r.t. $a \sim q ( \cdot | x )$ only.
|
| 383 |
+
|
| 384 |
+
# A.2 REGULARIZED JOINT POLICY GRADIENT
|
| 385 |
+
|
| 386 |
+
We now consider a parametrized policy $\pi _ { \theta }$ and consider maximizing the regularized joint policy optimization problem for a given initial state $x _ { 0 }$ (this could be a distribution over initial states). Thus we want to find a parameter $\theta$ that (locally) maximizes
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\mathcal { I } ( \theta , q ) = V ^ { \pi _ { \theta } , q } ( \boldsymbol { x } _ { 0 } ) = \mathbb { E } _ { q } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } \big ( r ( \boldsymbol { x } _ { t } , a _ { t } ) - \alpha \mathrm { K L } ( q ( \cdot | \boldsymbol { x } _ { t } ) | | \pi _ { \theta } ( \cdot | \boldsymbol { x } _ { t } ) ) \big ) \big | \boldsymbol { x } _ { 0 } , q \Big ] .
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
We start with an initial parameter $\theta _ { 0 }$ and define a sequence of policies $\pi _ { i } = \pi _ { \theta _ { i } }$ parametrized by $\theta _ { i }$ , in the following way:
|
| 393 |
+
|
| 394 |
+
• Given $\theta _ { i }$ , define
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
q _ { i } = \arg \operatorname* { m a x } _ { q } T _ { \alpha } ^ { \pi _ { \theta _ { i } } , q } V ^ { \pi _ { \theta _ { i } } } ,
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
• Define $\theta _ { i + 1 }$ as
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\theta _ { i + 1 } = \theta _ { i } - \beta \nabla _ { \theta } \mathbb { E } _ { \pi _ { i } } \left[ \sum _ { t \geq 0 } \gamma ^ { t } \mathrm { K L } \big ( q _ { k } ( \cdot | x _ { t } ) | | \pi _ { \theta } ( \cdot | x _ { t } ) \big ) _ { | \theta = \theta _ { i } } \big | x _ { 0 } , \pi _ { i } \right] .
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
Proposition 3. We have the following properties:
|
| 407 |
+
|
| 408 |
+
• The policy $q _ { i }$ satisfies:
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
q _ { i } ( a | x ) = \frac { \pi _ { i } ( a | x ) e ^ { \frac { 1 } { \alpha } Q ^ { \pi _ { i } } ( x , a ) } } { \mathbb { E } _ { b \sim \pi _ { i } ( \cdot | x ) } \big [ e ^ { \frac { 1 } { \alpha } Q ^ { \pi _ { i } } ( x , b ) } \big ] } ,
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
where $Q ^ { \pi } ( x , a ) = r ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ^ { \pi } ( y ) .$
|
| 415 |
+
|
| 416 |
+
• We have
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
V _ { \alpha } ^ { \pi _ { i } , q _ { i } } \geq V ^ { \pi _ { i } } .
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
• For η sufficiently small, we have
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\mathcal { I } ( \theta _ { i + 1 } , q _ { i + 1 } ) \geq \mathcal { I } ( \theta _ { i } , q _ { i } ) + c g _ { i } ,
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
where c is a numerical constant, and $g _ { i }$ is the norm of the gradient (minimized by the algorithm):
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
g _ { i } = \Big \| \nabla _ { \theta } \mathbb { E } _ { \pi _ { i } } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } K L \big ( q _ { i } ( \cdot | x _ { t } ) \| \pi _ { \theta } ( \cdot | x _ { t } ) \big ) _ { | \theta = \theta _ { i } } \big | x _ { 0 } , \pi _ { i } \Big ] \Big \| .
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
Thus we build a sequence of policies $( \pi _ { \theta _ { i } } , q _ { i } )$ whose values $\mathcal { I } ( \theta _ { i } , q _ { i } )$ are non-decreasing thus converge to a local maximum. In addition, the improvement is lower-bounded by $a$ constant times the norm of the gradient, thus the algorithm keeps improving the performance until the gradient vanishes (when we reach the limit of the capacity of our representation).
|
| 435 |
+
|
| 436 |
+
Proof. We have
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
\begin{array} { r l r } { q _ { i } ( \cdot | x ) } & { = } & { \arg \underset { q } { \operatorname* { m a x } } \mathbb { E } _ { a \sim q ( \cdot | x ) } \Big [ \underset { Q ^ { \pi _ { i } } ( x , a ) } { \underbrace { r \big ( x , a ) + \gamma \mathbb { E } _ { y \sim p ( \cdot | x , a ) } V ^ { \pi _ { i } } ( y ) } } - \alpha \log \frac { q \big ( a | x \big ) } { \pi _ { i } \big ( a | x \big ) } \Big ] , } \end{array}
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
from which we deduce (19). Now, from the definition of $q _ { i }$ , we have
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
T _ { \alpha } ^ { \pi _ { i } , q _ { i } } V ^ { \pi _ { i } } \geq T _ { \alpha } ^ { \pi _ { i } , \pi _ { i } } V ^ { \pi _ { i } } = T ^ { \pi _ { i } } V ^ { \pi _ { i } } = V ^ { \pi _ { i } } .
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
Now, since and its fixe $T _ { \alpha } ^ { \pi _ { i } , q _ { i } }$ is is otone operator (i.e. if , we have $V _ { 1 } \geq V _ { 2 }$ elementwise, then $T _ { \alpha } ^ { \pi _ { i } , q _ { i } } V _ { 1 } \geq T _ { \alpha } ^ { \pi _ { i } , q _ { i } } V _ { 2 } )$ $V _ { \alpha } ^ { \pi _ { i } , q _ { i } }$
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
V _ { \alpha } ^ { \pi _ { i } , q _ { i } } = \operatorname* { l i m } _ { t \to \infty } ( T _ { \alpha } ^ { \pi _ { i } , q _ { i } } ) ^ { t } V ^ { \pi _ { i } } \geq V ^ { \pi _ { i } } ,
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
which proves (20).
|
| 455 |
+
|
| 456 |
+
Now, in order to prove (21) we derive the following steps.
|
| 457 |
+
|
| 458 |
+
Step 1: From the definition of $q _ { i + 1 }$ we have, for any $x$
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\begin{array} { r } { \tilde { \Sigma } _ { a \sim q _ { 4 } + 1 } \left[ Q ^ { \pi _ { i + 1 } } ( x , a ) \right] - \alpha \mathbf { K L } \left( q _ { i + 1 } ( \cdot | x ) \| \pi _ { i + 1 } ( \cdot | x ) \right) \geq \mathbb { E } _ { a \sim q _ { 4 } } \left[ Q ^ { \pi _ { i + 1 } } ( x , a ) \right] - \alpha \mathbf { K L } \left( q _ { i } ( \cdot | x ) \| \pi _ { i + 1 } ( \cdot | x ) \right) } \end{array}
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
Writing the functional that we minimize
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
f ( \pi , q , \theta ) = \mathbb { E } _ { \pi } \Big [ \sum _ { t \geq 0 } \gamma ^ { t } \mathrm { K L } \big ( q ( \cdot | x _ { t } ) \| \pi _ { \theta } ( \cdot | x _ { t } ) \big ) \big | x _ { 0 } , \pi \Big ] ,
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
the update rule is $\theta _ { i + 1 } = \theta _ { i } - \beta \nabla _ { \theta } f ( \pi _ { i } , q _ { i } , \theta _ { i } )$ . Thus we have that for sufficiently small $\beta$ ,
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
f ( \pi _ { i } , q _ { i } , \theta _ { i + 1 } ) \leq f ( \pi _ { i } , q _ { i } , \theta _ { i } ) - \beta g _ { i } ,
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
where $\begin{array} { r } { g _ { i } = \frac { 1 } { 2 } \| \nabla _ { \theta } f ( \pi _ { i } , q _ { i } , \theta _ { i } ) \| } \end{array}$ .
|
| 477 |
+
|
| 478 |
+
Step 2: Now define $\mathcal { F }$ :
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\begin{array} { r c l } { \mathcal { F } ( \pi , q , \theta , \pi ^ { \prime } ) } & { = } & { \displaystyle \mathbb { E } _ { \pi } \left[ \sum _ { t \geq 0 } \gamma ^ { t } \big ( \mathbb { E } _ { a \sim q } \big [ Q ^ { \pi ^ { \prime } } ( x _ { t } , a ) \big ] - \alpha \mathrm { K L } \big ( q ( \cdot | x _ { t } ) \| \pi _ { \theta } ( \cdot | x _ { t } ) \big ) \big ) \big | x _ { 0 } , \pi \right] } \\ & { = } & { \displaystyle \delta _ { x _ { 0 } } \big ( I - \gamma P ^ { \pi } \big ) ^ { - 1 } T _ { \alpha } ^ { \pi _ { \theta } , q } V ^ { \pi ^ { \prime } } } \\ & { = } & { \delta _ { x _ { 0 } } \big ( I - \gamma P ^ { \pi } \big ) ^ { - 1 } T ^ { q } V ^ { \pi ^ { \prime } } - f ( \pi , q , \theta ) , } \end{array}
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
where $\delta _ { x _ { 0 } }$ is a Dirac (in the row vector $x _ { 0 }$ ), and $P ^ { \pi }$ is the transition matrix for policy $\pi$
|
| 485 |
+
|
| 486 |
+
From (22) and (23) we deduce that
|
| 487 |
+
|
| 488 |
+
$$
|
| 489 |
+
\begin{array} { r c l } { \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i + 1 } ) } & { \geq } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i + 1 } , \pi _ { i + 1 } ) } \\ & { \geq } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i + 1 } ) + \beta g _ { i } . } \end{array}
|
| 490 |
+
$$
|
| 491 |
+
|
| 492 |
+
We deduce
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
\begin{array} { r l } & { \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i } ) } \\ { \geq } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i } ) + \beta g _ { i } } \\ & { + \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i } ) - \mathcal { F } ( \pi _ { i } , q _ { i + 1 } , \theta _ { i + 1 } , \pi _ { i + 1 } ) + \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i + 1 } ) - \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i } ) } \\ { = } & { \mathcal { F } ( \pi _ { i } , q _ { i } , \theta _ { i } , \pi _ { i } ) + \beta g _ { i } + } \\ & { \mathbb { E } _ { \pi _ { i } } \Big [ \displaystyle \sum _ { t \geq 0 } \gamma ^ { t } \big ( \mathbb { E } _ { a \sim q _ { i + 1 } } \big [ Q ^ { \pi _ { i } } ( x _ { t } , a ) - Q ^ { \pi _ { i + 1 } } ( x _ { t } , a ) \big ] - \mathbb { E } _ { a \sim q _ { i } } \big [ Q ^ { \pi _ { i } } ( x _ { t } , a ) - Q ^ { \pi _ { i + 1 } } ( x _ { t } , a ) \big ] \big ) \Big ] } \end{array}
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
This rewrites:
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
\delta _ { x _ { 0 } } ( I - \gamma ^ { \pi _ { i } } ) ^ { - 1 } \big ( T _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } V ^ { \pi _ { i } } - T _ { \alpha } ^ { q _ { i } , \pi _ { i } } V ^ { \pi _ { i } } \big ) \geq \eta g _ { i } + O ( \beta ^ { 2 } ) .
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
Step 3: Now a bit of algebra. For two stochastic matrices $P$ and $P ^ { \prime }$ , we have
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
\begin{array} { r l } & { ( I - \gamma P ) ^ { - 1 } } \\ { = } & { ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma ( I - \gamma P ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } } \\ { = } & { ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma \big [ ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma ( I - \gamma P ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } \big ] ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } } \\ { = } & { ( I - \gamma P ^ { \prime } ) ^ { - 1 } + \gamma ( I - \gamma P ^ { \prime } ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } } \\ & { + \gamma ^ { 2 } ( I - \gamma P ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } ( P - P ^ { \prime } ) ( I - \gamma P ^ { \prime } ) ^ { - 1 } . } \end{array}
|
| 508 |
+
$$
|
| 509 |
+
|
| 510 |
+
Applying this equality to the transition matrices $P ^ { \pi _ { k } }$ and $P ^ { \pi _ { k + 1 } }$ and since $\lVert P ^ { \pi _ { k + 1 } } - P ^ { \pi _ { k } } \rVert = O ( \eta )$ , we have:
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\begin{array} { r l } & { V _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } } \\ { = } & { ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } } \\ { = } & { ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } + \gamma ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } ( P ^ { \pi _ { i + 1 } } - P ^ { \pi _ { i } } ) ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } + O ( \beta ^ { 2 } ) } \\ { = } & { ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i } , \pi _ { i } } + ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } ( r _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i + 1 } } - r _ { \alpha } ^ { q _ { i } , \pi _ { i } } + \gamma P ^ { \pi _ { i + 1 } } - \gamma P ^ { \pi _ { i } } ) ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } r _ { \alpha } ^ { q _ { i } , \pi _ { i } } } \\ { = } & { V _ { \alpha } ^ { q _ { i } , \pi _ { i } } + ( I - \gamma P ^ { \pi _ { i } } ) ^ { - 1 } ( T _ { \alpha } ^ { q _ { i + 1 } , \pi _ { i } + 1 } V ^ { \pi _ { i } } - T _ { \alpha } ^ { q _ { i } , \pi _ { i } } V ^ { \pi _ { k } } ) + O ( \beta ^ { 2 } ) . } \end{array}
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
Table 1: Results on a subset of the ALE environments in comparison to baselines taken from (Bellemare et al., 2017)
|
| 517 |
+
|
| 518 |
+
<table><tr><td>Game/Agent</td><td>Human</td><td>DQN</td><td>Prior. Dueling</td><td>C51</td><td>MPO</td></tr><tr><td></td><td></td><td>19.5</td><td>20.9</td><td></td><td></td></tr><tr><td>Pong Breakout</td><td>14.6 30.5</td><td>385.5</td><td>366.0</td><td>20.9 748</td><td>20.9 360.5</td></tr><tr><td></td><td>13,455.0</td><td>13,117.3</td><td>18,760.3</td><td>23,784</td><td></td></tr><tr><td>Q*bert Tennis</td><td>-8.3</td><td>12.2</td><td>0.0</td><td>23.1</td><td>10,317.0</td></tr><tr><td></td><td></td><td></td><td>98.9</td><td></td><td>22.2</td></tr><tr><td>Boxing</td><td>12.1</td><td>88.0</td><td></td><td>97.8</td><td>82.0</td></tr></table>
|
| 519 |
+
|
| 520 |
+
Finally, using (24), we deduce that
|
| 521 |
+
|
| 522 |
+
$$
|
| 523 |
+
\begin{array} { l l l } { \mathcal { I } ( \theta _ { i + 1 } , q _ { i + 1 } ) } & { = } & { V _ { \alpha } ^ { q _ { i } + 1 , \pi _ { i } + 1 } \big ( x _ { 0 } \big ) } \\ & { = } & { V _ { \alpha } ^ { q _ { i } , \pi _ { i } } \big ( x _ { 0 } \big ) + \delta _ { x _ { 0 } } \big ( I - \gamma P ^ { \pi _ { i } } \big ) ^ { - 1 } \big ( T _ { \alpha } ^ { q _ { i } + 1 , \pi _ { i + 1 } } V ^ { \pi _ { i } } - T _ { \alpha } ^ { q _ { i } , \pi _ { i } } V ^ { \pi _ { i } } \big ) + O ( \beta ^ { 2 } ) } \\ & { \geq } & { \mathcal { I } ( \theta _ { i } , q _ { i } ) + \eta g _ { i } + O ( \beta ^ { 2 } ) } \\ & { \geq } & { \mathcal { I } ( \theta _ { i } , q _ { i } ) + \frac { 1 } { 2 } \eta g _ { i } , } \end{array}
|
| 524 |
+
$$
|
| 525 |
+
|
| 526 |
+
for small enough $\eta$ .
|
| 527 |
+
|
| 528 |
+
# B ADDITIONAL EXPERIMENT: DISCRETE CONTROL
|
| 529 |
+
|
| 530 |
+
As a proof of concept – showcasing the robustness of our algorithm and its hyperparameters – we performed an experiment on a subset of the games contained contained in the "Arcade Learning Environment" (ALE). For this experiment we used the same hyperparameter settings for the KL constraints as for the continuous control experiments as well as the same learning rate and merely altered the network architecture to the standard network structure used by DQN Mnih et al. (2015) – and created a seperate network with the same architecture, but predicting the parameters of the policy distribution. A comparison between our algorithm and well established baselines from the literature, in terms of the mean performance, is listed in Table 1. While we do not obtain state-ofthe-art performance in this experiment, the fact that MPO is competitive, out-of-the-box in these domains suggests that combining the ideas presented in this paper with recent advances for RL with discrete actions (Bellemare et al., 2017) could be a fruitful avenue for future work.
|
| 531 |
+
|
| 532 |
+
# C EXPERIMENT DETAILS
|
| 533 |
+
|
| 534 |
+
In this section we give the details on the hyper-parameters used for each experiment. All the continuous control experiments use a feed-forward network except for Parkour-2d were we used the same network architecture as in Heess et al. (2017). Other hyper parameters for MPO with non parametric variational distribution were set as follows,
|
| 535 |
+
|
| 536 |
+
Table 2: Parameters for non-parametric variational distribution
|
| 537 |
+
|
| 538 |
+
<table><tr><td>Hyperparameter</td><td>control suite</td><td>humanoid</td></tr><tr><td>Policy net</td><td>100-100</td><td>200-200</td></tr><tr><td>Q function net</td><td>200-200</td><td>300-300</td></tr><tr><td>E</td><td>0.1</td><td>1</td></tr><tr><td>Eμ</td><td>0.1</td><td>"</td></tr><tr><td>£</td><td>0.0001</td><td>"</td></tr><tr><td>Discount factor()</td><td>0.99</td><td>1</td></tr><tr><td>Adam learning rate</td><td>0.0005</td><td>1</td></tr></table>
|
| 539 |
+
|
| 540 |
+
Hyperparameters for MPO with parametric variational distribution were as follows,
|
| 541 |
+
|
| 542 |
+
Table 3: Parameters for parametric variational distribution
|
| 543 |
+
|
| 544 |
+
<table><tr><td>Hyperparameter</td><td>control suite tasks</td><td>humanoid</td></tr><tr><td>Policy net</td><td>100-100</td><td>200-200</td></tr><tr><td>Q function net</td><td>200-200</td><td>300-300</td></tr><tr><td>Eμ</td><td>0.1</td><td>1</td></tr><tr><td>£</td><td>0.0001</td><td>1</td></tr><tr><td>Discount factor ()</td><td>0.99</td><td>1</td></tr><tr><td>Adam learning rate</td><td>0.0005</td><td>1</td></tr></table>
|
| 545 |
+
|
| 546 |
+
# D DERIVATION OF UPDATE RULES FOR A GAUSSIAN POLICY
|
| 547 |
+
|
| 548 |
+
For continuous control we assume that the policy is given by a Gaussian distribution with a full covariance matrix, i.e, $\pi ( \boldsymbol { a } | \boldsymbol { s } , \pmb { \theta } ) = \mathcal { N } \left( \mu , \pmb { \Sigma } \right)$ . Our neural network outputs the mean $\mu = \mu ( s )$ and Cholesky factor $A = A ( s )$ , such that $\Sigma = A A ^ { T }$ . The lower triagular factor $A$ has positive diagonal elements enforced by the softplus transform $A _ { i i } \log ( 1 + \exp ( A _ { i i } ) )$ .
|
| 549 |
+
|
| 550 |
+
# D.1 NON-PARAMETRIC VARIATIONAL DISTRIBUTION
|
| 551 |
+
|
| 552 |
+
In this section we provide the derivations and implementation details for the non-parametric variational distribution case for both $\mathrm { E }$ -step and M-step.
|
| 553 |
+
|
| 554 |
+
# D.2 E-STEP
|
| 555 |
+
|
| 556 |
+
The E-step with a non-parametric variational solves the following program, where we have replaced expectations with integrals to simplify the following derivations:
|
| 557 |
+
|
| 558 |
+
$$
|
| 559 |
+
\begin{array} { l } { \displaystyle \operatorname* { m a x } _ { q } \int \mu _ { q } ( s ) \int q ( a | s ) Q _ { \theta _ { i } } ( s , a ) d a d s } \\ { \displaystyle s . t . \int \mu _ { q } ( s ) { \bf K L } ( q ( a | s ) , \pi ( a | s , \theta _ { i } ) ) d a < \epsilon , } \\ { \displaystyle \iint \mu _ { q } ( s ) q ( a | s ) d a d s = 1 . } \end{array}
|
| 560 |
+
$$
|
| 561 |
+
|
| 562 |
+
First we write the Lagrangian equation, i.e,
|
| 563 |
+
|
| 564 |
+
$$
|
| 565 |
+
\begin{array} { c } { { L ( q , \eta , \gamma ) = \displaystyle \int \mu _ { q } ( s ) \int q ( a | s ) Q _ { \theta _ { i } } ( s , a ) d a d s + } } \\ { { \displaystyle \eta \left( \epsilon - \int \mu _ { q } ( s ) \int q ( a | s ) \log \frac { q ( a | s ) } { \pi ( a | s , \theta _ { i } ) } \right) + \gamma \left( 1 - \displaystyle \iint \mu _ { q } ( s ) q ( a | s ) d a d s \right) . } } \end{array}
|
| 566 |
+
$$
|
| 567 |
+
|
| 568 |
+
Next we maximise the Lagrangian $L$ w.r.t the primal variable $q$ . The derivative w.r.t $q$ reads,
|
| 569 |
+
|
| 570 |
+
$$
|
| 571 |
+
\partial q L ( q , \eta , \gamma ) = Q _ { \theta _ { i } } ( a , s ) - \eta \log q ( a | s ) + \eta \log \pi ( a | s , \pmb \theta _ { i } ) - ( \eta - \gamma ) .
|
| 572 |
+
$$
|
| 573 |
+
|
| 574 |
+
Setting it to zero and rearranging terms we get
|
| 575 |
+
|
| 576 |
+
$$
|
| 577 |
+
q ( a | s ) = \pi ( a | s , \pmb { \theta } _ { i } ) \exp \left( \frac { Q _ { \pmb { \theta } _ { i } } ( a , s ) } { \eta } \right) \exp \left( - \frac { \eta - \gamma } { \eta } \right) .
|
| 578 |
+
$$
|
| 579 |
+
|
| 580 |
+
However the last exponential term is a normalisation constant for $q$ . Therefore we can write,
|
| 581 |
+
|
| 582 |
+
$$
|
| 583 |
+
\exp ( - \frac { \eta - \gamma } { \eta } ) = \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp ( \frac { Q _ { \pmb { \theta } _ { i } } ( a , s ) } { \eta } ) d a ,
|
| 584 |
+
$$
|
| 585 |
+
|
| 586 |
+
$$
|
| 587 |
+
\gamma = \eta - \eta \log \left( \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp ( \frac { Q _ { \pmb { \theta } _ { i } } ( a , s ) } { \eta } ) d a \right) .
|
| 588 |
+
$$
|
| 589 |
+
|
| 590 |
+
Note that we could write $\gamma$ based on $\pi$ and $\eta$ . At this point we can derive the dual function,
|
| 591 |
+
|
| 592 |
+
$$
|
| 593 |
+
g ( \eta ) = \eta \epsilon + \eta \int \mu _ { q } ( s ) \log \left( \int \pi ( a | s , \pmb { \theta } _ { i } ) \exp ( \frac { Q ( a , s ) } { \eta } ) d a \right) .
|
| 594 |
+
$$
|
| 595 |
+
|
| 596 |
+
# D.3 M-STEP
|
| 597 |
+
|
| 598 |
+
To obtain the KL constraint in the $\mathbf { M }$ step we set $p ( \theta )$ to a Gaussian prior around the current policy, i.e,
|
| 599 |
+
|
| 600 |
+
$$
|
| 601 |
+
p ( \pmb \theta ) \approx \mathcal { N } \Big ( \mu = \pmb \theta _ { i } , \Sigma = \frac { F _ { \pmb \theta _ { i } } } { \lambda } \Big ) ,
|
| 602 |
+
$$
|
| 603 |
+
|
| 604 |
+
where $\theta _ { i }$ are the parameters of the current policy distribution, $F _ { \pmb { \theta } _ { i } }$ is the empirical Fisher information matrix and $\lambda$ .
|
| 605 |
+
|
| 606 |
+
With this, and dropping constant terms our optimization program becomes
|
| 607 |
+
|
| 608 |
+
$$
|
| 609 |
+
\operatorname* { m a x } _ { \pi } \int \mu _ { q } ( s ) \int q ( a | s ) \log \pi ( a | s , \pmb { \theta } ) d a d s - \lambda ( \pmb { \theta } - \pmb { \theta } _ { i } ) ^ { T } F _ { \pmb { \theta _ { i } } } ^ { - 1 } ( \pmb { \theta } - \pmb { \theta } _ { i } ) .
|
| 610 |
+
$$
|
| 611 |
+
|
| 612 |
+
We can observe that $( \pmb \theta - \pmb \theta _ { i } ) ^ { T } F _ { \pmb \theta _ { i } } ^ { - 1 } ( \pmb \theta - \pmb \theta _ { i } )$ is the second order Taylor approximation of $\begin{array} { r } { \int \mu _ { q } ( s ) \mathrm { K L } ( \pi ( a | s , \pmb { \theta } _ { i } ) , \pi ( a | s , \pmb { \theta } ) ) d s } \end{array}$ which leads us to the generalized M-step objective:
|
| 613 |
+
|
| 614 |
+
$$
|
| 615 |
+
\operatorname* { m a x } _ { \pi } \int \mu _ { q } ( s ) \int q ( a | s ) \log \pi ( a | s , \theta ) d a d s - \lambda \int \mu _ { q } ( s ) \mathbf { K L } ( \pi ( a | s , \theta _ { i } ) , \pi ( a | s , \theta ) ) d s
|
| 616 |
+
$$
|
| 617 |
+
|
| 618 |
+
which corresponds to Equation (11) from the main text, where expectations are replaced by integrals.
|
| 619 |
+
|
| 620 |
+
After obtaining the non parametric variational distribution in the $\mathbf { M }$ step with a Gaussian policy we empirically observed that better results could be achieved by decoupling the KL constraint into two terms such that we can constrain the contribution of the mean and covariance separately i.e.
|
| 621 |
+
|
| 622 |
+
$$
|
| 623 |
+
\int \mu _ { q } ( s ) \mathrm { K L } ( \pi _ { i } ( a | s , \pmb \theta ) , \pi ( a | s , \pmb \theta ) ) = C _ { \mu } + C _ { \Sigma } ,
|
| 624 |
+
$$
|
| 625 |
+
|
| 626 |
+
where
|
| 627 |
+
|
| 628 |
+
$$
|
| 629 |
+
\begin{array} { c } { { C _ { \mu } = \displaystyle \int \mu _ { q } ( s ) \frac 1 2 \big ( \mathrm { t r } \big ( \Sigma ^ { - 1 } \Sigma _ { i } \big ) - n + \mathrm { l n } ( \frac { \Sigma } { \Sigma _ { i } } ) \big ) d s , } } \\ { { { } } } \\ { { C _ { \Sigma } = \displaystyle \int \mu _ { q } ( s ) \frac 1 2 \big ( \mu - \mu _ { i } \big ) ^ { T } \Sigma ^ { - 1 } ( \mu - \mu _ { i } ) d s . } } \end{array}
|
| 630 |
+
$$
|
| 631 |
+
|
| 632 |
+
This decoupling allows us to set different $\epsilon$ values for each component, i.e., $\epsilon _ { \mu } , \epsilon _ { \Sigma }$ for the mean, the covariance matrix respectively. Different $\epsilon$ lead to different learning rates. The effectivness of this decoupling has also been shown in Abdolmaleki et al. (2017). We always set a much smaller epsilon for covariance than the mean. The intuition is that while we would like the distribution moves fast in the action space, we also want to keep the exploration to avoid premature convergence.
|
| 633 |
+
|
| 634 |
+
In order to solve the constrained optimisation in the M-step, we first write the generalised Lagrangian equation, i.e,
|
| 635 |
+
|
| 636 |
+
$$
|
| 637 |
+
L ( \pmb \theta , \eta _ { \mu } , \eta _ { \Sigma } ) = \int \mu _ { q } ( s ) \int q ( a | s ) \log \pi ( a | s , \pmb \theta ) d a d s + \eta _ { \mu } ( \epsilon _ { \mu } - C _ { \mu } ) + \eta _ { \Sigma } ( \epsilon _ { \Sigma } - C _ { \Sigma } )
|
| 638 |
+
$$
|
| 639 |
+
|
| 640 |
+
Where $\eta _ { \mu }$ and $\eta _ { \Sigma }$ are Lagrangian multipliers. Following prior work on constraint optimisation, we formulate the following primal problem,
|
| 641 |
+
|
| 642 |
+
$$
|
| 643 |
+
\operatorname* { m a x } _ { \pmb { \theta } } \operatorname* { m i n } _ { \eta _ { \mu } > 0 , \eta _ { \Sigma } > 0 } L ( \pmb { \theta } , \eta _ { \mu } , \eta _ { \Sigma } ) .
|
| 644 |
+
$$
|
| 645 |
+
|
| 646 |
+
In order to solve for $\pmb \theta$ we iteratively solve the inner and outer optimisation programs independently: We fix the Lagrangian multipliers to their current value and optimise for $\pmb \theta$ (outer maximisation) and then fix the parameters $\pmb \theta$ to their current value and optimise for the Lagrangian multipliers (inner minimisation). We continue this procedure until policy parameters $\pmb { \theta }$ and Lagrangian multipliers converge. Please note that the same approach can be employed to bound the KL explicitly instead of decoupling the contribution of mean and covariance matrix to the KL.
|
| 647 |
+
|
| 648 |
+
# D.4 PARAMETRIC VARIATIONAL DISTRIBUTION
|
| 649 |
+
|
| 650 |
+
In this case we assume our variational distribution also uses a Gaussian distribution over the action space and use the same structure as our policy $\pi$ .
|
| 651 |
+
|
| 652 |
+
Similar to the non-parametric case for a Gaussian distribution in the M-step we also use a decoupled KL but this time in the E-step for a Gaussian variational distribution. Using the same reasoning as in the previous section we can obtain the following generalized Lagrangian equation:
|
| 653 |
+
|
| 654 |
+
$$
|
| 655 |
+
L ( \theta ^ { q } , \eta _ { \mu } , \eta _ { \Sigma } ) = \int \mu _ { q } ( s ) \int q ( a | s ; \theta ^ { q } ) A _ { i } ( a , s ) d a d s + \eta _ { \mu } ( \epsilon _ { \mu } - C _ { \mu } ) + \eta _ { \Sigma } ( \epsilon _ { \Sigma } - C _ { \Sigma } ) .
|
| 656 |
+
$$
|
| 657 |
+
|
| 658 |
+
Where $\eta _ { \mu }$ and $\eta _ { \Sigma }$ are Lagrangian multipliers. And where we use the advantage function $A ( a , s )$ instead of the $\mathrm { Q }$ function $Q ( a , s )$ , as it empirically gave better performance. Please note that the KL in the $\mathrm { E }$ -step is different than the one used in the M-step. Following prior works on constraint optimisation, we can formulate the following primal problem,
|
| 659 |
+
|
| 660 |
+
$$
|
| 661 |
+
\operatorname* { m a x } _ { \pmb { \theta } ^ { q } } \operatorname* { m i n } _ { \eta _ { \mu } > 0 , \eta _ { \Sigma } > 0 } L ( \pmb { \theta } ^ { q } , \eta _ { \mu } , \eta _ { \Sigma } )
|
| 662 |
+
$$
|
| 663 |
+
|
| 664 |
+
In order to solve for $\pmb { \theta } ^ { q }$ we iteratively solve the inner and outer optimisation programs independently. In order to that we fix the Lagrangian multipliers to their current value and optimise for $\pmb { \theta } ^ { q }$ (outer maximisation), in this case we use the likelihood ratio gradient to compute the gradient w.r.t $\pmb { \theta } ^ { q }$ . Subsequently we fix the parameters $\pmb { \theta } ^ { q }$ to their current value and optimise for Lagrangian multipliers (inner minimisation). We iteratively continue this procedure until the policy parameters $\pmb { \theta } ^ { q }$ and the Lagrangian multipliers converges. Please note that the same approach can be used to bound the KL explicitly instead of decoupling the contribution of mean and covariance matrix to the KL. As our policy has the same structure as the parametric variational distribution, the M step in this case reduce to set the policy parameters $\pmb { \theta }$ to the parameters $\pmb { \theta } ^ { q }$ we obtained in E-step, i.e,
|
| 665 |
+
|
| 666 |
+
$$
|
| 667 |
+
\pmb \theta _ { i + 1 } = \pmb \theta ^ { q }
|
| 668 |
+
$$
|
| 669 |
+
|
| 670 |
+
# E IMPLEMENTATION DETAILS
|
| 671 |
+
|
| 672 |
+
While we ran most of our experiments using a single learner, we implemented a scalable variant of the presented method in which multiple workers collect data independently in an instance of the considered environment, compute gradients and send them to a chief (or parameter server) that performs parameter update by averaging gradients. That is we use distributed synchronous gradient descent. These procedures are described in Algorithms 1 and 2 for the non-parametric case and 3 for the parametric case.
|
| 673 |
+
|
| 674 |
+
# Algorithm 1 MPO (chief)
|
| 675 |
+
|
| 676 |
+
1: Input $G$ number of gradients to average
|
| 677 |
+
2: while True do
|
| 678 |
+
3: initialize $\Nu = 0$
|
| 679 |
+
4: initialize gradient store $s _ { \phi } = \{ \} , s _ { \eta } = \{ \} , s _ { \eta _ { \mu } } = \{ \} , s _ { \eta _ { \Sigma } } = \{ \} \ : s _ { \theta } = \{ \}$
|
| 680 |
+
5: while $N < G$ do
|
| 681 |
+
6: receive next gradient from worker $w$
|
| 682 |
+
7: $\begin{array} { l } { { s _ { \phi } = s _ { \phi } + [ \bar { \delta } \phi ^ { w } ] } } \\ { { s _ { \phi } = s _ { \theta } + [ \delta \theta ^ { w } ] } } \\ { { s _ { \eta } = s _ { \eta } + [ \delta \eta ^ { w } ] } } \\ { { s _ { \eta _ { \mu } } = s _ { \eta _ { \mu } } + [ \delta \eta _ { \mu } ^ { w } ] } } \\ { { s _ { \eta _ { \theta } } = s _ { \eta _ { \theta } } + [ \delta \eta _ { \theta } ^ { w } ] } } \end{array}$
|
| 683 |
+
8:
|
| 684 |
+
9:
|
| 685 |
+
10:
|
| 686 |
+
11:
|
| 687 |
+
12: update parameters with average gradient from
|
| 688 |
+
13: $s _ { \phi }$ , sη, sηµ, sηΣ sθ
|
| 689 |
+
14: send new parameters to workers
|
| 690 |
+
|
| 691 |
+
# Algorithm 2 MPO (worker) - Non parametric variational distribution
|
| 692 |
+
|
| 693 |
+
1: Input = , Σ, µ, Lmax
|
| 694 |
+
2: $i = 0$ , $L _ { \mathrm { c u r r } } = 0$
|
| 695 |
+
3: Initialise $Q _ { \omega _ { i } } ( a , s ) , \pi ( a | s , \pmb { \theta } _ { i } ) , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
|
| 696 |
+
4: for each worker do
|
| 697 |
+
5: while $L _ { \mathrm { c u r r } } > L _ { \mathrm { m a x } }$ do
|
| 698 |
+
6: update replay buffer $\boldsymbol { B }$ with $\mathrm { L }$ trajectories from the environment
|
| 699 |
+
7: $\bar { k = 0 }$
|
| 700 |
+
8: // Find better policy by gradient descent
|
| 701 |
+
9: while $k < 1 0 0 0$ do
|
| 702 |
+
10: sample a mini-batch $\boldsymbol { B }$ of $N$ $( s , a , r )$ pairs from replay
|
| 703 |
+
11: sample $M$ additional actions for each state from $\boldsymbol { B }$ , $\bar { \pi } ( \bar { a } | s , \pmb \theta _ { i } )$ for estimating integrals
|
| 704 |
+
12: compute gradients, estimating integrals using samples
|
| 705 |
+
13: // Q-function gradient:
|
| 706 |
+
14: $\delta _ { \phi } = \partial _ { \phi } L _ { \phi } ^ { \prime } ( \phi )$
|
| 707 |
+
15: // E-Step gradient:
|
| 708 |
+
16: $\delta \eta = \bar { \partial _ { \eta } g ( \eta ) }$
|
| 709 |
+
17: Let: q(a|s) ∝ π(a|s, θi) exp( Qθt (a,s,φ0)η )
|
| 710 |
+
18: // M-Step gradient:
|
| 711 |
+
19: $[ \delta _ { \eta _ { \mu } } , \delta _ { \eta _ { \Sigma } } ] \stackrel { - } { = } \alpha \partial _ { \eta _ { \mu } , \eta _ { \Sigma } } { \cal L } ( \theta _ { k } , \eta _ { \mu } , \eta _ { \Sigma } )$
|
| 712 |
+
20: $\delta _ { \theta } = \partial _ { \theta } L ( \theta , \eta _ { \mu _ { k + 1 } } , \eta _ { \Sigma k + 1 } )$
|
| 713 |
+
21: send gradients to chief worker
|
| 714 |
+
22: wait for gradient update by chief
|
| 715 |
+
23: fetch new parameters $\phi , \theta , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
|
| 716 |
+
24: $\begin{array} { r } { k = k + 1 ^ { \circ } } \\ { i = i + 1 , L _ { \mathrm { c u r r } } = L _ { \mathrm { c u r r } } + L } \\ { \pmb { \theta } _ { i } = \pmb { \theta } , \phi ^ { \prime } = \phi } \end{array}$
|
| 717 |
+
25:
|
| 718 |
+
26:
|
| 719 |
+
|
| 720 |
+
# Algorithm 3 MPO (worker) - parametric variational distribution
|
| 721 |
+
|
| 722 |
+
1: Input = Σ, µ, Lmax
|
| 723 |
+
2: $i = 0$ , Lcurr = 0
|
| 724 |
+
3: Initialise $Q _ { \omega _ { i } } ( a , s ) , \pi ( a | s , \pmb { \theta } _ { i } ) , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
|
| 725 |
+
4: for each worker do
|
| 726 |
+
5: while $L _ { \mathrm { c u r r } } < L _ { \mathrm { m a x } }$ do
|
| 727 |
+
6: update replay buffer $\boldsymbol { B }$ with $\mathrm { L }$ trajectories from the environment
|
| 728 |
+
7: $k = 0$
|
| 729 |
+
8: // Find better policy by gradient descent
|
| 730 |
+
9: while $k < 1 0 0 0$ do
|
| 731 |
+
10: sample a mini-batch $\boldsymbol { B }$ of $\mathrm { ~ V ~ } ( s , a , r )$ pairs from replay
|
| 732 |
+
11: sample $M$ additional actions for each state from $\boldsymbol { B }$ , $\dot { \pi } ( a | s , \theta _ { k } )$ for estimating inte
|
| 733 |
+
grals
|
| 734 |
+
12: compute gradients, estimating integrals using samples
|
| 735 |
+
13: // Q-function gradient:
|
| 736 |
+
14: $\delta _ { \phi } = \partial _ { \phi } L _ { \phi } ^ { \prime } ( \phi )$
|
| 737 |
+
15: // E-Step gradient:
|
| 738 |
+
16: $\begin{array} { r l } & { \bigl [ \delta _ { \eta _ { \mu } } , \delta _ { \eta _ { \Sigma } } \bigr ] ^ { \circ } = \alpha \partial _ { \eta _ { \mu } , \eta _ { \Sigma } } L ( \pmb \theta _ { k } , \eta _ { \mu } , \eta _ { \Sigma } ) } \\ & { \delta _ { \theta } = \partial _ { \theta } L ( \pmb \theta , \eta _ { \mu _ { k + 1 } } , \eta _ { \Sigma k + 1 , \eta } , } \\ & { \dots , \dots } \end{array}$
|
| 739 |
+
17:
|
| 740 |
+
18: // M-Step gradient: In practice there is no M-step in this case as policy and variatinal
|
| 741 |
+
distribution $q$ use a same structure.
|
| 742 |
+
19: send gradients to chief worker
|
| 743 |
+
20: wait for gradient update by chief
|
| 744 |
+
21: fetch new parameters $\phi , \theta , \eta , \eta _ { \mu } , \eta _ { \Sigma }$
|
| 745 |
+
22: $\begin{array} { r } { k = k + 1 ^ { \mathbf { \complement } } } \\ { i = i + 1 , L _ { \mathrm { c u r r } } = L _ { \mathrm { c u r r } } + L } \\ { \pmb { \theta } _ { i } = \pmb { \theta } , \phi ^ { \prime } = \phi } \end{array}$
|
| 746 |
+
23:
|
| 747 |
+
24:
|
md/train/S1Bb3D5gg/S1Bb3D5gg.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING END-TO-END GOAL-ORIENTED DIALOG
|
| 2 |
+
|
| 3 |
+
Antoine Bordes, Y-Lan Boureau & Jason Weston
|
| 4 |
+
Facebook AI Research
|
| 5 |
+
New York, USA
|
| 6 |
+
{abordes, ylan, jase}@fb.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Traditional dialog systems used in goal-oriented applications require a lot of domain-specific handcrafting, which hinders scaling up to new domains. Endto-end dialog systems, in which all components are trained from the dialogs themselves, escape this limitation. But the encouraging success recently obtained in chit-chat dialog may not carry over to goal-oriented settings. This paper proposes a testbed to break down the strengths and shortcomings of end-to-end dialog systems in goal-oriented applications. Set in the context of restaurant reservation, our tasks require manipulating sentences and symbols in order to properly conduct conversations, issue API calls and use the outputs of such calls. We show that an end-to-end dialog system based on Memory Networks can reach promising, yet imperfect, performance and learn to perform non-trivial operations. We confirm those results by comparing our system to a hand-crafted slot-filling baseline on data from the second Dialog State Tracking Challenge (Henderson et al., 2014a). We show similar result patterns on data extracted from an online concierge service.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
The most useful applications of dialog systems such as digital personal assistants or bots are currently goal-oriented and transactional: the system needs to understand a user request and complete a related task with a clear goal within a limited number of dialog turns. The workhorse of traditional dialog systems is slot-filling (Lemon et al., 2006; Wang and Lemon, 2013; Young et al., 2013) which predefines the structure of a dialog state as a set of slots to be filled during the dialog. For a restaurant reservation system, such slots can be the location, price range or type of cuisine of a restaurant. Slot-filling has proven reliable but is inherently hard to scale to new domains: it is impossible to manually encode all features and slots that users might refer to in a conversation.
|
| 15 |
+
|
| 16 |
+
End-to-end dialog systems, usually based on neural networks (Shang et al., 2015; Vinyals and Le, 2015; Sordoni et al., 2015; Serban et al., 2015a; Dodge et al., 2016), escape such limitations: all their components are directly trained on past dialogs, with no assumption on the domain or dialog state structure, thus making it easy to automatically scale up to new domains. They have shown promising performance in non goal-oriented chit-chat settings, where they were trained to predict the next utterance in social media and forum threads (Ritter et al., 2011; Wang et al., 2013; Lowe et al., 2015) or movie conversations (Banchs, 2012). But the performance achieved on chit-chat may not necessarily carry over to goal-oriented conversations. As illustrated in Figure 1 in a restaurant reservation scenario, conducting goal-oriented dialog requires skills that go beyond language modeling, e.g., asking questions to clearly define a user request, querying Knowledge Bases (KBs), interpreting results from queries to display options to users or completing a transaction. This makes it hard to ascertain how well end-to-end dialog models would do, especially since evaluating chit-chat performance in itself is not straightforward (Liu et al., 2016). In particular, it is unclear if end-to-end models are in a position to replace traditional dialog methods in a goal-directed setting: can end-to-end dialog models be competitive with traditional methods even in the well-defined narrow-domain tasks where they excel? If not, where do they fall short?
|
| 17 |
+
|
| 18 |
+
This paper aims to make it easier to address these questions by proposing an open resource to test endto-end dialog systems in a way that 1) favors reproducibility and comparisons, and 2) is lightweight and easy to use. We aim to break down a goal-directed objective into several subtasks to test some crucial capabilities that dialog systems should have (and hence provide error analysis by design).
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 1: Goal-oriented dialog tasks. A user (in green) chats with a bot (in blue) to book a table at a restaurant. Models must predict bot utterances and API calls (in dark red). Task 1 tests the capacity of interpreting a request and asking the right questions to issue an API call. Task 2 checks the ability to modify an API call. Task 3 and 4 test the capacity of using outputs from an API call (in light red) to propose options (sorted by rating) and to provide extra-information. Task 5 combines everything.
|
| 22 |
+
|
| 23 |
+
In the spirit of the bAbI tasks conceived as question answering testbeds (Weston et al., 2015b), we designed a set of five tasks within the goal-oriented context of restaurant reservation. Grounded with an underlying KB of restaurants and their properties (location, type of cuisine, etc.), these tasks cover several dialog stages and test if models can learn various abilities such as performing dialog management, querying KBs, interpreting the output of such queries to continue the conversation or dealing with new entities not appearing in dialogs from the training set. In addition to showing how the set of tasks we propose can be used to test the goal-directed capabilities of an end-to-end dialog system, we also propose results on two additional datasets extracted from real interactions with users, to confirm that the pattern of results observed in our tasks is indeed a good proxy for what would be observed on real data, with the added benefit of better reproducibility and interpretability.
|
| 24 |
+
|
| 25 |
+
The goal here is explicitly not to improve the state of the art in the narrow domain of restaurant booking, but to take a narrow domain where traditional handcrafted dialog systems are known to perform well, and use that to gauge the strengths and weaknesses of current end-to-end systems with no domain knowledge. Solving our tasks requires manipulating both natural language and symbols from a KB. Evaluation uses two metrics, per-response and per-dialog accuracies, the latter tracking completion of the actual goal. Figure 1 depicts the tasks and Section 3 details them. Section 4 compares multiple methods on these tasks. As an end-to-end neural model, we tested Memory Networks (Weston et al., 2015a), an attention-based architecture that has proven competitive for non goal-oriented dialog (Dodge et al., 2016). Our experiments in Section 5 show that Memory Networks can be trained to perform non-trivial operations such as issuing API calls to KBs and manipulating entities unseen in training. We confirm our findings on real human-machine dialogs from the restaurant reservation dataset of the $2 ^ { n d }$ Dialog State Tracking Challenge, or DSTC2 (Henderson et al., 2014a), which we converted into our task format, showing that Memory Networks can outperform a dedicated slot-filling rule-based baseline. We also evaluate on a dataset of humanhuman dialogs extracted from an online concierge service that books restaurants for users. Overall, the per-response performance is encouraging, but the per-dialog one remains low, indicating that end-to-end models still need to improve before being able to reliably handle goal-oriented dialog.
|
| 26 |
+
|
| 27 |
+
Table 1: Data used in this paper. Tasks 1-5 were generated using our simulator and share the same KB. Task 6 was converted from the $2 ^ { n d }$ Dialog State Tracking Challenge (Henderson et al., 2014a). Concierge is made of chats extracted from a real online concierge service. (∗) Tasks 1-5 have two test sets, one using the vocabulary of the training set and the other using out-of-vocabulary words.
|
| 28 |
+
|
| 29 |
+
<table><tr><td></td><td>Tasks</td><td>T1</td><td>T2</td><td>T3</td><td>T4</td><td>T5</td><td>T6</td><td>Concierge</td></tr><tr><td rowspan="4">DIALOGS Average statistics</td><td>Number of utterances:</td><td>12</td><td>17</td><td>43</td><td>15</td><td>55</td><td>54</td><td>8</td></tr><tr><td>- user utterances</td><td>5</td><td>7</td><td>7</td><td>4</td><td>13</td><td>6</td><td>4</td></tr><tr><td>- bot utterances</td><td>7</td><td>10</td><td>10</td><td>4</td><td>18</td><td>8</td><td>4</td></tr><tr><td>- outputs from API calls</td><td>0</td><td>0</td><td>23</td><td>7</td><td>24</td><td>40</td><td>0</td></tr><tr><td rowspan="4">DATASETS</td><td>Vocabulary size</td><td></td><td></td><td>3,747</td><td></td><td></td><td>1,229</td><td>8.629</td></tr><tr><td>Candidate set size</td><td></td><td></td><td>4,212</td><td></td><td></td><td>2,406</td><td>11,482</td></tr><tr><td>Training dialogs</td><td></td><td></td><td>1,000</td><td></td><td></td><td>1,618</td><td>3,249</td></tr><tr><td>Validation dialogs</td><td></td><td></td><td>1,000</td><td></td><td></td><td>500</td><td>403</td></tr><tr><td>Tasks1-5 share the same data source</td><td>Test dialogs</td><td></td><td></td><td>1,000(*)</td><td></td><td></td><td>1,117</td><td>402</td></tr></table>
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
The most successful goal-oriented dialog systems model conversation as partially observable Markov decision processes (POMDP) (Young et al., 2013). However, despite recent efforts to learn modules (Henderson et al., 2014b), they still require many hand-crafted features for the state and action space representations, which restrict their usage to narrow domains. Our simulation, used to generate goal-oriented datasets, can be seen as an equivalent of the user simulators used to train POMDP (Young et al., 2013; Pietquin and Hastie, 2013), but for training end-to-end systems.
|
| 34 |
+
|
| 35 |
+
Serban et al. (2015b) list available corpora for training dialog systems. Unfortunately, no good resources exist to train and test end-to-end models in goal-oriented scenarios. Goal-oriented datasets are usually designed to train or test dialog state tracker components (Henderson et al., 2014a) and are hence of limited scale and not suitable for end-to-end learning (annotated at the state level and noisy). However, we do convert the Dialog State Tracking Challenge data into our framework. Some datasets are not open source, and require a particular license agreement or the participation to a challenge (e.g., the end-to-end task of DSTC4 (Kim et al., 2016)) or are proprietary (e.g., Chen et al. (2016)). Datasets are often based on interactions between users and existing systems (or ensemble of systems) like DSTC datasets, SFCore (Gašic et al., 2014) or ATIS (Dahl et al., 1994). This creates noise and makes it harder to interpret the errors of a model. Lastly, resources designed to connect dialog systems to users, in particular in the context of reinforcement learning, are usually built around a crowdsourcing setting such as Amazon Mechanical Turk, e.g., (Hixon et al., 2015; Wen et al., 2015; Su et al., 2015a;b). While this has clear advantages, it prevents reproducibility and consistent comparisons of methods in the exact same setting.
|
| 36 |
+
|
| 37 |
+
The closest resource to ours might be the set of tasks described in (Dodge et al., 2016), since some of them can be seen as goal-oriented. However, those are question answering tasks rather than dialog, i.e. the bot only responds with answers, never questions, which does not reflect full conversation.
|
| 38 |
+
|
| 39 |
+
# 3 GOAL-ORIENTED DIALOG TASKS
|
| 40 |
+
|
| 41 |
+
All our tasks involve a restaurant reservation system, where the goal is to book a table at a restaurant. The first five tasks are generated by a simulation, the last one uses real human-bot dialogs. The data for all tasks is available at http://fb.ai/babi. We also give results on a proprietary dataset extracted from an online restaurant reservation concierge service with anonymized users.
|
| 42 |
+
|
| 43 |
+
# 3.1 RESTAURANT RESERVATION SIMULATION
|
| 44 |
+
|
| 45 |
+
The simulation is based on an underlying KB, whose facts contain the restaurants that can be booked and their properties. Each restaurant is defined by a type of cuisine (10 choices, e.g., French, Thai), a location (10 choices, e.g., London, Tokyo), a price range (cheap, moderate or expensive) and a rating (from 1 to 8). For simplicity, we assume that each restaurant only has availability for a single party size (2, 4, 6 or 8 people). Each restaurant also has an address and a phone number listed in the KB.
|
| 46 |
+
|
| 47 |
+
The KB can be queried using API calls, which return the list of facts related to the corresponding restaurants. Each query must contain four fields: a location, a type of cuisine, a price range and a party size. It can return facts concerning one, several or no restaurant (depending on the party size).
|
| 48 |
+
|
| 49 |
+
Using the KB, conversations are generated in the format shown in Figure 1. Each example is a dialog comprising utterances from a user and a bot, as well as API calls and the resulting facts. Dialogs are generated after creating a user request by sampling an entry for each of the four required fields: e.g. the request in Figure 1 is [cuisine: British, location: London, party size: six, price range: expensive]. We use natural language patterns to create user and bot utterances. There are 43 patterns for the user and 20 for the bot (the user can use up to 4 ways to say something, while the bot always uses the same). Those patterns are combined with the KB entities to form thousands of different utterances.
|
| 50 |
+
|
| 51 |
+
# 3.1.1 TASK DEFINITIONS
|
| 52 |
+
|
| 53 |
+
We now detail each task. Tasks 1 and 2 test dialog management to see if end-to-end systems can learn to implicitly track dialog state (never given explicitly), whereas Task 3 and 4 check if they can learn to use KB facts in a dialog setting. Task 3 also requires to learn to sort. Task 5 combines all tasks.
|
| 54 |
+
|
| 55 |
+
Task 1: Issuing API calls A user request implicitly defines a query that can contain from 0 to 4 of the required fields (sampled uniformly; in Figure 1, it contains 3). The bot must ask questions for filling the missing fields and eventually generate the correct corresponding API call. The bot asks for information in a deterministic order, making prediction possible.
|
| 56 |
+
|
| 57 |
+
Task 2: Updating API calls Starting by issuing an API call as in Task 1, users then ask to update their requests between 1 and 4 times (sampled uniformly). The order in which fields are updated is random. The bot must ask users if they are done with their updates and issue the updated API call.
|
| 58 |
+
|
| 59 |
+
Task 3: Displaying options Given a user request, we query the KB using the corresponding API call and add the facts resulting from the call to the dialog history. The bot must propose options to users by listing the restaurant names sorted by their corresponding rating (from higher to lower) until users accept. For each option, users have a $2 5 \%$ chance of accepting. If they do, the bot must stop displaying options, otherwise propose the next one. Users always accept the option if this is the last remaining one. We only keep examples with API calls retrieving at least 3 options.
|
| 60 |
+
|
| 61 |
+
Task 4: Providing extra information Given a user request, we sample a restaurant and start the dialog as if users had agreed to book a table there. We add all KB facts corresponding to it to the dialog. Users then ask for the phone number of the restaurant, its address or both, with proportions $2 5 \%$ , $2 5 \%$ and $50 \%$ respectively. The bot must learn to use the KB facts correctly to answer.
|
| 62 |
+
|
| 63 |
+
Task 5: Conducting full dialogs We combine Tasks 1-4 to generate full dialogs just as in Figure 1.
|
| 64 |
+
Unlike in Task 3, we keep examples if API calls return at least 1 option instead of 3.
|
| 65 |
+
|
| 66 |
+
# 3.1.2 DATASETS
|
| 67 |
+
|
| 68 |
+
We want to test how well models handle entities appearing in the KB but not in the dialog training sets. We split types of cuisine and locations in half, and create two KBs, one with all facts about restaurants within the first halves and one with the rest. This yields two KBs of 4,200 facts and 600 restaurants each (5 types of cuisine $\times 5$ locations $\times 3$ price ranges $\times 8$ ratings) that only share price ranges, ratings and party sizes, but have disjoint sets of restaurants, locations, types of cuisine, phones and addresses. We use one of the KBs to generate the standard training, validation and test dialogs, and use the other KB only to generate test dialogs, termed Out-Of-Vocabulary (OOV) test sets.
|
| 69 |
+
|
| 70 |
+
For training, systems have access to the training examples and both KBs. We then evaluate on both test sets, plain and OOV. Beyond the intrinsic difficulty of each task, the challenge on the OOV test sets is for models to generalize to new entities (restaurants, locations and cuisine types) unseen in any training dialog – something natively impossible for embedding methods. Ideally, models could, for instance, leverage information coming from the entities of the same type seen during training.
|
| 71 |
+
|
| 72 |
+
We generate five datasets, one per task defined in 3.1.1. Table 1 gives their statistics. Training sets are relatively small (1,000 examples) to create realistic learning conditions. The dialogs from the training and test sets are different, never being based on the same user requests. Thus, we test if models can generalize to new combinations of fields. Dialog systems are evaluated in a ranking, not a generation, setting: at each turn of the dialog, we test whether they can predict bot utterances and API calls by selecting a candidate, not by generating it.1 Candidates are ranked from a set of all bot utterances and API calls appearing in training, validation and test sets (plain and OOV) for all tasks combined.
|
| 73 |
+
|
| 74 |
+
# 3.2 DIALOG STATE TRACKING CHALLENGE
|
| 75 |
+
|
| 76 |
+
Since our tasks rely on synthetically generated language for the user, we supplement our dataset with real human-bot dialogs. We use data from DSTC2 (Henderson et al., 2014a), that is also in the restaurant booking domain. Unlike our tasks, its user requests only require 3 fields: type of cuisine (91 choices), location (5 choices) and price range (3 choices). The dataset was originally designed for dialog state tracking hence every dialog turn is labeled with a state (a user intent $^ +$ slots) to be predicted. As our goal is to evaluate end-to-end training, we did not use that, but instead converted the data into the format of our 5 tasks and included it in the dataset as Task 6.
|
| 77 |
+
|
| 78 |
+
We used the provided speech transcriptions to create the user and bot utterances, and given the dialog states we created the API calls to the KB and their outputs which we added to the dialogs. We also added ratings to the restaurants returned by the API calls, so that the options proposed by the bots can be consistently predicted (by using the highest rating). We did use the original test set but use a slightly different training/validation split. Our evaluation differs from the challenge (we do not predict the dialog state), so we cannot compare with the results from (Henderson et al., 2014a).
|
| 79 |
+
|
| 80 |
+
This dataset has similar statistics to our Task 5 (see Table 1) but is harder. The dialogs are noisier and the bots made mistakes due to speech recognition errors or misinterpretations and also do not always have a deterministic behavior (the order in which they can ask for information varies).
|
| 81 |
+
|
| 82 |
+
# 3.3 ONLINE CONCIERGE SERVICE
|
| 83 |
+
|
| 84 |
+
Tasks 1-6 are, at least partially, artificial. This provides perfect control over their design (at least for Tasks 1-5), but no guarantee that good performance would carry over from such synthetic to more realistic conditions. To quantify this, we also evaluate the models from Section 4 on data extracted from a real online concierge service performing restaurant booking: users make requests through a text-based chat interface that are handled by human operators who can make API calls. All conversations are between native English speakers.
|
| 85 |
+
|
| 86 |
+
We collected around 4k chats to create this extra dataset, denoted Concierge. All conversations have been anonymized by (1) removing all user identifiers, (2) using the Stanford NER tagger to remove named entities (locations, timestamps, etc.), (3) running some manually defined regex to filter out any remaining salient information (phone numbers, etc.). The dataset does not contain results from API calls, but still records when operators made use of an external service (Yelp or OpenTable) to gather information. Hence, these have to be predicted, but without any argument (unlike in Task 2).
|
| 87 |
+
|
| 88 |
+
The statistics of Concierge are given in Table 1. The dialogs are shorter than in Tasks 1-6, especially since they do not include results of API calls, but the vocabulary is more diverse and so is the candidate set; the candidate set is made of all utterances of the operator appearing in the training, validation and test sets. Beyond the higher variability of the language used by human operators compared to bots, the dataset offers additional challenges. The set of user requests is much wider, ranging from managing restaurant reservations to asking for recommendations or specific information. Users do not always stay focused on the request. API calls are not always used (e.g., the operator might use neither Yelp nor OpenTable to find a restaurant), and facts about restaurants are not structured nor constrained as in a KB. The structure of dialogs is thus much more variable. Users and operators also make typos, spelling and grammar mistakes.
|
| 89 |
+
|
| 90 |
+
# 4 MODELS
|
| 91 |
+
|
| 92 |
+
To demonstrate how to use the dataset and provide baselines, we evaluate several learning methods on our goal-oriented dialog tasks: rule-based systems, classical information retrieval methods, supervised embeddings, and end-to-end Memory networks.
|
| 93 |
+
|
| 94 |
+
# 4.1 RULE-BASED SYSTEMS
|
| 95 |
+
|
| 96 |
+
Our tasks T1-T5 are built with a simulator so as to be completely predictable. Thus it is possible to hand-code a rule based system that achieves $100 \%$ on them, similar to the bAbI tasks of Weston et al. (2015b). Indeed, the point of these tasks is not to check whether a human is smart enough to be able to build a rule-based system to solve them, but to help analyze in which circumstances machine learning algorithms are smart enough to work, and where they fail.
|
| 97 |
+
|
| 98 |
+
However, the Dialog State Tracking Challenge task (T6) contains some real interactions with users. This makes rule-based systems less straightforward and not so accurate (which is where we expect machine learning to be useful). We implemented a rule-based system for this task in the following way. We initialized a dialog state using the 3 relevant slots for this task: cuisine type, location and price range. Then we analyzed the training data and wrote a series of rules that fire for triggers like word matches, positions in the dialog, entity detections or dialog state, to output particular responses, API calls and/or update a dialog state. Responses are created by combining patterns extracted from the training set with entities detected in the previous turns or stored in the dialog state. Overall we built 28 rules and extracted 21 patterns. We optimized the choice of rules and their application priority (when needed) using the validation set, reaching a validation per-response accuracy of $4 0 . 7 \%$ . We did not build a rule-based system for Concierge data as it is even less constrained.
|
| 99 |
+
|
| 100 |
+
# 4.2 CLASSICAL INFORMATION RETRIEVAL MODELS
|
| 101 |
+
|
| 102 |
+
Classical information retrieval (IR) models with no machine learning are standard baselines that often perform surprisingly well on dialog tasks (Isbell et al., 2000; Jafarpour et al., 2010; Ritter et al., 2011; Sordoni et al., 2015). We tried two standard variants:
|
| 103 |
+
|
| 104 |
+
TF-IDF Match For each possible candidate response, we compute a matching score between the input and the response, and rank the responses by score. The score is the TF–IDF weighted cosine similarity between the bag-of-words of the input and bag-of-words of the candidate response. We consider the case of the input being either only the last utterance or the entire conversation history, and choose the variant that works best on the validation set (typically the latter).
|
| 105 |
+
|
| 106 |
+
Nearest Neighbor Using the input, we find the most similar conversation in the training set, and output the response from that example. In this case we consider the input to only be the last utterance, and consider the training set as (utterance, response) pairs that we select from. We use word overlap as the scoring method. When several responses are associated with the same utterance in training, we sort them by decreasing co-occurence frequency.
|
| 107 |
+
|
| 108 |
+
# 4.3 SUPERVISED EMBEDDING MODELS
|
| 109 |
+
|
| 110 |
+
A standard, often strong, baseline is to use supervised word embedding models for scoring (conversation history, response) pairs. The embedding vectors are trained directly for this goal. In contrast, word embeddings are most well-known in the context of unsupervised training on raw text as in word2vec (Mikolov et al., 2013). Such models are trained by learning to predict the middle word given the surrounding window of words, or vice-versa. However, given training data consisting of dialogs, a much more direct and strongly performing training procedure can be used: predict the next response given the previous conversation. In this setting a candidate reponse $y$ is scored against the input $x$ : $\bar { f } ( x , y ) = \bar { ( } A x ) ^ { \top } B y$ , where $A$ and $B$ are $d \times V$ word embedding matrices, i.e. input and response are treated as summed bags-of-embeddings. We also consider the case of enforcing $A = B$ , which sometimes works better, and optimize the choice on the validation set.
|
| 111 |
+
|
| 112 |
+
The embeddings are trained with a margin ranking loss: $f ( x , y ) > m + f ( x , { \bar { y } } )$ , with $m$ the size of the margin, and we sample $N$ negative candidate responses $\bar { y }$ per example, and train with SGD. This approach has been previously shown to be very effective in a range of contexts (Bai et al., 2009;
|
| 113 |
+
|
| 114 |
+
Dodge et al., 2016). This method can be thought of as a classical information retrieval model, but where the matching function is learnt.
|
| 115 |
+
|
| 116 |
+
# 4.4 MEMORY NETWORKS
|
| 117 |
+
|
| 118 |
+
Memory Networks (Weston et al., 2015a; Sukhbaatar et al., 2015) are a recent class of models that have been applied to a range of natural language processing tasks, including question answering (Weston et al., 2015b), language modeling (Sukhbaatar et al., 2015), and non-goal-oriented dialog (Dodge et al., 2016). By first writing and then iteratively reading from a memory component (using hops) that can store historical dialogs and short-term context to reason about the required response, they have been shown to perform well on those tasks and to outperform some other end-to-end architectures based on Recurrent Neural Networks. Hence, we chose them as end-to-end model baseline.
|
| 119 |
+
|
| 120 |
+
We use the MemN2N architecture of Sukhbaatar et al. (2015), with an additional modification to leverage exact matches and types, described shortly. Apart from that addition, the main components of the model are (i) how it stores the conversation in memory, (ii) how it reads from the memory to reason about the response; and (iii) how it outputs the response. The details are given in Appendix A.
|
| 121 |
+
|
| 122 |
+
# 4.5 MATCH TYPE FEATURES TO DEAL WITH ENTITIES
|
| 123 |
+
|
| 124 |
+
Words denoting entities have two important traits: 1) exact matches are usually more appropriate to deal with them than approximate matches, and 2) they frequently appear as OOV words (e.g., the name of a new restaurant). Both are a challenge for embedding-based methods. Firstly, embedding into a low dimensional space makes it hard to differentiate between exact word matches, and matches between words with similar meaning (Bai et al., 2009). While this can be a virtue (e.g. when using synonyms), it is often a flaw when dealing with entities (e.g. failure to differentiate between phone numbers since they have similar embeddings). Secondly, when a new word is used (e.g. the name of a new restaurant) not seen before in training, no word embedding is available, typically resulting in failure (Weston et al., 2015a).
|
| 125 |
+
|
| 126 |
+
Both problems can be alleviated with match type features. Specifically, we augment the vocabulary with 7 special words, one for each of the KB entity types (cuisine type, location, price range, party size, rating, phone number and address). For each type, the corresponding type word is added to the candidate representation if a word is found that appears 1) as a KB entity of that type, 2) in the candidate, and 3) in the input or memory. Any word that matches as a KB entity can be typed even if it has never been seen before in training dialogs. These features allow the model to learn to rely on type information using exact matching words cues when OOV entity embeddings are not known, as long as it has access to a KB with the OOV entities. We assess the impact of such features for TF-IDF Match, Supervised Embeddings and Memory Networks.
|
| 127 |
+
|
| 128 |
+
# 5 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
Our main results across all the models and tasks are given in Table 2 (extra results are also given in Table 10 of Appendix D). The first 5 rows show tasks T1-T5, and rows 6-10 show the same tasks in the out-of-vocabulary setting. Rows 11 and 12 give results for the Dialog State Tracking Challenge task (T6) and Concierge respectively. Columns 2-7 give the results of each method tried in terms of per-response accuracy and per-dialog accuracy, the latter given in parenthesis. Per-response accuracy counts the percentage of responses that are correct (i.e., the correct candidate is chosen out of all possible candidates). Per-dialog accuracy counts the percentage of dialogs where every response is correct. Ultimately, if only one response is incorrect this could result in a failed dialog, i.e. failure to achieve the goal (in this case, of achieving a restaurant booking). Note that we test Memory Networks (MemNNs) with and without match type features, the results are shown in the last two columns. The hyperparameters for all models were optimized on the validation sets; values for best performing models are given in Appendix C.
|
| 131 |
+
|
| 132 |
+
The classical IR method TF-IDF Match performs the worst of all methods, and much worse than the Nearest Neighbor IR method, which is true on both the simulated tasks T1-T5 and on the real data of T6 and Concierge. Supplementing TF-IDF Match with match type features noticeably improves performance, which however still remains far behind Nearest Neighbor IR (adding bigrams to the
|
| 133 |
+
|
| 134 |
+
Table 2: Test results across all tasks and methods. For tasks T1-T5 results are given in the standard setup and the out-of-vocabulary (OOV) setup, where words (e.g. restaurant names) may not have been seen during training. Task T6 is the Dialog state tracking 2 task with real dialogs, and only has one setup. Best performing methods (or methods within $0 . 1 \%$ of best performing) are given in bold for the per-response accuracy metric, with the per-dialog accuracy given in parenthesis. (∗) For Concierge, an example is considered correctly answered if the correct response is ranked among the top 10 candidates by the bot, to accommodate the much larger range of semantically equivalent responses among candidates (see ex. in Tab. 7) . (†) We did not implement MemNNs+match type on Concierge, because this method requires a KB and there is none associated with it.
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Rule-based Systems</td><td colspan="2">TF-IDF Match</td><td rowspan="2">Nearest</td><td colspan="2">Supervised</td><td rowspan="2"></td><td colspan="3">Memory Networks</td></tr><tr><td>no type</td><td>+type</td><td>Neighbor</td><td>Embeddings</td><td>no match type</td><td></td><td>+ match type</td></tr><tr><td>T1: Issuing API calls</td><td>100 (100)</td><td>5.6 (0)</td><td>22.4(0)</td><td>55.1 (0)</td><td>100</td><td>(100)</td><td></td><td>99.9 (99.6)</td><td>100</td><td>(100)</td></tr><tr><td>T2: Updating API calls</td><td>100 (100)</td><td>3.4(0)</td><td>16.4(0)</td><td>68.3(0)</td><td>68.4</td><td>(0))</td><td>100</td><td>(100)</td><td>98.3</td><td>(83.9)</td></tr><tr><td>T3:Displaying options</td><td>100 (100)</td><td>8.0 (0)</td><td>8.0 (0)</td><td>58.8 (0)</td><td>64.9</td><td>(0)</td><td>74.9</td><td>(2.0)</td><td>74.9</td><td>(0)</td></tr><tr><td>T4:Providing information</td><td>100 (100)</td><td>9.5 (0)</td><td>17.8(0)</td><td>28.6 (0)</td><td>57.2</td><td>(0)</td><td>59.5</td><td>(3.0)</td><td>100</td><td>(100)</td></tr><tr><td>T5: Full dialogs</td><td>100 (100)</td><td>4.6 (0)</td><td>8.1(0)</td><td>57.1 (0)</td><td>75.4</td><td>(0)</td><td>96.1</td><td>(49.4)</td><td>93.4</td><td>(19.7)</td></tr><tr><td>T1(OOV): Issuing API calls</td><td>100 (100)</td><td>5.8 (0)</td><td>22.4(0)</td><td>44.1 (0)</td><td>60.0</td><td>(0)</td><td>72.3</td><td>(0)</td><td>96.5</td><td>(82.7)</td></tr><tr><td>T2(OOV): Updating API calls</td><td>100 (100)</td><td>3.5 (0)</td><td>16.8(0)</td><td>68.3 (0)</td><td>68.3</td><td>(0)</td><td>78.9</td><td>(0)</td><td>94.5</td><td>(48.4)</td></tr><tr><td>T3(OOV): Displaying options</td><td>100 (100)</td><td>8.3 (0)</td><td>8.3 (0)</td><td>58.8 (0)</td><td>65.0</td><td>(0)</td><td>74.4</td><td>(0)</td><td>75.2</td><td>(0)</td></tr><tr><td>T4(OOV): Providing inform.</td><td>100 (100)</td><td>9.8 (0)</td><td>17.2(0)</td><td>28.6 (0)</td><td>57.0</td><td>(0)</td><td>57.6</td><td>(0)</td><td>100</td><td>(100)</td></tr><tr><td>T5(OOV): Full dialogs</td><td>100 (100)</td><td>4.6(0)</td><td>9.0 (0)</td><td>48.4 (0)</td><td>58.2</td><td>(0)</td><td>65.5</td><td>(0)</td><td>77.7</td><td>(0)</td></tr><tr><td>T6: Dialog state tracking 2</td><td>33.3 0</td><td>1.6(0)</td><td>1.6 (0)</td><td>21.9 (0)</td><td>22.6</td><td>0</td><td>41.1</td><td>(0)</td><td>41.0</td><td>(0</td></tr><tr><td>Concierge(*)</td><td>n/a</td><td>1.1(0.2)</td><td>n/a</td><td>13.4(0.5)</td><td>14.6</td><td>(0.5)</td><td>16.7</td><td>(1.2)</td><td>n/a()</td><td></td></tr></table>
|
| 137 |
+
|
| 138 |
+
dictionary has no effect on performance). This is in sharp contrast to other recent results on datadriven non-goal directed conversations, e.g. over dialogs on Twitter (Ritter et al., 2011) or Reddit (Dodge et al., 2016), where it was found that TF-IDF Match outperforms Nearest Neighbor, as general conversations on a given subject typically share many words. We conjecture that the goal-oriented nature of the conversation means that the conversation moves forward more quickly, sharing fewer words per (input, response) pair, e.g. consider the example in Figure 1.
|
| 139 |
+
|
| 140 |
+
Supervised embeddings outperform classical IR methods in general, indicating that learning mappings between words (via word embeddings) is important. However, only one task (T1, Issuing API calls) is completely successful. In the other tasks, some responses are correct, as shown by the per-response accuracy, however there is no dialog where the goal is actually achieved (i.e., the mean dialogaccuracy is 0). Typically the model can provide correct responses for greeting messages, asking to wait, making API calls and asking if there are any other options necessary. However, it fails to interpret the results of API calls to display options, provide information or update the calls with new information, resulting in most of its errors, even when match type features are provided.
|
| 141 |
+
|
| 142 |
+
Memory Networks (without match type features) outperform classical IR and supervised embeddings across all of the tasks. They can solve the first two tasks (issuing and updating API calls) adequately. On the other tasks, they give improved results, but do not solve them. While the per-response accuracy is improved, the per-dialog accuracy is still close to 0 on T3 and T4. Some examples of predictions of the MemNN for T1-4 are given in Appendix B. On the OOV tasks again performance is improved, but this is all due to better performance on known words, as unknown words are simply not used without the match type features. As stated in Appendix C, optimal hyperparameters on several of the tasks involve 3 or 4 hops, indicating that iterative accessing and reasoning over the conversation helps, e.g. on T3 using 1 hop gives $6 4 . 8 \%$ while 2 hops yields $7 4 . 7 \%$ . Appendix B displays illustrative examples of Memory Networks predictions on T 1-4 and Concierge.
|
| 143 |
+
|
| 144 |
+
Memory Networks with match type features give two performance gains over the same models without match type features: (i) T4 (providing information) becomes solvable because matches can be made to the results of the API call; and (ii) out-of-vocabulary results are significantly improved as well. Still, tasks T3 and T5 are still fail cases, performance drops slightly on T2 compared to not using match type features, and no relative improvement is observed on T6. Finally, note that matching words on its own is not enough, as evidenced by the poor performance of TF-IDF matching; this idea must be combined with types and the other properties of the MemNN model.
|
| 145 |
+
|
| 146 |
+
Unsurprisingly, perfectly coded rule-based systems can solve the simulated tasks T1-T5 perfectly, whereas our machine learning methods cannot. However, it is not easy to build an effective rule-based system when dealing with real language on real problems, and our rule based system is outperformed by MemNNs on the more realistic task T6.
|
| 147 |
+
|
| 148 |
+
Overall, while the methods we tried made some inroads into these tasks, there are still many challenges left unsolved. Our best models can learn to track implicit dialog states and manipulate OOV words and symbols (T1-T2) to issue API calls and progress in conversations, but they are still unable to perfectly handle interpreting knowledge about entities (from returned API calls) to present results to the user, e.g. displaying options in T3. The improvement observed on the simulated tasks e.g. where MemNNs outperform supervised embeddings which in turn outperform IR methods, is also seen on the realistic data of T6 with similar relative gains. This is encouraging as it indicates that future work on breaking down, analysing and developing models over the simulated tasks should help in the real tasks as well. Results on Concierge confirm this observation: the pattern of relative performances of methods is the same on Concierge and on our series of tasks. This suggests that our synthetic data can indeed be used as an effective evaluation proxy.
|
| 149 |
+
|
| 150 |
+
# 6 CONCLUSION
|
| 151 |
+
|
| 152 |
+
We have introduced an open dataset and task set for evaluating end-to-end goal-oriented dialog learning methods in a systematic and controlled way. We hope this will help foster progress of end-toend conversational agents because (i) existing measures of performance either prevent reproducibility (different Mechanical Turk jobs) or do not correlate well with human judgements (Liu et al., 2016); (ii) the breakdown in tasks will help focus research and development to improve the learning methods; and (iii) goal-oriented dialog has clear utility in real applications. We illustrated how to use the testbed using a variant of end-to-end Memory Networks, which prove an effective model on these tasks relative to other baselines, but are still lacking in some key areas.
|
| 153 |
+
|
| 154 |
+
# ACKNOWLEDGMENTS
|
| 155 |
+
|
| 156 |
+
The authors would like to thank Martin Raison, Alex Lebrun and Laurent Landowski for their help with the Concierge data.
|
| 157 |
+
|
| 158 |
+
# REFERENCES
|
| 159 |
+
|
| 160 |
+
Bai, B., Weston, J., Grangier, D., Collobert, R., Sadamasa, K., Qi, Y., Chapelle, O., and Weinberger, K. (2009). Supervised semantic indexing. In Proceedings of ACM CIKM, pages 187–196. ACM.
|
| 161 |
+
Banchs, R. E. (2012). Movie-dic: a movie dialogue corpus for research and development. In Proceedings of the 50th Annual Meeting of the ACL.
|
| 162 |
+
Chen, Y.-N., Hakkani-Tür, D., Tur, G., Gao, J., and Deng, L. (2016). End-to-end memory networks with knowledge carryover for multi-turn spoken language understanding. In Proceedings of Interspeech.
|
| 163 |
+
Dahl, D. A., Bates, M., Brown, M., Fisher, W., Hunicke-Smith, K., Pallett, D., Pao, C., Rudnicky, A., and Shriberg, E. (1994). Expanding the scope of the atis task: The atis-3 corpus. In Proceedings of the workshop on Human Language Technology, pages 43–48. Association for Computational Linguistics.
|
| 164 |
+
Dodge, J., Gane, A., Zhang, X., Bordes, A., Chopra, S., Miller, A., Szlam, A., and Weston, J. (2016). Evaluating prerequisite qualities for learning end-to-end dialog systems. In Proc. of ICLR.
|
| 165 |
+
Gašic, M., Kim, D., Tsiakoulis, P., Breslin, C., Henderson, M., Szummer, M., Thomson, B., and Young, S. (2014). Incremental on-line adaptation of pomdp-based dialogue managers to extended domains. In Proceedings on InterSpeech.
|
| 166 |
+
Henderson, M., Thomson, B., and Williams, J. (2014a). The second dialog state tracking challenge. In 15th Annual Meeting of the Special Interest Group on Discourse and Dialogue, page 263.
|
| 167 |
+
Henderson, M., Thomson, B., and Young, S. (2014b). Word-based dialog state tracking with recurrent neural networks. In Proceedings of the 15th Annual Meeting of the Special Interest Group on Discourse and Dialogue (SIGDIAL), pages 292–299.
|
| 168 |
+
Hixon, B., Clark, P., and Hajishirzi, H. (2015). Learning knowledge graphs for question answering through conversational dialog. In Proceedings of the the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Denver, Colorado, USA.
|
| 169 |
+
Isbell, C. L., Kearns, M., Kormann, D., Singh, S., and Stone, P. (2000). Cobot in lambdamoo: A social statistics agent. In AAAI/IAAI, pages 36–41.
|
| 170 |
+
Jafarpour, S., Burges, C. J., and Ritter, A. (2010). Filter, rank, and transfer the knowledge: Learning to chat. Advances in Ranking, 10.
|
| 171 |
+
Kim, S., D’Haro, L. F., Banchs, R. E., Williams, J. D., and Henderson, M. (2016). The fourth dialog state tracking challenge. In Proceedings of the 7th International Workshop on Spoken Dialogue Systems (IWSDS).
|
| 172 |
+
Lemon, O., Georgila, K., Henderson, J., and Stuttle, M. (2006). An isu dialogue system exhibiting reinforcement learning of dialogue policies: generic slot-filling in the talk in-car system. In Proceedings of the 11th Conference of the European Chapter of the ACL: Posters & Demonstrations, pages 119–122.
|
| 173 |
+
Liu, C.-W., Lowe, R., Serban, I. V., Noseworthy, M., Charlin, L., and Pineau, J. (2016). How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023.
|
| 174 |
+
Lowe, R., Pow, N., Serban, I., and Pineau, J. (2015). The ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dialogue systems. arXiv preprint arXiv:1506.08909.
|
| 175 |
+
Lowe, R., Serban, I. V., Noseworthy, M., Charlin, L., and Pineau, J. (2016). On the evaluation of dialogue systems with next utterance classification. arXiv preprint arXiv:1605.05414.
|
| 176 |
+
Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv:1301.3781.
|
| 177 |
+
Pietquin, O. and Hastie, H. (2013). A survey on metrics for the evaluation of user simulations. The knowledge engineering review, 28(01), 59–73.
|
| 178 |
+
Ritter, A., Cherry, C., and Dolan, W. B. (2011). Data-driven response generation in social media. In Proceedings of the Conference on Empirical Methods in Natural Language Processing.
|
| 179 |
+
Serban, I. V., Sordoni, A., Bengio, Y., Courville, A., and Pineau, J. (2015a). Building end-to-end dialogue systems using generative hierarchical neural network models. In Proc. of the AAAI Conference on Artificial Intelligence.
|
| 180 |
+
Serban, I. V., Lowe, R., Charlin, L., and Pineau, J. (2015b). A survey of available corpora for building data-driven dialogue systems. arXiv preprint arXiv:1512.05742.
|
| 181 |
+
Shang, L., Lu, Z., and Li, H. (2015). Neural responding machine for short-text conversation. arXiv preprint arXiv:1503.02364.
|
| 182 |
+
Sordoni, A., Galley, M., Auli, M., Brockett, C., Ji, Y., Mitchell, M., Nie, J.-Y., Gao, J., and Dolan, B. (2015). A neural network approach to context-sensitive generation of conversational responses. Proceedings of NAACL.
|
| 183 |
+
Su, P.-H., Vandyke, D., Gasic, M., Kim, D., Mrksic, N., Wen, T.-H., and Young, S. (2015a). Learning from real users: Rating dialogue success with neural networks for reinforcement learning in spoken dialogue systems. arXiv preprint arXiv:1508.03386.
|
| 184 |
+
Su, P.-H., Vandyke, D., Gasic, M., Mrksic, N., Wen, T.-H., and Young, S. (2015b). Reward shaping with recurrent neural networks for speeding up on-line policy learning in spoken dialogue systems. arXiv preprint arXiv:1508.03391.
|
| 185 |
+
Sukhbaatar, S., Szlam, A., Weston, J., and Fergus, R. (2015). End-to-end memory networks. Proceedings of NIPS.
|
| 186 |
+
Vinyals, O. and Le, Q. (2015). A neural conversational model. arXiv preprint arXiv:1506.05869.
|
| 187 |
+
Wang, H., Lu, Z., Li, H., and Chen, E. (2013). A dataset for research on short-text conversations. In EMNLP.
|
| 188 |
+
Wang, Z. and Lemon, O. (2013). A simple and generic belief tracking mechanism for the dialog state tracking challenge: On the believability of observed information. In Proceedings of the SIGDIAL 2013 Conference.
|
| 189 |
+
Wen, T.-H., Gasic, M., Mrksic, N., Su, P.-H., Vandyke, D., and Young, S. (2015). Semantically conditioned lstm-based natural language generation for spoken dialogue systems. arXiv preprint arXiv:1508.01745.
|
| 190 |
+
Weston, J., Chopra, S., and Bordes, A. (2015a). Memory networks. Proceedings of ICLR.
|
| 191 |
+
Weston, J., Bordes, A., Chopra, S., and Mikolov, T. (2015b). Towards ai-complete question answering: a set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698.
|
| 192 |
+
Young, S., Gasic, M., Thomson, B., and Williams, J. D. (2013). Pomdp-based statistical spoken dialog systems: A review. Proceedings of the IEEE, 101(5), 1160–1179.
|
| 193 |
+
|
| 194 |
+
# A MEMORY NETWORKS IMPLEMENTATION
|
| 195 |
+
|
| 196 |
+
Storing and representing the conversation history As the model conducts a conversation with the user, at each time step $t$ the previous utterance (from the user) and response (from the model) are appended to the memory. Hence, at any given time there are $c _ { 1 } ^ { u } , \ldots c _ { t } ^ { u }$ user utterances and $c _ { 1 } ^ { r } , \ldots . c _ { t - 1 } ^ { r }$ model responses stored (i.e. the entire conversation).2 The aim at time $t$ is to thus choose the next response $c _ { t } ^ { r }$ . We train on existing full dialog transcripts, so at training time we know the upcoming utterance $\boldsymbol { c } _ { t } ^ { r }$ and can use it as a training target. Following Dodge et al. (2016), we represent each utterance as a bag-of-words and in memory it is represented as a vector using the embedding matrix $A$ , i.e. the memory is an array with entries:
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
m = ( A \Phi ( c _ { 1 } ^ { u } ) , A \Phi ( c _ { 1 } ^ { r } ) \dots , A \Phi ( c _ { t - 1 } ^ { u } ) , A \Phi ( c _ { t - 1 } ^ { r } ) )
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
where $\Phi ( \cdot )$ maps the utterance to a bag of dimension $V$ (the vocabulary), and $A$ is a $d \times V$ matrix, where $d$ is the embedding dimension. We retain the last user utterance $c _ { t } ^ { u }$ as the “input” to be used directly in the controller. The contents of each memory slot $m _ { i }$ so far does not contain any information of which speaker spoke an utterance, and at what time during the conversation. We therefore encode both of those pieces of information in the mapping $\Phi$ by extending the vocabulary to contain $T = 1 0 0 0$ extra “time features” which encode the index $_ { i }$ into the bag-of-words, and two more features that encode whether the utterance was spoken by the user or the model.
|
| 203 |
+
|
| 204 |
+
Attention over the memory The last user utterance $c _ { t } ^ { u }$ is embedded using the same matrix $A$ giving $q = A \Phi ( c _ { t } ^ { u } )$ , which can also be seen as the initial state of the controller. At this point the controller reads from the memory to find salient parts of the previous conversation that are relevant to producing a response. The match between $q$ and the memories is computed by taking the inner product followed by a softmax: $p _ { i } = \mathrm { S o f t m a x } ( u ^ { \top } m _ { i } )$ , giving a probability vector over the memories. The vector that is returned back to the controller is then computed by $\begin{array} { r } { o = R \sum _ { i } ^ { } p _ { i } m _ { i } } \end{array}$ where $R$ is a $d \times d$ square matrix. The controller state is then updated with $q _ { 2 } = o + q$ . The memory can be iteratively reread to look for additional pertinent information using the updated state of the controller $q _ { 2 }$ instead of $q$ , and in general using $q _ { h }$ on iteration $h$ , with a fixed number of iterations $N$ (termed $N$ hops). Empirically we find improved performance on our tasks with up to 3 or 4 hops.
|
| 205 |
+
|
| 206 |
+
Choosing the response The final prediction is then defined as:
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
\hat { a } = \operatorname { S o f t m a x } \bigl ( { q _ { N + 1 } } ^ { \top } W \Phi ( y _ { 1 } ) , \ldots , { q _ { N + 1 } } ^ { \top } W \Phi ( y _ { C } ) \bigr )
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
where there are $C$ candidate responses in $y$ , and $W$ is of dimension $d \times V$ . In our tasks the set $_ y$ is a (large) set of candidate responses which includes all possible bot utterances and API calls.
|
| 213 |
+
|
| 214 |
+
The entire model is trained using stochastic gradient descent (SGD), minimizing a standard cross-entropy loss between $\hat { a }$ and the true label $a$ .
|
| 215 |
+
|
| 216 |
+
# B EXAMPLES OF PREDICTIONS OF A MEMORY NETWORK
|
| 217 |
+
|
| 218 |
+
Tables 3, 4, 5 and 6 display examples of predictions of the best performing Memory Network on full dialogs, Task 5, (with 3 hops) on test examples of Tasks 1-4 along with the values of the attention over each memory for each hop ${ p } _ { i }$ as defined in Sec. A). This model does not use match type features. Then, Table 7 displays an example of prediction of the best performing Memory Network on Concierge (with 2 hops) on a test example along with the values of the attention over each memory for each hop.
|
| 219 |
+
|
| 220 |
+
# C HYPERPARAMETERS
|
| 221 |
+
|
| 222 |
+
Tables 8 and 9 respectively display the values of the hyperparameters of the best Supervised Embeddings and Memory Networks selected for each task. These models were selected using the best validation validation sets.
|
| 223 |
+
|
| 224 |
+
# D ADDITIONAL RESULTS
|
| 225 |
+
|
| 226 |
+
Table 10 provides results for additional variants of supervised embeddings, using either a dictionary that includes all bigrams to leverage some word order information, or match type features. On some tasks, supervised embeddings perform better when the last user utterance is used as sole input, without the full dialog history (see Table 8). When no history is used, we slightly adapt match type features to only record type: a special word corresponding to type $T$ (e.g., phone, address, etc) is appended to the representation of a candidate if the candidate contains a word that appears in the knowledge base as an entity of type $T$ , regardless of whether the same word appeared earlier in the conversation. As seen on Table 10, match type features improve performance on out-of-vocabulary tasks 1 and 5, bringing it closer to that of Memory Networks without match type features, but still quite lagging Memory Networks with match type features. Bigrams slightly hurt rather than help performance, except in Task 5 in the standard in-vocabulary setup (performance is lower in the OOV setup).
|
| 227 |
+
|
| 228 |
+
Table 3: Task 1 (Issue API call) The model learns to direct its attention towards the 4 memories containing the information key to issue the API call. More hops help to strengthen this signal. <silence> is a special token used to indicate that the user did not speak at this turn – the model has to carry out the conversation with no additional input.
|
| 229 |
+
|
| 230 |
+
<table><tr><td>Time</td><td>Locutor</td><td colspan="3">Dialog History</td><td>Hop #1</td><td>Hop #2</td><td>Hop #3</td></tr><tr><td>1</td><td>User</td><td colspan="3">hi</td><td>.054</td><td>.016</td><td>.020</td></tr><tr><td>2</td><td>Bot</td><td colspan="3">hello what can i help you with today</td><td>.040</td><td>.024</td><td>.008</td></tr><tr><td>3</td><td>User</td><td colspan="3">may i have a table in paris</td><td>.099</td><td>.137</td><td>.141</td></tr><tr><td>4</td><td>Bot</td><td colspan="3">i'm on it</td><td>.048</td><td>.028</td><td>.004</td></tr><tr><td>5</td><td>User</td><td colspan="3"><silence></td><td>.181</td><td>.099</td><td>.037</td></tr><tr><td>6</td><td>Bot</td><td colspan="3">any preference on a type of cuisine</td><td>.056</td><td>.090</td><td>.014</td></tr><tr><td>7</td><td>User</td><td colspan="3">i love indian food</td><td>.159</td><td>.188</td><td>.238</td></tr><tr><td>8</td><td>Bot</td><td colspan="3">how many people would be in your party</td><td>.051</td><td>.022</td><td>.010</td></tr><tr><td>9</td><td>User</td><td colspan="3">we will be six</td><td>.129</td><td>.144</td><td>.114</td></tr><tr><td>10</td><td>Bot</td><td colspan="3">which price range are looking for</td><td>.039</td><td>.028</td><td>.006</td></tr><tr><td>11</td><td>User</td><td colspan="3">in a moderate price range please</td><td>.128</td><td>.213</td><td>.405</td></tr><tr><td>12</td><td>Bot</td><td colspan="3">ok let me look into some options for you</td><td>.016</td><td>.011</td><td>.003</td></tr><tr><td colspan="2">User input</td><td colspan="6"><silence></td></tr><tr><td colspan="2">Correct answer</td><td>api_call indian</td><td>paris</td><td>six moderate</td><td></td><td></td><td></td></tr><tr><td colspan="2">Predicted answer</td><td>api_call</td><td>indian paris six moderate</td><td></td><td>[Correct]</td><td></td><td></td></tr></table>
|
| 231 |
+
|
| 232 |
+
Table 4: Task 2 (Update API call) Out of the multiple memories from the current dialog, the model correctly focuses on the 2 important pieces: the original API call and the utterance giving the update.
|
| 233 |
+
|
| 234 |
+
<table><tr><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Locutor</td><td rowspan=1 colspan=3>Dialog history</td><td rowspan=1 colspan=1>Hop #1</td><td rowspan=1 colspan=1>Hop #2</td><td rowspan=1 colspan=1>Hop #3</td></tr><tr><td rowspan=2 colspan=1>34</td><td rowspan=2 colspan=1>UserBot</td><td rowspan=2 colspan=3>mayihavea table in parisi'm on it</td><td rowspan=1 colspan=1>.061</td><td rowspan=1 colspan=1>.072</td><td rowspan=1 colspan=1>.040</td></tr><tr><td rowspan=1 colspan=1>.026</td><td rowspan=1 colspan=1>.012</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=2 colspan=1>56</td><td rowspan=2 colspan=1>UserBot</td><td rowspan=5 colspan=3><silence>any preference on a type of cuisinei love indian foodhow many people would be in your partywe will be six</td><td rowspan=1 colspan=1>.087</td><td rowspan=1 colspan=1>.042</td><td rowspan=1 colspan=1>.012</td></tr><tr><td rowspan=1 colspan=1>.026</td><td rowspan=1 colspan=1>.023</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=6 colspan=1>789101112</td><td rowspan=6 colspan=1>UserBotUserBotUserBot</td><td rowspan=1 colspan=1>i</td><td rowspan=1 colspan=1>.081</td><td rowspan=1 colspan=1>.070</td><td rowspan=1 colspan=1>.055</td></tr><tr><td rowspan=1 colspan=2>how</td><td rowspan=1 colspan=1>.025</td><td rowspan=1 colspan=1>.006</td><td rowspan=2 colspan=1>.001.018</td></tr><tr><td rowspan=4 colspan=3>we will be sixwhich price range are looking forin a moderate price range pleaseok let me look into some options for you</td><td rowspan=1 colspan=1>.059</td><td rowspan=2 colspan=1>.051.043</td><td rowspan=2 colspan=1>.018.004</td></tr><tr><td rowspan=1 colspan=1>.038</td></tr><tr><td rowspan=1 colspan=1>.080</td><td rowspan=1 colspan=1>.095</td><td rowspan=1 colspan=1>.096</td></tr><tr><td rowspan=1 colspan=1>.025</td><td rowspan=1 colspan=1>.042</td><td rowspan=1 colspan=1>.003</td></tr><tr><td rowspan=1 colspan=1>13</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=3><silence></td><td rowspan=1 colspan=1>.127</td><td rowspan=1 colspan=1>.069</td><td rowspan=1 colspan=1>.032</td></tr><tr><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>Bot</td><td rowspan=2 colspan=3>api_call indian paris six moderateinstead could it be with french food</td><td rowspan=1 colspan=1>.062</td><td rowspan=1 colspan=1>.113</td><td rowspan=1 colspan=1>.043</td></tr><tr><td rowspan=4 colspan=1>15161718</td><td rowspan=4 colspan=1>UserBotUserBot</td><td rowspan=4 colspan=3>instead could it be with french foodsure is there anything else to updatenook let me look into some options for you</td><td rowspan=1 colspan=1>.188</td><td rowspan=1 colspan=1>.311</td><td rowspan=1 colspan=1>.683</td></tr><tr><td rowspan=1 colspan=1>.016</td><td rowspan=1 colspan=1>.007</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=2 colspan=1>.028.011</td><td rowspan=1 colspan=1>.013</td><td rowspan=1 colspan=1>.007</td></tr><tr><td rowspan=1 colspan=1>.006</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=1 colspan=2>User input</td><td rowspan=1 colspan=6><silence></td></tr><tr><td rowspan=1 colspan=2>Correct answer</td><td rowspan=1 colspan=6>api__callfrenchparissix moderate</td></tr><tr><td rowspan=1 colspan=2>Predictedanswer</td><td rowspan=1 colspan=4>api_callfrench paris six moderate [Correct]</td><td rowspan=1 colspan=2></td></tr></table>
|
| 235 |
+
|
| 236 |
+
Table 5: Task 3 (Displaying options) The model knows it has to display options but the attention is wrong: it should attend on the ratings to select the best option (with highest rating). It cannot learn that properly and match type features do not help. It is correct here by luck, the task is not solved overall (see Tab. 2). We do not show all memories in the table, only those with meaningful attention.
|
| 237 |
+
|
| 238 |
+
<table><tr><td>Time</td><td>Locutor</td><td>Dialog history</td><td></td><td>Hop #1</td><td>Hop #2</td><td>Hop #3</td></tr><tr><td>14</td><td>Bot</td><td></td><td>api_call indian paris six moderate</td><td>.012</td><td>.000</td><td>.000</td></tr><tr><td>15</td><td>User</td><td></td><td>instead could it be with french food</td><td>.067</td><td>.103</td><td>.147</td></tr><tr><td>20</td><td>Bot</td><td></td><td>api_call french paris six moderate</td><td>.012</td><td>.000</td><td>.000</td></tr><tr><td>21</td><td>User</td><td>resto_1</td><td>r_phone rest_1_phone</td><td>.018</td><td>.004</td><td>.000</td></tr><tr><td>23</td><td>User</td><td>resto_1</td><td>1 r_cuisine french</td><td>.029</td><td>.005</td><td>.000</td></tr><tr><td>24</td><td>User</td><td>resto_1</td><td>r_location paris</td><td>.060</td><td>.292</td><td>.094</td></tr><tr><td>25</td><td>User</td><td>resto_1</td><td>r_number six</td><td>.050</td><td>.298</td><td>.745</td></tr><tr><td>26</td><td>User</td><td>resto_1</td><td>r_price moderate</td><td>.060</td><td>.090</td><td>.002</td></tr><tr><td>27</td><td>User</td><td>resto_1</td><td>r_rating 6</td><td>.016</td><td>.002</td><td>.000</td></tr><tr><td>30</td><td>User</td><td>resto_2</td><td>r_cuisine french</td><td>.031</td><td>.007</td><td>.000</td></tr><tr><td>31</td><td>User</td><td>resto_2</td><td>r_location paris</td><td>.040</td><td>.081</td><td>.004</td></tr><tr><td>32</td><td>User</td><td>resto_2</td><td>r_number six</td><td>.020</td><td>.012</td><td>.000</td></tr><tr><td>33</td><td>User</td><td>resto_2</td><td>r_price moderate</td><td>.029</td><td>.009</td><td>.000</td></tr><tr><td>37</td><td>User</td><td>resto_3</td><td>r_cuisine french</td><td>.014</td><td>.001</td><td>.000</td></tr><tr><td>38</td><td>User</td><td>resto_3</td><td>r_location paris</td><td>.028</td><td>.016</td><td>.001</td></tr><tr><td>39</td><td>User</td><td>resto_3</td><td>r_number six</td><td>.024</td><td>.022</td><td>.004</td></tr><tr><td>40</td><td>User</td><td>resto_3</td><td>r_price moderate</td><td>.039</td><td>.015</td><td>.001</td></tr><tr><td colspan="2">User input</td><td colspan="6"><silence></td></tr><tr><td colspan="2">Correct answer</td><td colspan="6">what do you think of this option:resto_1</td></tr><tr><td colspan="2">Predictedanswer</td><td colspan="6">what do you think of this option:resto_1 [Correct]</td></tr></table>
|
| 239 |
+
|
| 240 |
+
Table 6: Task 4 (Providing extra-information) The model knows it must display a phone or an address, but, as explained in Section A the embeddings mix up the information and make it hard to distinguish between different phone numbers or addresses, making answering correctly very hard. As shown in the results of Tab. 2, this problem can be solved by adding match type features, that allow to emphasize entities actually appearing in the history. The attention is globally wrong here.
|
| 241 |
+
|
| 242 |
+
<table><tr><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Locutor</td><td rowspan=1 colspan=2>Dialog history</td><td rowspan=1 colspan=2>Hop #1</td><td rowspan=1 colspan=1>Hop #2</td><td rowspan=1 colspan=1>Hop #3</td></tr><tr><td rowspan=2 colspan=1>1415</td><td rowspan=1 colspan=1>Bot</td><td rowspan=2 colspan=2>api_call indian paris six moderateinstead could it be with french food</td><td rowspan=1 colspan=2>.006</td><td rowspan=1 colspan=1>.000</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=2>.024</td><td rowspan=1 colspan=1>.011</td><td rowspan=1 colspan=1>.007</td></tr><tr><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>Bot</td><td rowspan=1 colspan=2>api_call french paris six moderate</td><td rowspan=1 colspan=2>.005</td><td rowspan=1 colspan=1>.000</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>21</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=2>resto_1 r_phone resto_l_phone</td><td rowspan=1 colspan=2>.011</td><td rowspan=1 colspan=1>.005</td><td rowspan=1 colspan=1>.004</td></tr><tr><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=2>resto_1 r_address resto_1_address</td><td rowspan=1 colspan=2>.018</td><td rowspan=1 colspan=1>.004</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>.r_cuisine french</td><td rowspan=1 colspan=2>.018</td><td rowspan=1 colspan=1>.003</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>24</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_location paris</td><td rowspan=1 colspan=2>.068</td><td rowspan=1 colspan=1>.091</td><td rowspan=1 colspan=1>.108</td></tr><tr><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_number six</td><td rowspan=1 colspan=2>.086</td><td rowspan=1 colspan=1>.078</td><td rowspan=1 colspan=1>.020</td></tr><tr><td rowspan=1 colspan=1>26</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_price moderate</td><td rowspan=1 colspan=2>.070</td><td rowspan=1 colspan=1>.225</td><td rowspan=1 colspan=1>.369</td></tr><tr><td rowspan=1 colspan=1>27</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_rating 6</td><td rowspan=1 colspan=2>.014</td><td rowspan=1 colspan=1>.006</td><td rowspan=1 colspan=1>.008</td></tr><tr><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_phone resto_2_phone</td><td rowspan=1 colspan=2>.015</td><td rowspan=1 colspan=1>.009</td><td rowspan=1 colspan=1>.006</td></tr><tr><td rowspan=1 colspan=1>29</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_address resto_2_address</td><td rowspan=1 colspan=2>.014</td><td rowspan=1 colspan=1>.004</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>31</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_location paris</td><td rowspan=1 colspan=2>.075</td><td rowspan=1 colspan=1>.176</td><td rowspan=1 colspan=1>.193</td></tr><tr><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_number six</td><td rowspan=1 colspan=2>.100</td><td rowspan=1 colspan=1>.126</td><td rowspan=1 colspan=1>.026</td></tr><tr><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_price moderate</td><td rowspan=1 colspan=2>.038</td><td rowspan=1 colspan=1>.090</td><td rowspan=1 colspan=1>.167</td></tr><tr><td rowspan=1 colspan=1>35</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>r_phone resto_3_phone</td><td rowspan=1 colspan=2>.004</td><td rowspan=1 colspan=1>.001</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>36</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>r_address resto_3_address</td><td rowspan=1 colspan=2>.005</td><td rowspan=1 colspan=1>.002</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>37</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>resto_3 r_location paris</td><td rowspan=1 colspan=2>.028</td><td rowspan=1 colspan=1>.028</td><td rowspan=1 colspan=1>.026</td></tr><tr><td rowspan=1 colspan=1>39</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>resto_3 r_number six</td><td rowspan=1 colspan=2>.039</td><td rowspan=1 colspan=1>.013</td><td rowspan=1 colspan=1>.002</td></tr><tr><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>resto_3 r_price moderate</td><td rowspan=1 colspan=2>.018</td><td rowspan=1 colspan=1>.008</td><td rowspan=1 colspan=1>.013</td></tr><tr><td rowspan=1 colspan=1>42</td><td rowspan=1 colspan=1>Bot</td><td rowspan=2 colspan=2>what do you think of this option: resto_1let's do it</td><td rowspan=1 colspan=2>.074</td><td rowspan=1 colspan=1>.001</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=2 colspan=1>4344</td><td rowspan=2 colspan=1>UserBot</td><td rowspan=1 colspan=2>.032</td><td rowspan=1 colspan=1>.004</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=2>great let me do the reservation</td><td rowspan=1 colspan=2>.003</td><td rowspan=1 colspan=1>.000</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=1 colspan=2>User input</td><td rowspan=3 colspan=6>do you have itsaddresshere it is resto_1_addresshereitis:resto_8_address [Incorrect]</td></tr><tr><td rowspan=1 colspan=2>Correctanswer</td><td rowspan=2 colspan=3>here it is resto_1_addresshereitis:resto_8_address</td></tr><tr><td rowspan=1 colspan=2>Predictedanswer</td></tr></table>
|
| 243 |
+
|
| 244 |
+
Table 7: Concierge Data The model is also able to learn from human-human dialogs. <person>, <org>, <number> and <date> are special tokens used to anonymize the data. We report the top 5 answers predicted by the model. They are all semantically equivalent. Note that the utterances, while all produced by humans, are not perfect English ("rservation", "I’ll check into it")
|
| 245 |
+
|
| 246 |
+
<table><tr><td>Time</td><td>Locutor</td><td>Dialog History</td><td>Hop #1</td><td>Hop #2</td></tr><tr><td>1</td><td>User</td><td>hey concierge</td><td>.189</td><td>.095</td></tr><tr><td>2</td><td>User</td><td>could you check if i can get a rservation at <org> <date> for brunch</td><td>.209</td><td>.178</td></tr><tr><td>134</td><td>User</td><td><number> people</td><td>.197</td><td>.142</td></tr><tr><td>5</td><td>User</td><td><silence></td><td>.187</td><td>.167</td></tr><tr><td></td><td>Bot</td><td>hi <person> unfortunately <org> is fully booked for <date></td><td>.225</td><td>.410</td></tr><tr><td>User input</td><td></td><td>and there's <number> people on the waiting list when'sthe earliestavailability</td><td></td><td></td></tr><tr><td colspan="2">Correctanswer</td><td colspan="3">i'll check</td></tr><tr><td colspan="2">Pred.answer#1</td><td>i'm on it</td><td>[Incorrect]</td><td></td></tr><tr><td colspan="2">Pred.answer #2</td><td>i'll find out</td><td colspan="2">[Incorrect]</td></tr><tr><td colspan="2">Pred.answer #3</td><td>i'll take a look</td><td colspan="2">[Incorrect]</td></tr><tr><td colspan="2">Pred.answer #4</td><td>i'll check</td><td colspan="2">[Correct]</td></tr><tr><td colspan="2"></td><td></td><td colspan="2"></td></tr><tr><td colspan="2">Pred.answer #5</td><td>i'll check into it</td><td colspan="2">[Incorrect]</td></tr></table>
|
| 247 |
+
|
| 248 |
+
Table 8: Hyperparameters of Supervised Embeddings. When Use History is True, the whole conversation history is concatenated with the latest user utterance to create the input. If False, only the latest utterance is used as input.
|
| 249 |
+
|
| 250 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>Learning Rate</td><td rowspan=1 colspan=1>Margin m</td><td rowspan=1 colspan=1>Embedding Dim d</td><td rowspan=1 colspan=1>Negative Cand. N</td><td rowspan=1 colspan=1>Use History</td></tr><tr><td rowspan=2 colspan=1>Task 1Task 2</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>100</td><td rowspan=3 colspan=1>TrueFalseFalseFalseTrue</td></tr><tr><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>100</td></tr><tr><td rowspan=1 colspan=1>Task 3Task 4Task 5</td><td rowspan=1 colspan=1>0.010.0010.01</td><td rowspan=1 colspan=1>0.10.10.01</td><td rowspan=1 colspan=1>12812832</td><td rowspan=1 colspan=1>10001000100</td></tr><tr><td rowspan=1 colspan=1>Task 6</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>False</td></tr><tr><td rowspan=1 colspan=1>Concierge</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>False</td></tr></table>
|
| 251 |
+
|
| 252 |
+
Table 9: Hyperparameters of Memory Networks. The longer and more complex the dialogs are, the more hops are needed.
|
| 253 |
+
|
| 254 |
+
<table><tr><td>Task</td><td>Learning Rate</td><td>Margin m</td><td>Embedding Dimd</td><td>Negative Cand. N</td><td>Nb Hops</td></tr><tr><td>Task 1</td><td>0.01</td><td>0.1</td><td>128</td><td>100</td><td>1</td></tr><tr><td>Task 2</td><td>0.01</td><td>0.1</td><td>32</td><td>100</td><td>1</td></tr><tr><td>Task 3</td><td>0.01</td><td>0.1</td><td>32</td><td>100</td><td>3</td></tr><tr><td>Task 4</td><td>0.01</td><td>0.1</td><td>128</td><td>100</td><td>2</td></tr><tr><td>Task 5</td><td>0.01</td><td>0.1</td><td>32</td><td>100</td><td>3</td></tr><tr><td>Task 6</td><td>0.01</td><td>0.1</td><td>128</td><td>100</td><td>4</td></tr><tr><td>Concierge</td><td>0.001</td><td>0.1</td><td>128</td><td>100</td><td>2</td></tr></table>
|
| 255 |
+
|
| 256 |
+
Table 10: Test results across all tasks and methods. For tasks T1-T5 results are given in the standard setup and the out-of-vocabulary (OOV) setup, where words (e.g. restaurant names) may not have been seen during training. Task T6 is the Dialog state tracking 2 task with real dialogs, and only has one setup. Best performing methods (or methods within $0 . 1 \%$ of best performing) are given in bold for the per-response accuracy metric, with the per-dialog accuracy given in parenthesis.
|
| 257 |
+
|
| 258 |
+
<table><tr><td rowspan="2">Task</td><td colspan="4">Supervised Embeddings</td><td rowspan="2"></td><td colspan="3">Memory Networks + match type</td></tr><tr><td>no match type no bigram</td><td>+ match type no bigram</td><td></td><td>+bigrams no match type</td><td colspan="3"> no match type</td></tr><tr><td>T1: Issuing API calls</td><td>100</td><td>(100) 83.2</td><td>(0)</td><td>98.6</td><td>(92.4)</td><td>99.9</td><td>(99.6)</td><td>100 (100)</td></tr><tr><td>T2: Updating API calls</td><td>68.4 (0)</td><td>68.4</td><td>(0)</td><td>68.3 (0)</td><td>100</td><td>(100)</td><td>98.3</td><td>(83.9)</td></tr><tr><td>T3:Displaying options</td><td>64.9 (0)</td><td>64.9</td><td>(0)</td><td>64.9 (0)</td><td></td><td>74.9 (2.0)</td><td>74.9</td><td>(0)</td></tr><tr><td>T4:Providing information</td><td>57.2 (0)</td><td>57.2</td><td>(0)</td><td>57.3 (0)</td><td>59.5</td><td>(3.0)</td><td>100</td><td>(100)</td></tr><tr><td>T5: Full dialogs</td><td>75.4 0)</td><td>76.2</td><td>(0)</td><td>83.4 (0)</td><td></td><td>96.1 (49.4)</td><td>93.4</td><td>(19.7)</td></tr><tr><td>T1(OOV): Issuing API calls</td><td>60.0 (0)</td><td>67.2</td><td>(0)</td><td>58.8 (0)</td><td></td><td>72.3 (0)</td><td>96.5</td><td>(82.7)</td></tr><tr><td>T2(OOV): Updating API calls</td><td>68.3 (0)</td><td>68.3</td><td>(0)</td><td>68.3</td><td>(0)</td><td>78.9 (0)</td><td>94.5</td><td>(48.4)</td></tr><tr><td>T3(OOV): Displaying options</td><td>65.0 (0)</td><td>65.0</td><td>(0)</td><td>62.1 (0)</td><td></td><td>74.4 (0)</td><td>75.2</td><td>(0)</td></tr><tr><td>T4(OOV): Providing inform.</td><td>57.0 (0)</td><td>57.1</td><td>(0)</td><td>57.0 (0)</td><td></td><td>57.6 (0)</td><td>100</td><td>(100)</td></tr><tr><td>T5(OOV): Full dialogs</td><td>58.2 0)</td><td>64.4</td><td>(0)</td><td>50.4</td><td>(0)</td><td>65.5 (0)</td><td>77.7</td><td>(0)</td></tr><tr><td>T6: Dialog state tracking 2</td><td>22.6 0)</td><td>22.1</td><td>(0)</td><td>21.8</td><td>(0)</td><td>41.1 (0)</td><td></td><td>41.0 (0)</td></tr></table>
|
md/train/S1CChZ-CZ/S1CChZ-CZ.md
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ASK THE RIGHT QUESTIONS: ACTIVE QUESTION REFORMULATION WITH REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Christian Buck, Jannis Bulian, Massimiliano Ciaramita, Wojciech Gajewski,
|
| 4 |
+
Andrea Gesmundo, Neil Houlsby, Wei Wang
|
| 5 |
+
Google
|
| 6 |
+
{cbuck,jbulian,massi,wgaj,agesmundo,neilhoulsby,wangwe}@google.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
We frame Question Answering (QA) as a Reinforcement Learning task, an approach that we call Active Question Answering. We propose an agent that sits between the user and a black box QA system and learns to reformulate questions to elicit the best possible answers. The agent probes the system with, potentially many, natural language reformulations of an initial question and aggregates the returned evidence to yield the best answer. The reformulation system is trained end-to-end to maximize answer quality using policy gradient. We evaluate on SearchQA, a dataset of complex questions extracted from Jeopardy!. The agent outperforms a stateof-the-art base model, playing the role of the environment, and other benchmarks. We also analyze the language that the agent has learned while interacting with the question answering system. We find that successful question reformulations look quite different from natural language paraphrases. The agent is able to discover non-trivial reformulation strategies that resemble classic information retrieval techniques such as term re-weighting (tf-idf) and stemming.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Web and social media have become primary sources of information. Users’ expectations and information seeking activities co-evolve with the increasing sophistication of these resources. Beyond navigation, document retrieval, and simple factual question answering, users seek direct answers to complex and compositional questions. Such search sessions may require multiple iterations, critical assessment, and synthesis (Marchionini, 2006).
|
| 15 |
+
|
| 16 |
+
The productivity of natural language yields a myriad of ways to formulate a question (Chomsky, 1965). In the face of complex information needs, humans overcome uncertainty by reformulating questions, issuing multiple searches, and aggregating responses. Inspired by humans’ ability to ask the right questions, we present an agent that learns to carry out this process for the user. The agent sits between the user and a backend QA system that we refer to as ‘the environment’. We call the agent AQA, as it implements an active question answering strategy. AQA aims to maximize the chance of getting the correct answer by sending a reformulated question to the environment. The agent seeks to find the best answer by asking many questions and aggregating the returned evidence. The internals of the environment are not available to the agent, so it must learn to probe a black-box optimally using only question strings. The key component of the AQA agent is a sequence-to-sequence model trained with reinforcement learning (RL) using a reward based on the answer returned by the environment. The second component to AQA combines the evidence from interacting with the environment using a convolutional neural network to select an answer.
|
| 17 |
+
|
| 18 |
+
We evaluate on a dataset of Jeopardy! questions, SearchQA (Dunn et al., 2017). These questions are hard to answer by design because they use convoluted language, e.g., Travel doesn’t seem to be an issue for this sorcerer & onetime surgeon; astral projection & teleportation are no prob (answer: Doctor Strange). Thus SearchQA tests the ability of AQA to reformulate questions such that the QA system has the best chance of returning the correct answer. AQA improves over the performance of a deep network built for QA, BiDAF (Seo et al., 2017a), which has produced state-of-the-art results on multiple tasks, by $1 1 . 4 \%$ absolute F1, a $32 \%$ relative F1 improvement. Additionally, AQA outperforms other competitive heuristic query reformulation benchmarks.
|
| 19 |
+
|
| 20 |
+
AQA defines an instance of machine-machine communication. One side of the conversation, the AQA agent, is trying to adapt its language to improve the response from the other side, the QA environment. To shed some light on this process we perform a qualitative analysis of the language generated by the AQA agent. By evaluating on MSCOCO (Lin et al., 2014), we find that the agent’s question reformulations diverge significantly from natural language paraphrases. Remarkably, though, the agent is able to learn non-trivial and transparent policies. In particular, the agent is able to discover classic IR query operations such as term re-weighting, resembling tf-idf, and morphological simplification/stemming. A possible reason being that current machine comprehension tasks involve the ranking of short textual snippets, thus incentivizing relevance, more than deep language understanding.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORK
|
| 23 |
+
|
| 24 |
+
Lin & Pantel (2001) learned patterns of question variants by comparing dependency parsing trees. Duboue & Chu-Carroll (2006) showed that MT-based paraphrases can be useful in principle by providing significant headroom in oracle-based estimations of QA performance. Recently, Berant & Liang (2014) used paraphrasing to augment the training of a semantic parser by expanding through the paraphrases as a latent representation. Bilingual corpora and MT have been used to generate paraphrases by pivoting through a second language. Recent work uses neural translation models and multiple pivots (Mallinson et al., 2017). In contrast, our approach does not use pivoting and is, to our knowledge, the first direct neural paraphrasing system. Riezler et al. (2007) propose phrase-based paraphrasing for query expansion. In contrast with this line of work, our goal is to generate full question reformulations while optimizing directly the end-to-end target performance metrics.
|
| 25 |
+
|
| 26 |
+
Reinforcement learning is gaining traction in natural language understanding across many problems. For example, Narasimhan et al. (2015) use RL to learn control policies for multi-user dungeon games where the state of the game is summarized by a textual description, and Li et al. (2016) use RL for dialogue generation. Policy gradient methods have been investigated recently for MT and other sequence-to-sequence problems. They alleviate limitations inherent to the word-level optimization of the cross-entropy loss, allowing the use of sequence-level reward functions, like BLEU. Reward functions based on language models and reconstruction errors are used to bootstrap MT with fewer resources (Xia et al., 2016). RL training can also prevent exposure bias; an inconsistency between training and inference time stemming from the fact that the model never sees its own mistakes during training (Ranzato et al., 2015). We also use policy gradient to optimize our agent, however, we use end-to-end question answering quality as the reward.
|
| 27 |
+
|
| 28 |
+
Uses of policy gradient for QA include Liang et al. (2017), who train a semantic parser to query a knowledge base, and Seo et al. (2017b) who propose query reduction networks that transform a query to answer questions that involve multi-hop common sense reasoning. The work of Nogueira & Cho (2016) is most related to ours. They identify a document containing an answer to a question by following links on a graph. Evaluating on a set of questions from the game Jeopardy!, they learn to walk the Wikipedia graph until they reach the predicted answer. In a follow-up, Nogueira & Cho (2017) improve document retrieval with an approach inspired by relevance feedback in combination with RL. They reformulate a query by adding terms from documents retrieved from a search engine for the original query. Our work differs in that we generate complete sequence reformulations rather than adding single terms, and we target question-answering rather than document retrieval.
|
| 29 |
+
|
| 30 |
+
Active QA is also related to recent research on fact-checking: Wu et al. (2017) propose to perturb database queries in order to estimate the support of quantitative claims. In Active QA questions are perturbed semantically with a similar purpose, although directly at the surface natural language form.
|
| 31 |
+
|
| 32 |
+
# 3 ACTIVE QUESTION ANSWERING MODEL
|
| 33 |
+
|
| 34 |
+
Figure 1 shows the Active Question Answering (AQA) agent-environment setup. The AQA model interacts with a black-box environment. AQA queries it with many versions of a question, and finally returns the best of the answers found. An episode starts with an original question $q _ { 0 }$ . The agent then
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 1: The AQA agent-environment setup. In the downward pass the agent reformulates the question and sends variants to the QA system. In the upward pass the final answer is selected.
|
| 38 |
+
|
| 39 |
+
generates a set of reformulations $\{ q _ { i } \} _ { i = 1 } ^ { N }$ . These are sent to the environment which returns answers $\{ a _ { i } \} _ { i = 1 } ^ { N }$ . The selection model then picks the best from these candidates.
|
| 40 |
+
|
| 41 |
+
# 3.1 QUESTION-ANSWERING ENVIRONMENT
|
| 42 |
+
|
| 43 |
+
For the QA environment, we use a competitive neural question answering model, BiDirectional Attention Flow (BiDAF) (Seo et al., 2017a). BiDAF is an extractive QA system, it selects answers from contiguous spans of a given document. Given a question, the environment returns an answer and, during training, a reward. The reward may be any quality metric for the returned answer, we use token-level F1 score. Note that the reward for each answer $a _ { i }$ is computed against the original question $q _ { 0 }$ . We assume that the environment is opaque; the agent has no access to its parameters, activations or gradients. This setting enables one, in principle, to also interact with other information sources, possibly providing feedback in different modes such as images and structured data from knowledge bases. However, without propagating gradients through the environment we lose information, feedback on the quality of the question reformulations is noisy, presenting a challenge for training.
|
| 44 |
+
|
| 45 |
+
# 3.2 REFORMULATION MODEL
|
| 46 |
+
|
| 47 |
+
The reformulator is a sequence-to-sequence model, as is popular for neural machine translation. We build upon the implementation of Britz et al. (2017). The major departure from the standard MT setting is that our model reformulates utterances in the same language. Unlike in MT, there is little high quality training data available for monolingual paraphrasing. Effective training of highly parametrized neural networks relies on an abundance of data. We address this challenge by first pre-training on a related task, multilingual translation, and then using signals produced during the interaction with the environment for adaptation.
|
| 48 |
+
|
| 49 |
+
# 3.3 ANSWER SELECTION MODEL
|
| 50 |
+
|
| 51 |
+
During training, we have access to the reward for the answer returned for each reformulation $q _ { i }$ However, at test time we must predict the best answer $a ^ { * }$ . The selection model selects the best answer from the set $\{ a _ { i } \} _ { i = 1 } ^ { N }$ observed during the interaction by predicting the difference of the F1 score to the average F1 of all variants. We use pre-trained embeddings for the tokens of query, rewrite, and answer. For each, we add a 1-dimensional CNN followed by max-pooling. The three resulting vectors are then concatenated and passed through a feed-forward network which produces the output.
|
| 52 |
+
|
| 53 |
+
# 4 TRAINING
|
| 54 |
+
|
| 55 |
+
# 4.1 QUESTION ANSWERING ENVIRONMENT
|
| 56 |
+
|
| 57 |
+
We train a model on the training set for the QA task at hand, see Section 5.4 for details. Afterwards, BiDAF becomes the black-box environment and its parameters are not updated further. In principle,
|
| 58 |
+
|
| 59 |
+
we could train both the agent and the environment jointly to further improve performance. However, this is not our desired task: our aim is for the agent to learn to communicate using natural language with an environment over which is has no control.
|
| 60 |
+
|
| 61 |
+
# 4.2 POLICY GRADIENT TRAINING OF THE REFORMULATION MODEL
|
| 62 |
+
|
| 63 |
+
For a given question $q _ { 0 }$ , we want to return the best possible answer $a ^ { * }$ , maximizing a reward $a ^ { * } = \operatorname { a r g m a x } _ { a } R ( a | q _ { 0 } )$ . Typically, $R$ is the token level F1 score on the answer. The answer $a = f ( q )$ is an unknown function of a question $q$ , computed by the environment. The reward is computed with respect to the original question $q _ { 0 }$ while the answer is provided for $q$ . The question is generated according to a policy $\pi _ { \theta }$ where $\theta$ are the policy’s parameters $q \sim \pi _ { \theta } ( { \bf \nabla } \cdot | q _ { 0 } )$ . The policy, in this case, a sequence-to-sequence model, assigns a probability
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\pi _ { \boldsymbol { \theta } } ( q | q _ { 0 } ) = \prod _ { t = 1 } ^ { T } p ( w _ { t } | w _ { 1 } , \dots , w _ { t - 1 } , q _ { 0 } )
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
to any possible question $q = w _ { 1 } , \ldots , w _ { T }$ , where $T$ is the length of $q$ with tokens $w _ { t } \in V$ from a fixed vocabulary $V$ . The goal is to maximize the expected reward of the answer returned under the policy, $\mathbb { E } _ { q \sim \pi _ { \theta } ( \cdot | q _ { 0 } ) } [ R ( f ( q ) ) ]$ . We optimize the reward directly with respect to parameters of the policy using Policy Gradient methods (Sutton $\&$ Barto, 1998). The expected reward cannot be computed in closed form, so we compute an unbiased estimate with Monte Carlo sampling,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathbb { E } _ { q \sim \pi _ { \theta } ( \cdot | q _ { 0 } ) } [ R ( f ( q ) ) ] \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } R ( f ( q _ { i } ) ) , \quad q _ { i } \sim \pi _ { \theta } ( \cdot | q _ { 0 } )
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
To compute gradients for training we use REINFORCE (Williams & Peng, 1991),
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r l } { { \nabla \mathbb { E } _ { q \sim \pi _ { \theta } ( \cdot \vert q _ { 0 } ) } [ R ( f ( q ) ) ] = \mathbb { E } _ { q \sim \pi _ { \theta } ( \cdot \vert q _ { 0 } ) } \nabla _ { \theta } \log ( \pi _ { \theta } ( q \vert q _ { 0 } ) ) R ( f ( q ) ) } } \\ & { \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \nabla _ { \theta } \log ( \pi ( q _ { i } \vert q _ { 0 } ) ) R ( f ( q _ { i } ) ) , \quad q _ { i } \sim \pi _ { \theta } ( \cdot \vert q _ { 0 } ) } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
This estimator is often found to have high variance, leading to unstable training (Greensmith et al., 2004). We reduce the variance by subtracting the following baseline reward: $B ( q _ { 0 } ) =$ $\mathbb { E } _ { q \sim \pi _ { \theta } ( \cdot | q _ { 0 } ) } [ R ( f ( q ) ) ]$ . This expectation is also computed by sampling from the policy given $q _ { 0 }$ .
|
| 82 |
+
|
| 83 |
+
We often observed collapse onto a sub-optimal deterministic policy. To address this we use entropy regularization
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
H [ \pi _ { \boldsymbol { \theta } } ( q | q _ { 0 } ) ] = - \sum _ { t = 1 } ^ { T } \sum _ { w _ { t } \in V } p _ { \boldsymbol { \theta } } ( w _ { t } | w _ { < t } , q _ { 0 } ) \log p _ { \boldsymbol { \theta } } ( w _ { t } | w _ { < t } , q _ { 0 } )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
This final objective is:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathbb { E } _ { q \sim \pi _ { \theta } ( \cdot | q _ { 0 } ) } [ R ( f ( q ) ) - B ( q _ { 0 } ) ] + \lambda H [ \pi ( q | q _ { 0 } ) ] ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $\lambda$ is the regularization weight.
|
| 96 |
+
|
| 97 |
+
# 4.3 ANSWER SELECTION
|
| 98 |
+
|
| 99 |
+
Unlike the reformulation policy, we train the answer with either beam search or sampling. We can produce many rewrites of a single question from our reformulation system. We issue each rewrite to the QA environment, yielding a set of (query, rewrite, answer) tuples from which we need to pick the best instance. We train another neural network to pick the best answer from the candidates. We frame the task as binary classification, distinguishing between above and below average performance. In training, we compute the F1 score of the answer for every instance. If the rewrite produces an answer with an F1 score greater than the average score of the other rewrites the instance is assigned a positive label. We ignore questions where all rewrites yield equally good/bad answers. We evaluated FFNNs, LSTMs, and CNNs and found that the performance of all systems was comparable. We choose a CNN which offers good computational efficiency and accuracy (cf. 3.3).
|
| 100 |
+
|
| 101 |
+
# 4.4 PRETRAINING OF THE REFORMULATION MODEL
|
| 102 |
+
|
| 103 |
+
We pre-train the policy by building a paraphrasing Neural MT model that can translate from English to English. While parallel corpora are available for many language pairs, English-English corpora are scarce. We first produce a multilingual translation system that translates between several languages (Johnson et al., 2016). This allows us to use available bilingual corpora. Multilingual training requires nothing more than adding two special tokens to every line which indicate the source and target languages. The encoder-decoder architecture of the translation model remains unchanged.
|
| 104 |
+
|
| 105 |
+
As Johnson et al. (2016) show, this model can be used for zero-shot translation, i.e. to translate between language pairs for which it has seen no training examples. For example, after training English-Spanish, English-French, French-English, and Spanish-English the model has learned a single encoder that encodes English, Spanish, and French and a decoder for the same three languages. Thus, we can use the same model for French-Spanish, Spanish-French and also English-English translation by adding the respective tokens to the source. Johnson et al. (2016) note that zero-shot translation usually performs worse than bridging, an approach that uses the model twice: first, to translate into a pivot language, then into the target language. However, the performance gap can be closed by running a few training steps for the desired language pair. Thus, we first train on multilingual data, then on a small corpus of monolingual data.
|
| 106 |
+
|
| 107 |
+
# 5 EXPERIMENTS
|
| 108 |
+
|
| 109 |
+
# 5.1 QUESTION ANSWERING DATA AND BIDAF TRAINING
|
| 110 |
+
|
| 111 |
+
SearchQA (Dunn et al., 2017) is a dataset built starting from a set of Jeopardy! clues. Clues are obfuscated queries such as This ‘Father of Our Country’ didn’t really chop down a cherry tree. Each clue is associated with the correct answer, e.g. George Washington, and a list of snippets from Google’s top search results. SearchQA contains over 140k question/answer pairs and $6 . 9 \mathbf { M }$ snippets. We train our model on the pre-defined training split, perform model selection and tuning on the validation split and report results on the validation and test splits. The training, validation and test sets contain 99,820, 13,393 and 27,248 examples, respectively.
|
| 112 |
+
|
| 113 |
+
We train BiDAF directly on the SearchQA training data. We join snippets to form the context from which BiDAF selects answer spans. For performance reasons, we limit the context to the top 10 snippets. This corresponds to finding the answer on the first page of Google results. The results are only mildly affected by this limitation, for $10 \%$ of the questions, there is no answer in this shorter context. These data points are all counted as losses. We trained with the Adam optimizer for 4500 steps, using learning rate 0.001, batch size 60.
|
| 114 |
+
|
| 115 |
+
# 5.2 QUESTION REFORMULATOR TRAINING
|
| 116 |
+
|
| 117 |
+
For the pre-training of the reformulator, we use the multilingual United Nations Parallel Corpus v1.0 (Ziemski et al., 2016). This dataset contains 11.4M sentences which are fully aligned across six UN languages: Arabic, English, Spanish, French, Russian, and Chinese. From all bilingual pairs, we produce a multilingual training corpus of 30 language pairs. This yields 340M training examples which we use to train the zero-shot neural MT system (Johnson et al., 2016). We tokenize our data using 16k sentence pieces.1 Following Britz et al. (2017) we use a bidirectional LSTM as the encoder and a 4-layer stacked LSTM with attention as the decoder. The model converged after training on 400M instances using the Adam optimizer with a learning rate of 0.001 and batch size of 128.
|
| 118 |
+
|
| 119 |
+
The model trained as described above has poor quality. For example, for the question What month, day and year did Super Bowl 50 take place?, the top rewrite is What month and year goes back to the morning and year?. To improve quality, we resume training on a smaller monolingual dataset, extracted from the Paralex database of question paraphrases (Fader et al., 2013).2 Unfortunately, this data contains many noisy pairs. We filter many of these pairs out by keeping only those where the Jaccard coefficient between the sets of source and target terms is above 0.5. Further, since the number of paraphrases for each question can vary significantly, we keep at most 4 paraphrases for each question. After processing, we are left with about $1 . 5 \mathbf { M }$ pairs out of the original 35M. The refined model has visibly better quality than the zero-shot one; for the example question above it generates What year did superbowl take place?. We also tried training on the monolingual pairs alone. As in (Johnson et al., 2016), the quality was in between the multilingual and refined models.
|
| 120 |
+
|
| 121 |
+
After pre-training the reformulator, we switch the optimizer from Adam to SGD and train for $1 0 0 \mathrm { k }$ RL steps of batch size 64 with a low learning rate of 0.001. We use an entropy regularization weight of $\lambda = 0 . 0 0 1$ . For a stopping criterion, we monitor the reward from the best single rewrite, generated via greedy decoding, on the validation set. In contrast to our initial training which we ran on GPUs, this training phase is dominated by the latency of the QA system and we run inference and updates on CPU and the BiDAF environment on GPU.
|
| 122 |
+
|
| 123 |
+
# 5.3 TRAINING THE ANSWER SELECTOR
|
| 124 |
+
|
| 125 |
+
For the selection model we use supervised learning: first, we train the reformulator, then we generate $N = 2 0$ rewrites for each question in the SearchQA training and validation sets. After sending these to the environment we have about 2M (question, rewrite, answer) triples. We remove queries where all rewrites yield identical rewards, which removes about half of the training data. We use pre-trained 100-dimensional embeddings (Pennington et al., 2014) for the tokens. Our CNN-based selection model encodes the three strings into 100-dimensional vectors using a 1D CNN with kernel width 3 and output dimension 100 over the embedded tokens, followed by max-pooling. The vectors are then concatenated and passed through a feed-forward network which produces the binary output, indicating whether the triple performs below or above average, relative to the other reformulations and respective answers.
|
| 126 |
+
|
| 127 |
+
We use the training portion of the SearchQA data thrice, first for the initial training of the BiDAF model, then for the reinforcement-learning based tuning of the reformulator, and finally for the training of the selector. We carefully monitored that this didn’t cause severe overfitting. BiDAF alone has a generalization gap between the training and validation set errors of $3 . 4 \mathrm { F } 1$ . This gap remains virtually identical after training the rewriter. After training the CNN, AQA-Full has a slightly larger gap of $3 . 9 \mathrm { F } 1$ . We conclude that training AQA on BiDAF’s training set causes very little additional overfitting. We use the test set only for evaluation of the final model.
|
| 128 |
+
|
| 129 |
+
# 5.4 BASELINES AND BENCHMARKS
|
| 130 |
+
|
| 131 |
+
As a baseline, we report the results of the modified pointer network, called Attention Sum Reader (ASR), developed for SearchQA (Dunn et al., 2017).We also report the performance of the BiDAF environment used without the reformulator to answer the original question.
|
| 132 |
+
|
| 133 |
+
We evaluate against several benchmarks. First, following Kumaran & Carvalho (2009), we implement a system (MI-SubQuery) that generates reformulation candidates by enumerating all subqueries of the original SearchQA query and then keeps the top $N$ ranked by mutual information.3 From this set, we pick the highest scoring one as the top hypothesis to be used as a single rewrite. We also use the whole set to train a CNN answer selector for this specific source of rewrites. In this way, we can compare systems fairly both in single prediction or ensemble prediction modes. Additionally, we evaluate against another source of reformulations: the zero-shot monolingual NMT system trained on the U.N. corpus and Paralex (Base-NMT), without reinforcement learning. As with the MI-SubQuery benchmark, we evaluate the Base-NMT system both as a single reformulation predictor and as a source of $N$ best rewrites, for which we train a dedicated CNN answer selector. We also report human performance on SearchQA, based on a sample of the test set, from (Dunn et al., 2017).
|
| 134 |
+
|
| 135 |
+
# 5.5 RESULTS
|
| 136 |
+
|
| 137 |
+
We evaluate several variants of AQA. For each query $q$ in the evaluation we generate a list of reformulations $q _ { i }$ , for $i = 1 \dots N$ , from the AQA reformulator trained as described in Section 4. We set $N = 2 0$ in these experiments, the same value is used for the benchmarks. In AQA TopHyp we use the top hypothesis generated by the sequence model, $q _ { 1 }$ . In AQA Voting we use BiDAF scores for a heuristic weighted voting scheme to implement deterministic selection. Let $a$ be the answer returned by BiDAF for query $q$ , with an associated score $s ( a )$ . We pick the answer according to argmaxa $\scriptstyle \sum _ { a ^ { \prime } = a } s ( a ^ { \prime } )$ . In AQA MaxConf we select the answer with the single highest BiDAF score across question reformulations. Finally, AQA CNN identifies the complete system with the learned CNN model described in Section 3.
|
| 138 |
+
|
| 139 |
+
Table 1: Results table for the experiments on SearchQA. Two-sample $t$ -tests between the AQA results and either the Base-NMT or the MI-SubQuery results show that differences in F1 and Exact Match scores are statistically significant, $p < 1 \bar { 0 } ^ { - 4 }$ , for both Top Hypothesis and CNN predictions. The difference between Base-NMT and MI-SubQuery is also significant for Top Hypothesis predictions.
|
| 140 |
+
|
| 141 |
+
<table><tr><td></td><td></td><td colspan="2">Baseline</td><td colspan="2">MI-SubQuery</td><td colspan="2">Base-NMT</td><td colspan="4">AQA</td><td></td></tr><tr><td></td><td></td><td></td><td>BAAR</td><td>TopHyp</td><td></td><td>TopHyp</td><td></td><td>TopHyp</td><td>Voting</td><td>MaxConf</td><td></td><td>Human</td></tr><tr><td></td><td>EM</td><td>1</td><td>31.7</td><td>24.1</td><td>37.5</td><td>26.0</td><td>37.5</td><td>32.0</td><td>33.6</td><td>35.5</td><td>40.5</td><td>1</td></tr><tr><td>Dev</td><td>F1</td><td>24.2</td><td>37.9</td><td>29.9</td><td>44.5</td><td>32.2</td><td>44.8</td><td>38.2</td><td>40.5</td><td>42.0</td><td>47.4</td><td>=</td></tr><tr><td></td><td>EM</td><td>1</td><td>28.6</td><td>23.2</td><td>35.8</td><td>24.8</td><td>35.7</td><td>30.6</td><td>33.3</td><td>33.8</td><td>38.7</td><td>43.9</td></tr><tr><td>Test</td><td>F1</td><td>22.8</td><td>34.6</td><td>29.0</td><td>42.8</td><td>31.0</td><td>42.9</td><td>36.8</td><td>39.3</td><td>40.2</td><td>45.6</td><td>1</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 1 shows the results. We report exact match (EM) and F1 metrics, computed on token level between the predicted answer and the gold answer. We present results on the full validation and test sets (referred to as $n$ -gram in (Dunn et al., 2017)). Overall, SearchQA appears to be harder than other recent QA tasks such as SQuAD (Rajpurkar et al., 2016), for both machines and humans. BiDAF’s performance drops by $4 0 \ : \mathrm { F 1 }$ points on SearchQA compared to SQuAD. However, BiDAF is still competitive on SeachQA, improving over the Attention Sum Reader network by 13.7 F1 points.
|
| 144 |
+
|
| 145 |
+
Using the top hypothesis already yields an improvement of $2 . 2 \mathrm { F } 1$ on the test set. This demonstrates that even the reformulator alone is capable to produce questions more easily answered by the environment. When generating a single prediction, both MI-SubQuery and Base-NMT benchmarks perform worse than BiDAF. Heuristic selection via both Voting and Max Conf yields a further performance boost. Both heuristics draw upon the intuition that when BiDAF is confident in its answer it is more likely to be correct, and that multiple instances of the same answer provide positive evidence (for MaxConf, the max operation implicitly rewards having an answer scored with respect to multiple questions). Finally, a trained selection function improves performance further, yielding an absolute increase of $1 1 . 4 \mathrm { F } 1$ points ( $32 \%$ relative) over BiDAF with the original questions. In terms of exact match score, this more than closes half the gap between BiDAF and human performance. The benchmarks improve considerably when they generate $N$ candidates, and paired with a dedicated CNN selector. This is not surprising as it provides an ensemble prediction setup. However, the AQA CNN system outperforms both MI-SubQuery and Base-NMT in all conditions by about $3 \%$ .
|
| 146 |
+
|
| 147 |
+
Finally, we consider the maximum performance possible that could be achieved by picking the answer with the highest F1 score from the set of those returned for all available reformulations. Here we find that the different sources of rewrites provide comparable headroom: the oracle Exact Match is near 50, while the oracle F1 is close to 58.
|
| 148 |
+
|
| 149 |
+
# 6 ANALYSIS OF THE AGENT’S LANGUAGE
|
| 150 |
+
|
| 151 |
+
The AQA agent can learn several types of sub-optimal policies. For example, it can converge to deterministic policies by learning to emit the same, meaningless, reformulation for any input question. This strategy can lead to local optima because the environment has built in strong priors on what looks like a likely answer, even ignoring the input question. Hence, convergence to non-negligible performance is easy. Entropy regularization typically fixes this behavior. Too much weight on the entropy regularizer, on the other hand, might yield random policies. A more competitive sub-optimal policy is one that generates minimal changes to the input, in order to stay close to the original question. This is a successful strategy because the environment has been trained on the original questions alone, which leads to baseline performance.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 2: Boxplot summaries of the statistics collected for all types of questions. Two-sample $t \cdot$ -tests performed on all pairs in each box confirm that the differences in means are significant $p \bar { < } 1 0 ^ { - 3 }$ .
|
| 155 |
+
|
| 156 |
+
It seems quite remarkable then that AQA is able to learn non-trivial reformulation policies, that differ significantly from all of the above. One can think of the policy as a language for formulating questions that the agent has developed while engaging in a machine-machine communication with the environment. In this section we look deeper into the agent’s language.
|
| 157 |
+
|
| 158 |
+
# 6.1 GENERAL PROPERTIES
|
| 159 |
+
|
| 160 |
+
We analyze input questions and reformulations on the development partition of SearchQA to gain insights on how the agent’s language evolves during training via policy gradient. It is important to note that in the SearchQA dataset the original Jeopardy! clues have been preprocessed by lowercasing and stop word removal. The resulting preprocessed clues that form the sources (inputs) for the sequence-to-sequence reformulation model resemble more keyword-based search queries than grammatical questions. For example, the clue Gandhi was deeply influenced by this count who wrote "War and Peace" is simplified to gandhi deeply influenced count wrote war peace.
|
| 161 |
+
|
| 162 |
+
The (preprocessed) SearchQA questions contain 9.6 words on average. They contain few repeated terms, computed as the mean term frequency (TF) per question. The average is 1.03, but for most of the queries $( 7 5 \% )$ TF is 1.0. We also compute the median document frequency (DF) per query, where the document is the context from which the answer is selected, as a measure of how informative a term is.4 As another measure of query performance, we also compute Query Clarity (QC) (Cronen-Townsend et al., 2002).5 Figure 2 summarizes statistics of the questions and rewrites.
|
| 163 |
+
|
| 164 |
+
We first consider the top hypothesis generated by the pre-trained NMT reformulation system, before reinforcement learning (Base-NMT). The Base-NMT rewrites differ greatly from their sources. They are shorter, 6.3 words on average, and have even fewer repeated terms (1.01). Interestingly, these reformulations are mostly syntactically well-formed questions. For example, the clue above becomes Who influenced count wrote war?.6 Base-NMT improves structural language quality by properly reinserting dropped function words and wh-phrases. We also verified the increased fluency by using a large language model and found that the Base-NMT rewrites are $50 \%$ more likely than the original questions. While more fluent, the Base-NMT rewrites involve lower DF terms. This is probably due to a domain mismatch between SearchQA and the NMT training corpus. The query clarity of the Base-NMT rewrites is also degraded as a result of the transduction process.
|
| 165 |
+
|
| 166 |
+
We next consider the top hypothesis generated by the AQA question reformulator (AQA-QR) after the policy gradient training. The AQA-QR rewrites are those whose corresponding answers are evaluated as AQA TopHyp in Table 1. These single rewrites alone outperform the original SearchQA queries by $2 \%$ on the test set. We analyze the top hypothesis instead of the final output of the full AQA agent to avoid confounding effects from the answer selection step. These rewrites look different from both the Base-NMT and the SearchQA ones. For the example above AQA-QR’s top hypothesis is What is name gandhi gandhi influence wrote peace peace?. Surprisingly, $9 9 . 8 \%$ start with the prefix What is name. The second most frequent is What country is (81 times), followed by What is is (70) and What state (14). This is puzzling as it occurs in only 9 Base-NMT rewrites, and never in the original SearchQA questions. We speculate it might be related to the fact that virtually all answers involve names, of named entities (Micronesia) or generic concepts (pizza).
|
| 167 |
+
|
| 168 |
+
AQA-QR’s rewrites seem less fluent than both the SearchQA and the Base-MT counterparts. In terms of language model probability, they are less likely than both SearchQA and Base-NMT. However, they have more repeated terms (1.2 average TF), are significantly longer (11.9) than in Base-NMT and contain more informative context terms than SearchQA questions (lower DF). Also, the translation process does not affect query clarity much. Finally, we find that AQA-QR’s reformulations contain morphological variants in $12 . 5 \%$ of cases. The number of questions that contain multiple tokens with the same stem doubles from SearchQA to AQA-QR. Singular forms are preferred over plurals. Morphological simplification is useful because it increases the chance that a word variant in the question matches the context.
|
| 169 |
+
|
| 170 |
+
# 6.2 PARAPHRASING QUALITY
|
| 171 |
+
|
| 172 |
+
We also investigate the general paraphrasing abilities of our model, focusing on the relation between paraphrasing quality and QA quality. To tease apart the relationship between paraphrasing and reformulation for QA we evaluated 3 variants of the reformulator:
|
| 173 |
+
|
| 174 |
+
Base-NMT This is the model used to initialize RL training of the agent. Trained first on the multilingual U.N. corpus, then on the Paralex corpus, as detailed in Section 5.2.
|
| 175 |
+
|
| 176 |
+
Base-NMT-NoParalex This is the model above trained solely on the multilingual U.N. corpus, without the Paralex monolingual corpus.
|
| 177 |
+
|
| 178 |
+
Base-NMT $^ { \cdot } +$ Quora This is the same as Base-NMT, additionally trained on the Quora dataset7 which contains $1 5 0 \mathrm { k }$ duplicate questions.
|
| 179 |
+
|
| 180 |
+
Following Prakash et al. (2016), we evaluate all models on the MSCOCO8 (Lin et al., 2014) validation set (VAL2014). This dataset consists of images with 5 captions each, of which we select a random one as the source and the other four as references. We use beam search, to compute the top hypothesis and report uncased, moses-tokenized BLEU using multeval9 (Clark et al., 2011). Please note, that the MSCOCO data is only used for evaluation purposes. Examples of all systems can be found in Appendix C.
|
| 181 |
+
|
| 182 |
+
The Base-NMT model performs at 11.4 BLEU (see Table 1 for the QA eval numbers). In contrast, Base-NMT-NoParalex performs poorly at 5.0 BLEU. Limiting training to the multilingual data alone also degrades QA performance: the scores of the Top Hypothesis are at least 5 points lower in all metrics and CNN scores are 2-3 points lower.
|
| 183 |
+
|
| 184 |
+
By training on additional monolingual data, the Base-NMT $^ +$ Quora model improves BLEU score slightly to 11.6. End-to-end QA performance also improves marginally, the maximum delta with respect to Base-NMT under all conditions is $+ 0 . 5$ points, but the difference is not statistically significant. Thus, adding the Quora training does not have a significant effect. This might be due to the fact that most of the improvement is captured by training on the larger Paralex data set. Improving raw paraphrasing quality as well as reformulation fluency helps AQA up to a point. However, they are only partially aligned with the main task, which is QA performance. The AQA-QR reformulator has a BLEU score of 8.6, well below both Base-NMT models trained on monolingual data. Yet, AQA-QR significantly outperforms all others in the QA task. Training the agent starting from the Base-NMT $\scriptstyle +$ Quora model yielded comparable results as starting from Base-NMT.
|
| 185 |
+
|
| 186 |
+
# 6.3 DISCUSSION
|
| 187 |
+
|
| 188 |
+
Recently, Lewis et al. (2017) trained chatbots that negotiate via language utterances in order to complete a task. They report that the agent’s language diverges from human language if there is no incentive for fluency in the reward function. Our findings seem related. The fact that the questions reformulated by AQA do not resemble natural language is not due to the keyword-like SearchQA input questions, because Base-NMT is capable of producing more fluent questions from the same input. AQA learns to re-weight terms by focusing on informative (lower document frequency), query-specific (high query clarity), terms while increasing term frequency (TF) via duplication. At the same time it learns to modify surface forms in ways akin to stemming and morphological analysis.
|
| 189 |
+
|
| 190 |
+
Some of the techniques seem to adapt to the specific properties of current deep QA architectures such as character-based modeling and attention. Sometimes AQA learns to generate semantically nonsensical, novel, surface term variants; e.g., it might transform the adjective dense to densey. The only justification for this is that such forms can be still exploited by the character-based BiDAF question encoder. Finally, repetitions can directly increase the chances of alignment in the attention components.
|
| 191 |
+
|
| 192 |
+
We hypothesize that, while there is no incentive for the model to use human language due to the nature of the task, AQA learns to ask BiDAF questions by optimizing a language that increases the likelihood of BiDAF ranking better the candidate answers. Jia & Liang (2017) argue that reading comprehension systems are not capable of significant language understanding and fail easily in adversarial settings. We speculate that current machine comprehension tasks involve mostly pattern matching and relevance modeling. As a consequence deep QA systems might implement sophisticated ranking systems trained to sort snippets of text from the context. As such, they resemble document retrieval systems which incentivizes the (re-)discovery of IR techniques, such as tf-idf re-weighting and stemming, that have been successful for decades (Baeza-Yates & Ribeiro-Neto, 1999).
|
| 193 |
+
|
| 194 |
+
# 7 CONCLUSION
|
| 195 |
+
|
| 196 |
+
We propose a new framework to improve question answering. We call it active question answering (AQA), as it aims to improve answering by systematically perturbing input questions. We investigated a first system of this kind that has three components: a question reformulator, a black box QA system, and a candidate answer aggregator. The reformulator and aggregator form a trainable agent that seeks to elicit the best answers from the QA system. Importantly, the agent may only query the environment with natural language questions. Experimental results prove that the approach is highly effective and that the agent is able to learn non-trivial and somewhat interpretable reformulation policies.
|
| 197 |
+
|
| 198 |
+
For future work, we will continue developing active question answering, investigating the sequential, iterative aspects of information seeking tasks, framed as end-to-end RL problems, thus, closing the loop between the reformulator and the selector.
|
| 199 |
+
|
| 200 |
+
# 8 ACKNOWLEDGEMENTS
|
| 201 |
+
|
| 202 |
+
We would like to thank the anonymous reviewers for their valuable comments and suggestions. We would also like to thank Jyrki Alakuijala, Gábor Bártok, Alexey Gronskiy, Rodrigo Nogueira and Hugo Penedones for insightful discussions and technical feedback.
|
| 203 |
+
|
| 204 |
+
# REFERENCES
|
| 205 |
+
|
| 206 |
+
Ricardo Baeza-Yates and Berthier Ribeiro-Neto. Modern Information Retrieval. Addison-Wesley Longman Publishing Co., Inc., 1999.
|
| 207 |
+
|
| 208 |
+
Jonathan Berant and Percy Liang. Semantic parsing via paraphrasing. In Proceedings of ACL, pp. 1415–1425, 2014.
|
| 209 |
+
|
| 210 |
+
Denny Britz, Anna Goldie, Minh-Thang Luong, and Quoc Le. Massive exploration of neural machine translation architectures. In Proceedings of EMNLP, pp. 1442–1451, 2017.
|
| 211 |
+
|
| 212 |
+
Noam Chomsky. Aspects of the Theory of Syntax. The MIT Press, 1965.
|
| 213 |
+
|
| 214 |
+
Jonathan H. Clark, Chris Dyer, Alon Lavie, and Noah A. Smith. Better hypothesis testing for statistical machine translation: Controlling for optimizer instability. In Proceedings of the Association for Computational Lingustics, 2011.
|
| 215 |
+
|
| 216 |
+
Steve Cronen-Townsend, Yun Zhou, and W. Bruce Croft. Predicting query performance. In Proceedings of ACM SIGIR, pp. 299–306, 2002.
|
| 217 |
+
|
| 218 |
+
Pablo Ariel Duboue and Jennifer Chu-Carroll. Answering the question you wish they had asked: The impact of paraphrasing for question answering. In Proceedings of HLT-NAACL, pp. 33–36, 2006.
|
| 219 |
+
|
| 220 |
+
Matthew Dunn, Levent Sagun, Mike Higgins, Ugur Guney, Volkan Cirik, and Kyunghyun Cho. SearchQA: A New Q&A Dataset Augmented with Context from a Search Engine. https://arxiv.org/abs/1704.05179, 2017.
|
| 221 |
+
|
| 222 |
+
Anthony Fader, Luke Zettlemoyer, and Oren Etzioni. Paraphrase-Driven Learning for Open Question Answering. In Proceedings of ACL, 2013.
|
| 223 |
+
|
| 224 |
+
Evan Greensmith, Peter L Bartlett, and Jonathan Baxter. Variance reduction techniques for gradient estimates in reinforcement learning. Journal of Machine Learning Research, 5(Nov):1471–1530, 2004.
|
| 225 |
+
|
| 226 |
+
Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Proceedings of EMNLP, pp. 2011–2021, 2017.
|
| 227 |
+
|
| 228 |
+
Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viégas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s Multilingual Neural Machine Translation System: Enabling Zero-Shot Translation. https://arxiv.org/abs/1611.04558, 2016.
|
| 229 |
+
|
| 230 |
+
Giridhar Kumaran and Vitor R. Carvalho. Reducing long queries using query quality predictors. In Proceedings of ACM SIGIR, pp. 564–571, 2009.
|
| 231 |
+
|
| 232 |
+
Mike Lewis, Denis Yarats, Yann Dauphin, Devi Parikh, and Dhruv Batra. Deal or no deal? end-to-end learning of negotiation dialogues. In Proceedings of EMNLP, pp. 2433–2443, 2017.
|
| 233 |
+
|
| 234 |
+
Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. Deep reinforcement learning for dialogue generation. In Proceedings of EMNLP, 2016.
|
| 235 |
+
|
| 236 |
+
Chen Liang, Jonathan Berant, Quoc Le, Kenneth D. Forbus, and Ni Lao. Neural symbolic machines: Learning semantic parsers on freebase with weak supervision. In Proceedings of ACL, 2017.
|
| 237 |
+
|
| 238 |
+
Dekang Lin and Patrick Pantel. Discovery of inference rules for question-answering. Nat. Lang. Eng., 7(4):343–360, 2001.
|
| 239 |
+
|
| 240 |
+
Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO: common objects in context. In Proceedings of ECCV 2014, pp. 740–755, 2014.
|
| 241 |
+
|
| 242 |
+
Jonathan Mallinson, Rico Sennrich, and Mirella Lapata. Paraphrasing revisited with neural machine translation. In Proceedings of EACL, 2017.
|
| 243 |
+
|
| 244 |
+
Gary Marchionini. Exploratory search: From finding to understanding. Commun. ACM, 49(4), 2006.
|
| 245 |
+
|
| 246 |
+
Karthik Narasimhan, Tejas Kulkarni, and Regina Barzilay. Language understanding for text-based games using deep reinforcement learning. https://arxiv.org/abs/1506.08941, 2015.
|
| 247 |
+
|
| 248 |
+
Rodrigo Nogueira and Kyunghyun Cho. End-to-end goal-driven web navigation. In Proceedings of NIPS, 2016.
|
| 249 |
+
|
| 250 |
+
Rodrigo Nogueira and Kyunghyun Cho. Task-oriented query reformulation with reinforcement learning. In Proceedings of EMNLP, 2017.
|
| 251 |
+
|
| 252 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of EMNLP, pp. 1532–1543, 2014.
|
| 253 |
+
|
| 254 |
+
Aaditya Prakash, Sadid A. Hasan, Kathy Lee, Vivek Datla, Ashequl Qadir, Joey Liu, and Oladimeji Farri. Neural paraphrase generation with stacked residual LSTM networks. In Proceedings of the 26th International Conference on Computational Linguistics (COLING), pp. 2923–2934, 2016.
|
| 255 |
+
|
| 256 |
+
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, pp. 2383–2392, 2016.
|
| 257 |
+
|
| 258 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. https://arxiv.org/abs/1511.06732, 2015.
|
| 259 |
+
|
| 260 |
+
Stefan Riezler, Alexander Vasserman, Ioannis Tsochantaridis, Vibhu Mittal, and Yi Liu. Statistical machine translation for query expansion in answer retrieval. In Proceedings of ACL, 2007.
|
| 261 |
+
|
| 262 |
+
Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional Attention Flow for Machine Comprehension. In Proceedings of ICLR, 2017a.
|
| 263 |
+
|
| 264 |
+
Minjoon Seo, Sewon Min, Ali Farhadi, and Hannaneh Hajishirzi. Query-reduction networks for question answering. In Proceedings of ICLR 2017, ICLR 2017, 2017b.
|
| 265 |
+
|
| 266 |
+
Richard S. Sutton and Andrew G. Barto. Introduction to Reinforcement Learning. MIT Press, 1998.
|
| 267 |
+
|
| 268 |
+
Ronald J. Williams and Jing Peng. Function optimization using connectionist reinforcement learning algorithms. Connection Science, 3(3):241–268, 1991.
|
| 269 |
+
|
| 270 |
+
You Wu, Pankaj K. Agarwal, Chengkai Li, Jun Yang, and Cong Yu. Computational fact checking through query perturbations. ACM Trans. Database Syst., 42(1):4:1–4:41, 2017.
|
| 271 |
+
|
| 272 |
+
Yingce Xia, Di He, Tao Qin, Liwei Wang, Nenghai Yu, Tie-Yan Liu, and Wei-Ying Ma. Dual learning for machine translation. In Proceedings of the 30th International Conference on Neural Information Processing Systems, 2016.
|
| 273 |
+
|
| 274 |
+
Michał Ziemski, Marcin Junczys-Dowmunt, and Bruno Poliquen. The united nations parallel corpus v1.0. In Proceedings of LREC, 2016.
|
| 275 |
+
|
| 276 |
+
# A REFORMULATION EXAMPLES
|
| 277 |
+
|
| 278 |
+
Table 2: Results of the qualitative analysis on SearchQA. For the original Jeopardy! questions we give the reference answer, otherwise the answer given by BiDAF.
|
| 279 |
+
|
| 280 |
+
<table><tr><td>Model</td><td>Query</td><td>Reference /Answer from BiDAF (F1)</td></tr><tr><td>Jeopardy!</td><td>People of this nation AKA Nippon wrote with a brush,so painting became the preferred form of artistic expression</td><td> japan</td></tr><tr><td>SearchQA</td><td>people nation aka nippon wrote brush ,painting became preferred</td><td>japan (1.0)</td></tr><tr><td></td><td>form artistic expression nippon brush preferred</td><td> julian (0)</td></tr><tr><td>MI Base-NMT</td><td>Aka nippon written form artistic expression?</td><td> julian (0)</td></tr><tr><td>AQA-QR</td><td>What is name did people nation aka nippon wrote brush expres-</td><td>japan (1.0)</td></tr><tr><td>AQA-Full</td><td>sion? people nation aka nippon wrote brush ,painting became preferred</td><td> japan (1.0)</td></tr><tr><td>Jeopardy!</td><td>form artistic expression Michael Caine & Steve Martin teamed up as Lawrence & Freddy,</td><td>dirty rotten scoundrels</td></tr><tr><td>SearchQA</td><td>a couple of these,the title of a1988 flm michael caine steve martin teamed lawrence freddy,couple,title</td><td>dirty rotten scoundrels (1.0)</td></tr><tr><td>MI</td><td>1988 film caine teamed freddy</td><td>dirty rotten scoundrels (1.0)</td></tr><tr><td>Base-NMT</td><td>Who was lawrence of michael caine steve martin?</td><td>rain man 1988 best picture fikkle [...25 tokens]</td></tr><tr><td>AQA-QR</td><td>What is name is name is name michael caine steve martin teamed</td><td>(0.18) dirty rotten scoundrels (1.0)</td></tr><tr><td>AQA-Full</td><td>lawrence freddy and title 1988 film? What is name is name where name is name michael caine steve martin teamed lawrence freddy and title 1988 film key 2000 ?</td><td>dirty rotten scoundrels (1.0)</td></tr><tr><td>Jeopardy!</td><td>Used underwater,ammonia gelatin is a waterproof type of this ex-</td><td>dynamite</td></tr><tr><td>SearchQA</td><td>plosive used underwater,ammonia gelatin waterproof type explosive</td><td></td></tr><tr><td>MI</td><td>ammonia gelatin waterproof</td><td>nitroglycerin (0) nitroglycerin (0)</td></tr><tr><td>Base-NMT</td><td>Where is ammonia gelatin waterproof? nitroglycerin (0)</td><td></td></tr><tr><td>AQA-QR</td><td>What is name is used under water with ammonia gelatin water wa- terproof type explosive?</td><td>nitroglycerin (0)</td></tr><tr><td>AQA-Full</td><td>used underwater,ammonia gelatin waterproof type explosive</td><td>nitroglycerin (0)</td></tr><tr><td>Jeopardy!</td><td>The Cleveland Peninsula is about 40 miles northwest of Ketchikan in this state</td><td>alaska</td></tr><tr><td>SearchQA</td><td>cleveland peninsula 4O miles northwest ketchikan state</td><td>alaska 's community information summary says [. 113 tokens] (0.02)</td></tr><tr><td>MI Base-NMT</td><td>cleveland peninsula ketchikan The cleveland peninsula 40 miles?</td><td>alaska 's dec 16,1997[..132 tokens](0.01) ketchikan alaskalocatednorthwesttip</td></tr><tr><td>AQA-QR</td><td>What is name is cleveland peninsula state northwest state state</td><td>[... 46 tokens] (0.04) alaska (1.0)</td></tr><tr><td>AQA-Full</td><td>state? What is name are cleveland peninsula state northwest state state</td><td>alaska (1.0)</td></tr><tr><td></td><td>state ?</td><td></td></tr><tr><td>Jeopardy! SearchQA</td><td>Tess Ocean,Tinker Bell, Charlotte the Spider tess ocean,tinker bell,charlotte spider</td><td>julia roberts julia roberts tv com charlotte spider[..87 tokens]</td></tr><tr><td>MI</td><td>tess tinker spider</td><td>(0.04) julia roberts tvcom charlotte spider.. 119 tokens]</td></tr><tr><td>Base-NMT</td><td>What ocean tess tinker bell?</td><td>(0.01) julia roberts american actress producer made</td></tr><tr><td>AQA-QR</td><td>What is name tess ocean tinker bellink charlotte spider?</td><td>[.. 206 tokens] (0.02) julia roberts (1.0)</td></tr><tr><td>AQA-Full</td><td>What is name is name tess ocean tinker bell spider contain char- lotte spider contain hump around the world winter au to finish au de mon moist</td><td> julia roberts (1.0)</td></tr><tr><td>Jeopardy!</td><td>During the Tertiary Period,India plowed into Eurasia & this high- est mountain range was formed</td><td>himalayas</td></tr><tr><td>SearchQA</td><td>tertiary period,india plowed eurasia highest mountain range formed</td><td>himalayas (1.0)</td></tr><tr><td>MI</td><td>tertiary plowed eurasia</td><td>himalayas (1.0)</td></tr><tr><td>Base-NMT</td><td>What is eurasia highest mountain range?</td><td>himalayas (1.0)</td></tr><tr><td>AQA-QR</td><td>What is name were tertiary period in india plowed eurasia?</td><td>himalayas (1.0)</td></tr><tr><td>AQA-Full</td><td>tertiary period,india plowed eurasia highest mountain range formed</td><td>himalayas (1.0)</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Jeopardy!</td><td>The melody heard here is from the opera about Serse,better known to us as this "X"-rated Persian king</td><td>xerxes</td></tr><tr><td>SearchQA</td><td>melody heard opera serse,better known us X rated persian king</td><td>gilbert sullivan (0)</td></tr><tr><td>MI</td><td>melody opera persian</td><td>gilbert sullivan (0)</td></tr><tr><td>Base-NMT</td><td>Melody heard opera serse thing?</td><td>gilbert sullivan (0)</td></tr><tr><td>AQA-QR</td><td>What is name melody heard opera serse is better persian king?</td><td>gilbert sullivan (0)</td></tr><tr><td>AQA-Full</td><td>What is name is name melody heard opera serse is better persian king persian K ?</td><td>gilbert sullivan (0)</td></tr></table>
|
| 281 |
+
|
| 282 |
+
# B EXAMPLES OF RANKING LOSSES
|
| 283 |
+
|
| 284 |
+
Table 3: Examples of queries where none of the methods produce the right answer, but the Oracle model can.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Model</td><td>Query</td><td>Answer (F1)</td></tr><tr><td>SearchQA</td><td>ancient times ,pentelic quarries major source building material athens</td><td>parthenon (0.0)</td></tr><tr><td>AQA-QR AQA-CNN</td><td>What is name an Ancient History Warry quarry material athens? ancient times ,pentelic quarries major source building material</td><td>parthenon (0.0) parthenon (0.0)</td></tr><tr><td>AQA-Oracle</td><td>athens What is name is name an Ancient Romes For pentelic quarry</td><td>marble (1.0)</td></tr><tr><td>SearchQA</td><td>material athens measure athens? 1949 1999 germany 's bundestag legislature met city</td><td>berlin (0.0)</td></tr><tr><td>AQA-QR</td><td>What is name is name 1999 germanys bundestag legislature met city city?</td><td>berlin (0.0)</td></tr><tr><td>AQA-CNN</td><td>What is name is name 1999 germany germany bundestag legisla- ture city city?</td><td>berlin (0.0)</td></tr><tr><td>AQA-Oracle</td><td>What is name is name a 1999 germany germany legislature met city city?</td><td>bonn (1.0)</td></tr><tr><td>SearchQA</td><td>utah jazz retired 12 jersey</td><td>karl malone (0.0)</td></tr><tr><td>AQA-QR</td><td>What is name did utah jazz retired jersey jersey?</td><td>karl malone (0.0)</td></tr><tr><td>AQA-CNN</td><td>What is name did utah jazz retired jersey jersey?</td><td>karl malone (0.0)</td></tr><tr><td>AQA-Oracle</td><td>What is name is name where utah jazz is retired jersey jersey?</td><td> john stockton (1.0)</td></tr><tr><td>SearchQA</td><td>swing intersection count basie capital virginia</td><td></td></tr><tr><td>AQA-QR</td><td>What is name for swing intersection count basie capital virginia?</td><td>chicago (0.0)</td></tr><tr><td>AQA-CNN</td><td></td><td>chicago (0.0)</td></tr><tr><td></td><td>swing intersection count basie capital virginia</td><td>chicago (0.0)</td></tr><tr><td>AQA-Oracle SearchQA</td><td>What is name swing swing intersection capital virginia?</td><td>richmond (1.0)</td></tr><tr><td></td><td>huge upset virginia , jim webb beat senator prospective presiden- tial candidate</td><td>hillary clinton (0.0)</td></tr><tr><td>AQA-QR</td><td>What is name is name huge upset virginia jug webb beat senator?</td><td>jim webb (0.0)</td></tr><tr><td>AQA-CNN AQA-Oracle</td><td>What is name is name huge upset virginia jug webb beat senator world candidate?</td><td> jim webb (0.0)</td></tr></table>
|
| 287 |
+
|
| 288 |
+
# C PARAPHRASING EXAMPLES
|
| 289 |
+
|
| 290 |
+
Table 4: Paraphrasing examples on captions from MSCOCO (Lin et al., 2014).
|
| 291 |
+
|
| 292 |
+
<table><tr><td>Source Reference</td><td>a man riding a wave on top of a surfboard. a man on a surfboard in the crest of a wave.</td></tr><tr><td></td><td></td></tr><tr><td>Base-NMT</td><td>a man on top of a surfboard?</td></tr><tr><td>Base-NMT-NoParalex</td><td>amankind arises away froma floor.</td></tr><tr><td>Base-NMT+Quora</td><td>it possible to riding a wave on a surfboard?</td></tr><tr><td>AQA-QR</td><td>what is name an average man riding a wave at onfboard?</td></tr><tr><td>Source</td><td>a person riding some skis through a snowy mountain trail.</td></tr><tr><td>Reference</td><td>a man on skis is standing by some trees.</td></tr><tr><td>Base-NMT</td><td>what is some skis through a snowy mountain trail?</td></tr><tr><td>Base-NMT-NoParalex</td><td>the person rising somekises through a snow blood.</td></tr><tr><td>Base-NMT+Quora</td><td>what is a skis mountain trail?</td></tr><tr><td>AQA-QR</td><td>what is name an average person riding some one snowy mountain trail?</td></tr><tr><td>Source</td><td> a group of people all taking a bite out of the same sandwich.</td></tr><tr><td>Reference</td><td>a group of people eating rom a large sandwich.</td></tr><tr><td>Base-NMT</td><td>what do people call a bite out of the same sandwich?</td></tr><tr><td>Base-NMT-NoParalex</td><td>a group of people who takes a bargained from the same index.</td></tr><tr><td>Base-NMT+Quora AQA-QR</td><td>what is the group of people who take bite out of the same sandwich?</td></tr><tr><td></td><td>what is name a group of people with bite out of sandwich?</td></tr><tr><td>Source</td><td>a partially lit asian person holding a phone</td></tr><tr><td>Reference</td><td>a man standing next to a sign talking on a phone.</td></tr><tr><td>Base-NMT</td><td>what is a partical that holds a phone?</td></tr><tr><td>Base-NMT-NoParalex</td><td>plus little as an associate person</td></tr><tr><td>Base-NMT+Quora</td><td>what is a partially little asian person?</td></tr><tr><td>AQA-QR</td><td>what is name is associated with a partially active asian person holding a phone?</td></tr><tr><td>Source</td><td>a car driving through a very flooded street</td></tr><tr><td>Reference</td><td>a car is driving through a flooded street.</td></tr><tr><td>Base-NMT</td><td>what car driving through a flooded street?</td></tr><tr><td>Base-NMT-NoParalex</td><td>analysing through a heat street</td></tr><tr><td>Base-NMT+Quora</td><td>i driving through a flooded street?</td></tr><tr><td>AQA-QR</td><td>what is name is given to a car with a car driving through a flooded street?</td></tr><tr><td>Source</td><td>a man is holding a tennis racket on a court</td></tr><tr><td>Reference</td><td>a man holding a racquet on top of a tennis court.</td></tr><tr><td>Base-NMT</td><td>how do you hold a tennis racket?</td></tr><tr><td>Base-NMT-NoParalex</td><td>a man to hold a threshold on a court</td></tr><tr><td>Base-NMT+Quora</td><td>what is a tennis racket?</td></tr><tr><td>AQA-QR</td><td>what is name an average man make a tennis racket on a court?</td></tr><tr><td>Source</td><td>a pizza on a pan that is half gone</td></tr><tr><td>Reference</td><td>a table with a half eaten pizza and glasses if beer.</td></tr><tr><td>Base-NMT</td><td>what is half gone in a pizza?</td></tr><tr><td>Base-NMT-NoParalex</td><td>average on a size</td></tr><tr><td>Base-NMT+Quora</td><td>is a pizza on a pan that is half gone?</td></tr><tr><td>AQA-QR</td><td>what is name a pizza on a pizza pan that is half gone?</td></tr><tr><td>Source</td><td>a boy holding a glove while on a baseball field.</td></tr><tr><td>Reference</td><td>a young boy bending over holding a catchers mitt.</td></tr><tr><td>Base-NMT</td><td>how do you hold a glove on a baseball field?</td></tr><tr><td>Base-NMT-NoParalex</td><td>a cell holding a globe ata later field.</td></tr><tr><td>Base-NMT+Quora</td><td>is it possible to hold a glove while on a baseball feld?</td></tr><tr><td>AQA-QR</td><td>what is name an boy make up a glove while on baseball feld?</td></tr><tr><td>Source</td><td>a street light with a red arrow pointing left.</td></tr><tr><td>Reference</td><td>a tagged traffic light displays ared arrow.</td></tr><tr><td>Base-NMT</td><td>a street light with red arrow pointing?</td></tr><tr><td>Base-NMT-NoParalex</td><td></td></tr><tr><td>Base-NMT+Quora</td><td>a strength with a skilling point. what is the street light of a red arrow pointing?</td></tr><tr><td>AQA-QR</td><td>what is name a street light with red arrow pointing left?</td></tr></table>
|
md/train/S1DWPP1A-/S1DWPP1A-.md
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNSUPERVISED LEARNING OF GOAL SPACES FORINTRINSICALLY MOTIVATED GOAL EXPLORATION
|
| 2 |
+
|
| 3 |
+
# Alexandre Péré
|
| 4 |
+
|
| 5 |
+
Flowers Team Inria and Ensta-ParisTech, France alexandre.pere@inria.fr
|
| 6 |
+
|
| 7 |
+
Sebastien Forestier
|
| 8 |
+
Flowers Team
|
| 9 |
+
Inria and Ensta-ParisTech, France
|
| 10 |
+
sebastien.forestier@inria.fr
|
| 11 |
+
|
| 12 |
+
# Olivier Sigaud
|
| 13 |
+
|
| 14 |
+
# Pierre-Yves Oudeyer
|
| 15 |
+
|
| 16 |
+
Flowers Team Inria, Ensta-ParisTech and UPMC, France Olivier.Sigaud@upmc.fr
|
| 17 |
+
|
| 18 |
+
Flowers Team Inria and Ensta-ParisTech, France pierre-yves.oudeyer@inria.fr
|
| 19 |
+
|
| 20 |
+
# ABSTRACT
|
| 21 |
+
|
| 22 |
+
Intrinsically motivated goal exploration algorithms enable machines to discover repertoires of policies that produce a diversity of effects in complex environments. These exploration algorithms have been shown to allow real world robots to acquire skills such as tool use in high-dimensional continuous state and action spaces. However, they have so far assumed that self-generated goals are sampled in a specifically engineered feature space, limiting their autonomy. In this work, we propose to use deep representation learning algorithms to learn an adequate goal space. This is a developmental 2-stage approach: first, in a perceptual learning stage, deep learning algorithms use passive raw sensor observations of world changes to learn a corresponding latent space; then goal exploration happens in a second stage by sampling goals in this latent space. We present experiments where a simulated robot arm interacts with an object, and we show that exploration algorithms using such learned representations can match the performance obtained using engineered representations.
|
| 23 |
+
|
| 24 |
+
Keywords: exploration; autonomous goal setting; diversity; unsupervised learning; deep neural network
|
| 25 |
+
|
| 26 |
+
# 1 INTRODUCTION
|
| 27 |
+
|
| 28 |
+
Spontaneous exploration plays a key role in the development of knowledge and skills in human children. For example, young children spend a large amount of time exploring what they can do with their body and external objects, independently of external objectives such as finding food or following instructions from adults. Such intrinsically motivated exploration (Berlyne, 1966; Gopnik et al., 1999; Oudeyer & Smith, 2016) leads them to make ratcheting discoveries, such as learning to locomote or climb in various styles and on various surfaces, or learning to stack and use objects as tools. Equipping machines with similar intrinsically motivated exploration capabilities should also be an essential dimension for lifelong open-ended learning and artificial intelligence.
|
| 29 |
+
|
| 30 |
+
In the last two decades, several families of computational models have both contributed to a better understanding of such exploration processes in infants, and how to apply them efficiently for autonomous lifelong machine learning (Oudeyer et al., 2016). One general approach taken by several research groups (Baldassarre et al., 2013; Oudeyer et al., 2007; Barto, 2013; Friston et al., 2017) has been to model the child as intrinsically motivated to make sense of the world, exploring like a scientist that imagines, selects and runs experiments to gain knowledge and control over the world. These models have focused in particular on three kinds of mechanisms argued to be essential and complementary to enable machines and animals to efficiently explore and discover skill repertoires in the real world (Oudeyer et al., 2013; Cangelosi et al., 2015): embodiment 1, intrinsic motivation2 and social guidance3. This article focuses on challenges related to learning goal representations for intrinsically motivated exploration, but also leverages models of embodiment, through the use of parameterized Dynamic Movement Primitives controllers (Ijspeert et al., 2013) and social guidance, through the use of observations of another agent.
|
| 31 |
+
|
| 32 |
+
Given an embodiment, intrinsically motivated exploration4 consists in automatically and spontaneously conducting experiments with the body to discover both the world dynamics and how it can be controlled through actions. Computational models have framed intrinsic motivation as a family of mechanisms that self-organize agents exploration curriculum, in particular through generating and selecting experiments that maximize measures such as novelty (Andreae & Andreae, 1978; Sutton, 1990), predictive information gain (Little & Sommer, 2013), learning progress (Schmidhuber, 1991; Kaplan & Oudeyer, 2003), compression progress (Schmidhuber, 2013), competence progress (Baranes & Oudeyer, 2013), predictive information (Martius et al., 2013) or empowerment (Salge et al., 2014). When used in the Reinforcement Learning (RL) framework (e.g. (Sutton, 1990; Schmidhuber, 1991; Kaplan & Oudeyer, 2003; Barto, 2013)), these measures have been called intrinsic rewards, and they are often applied to reward the "interestingness" of actions or states that are explored. They have been consistently shown to enable artificial agents or robots to make discoveries and solve problems that would have been difficult to learn using a classical optimization or RL approach based only on the target reward (which is often rare or deceptive) (Chentanez et al., 2005; Baranes & Oudeyer, 2013; Stanley & Lehman, 2015). Recently, they have been similarly used to guide exploration in difficult deep RL problems with sparse rewards, e.g. (Bellemare et al., 2016; Houthooft et al., 2016; Tang et al., 2017; Pathak et al., 2017).
|
| 33 |
+
|
| 34 |
+
However, many of these computational approaches have considered intrinsically motivated exploration at the level of micro-actions and states (e.g. considering low-level actions and pixel level perception). Yet, children’s intrinsically motivated exploration leverages abstractions of the environments, such as objects and qualitative properties of the way they may move or sound, and explore by setting self-generated goals (Von Hofsten, 2004), ranging from objects to be reached, toy towers to be built, or paper planes to be flown. A computational framework proposed to address this higher-level form of exploration has been Intrinsically Motivated Goal Exploration Processes (IMGEPs) (Baranes & Oudeyer, 2009; Forestier et al., 2017), which is closely related to the idea of goal babbling (Rolf et al., 2010). Within this approach, agents are equipped with a mechanism enabling them to sample a goal in a space of parameterized goals5, before they try to reach it by executing an experiment. Each time they sample a goal, they dedicate a certain budget of experiments time to improve the solution to reach this goal, using lower-level optimization or RL methods for example. Most importantly, in the same time, they take advantage of information gathered during this exploration to discover other outcomes and improve solutions to other goals6.
|
| 35 |
+
|
| 36 |
+
This property of cross-goal learning often enables efficient exploration even if goals are sampled randomly (Baranes & Oudeyer, 2013) in goal spaces containing many unachievable goals. Indeed, generating random goals (including unachievable ones) will very often produce goals that are outside the convex hull of already discovered outcomes, which in turn leads to exploration of variants of known corresponding policies, pushing the convex hull further. Thus, this fosters exploration of policies that have a high probability to produce novel outcomes without the need to explicitly measure novelty. This explains why forms of random goal exploration are a form of intrinsically motivated exploration. However, more powerful goal sampling strategies exist. A particular one consists in using meta-learning algorithms to monitor the evolution of competences over the space of goals and to select the next goal to try, according to the expected competence progress resulting from practicing it (Baranes & Oudeyer, 2013). This enables to automate curriculum sequences of goals of progressively increasing complexity, which has been shown to allow high-dimensional real world robots to acquire efficiently repertoires of locomotion skills or soft object manipulation (Baranes & Oudeyer, 2013), or advanced forms of nested tool use (Forestier et al., 2017). Similar ideas have been recently applied in the context of multi-goal deep RL, where architectures closely related to intrinsically motivated goal exploration are used by procedurally generating goals and sampling them randomly (Cabi et al., 2017; Najnin & Banerjee, 2017) or adaptively (Florensa et al., 2017).
|
| 37 |
+
|
| 38 |
+
Yet, a current limit of existing algorithms within the family of Intrinsically Motivated Goal Exploration Processes is that they have assumed that the designer7 provides a representation allowing the autonomous agent to generate goals, together with formal tools used to measure the achievement of these goals (e.g. cost functions). For example, the designer could provide a representation that enables the agent to imagine goals as potential continuous target trajectories of objects (Forestier et al., 2017), or reach an end-state starting from various initial states defined in Euclidean space (Florensa et al., 2017), or realize one of several discrete relative configurations of objects (Cabi et al., 2017), which are high-level abstractions from the pixels. While this has allowed to show the power of intrinsically motivated goal exploration architectures, designing IMGEPs that sample goals from a learned goal representation remains an open question. There are several difficulties. One concerns the question of how an agent can learn in an unsupervised manner a representation for hypothetical goals that are relevant to their world before knowing whether and how it is possible to achieve them with the agent’s own action system. Another challenge is how to sample "interesting" goals using a learned goal representation, in order to remain in regions of the learned goal parameters that are not too exotic from the underlying physical possibilities of the world. Finally, a third challenge consists in understanding which properties of unsupervised representation learning methods enable an efficient use within an IMGEP architecture so as to lead to efficient discovery of controllable effects in the environment.
|
| 39 |
+
|
| 40 |
+
In this paper, we present one possible approach named IMGEP-UGL where aspects of these difficulties are addressed within a 2-stage developmental approach, combining deep representation learning and goal exploration processes:
|
| 41 |
+
|
| 42 |
+
Unsupervised Goal space Learning stage (UGL): In the first phase, we assume the learner can passively observe a distribution of world changes (e.g. different ways in which objects can move), perceived through raw sensors (e.g. camera pixels or other forms of low-level sensors in other modalities). Then, an unsupervised representation learning algorithm is used to learn a lower-dimensional latent space representation (also called embedding) of these world configurations. After training, a Kernel Density Estimator (KDE) is used to estimate the distribution of these observations in the latent space.
|
| 43 |
+
|
| 44 |
+
Intrinsically Motivated Goal Exploration Process stage (IMGEP): In the second phase, the embedding representation and the corresponding density estimation learned during the first stage are reused in a standard IMGEP. Here, goals are iteratively sampled in the embedding as target outcomes. Each time a goal is sampled, the current knowledge (forward model and meta-policy, see below) enables to guess the parameters of a corresponding policy, used to initialize a time-bounded optimization process to improve the cost of this policy for this goal. Crucially, each time a policy is executed, the observed outcome is not only used to improve knowledge for the currently selected goal, but for all goals in the embedding. This process enables the learner to incrementally discover new policy parameters and their associated outcomes, and aims at learning a repertoire of policies that produce a maximally diverse set of outcomes.
|
| 45 |
+
|
| 46 |
+
A potential limit of this approach, as it is implemented and studied in this article, is that representations learned in the first stage are frozen and do not evolve in the second stage. However, we consider here this decomposition for two reasons. First, it corresponds to a well-known developmental progression in infant development: in their first few weeks, motor exploration in infants is very limited (due to multiple factors), while they spend a considerable amount of time observing what is happening in the outside world with their eyes (e.g. observing images of social peers producing varieties of effects on objects). During this phase, a lot of perceptual learning happens, and this is reused later on for motor learning (infant perceptual development often happens ahead of motor development in several important ways). Here, passive perceptual learning from a database of visual effects observed in the world in the first phase can be seen as a model of this stage where infants learn by passively observing what is happening around them8. A second reason for this decomposition is methodological: given the complexity of the underlying algorithmic components, analyzing the dynamics of the architecture is facilitated when one decomposes learning in these two phases (representation learning, then exploration).
|
| 47 |
+
|
| 48 |
+
Main contribution of this article. Prior to this work, and to our knowledge, all existing goal exploration process architectures used a goal space representation that was hand designed by the engineer, limiting the autonomy of the system. Here, the main contribution is to show that representation learning algorithms can discover goal spaces that lead to exploration dynamics close to the one obtained using an engineered goal representation space. The proposed algorithmic architecture is tested in two environments where a simulated robot learns to discover how to move and rotate an object with its arm to various places (the object scene being perceived as a raw pixel map). The objective measure we consider, called KL-coverage, characterizes the diversity of discovered outcomes during exploration by comparing their distribution with the uniform distribution over the space of outcomes that are physically possible (which is unknown to the learner). We even show that the use of particular representation learning algorithms such as VAEs in the IMGEP-UGL architecture can produce exploration dynamics that match the one using engineered representations.
|
| 49 |
+
|
| 50 |
+
# Secondary contributions of this article:
|
| 51 |
+
|
| 52 |
+
• We show that the IMGEP-UGL architecture can be successfully implemented (in terms of exploration efficiency) using various unsupervised learning algorithms for the goal space learning component: AutoEncoders (AEs) (Bourlard & Kamp, 1988), Variational AE (VAE) (Rezende et al., 2014; Kingma & Ba, 2015), VAE with Normalizing Flow (Rezende & Mohamed, 2015), Isomap (Tenenbaum et al., 2000), PCA (Pearson, 1901), and we quantitatively compare their performances in terms of exploration dynamics of the associated IMGEP-UGL architecture.
|
| 53 |
+
We show that specifying more embedding dimensions than needed to capture the phenomenon manifold does not deteriorate the performance of these unsupervised learning algorithms.
|
| 54 |
+
We show examples of unsupervised learning algorithms (Radial Flow VAEs) which produce less efficient exploration dynamics than other algorithms in our experiments, and suggest hypotheses to explain this difference.
|
| 55 |
+
|
| 56 |
+
# 2 GOALS REPRESENTATION LEARNING FOR EXPLORATION ALGORITHMS
|
| 57 |
+
|
| 58 |
+
In this section, we first present an outline of intrinsically motivated goal exploration algorithmic architectures (IMGEPs) as originally developed and used in the field of developmental robotics, and where goal spaces are typically hand crafted. Then, we present a new version of this architecture (IMGEP-UGL) that includes a first phase of passive perceptual learning where goal spaces are learned using a combination of representation learning and density estimation. Finally, we outline a list of representation learning algorithms that can be used in this first phase, as done in the experimental section.
|
| 59 |
+
|
| 60 |
+
# 2.1 INTRINSICALLY MOTIVATED GOAL EXPLORATION ALGORITHMS
|
| 61 |
+
|
| 62 |
+
Intrinsically Motivated Goal Exploration Processes (IMGEPs), are powerful algorithmic architectures which were initially introduced in Baranes & Oudeyer (2009) and formalized in Forestier et al. (2017). They can be used as heuristics to drive the exploration of high-dimensional continuous action spaces so as to learn forward and inverse control models in difficult robotic problems. To clearly understand the essence of IMGEPs, we must envision the robotic agent as an experimenter seeking information about an unknown physical phenomenon through sequential experiments. In this perspective, the main elements of an exploration process are:
|
| 63 |
+
|
| 64 |
+
• A context c, element of a Context Space $\mathcal { C }$ . This context represents the initial experimental factors that are not under the robotic agent control. In most cases, the context is considered fully observable (e.g. state of the world as measured by sensors).
|
| 65 |
+
|
| 66 |
+
• A parameterization $\theta$ , element of a Parameterization Space $\Theta$ . This parameterization represents the experimental factors that can be controlled by the robotic agent (e.g. parameters of a policy). • An outcome o, element of an Outcome Space $\mathcal { O }$ . The outcome contains information qualifying properties of the phenomenon during the execution of the experiment (e.g. measures characterizing the trajectory of raw sensor observations during the experiment). • A phenomenon dynamics $D : { \mathcal { C } } , \Theta \mapsto \mathcal { O }$ , which in most interesting cases is unknown.
|
| 67 |
+
|
| 68 |
+
If we take the example of the Arm-Ball problem9 in which a multi-joint robotic arm can interact with a ball, the context could be the initial state of the robot and the ball, the parameterization could be the parameters of a policy that generate a sequence of motor torque commands for $N$ time steps, and the outcome could be the position of the ball at the last time step. Developmental roboticists are interested in developing autonomous agents that learn two models, the forward model $\tilde { D } : \mathcal { C } \times \Theta \mapsto $ $\mathcal { O }$ which approximates the phenomenon dynamics, and the inverse model $\tilde { I } : \mathcal { C } \times \mathcal { O } \mapsto \Theta$ which allows to produce desired outcomes under given context by properly setting the parameterization. Using the aforementioned elements, one could imagine a simple strategy that would allow the agent to gather tuples $\{ c , \theta , o \}$ to train those models, by uniformly sampling a random parameterization $\theta \stackrel { - } { \sim } \mathcal { U } ( \theta )$ and executing the experiment. We refer to this strategy as Random Parameterization Exploration. The problem for most interesting applications in robotics, is that only a small subspace of $\Theta$ is likely to produce interesting outcomes. Indeed, considering again the Arm-Ball problem with time-bounded action sequences as parameterizations, very few of those will lead the arm to touch the object and move it. In this case, a random sampling in $\Theta$ would be a terrible strategy to yield interesting samples allowing to learn useful forward and inverse models for moving the ball.
|
| 69 |
+
|
| 70 |
+
To overcome this difficulty, one must come up with a better approach to sample parameterizations that lead to informative samples. Intrinsically Motivated Goal Exploration Strategies propose a way to address this issue by giving the agent a set of tools to handle this situation:
|
| 71 |
+
|
| 72 |
+
• A Goal Space $\tau$ whose elements $\tau$ represent parameterized goals that can be targeted by the autonomous agent. In the context of this article, and of the IMGEP-UGL architecture, we consider the simple but important case where the Goal Space is equated with the Outcome space. Thus, goals are simply vectors in the outcome space that describe target properties of the phenomenon that the learner tries to achieve through actions.
|
| 73 |
+
A Goal Policy $\gamma ( \tau )$ , which is a probability distribution over the Goal Space used for sampling goals (see Algorithmic Architecture 2). It can be stationary, but in most cases, it will be updated over time following an intrinsic motivation strategy. Note that in some cases, this Goal Policy can be conditioned on the context $\gamma ( \tau \vert c )$ .
|
| 74 |
+
• A set of Goal-parameterized Cost Functions $C _ { \tau } : \mathcal { O } \mapsto \mathbb { R }$ defined over all $\mathcal { O }$ , which maps every outcome with a real number representing the goodness-of-fit of the outcome $o$ regarding the goal $\tau$ . As these cost functions are defined over $\mathcal { O }$ , this enables to compute the cost of a policy for a given goal even if the goal is imagined after the policy roll-out. Thus, as IMGEPs typically memorize the population of all executed policies and their outcomes, this enables reuse of experimentations across multiple goals.
|
| 75 |
+
A Meta-Policy $\Pi : \tau , \mathcal { C } \mapsto \Theta$ which is a mechanism to approximately solve the minimization problem $\Pi ( \tau , c ) = \arg \operatorname* { m i n } _ { \theta } C _ { \tau } ( \tilde { D } ( \theta , c ) )$ , where $\bar { \tilde { D } }$ is a running forward model (approximating $D$ ), trained on-line during exploration.
|
| 76 |
+
|
| 77 |
+
In some applications, a de-facto ensemble of such tools can be used. For example, in the case where $\mathcal { O }$ is an Euclidean space, we can allow the agent to set goals in the Outcome Space $\mathcal { T } = \mathcal { O }$ , in which case for every goal $\tau$ we can consider a Goal-parameterized cost function $C _ { \tau } ( o ) = \| \tau - o \|$ where $\left. . \right.$ is a similarity metric. In the case of the Arm-Ball problem, the final position of the ball can be used as Outcome Space, hence the Euclidean distance between the goal position and the final ball position at the end of the episode can be used as Goal-parameterized cost function (but one could equally choose the full trajectories of the ball as outcomes and goals, and an associated similarity metric).
|
| 78 |
+
|
| 79 |
+
Algorithmic architecture 2 describes the main steps of Intrinsically Motivated Goal Exploration Processes using these tools10:
|
| 80 |
+
|
| 81 |
+
Bootstrapping phase: Sampling a few policy parameters (called Random Parametrization Exploration, RPE), observing the starting context and the resulting outcome, to initialize a memory of experiments $( \mathcal { H } = \{ ( c _ { i } , \theta _ { i } , o _ { i } ) \} )$ and a regressor $\tilde { D } _ { r u n n i n g }$ approximating the phenomenon dynamics.
|
| 82 |
+
|
| 83 |
+
Goal exploration phase: Stochastically mixing random policy exploration with goal exploration. In goal exploration, one first observes the context $c$ and then samples a goal $\tau$ using goal policy $\gamma$ (this goal policy can be a random stationary distribution, as in experiments below, or a contextual multi-armed bandit maximizing information gain or competence progress, see (Baranes & Oudeyer, 2013)). Then, a meta-policy algorithm $\Pi$ is used to search the parameterization $\theta$ minimizing the Goal-parameterized cost function $C _ { \tau }$ , i.e. it computes $\bar { \theta } = \arg \operatorname* { m i n } _ { \theta } C _ { \tau } ( \tilde { D } _ { r u n n i n g } ( \bar { \theta } , c ) )$ . This process is typically initialized by searching the parameter $\theta _ { i n i t }$ in $\mathcal { H }$ such that the corresponding $c _ { i n i t }$ is in the neighborhood of $c$ and $C _ { \tau } ( o _ { i n i t } )$ is minimized. Then, this initial guess is improved using an optimization algorithm (e.g. L-BFGS) over the regressor $\tilde { D } _ { r u n n i n g }$ . The resulting policy $\theta$ is executed, and the outcome $o$ is observed. The observation $( c , \theta , o )$ is then used to update $\mathcal { H }$ and $\tilde { D } _ { r u n n i n g }$ .
|
| 84 |
+
|
| 85 |
+
This procedure has been experimentally shown to enable sample efficient exploration in highdimensional continuous action robotic setups, enabling in turn to learn repertoires of skills in complex physical setups with object manipulations using tools (Forestier $\&$ Oudeyer, 2016; Forestier et al., 2017) or soft deformable objects (Nguyen & Oudeyer, 2014).
|
| 86 |
+
|
| 87 |
+
Nevertheless, two issues arise when it comes to using these algorithms in real-life setups, and within a fully autonomous learning approach. First, there are many real world cases where providing an Outcome Space (in which to make observations and sample goals, so this is also the Goal Space) to the agent is difficult, since the designer may not himself understand well the space that the robot is learning about. The approach taken until now (Forestier et al., 2017), was to create an external program which extracted information out of images, such as tracking all objects positions. This information was presented to the agent as a point in $[ 0 , 1 ] ^ { n }$ , which was hence considered as an Outcome Space. In such complex environments, the designer may not know what is actually feasible or not for the robot, and the Outcome space may contain many unfeasible goals. This is the reason why advanced mechanisms for sampling goals and discovering which ones are actually feasible have been designed (Baranes & Oudeyer, 2013; Forestier et al., 2017). Second, a system where the engineer designs the representation of an Outcome Space space is limited in its autonomy. A question arising from this is: can we design a mechanism that allows the agent to construct an Outcome Space that leads to efficient exploration by the mean of examples? Representation Learning methods, in particular Deep Learning algorithms, constitute a natural approach to this problem as it has shown outstanding performances in learning representations for images. In the next two sections, we present an update of the IMGEP architecture that includes a goal space representation learning stage, as well as various Deep Representation Learning algorithms tested: Autoencoders along with their more recent Variational counter-parts.
|
| 88 |
+
|
| 89 |
+
# 2.2 UNSUPERVISED GOAL REPRESENTATION LEARNING FOR IMGEP
|
| 90 |
+
|
| 91 |
+
In order to enable goal space representation learning within the IMGEP framework, we propose to add a first stage of unsupervised perceptual learning (called UGL) before the goal exploration stage, leading to the new IMGEP-UGL architecture described in Algorithmic Architecture 1. In the passive perceptual learning stage (UGL, lines 2-8), the learner passively observes the unknown phenomenon by collecting samples $x _ { i }$ of raw sensor values as the world changes. The architecture is neutral with regards to how these world changes are produced, but as argued in the introduction, one can see them as coming from actions of other agents in the environment. Then, this database of $x _ { i }$ observations is used to train an unsupervised learning algorithm (e.g. VAE, Isomap) to learn an embedding function $\tilde { \mathcal { R } }$ which maps the high-dimensional raw sensor observations onto a lowerdimensional representation $o$ . Also, a kernel density estimator $K D E$ estimates the distribution $p _ { k d e } ( o )$ of observed world changes projected in the embedding. Then, in the goal exploration stage (lines 9-26), this lower-dimensional representation $o$ is used as the outcome and goal space, and the distribution $p _ { k d e } ( o )$ is used as a stochastic goal policy, within a standard IMGEP process (see above).
|
| 92 |
+
|
| 93 |
+
# Algorithmic Architecture 1: Intrinsically Motivated Goal Exploration Process with Unsupervised Goal Representation Learning (IMGEP-UGL)
|
| 94 |
+
|
| 95 |
+
#
|
| 96 |
+
|
| 97 |
+
Regressor $\tilde { D } _ { r u n n i n g }$ , Goal Policy $\gamma$ , Parameterized cost function $C _ { \tau }$ , Meta-Policy algorithm Π,
|
| 98 |
+
Unsupervised representation learning algorithm $\mathcal { A }$ (e.g. AE, VAE, Isomap), Kernel Density
|
| 99 |
+
Estimator algorithm $K D E$ ,
|
| 100 |
+
History $\mathcal { H }$ , Random exploration ratio $\Gamma _ { e }$
|
| 101 |
+
|
| 102 |
+
# 1 begin
|
| 103 |
+
|
| 104 |
+
# Passive perceptual learning stage (UGL):
|
| 105 |
+
|
| 106 |
+
for A fixed number of Observation iterations $n _ { r }$ do
|
| 107 |
+
|
| 108 |
+
Learn an embedding function ${ \tilde { R } } : { \mathrm { ~ } } x \to o$ using algorithm $\mathcal { A }$ on data $\mathcal { D }$ Set $\mathcal { O } = \mathcal { T } = \tilde { R } ( x )$
|
| 109 |
+
|
| 110 |
+
Estimate the outcome distribution $p _ { k d e } ( o )$ from $\{ \tilde { R } ( x _ { i } ) \} _ { i \in [ 0 , 1 0 0 0 0 ] }$ using algorithm $K D E$ Set the Goal Policy $\gamma = p _ { k d e }$ to be the estimated outcome distribution
|
| 111 |
+
|
| 112 |
+
# Goal exploration stage (IMGEP):
|
| 113 |
+
|
| 114 |
+
or A fixed number of Bootstrapping iterations do Observe context $c$ Sample $\theta \sim \mathcal { U } ( \theta )$ Perform experiment and retrieve outcome from raw sensor signal $o = \tilde { R } ( x )$ Update Regressor $\tilde { D } _ { r u n n i n g }$ with tuple $\{ c , \theta , o \}$ $\mathcal { \bar { H } } = \mathcal { H } \cup \{ c , \theta , o \}$
|
| 115 |
+
|
| 116 |
+
Perform experiment and retrieve outcome from raw sensor signal $o = \tilde { R } ( x )$ Update Regressor $\tilde { D } _ { r u n n i n g }$ with a tuple $\{ c , \theta , o \}$ Update Goal Policy $\gamma$ , according to Intrinsic Motivation strategy $\mathcal { \bar { H } } = \mathcal { H } \cup \{ c , \theta , o \}$
|
| 117 |
+
|
| 118 |
+
28 return The forward model $\tilde { D } _ { r u n n i n g }$ , the history $\mathcal { H }$ and the embedding $\tilde { R }$
|
| 119 |
+
|
| 120 |
+
2.3 REPRESENTATION LEARNING ALGORITHMS AND DENSITY ESTIMATION FOR THE UGL STAGE
|
| 121 |
+
|
| 122 |
+
As IMGEP-UGL is an algorithmic architecture, it can be implemented with several algorithmic variants depending on which unsupervised learning algorithm is used in the UGL phase. We experimented over different deep and classical Representation Learning algorithms for the UGL phase. We rapidly outline these algorithms here. For a more in-depth introduction to those models, the reader can refer to Appendix B which contains details on the derivations of the different Cost Functions and Architectures of the Deep Neural Networks based models.
|
| 123 |
+
|
| 124 |
+
Auto-Encoders (AEs) are a particular type of Feed-Forward Neural Networks that were introduced in the early hours of neural networks (Bourlard & Kamp, 1988). They are trained to output a reconstruction $\tilde { \bf x }$ of the input vector $\mathbf { x }$ of dimension $D$ , through a representation layer of size $d < D$ . They can be trained in an unsupervised manner using a large dataset of unlabeled samples $\mathcal { D } = \{ \mathbf { x } ^ { ( i ) } \} _ { i \in \{ 0 \ldots N \} }$ . Their main interest lies in their ability to model the statistical regularities existing in the data. Indeed, during training, the network learns the regularities allowing to encode most of the information existing in the input in a more compact representation. Put differently, AEs can be seen as learning a non-linear compression for data coming from an unknown distribution. Those models can be trained using different algorithms, the most simple being Stochastic Gradient Descent (SGD), to minimize a loss function $\mathcal { I } ( \mathcal { D } )$ that penalizes differences between $\tilde { \bf x }$ and $\mathbf { x }$ for all samples in $\mathcal { D }$ .
|
| 125 |
+
|
| 126 |
+
Variational Auto-Encoders (VAEs) are a recent alternative to classic AEs (Rezende et al., 2014; Kingma & Ba, 2015), that can be seen as an extension to a stochastic encoding. The argument underlying this model is slightly more involved than the simple approach taken for AEs, and relies on a statistical standpoint presented in Appendix B. In practice, this model simplifies to an architecture very similar to an AE, differing only in the fact that the encoder $f _ { \theta }$ outputs the parameters $\mu$ and $\sigma$ of a multivariate Gaussian distribution ${ \mathcal { N } } ( \mu , d i a g ( \sigma ^ { 2 } ) )$ with diagonal covariance matrix, from which the representation $\mathbf { z }$ is sampled. Moreover, an extra term is added to the Cost Function, to condition the distribution of $\mathbf { z }$ in the representation space. Under the restriction that a factorial Gaussian is used, the neural network can be made fully differentiable thanks to a reparameterization trick, making it possible to use SGD for training.
|
| 127 |
+
|
| 128 |
+
In practice VAEs tend to yield smooth representations of the data, and are faster to converge than AEs from our experiments. Despite these interesting properties, the derivation of the actual cost function relies mostly on the assumption that the factors can be described by a factorial Gaussian distribution. This hypothesis can be largely erroneous, for example if one of the factors is periodic, multi-modal, or discrete. In practice our experiments showed that even if training could converge for non-Gaussian factors, it tends to be slower and to yield poorly conditioned representations.
|
| 129 |
+
|
| 130 |
+
Normalizing Flow proposes a way to overcome this restriction on distribution, by allowing more expressive ones (Rezende & Mohamed, 2015). It uses the classic rule of change of variables for random variables, which states that considering a random variable ${ \bf z } _ { 0 } \sim { \boldsymbol q } ( { \bf z } _ { 0 } )$ , and an invertible transformation $t : \mathbb { R } ^ { d } \mapsto \mathbb { R } ^ { d }$ , if ${ \bf z } = t ( { \bf z } _ { 0 } )$ then $q ( \mathbf { z } ) = q ( \mathbf { z } _ { 0 } ) \lvert \operatorname* { d e t } \partial t / \partial \mathbf { z } _ { 0 } \rvert ^ { - 1 }$ . Using this, we can chain multiple transformations $t _ { 1 } , t _ { 2 } , \dots , t _ { K }$ to produce a new random variable $\mathbf { z } _ { K } = t _ { K } \circ \cdot \cdot \cdot \circ$ $t _ { 2 } \circ t _ { 1 } ( \mathbf { z } _ { 0 } )$ . One particularly interesting transformation is the Radial Flow, which allows to radially contract and expand a distribution as can be seen in Figure 5 in Appendix. This transformation seems to give the required flexibility to encode periodic factors.
|
| 131 |
+
|
| 132 |
+
Isomap is a classical approach of Multi-Dimensional Scaling (Kruskal, 1964) a procedure allowing to embed a set of $N$ -dimensional points in a $n$ dimensional space, with $N > n$ , minimizing the Kruskal Stress, which measures the distortion induced by the embedding in the pairwise Euclidean distances. This algorithm results in an embedding whose pairwise distances are roughly the same as in the initial space. Isomap (Tenenbaum et al., 2000) goes further by assuming that the data lies in the vicinity of a lower dimensional manifold. Hence, it replaces the pairwise Euclidean distances in the input space by an approximate pairwise geodesic distance, computed by the Dijkstra’s Shortest Path algorithm on a $\kappa$ nearest-neighbors graph.
|
| 133 |
+
|
| 134 |
+
Principal Component Analysis is an ubiquitous procedure (Pearson, 1901) which, for a set of data points, allows to find the orthogonal transformation that yields linearly uncorrelated data. This transformation is found by taking the principal axis of the covariance matrix of the data, leading to a representation whose variance is in decreasing order along dimensions. This procedure can be used to reduce dimensionality, by taking only the first $n$ dimensions of the transformed data.
|
| 135 |
+
|
| 136 |
+
Estimation of sampling distribution: Since the Outcome Space $\mathcal { O }$ was learned by the agent, it had no prior knowledge of $p ( o )$ for $o \in \mathcal { O }$ . We used a Gaussian Kernel Density Estimation (KDE) (Parzen, 1962; Rosenblatt, 1956) to estimate this distribution from the projection of the images observed by the agent, into the learned goal space representation. Kernel Density Estimation allows to estimate the continuous density function (cdf) $f ( o )$ out of a discrete set of samples $\{ o _ { i } \} _ { i \in \{ 1 , . . . , n \} }$ drown from distribution $p ( o )$ . The estimated cdf is computed using the following equation:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
{ \hat { f } } _ { \mathbf { H } } ( o ) = { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } K _ { \mathbf { H } } ( o - o _ { i } ) ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
with $K ( \cdot )$ a kernel function and $\mathbf { H }$ a bandwidth $d \times d$ matrix (d the dimension of $\mathcal { O }$ ). In our case, we used a Gaussian Kernel:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
K _ { \mathbf { H } } ( o ) = ( 2 \pi ) ^ { - \frac { d } { 2 } } | \mathbf { H } | ^ { - \frac { 1 } { 2 } } e ^ { - \frac { 1 } { 2 } o ^ { T } \mathbf { H } ^ { - 1 } o } ,
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
with the bandwidth matrix $\mathbf { H }$ equaling the covariance matrix of the set of points, rescaled by factor $n ^ { - \frac { 1 } { d + 4 } }$ , with $n$ the number of samples, as proposed in Scott (1992).
|
| 149 |
+
|
| 150 |
+
# 3 EXPERIMENTS
|
| 151 |
+
|
| 152 |
+
We conducted experiments to address the following questions in the context of two simulated environments:
|
| 153 |
+
|
| 154 |
+
• Is it possible for an IMGEP-UGL implementation to produce a Goal Space representation yielding an exploration dynamics as efficient as the dynamics produced by an IMGEP implementation using engineered goal space representations? Here, the dynamics of exploration is measured through the KL Coverage defined thereafter.
|
| 155 |
+
• What is the impact of the target embedding dimensionality provided to these algorithms?
|
| 156 |
+
• Are there differences in exploration dynamics when one uses different unsupervised learning algorithms (Isomap-KDE, PCA-KDE, AE-KDE, VAE-KDE, VAE-GP, RFVAE-GP, RFVAE-KDE) as various UGL component of IMGEP-UGL?
|
| 157 |
+
|
| 158 |
+
We now present in depth the experimental campaign we performed11.
|
| 159 |
+
|
| 160 |
+
Environments: We experimented on two different Simulated Environments derived from the Arm-Ball benchmark represented in Figure 1, namely the Arm-Ball and the Arm-Arrow environments, in which a 7-joint arm, controlled by a 21 continuous dimension Dynamic Movement Primitives (DMP) (Ijspeert et al., 2013) controller, evolves in an environment containing an object it can handle and move around in the scene. In the case of IMGEP-UGL learners, the scene is perceived as a $7 0 \mathrm { x } 7 0$ pixel image. For the UGL phase, we used the following mechanism to generate the distribution of samples $x _ { i }$ : the object was moved randomly uniformly over $[ - 1 , 1 ] ^ { 2 }$ for ArmBall, and over $[ - 1 , 1 ] ^ { 2 } \times \mathbf { \bar { [ 0 , 2 \pi ] } }$ for ArmArrow, and the corresponding images were generated and provided as an observable sample to IMGEP-UGL learners. Note that the physically reachable space (i.e. the largest space the arm can move the object to) is the disk centered on 0 and of radius 1: this means that the distribution of object movements observed by the learner is slightly larger than the actual space of moves that learners can produce themselves (and learners have no knowledge of which subspace corresponds to physically feasible outcomes). The environments are presented in depth in Appendix C.
|
| 161 |
+
|
| 162 |
+
Algorithmic Instantiation of the IMGEP-UGL Architecture: We experimented over the following Representation Learning Algorithms for the UGL component: Auto-Encoders with $K D E$ (RGE-AE), Variational Auto-Encoders with $K D E$ (RGE-VAE), Variational Auto-Encoders using the associated Gaussian prior for sampling goal instead of $K D E$ (RGE-VAE-GP), Radial Flow Variational Auto-Encoders with $K D E$ (RGE-RFVAE), Radial Flow Variational Auto-Encoders using the associated Gaussian prior for sampling goal (RGE-RFVAE-GP), Isomap (RGE-Isomap) (Tenenbaum et al., 2000) and Principal Component Analysis (RGE-Isomap).
|
| 163 |
+
|
| 164 |
+
Regarding the classical IMGEP components, we considered the following elements:
|
| 165 |
+
|
| 166 |
+
• Context Space $\boldsymbol { \mathcal { C } } = \boldsymbol { \mathcal { D } }$ : In the implemented environments, the initial positions of the arm and the object were reset at each episode12. Consequently, the context was not observed nor accounted for by the agent.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 1: Left: The Arm-Ball environment with a 7 DOF arm, controlled by a 21D continuous actions DMP controller, that can stick and move the ball if the arm tip touches it (on the left). Right: rendered $7 0 \mathrm { x } 7 0$ images used as raw signals representing the end position of the objects for Arm-Ball (on the center) and Arm-Arrow (on the right) environments. The arm is not visible to learners.
|
| 170 |
+
|
| 171 |
+
• Parameterization Space $\Theta = [ 0 , 1 ] ^ { 2 1 }$ : During the experiments, we used DMP controllers as parameterized policies to generate time-bounded motor actions sequences. Since the DMP controller was parameterized by 3 basis functions for each joint of the arm (7), the parameterization of the controller was represented by a point in $[ 0 , \bar { 1 } ] ^ { 3 \times 7 }$ .
|
| 172 |
+
|
| 173 |
+
Outcome Space $\mathcal { O } \subset \mathbb { R } ^ { l }$ : The Outcome Space is the subspace of $\bar { \mathbb { R } ^ { l } }$ spanned by the embedding representations of the ensemble of images observed in the first phase of learning. For the RGE-EFR algorithm, $l = 2$ in ArmBall and $l = 3$ in ArmArrow. For IMGEPUGL algorithms, as the representation learning algorithms used in the UGL stage require a parameter specifying the maximum dimensionality of the target embedding, we considered two cases in experiments: 1) $l = 1 0$ , which is 5 times larger than the true manifold dimension for ArmBall, and 3.3 times larger for ArmArrow (the algorithm is not supposed to know this, so testing the performance with larger embedding dimension is key); 2) $l = 2$ for ArmBall, and $l = 3$ for ArmArrow, which is the same dimensionality as the true dimensions of these manifolds. Goal Space $\tau = \mathcal { O }$ : The Goal Space was taken to equate the Outcome Space. • Goal-Parameterized Cost function $C _ { \tau } ( \cdot ) = \| \tau - \cdot \| _ { 2 }$ : Sampling goals in the Outcome Space allows us to use the Euclidean distance as Goal-parameterized cost function.
|
| 174 |
+
|
| 175 |
+
Considering those elements, we used the instantiation of the IMGEP architecture represented in Appendix $\mathbf { D }$ in Algorithm 3. We implemented a goal sampling strategy known as Random Goal Exploration (RGE), which consists, given a stationary distribution over the Outcome Space $p ( o )$ , in sampling a random goal $o \sim p ( o )$ each time (note that this stationary distribution $p ( o )$ is learnt in the UGL stage for IMGEP-UGL implementations). We used a simple $k$ -neighbors regressor to implement the running forward model $\tilde { D }$ , and the Meta-Policy mechanism consisted in returning the nearest achieved outcome in the outcome space, and taking the same parameterization perturbed by an exploration noise (which has proved to be a very strong baseline in IMGEP architectures in previous works (Baranes & Oudeyer, 2013; Forestier & Oudeyer, 2016)).
|
| 176 |
+
|
| 177 |
+
Exploration Performance Measure: In this article, the central property we are interested in is the dynamics and quality of exploration of the outcome space, characterizing the evolution of the distribution of discovered outcomes, i.e. the diversity of effects that the learner discovers how to produce. In order to characterize this exploration dynamics quantitatively, we monitored a measure which we refer to as Kullback-Leibler Coverage (KLC). At a given point in time during exploration, this measure computes the KL-divergence between the distribution of the outcomes produced so far, with a uniform distribution of outcomes in the space of physically possible outcomes (which is known by the experimenter, but unknown by the learner). To compute it, we use a normalized histogram of the explored outcomes, with 30 bins per dimension, which we refer to as $E$ , and we compute its Kullback Leibler Divergence with the normalized histogram of attainable points which
|
| 178 |
+
|
| 179 |
+
we refer to as $A$
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
K L C = \mathbb { D } _ { K L } [ E \| A ] = \sum _ { i = 1 } ^ { 3 0 } E ( i ) \log { \frac { E ( i ) } { A ( i ) } } .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
We emphasize that, when computed against a uniform distribution, the KLC measure is a proxy for the (opposite) Entropy of the $E$ distribution. Nevertheless, we prefer to keep it under the divergence form, as the $A$ distribution allows to define what the experimenter considers to be a good exploration distribution. In the case of this study, we consider a uniform distribution of explored locations over the attainable domain, to be the best exploration distribution achievable.
|
| 186 |
+
|
| 187 |
+
Baseline algorithms: We are using two natural baseline algorithms for evaluating the exploration dynamics of our IMGEP-UGL algorithmic implementations :
|
| 188 |
+
|
| 189 |
+
• Random Goal Exploration with Engineered Features Representations (RGE-EFR): This is an IMGEP implementation using a goal/outcome space with handcrafted features that directly encode the underlying structure of environments: for Arm-Ball, this is the 2D position of the ball in $[ 0 , 1 ] ^ { 2 }$ , and for Arm-Arrow this is the 2D position and the 1D orientation of the arrow in $[ 0 , \dot { 1 } ] ^ { 3 }$ . This algorithm is also given the prior knowledge of $p ( o ) = \mathcal { U } ( O )$ . All other aspects of the IMGEP (regressor, meta-policy, other parameters) are identical to IMGEP-UGL implementations. This algorithm is known to provide highly efficient exploration dynamics in these environments (Forestier & Oudeyer, 2016). Random Parameterization Exploration (RPE): The Random Parameterization Exploration approach does not use an Outcome Space, nor a Goal Policy, and only samples a random parameterization $\theta \sim \mathcal { U } ( \Theta )$ at each episode. We expected this algorithm to lower bound the performances of our novel architecture.
|
| 190 |
+
|
| 191 |
+
# 4 RESULTS
|
| 192 |
+
|
| 193 |
+
We first study the exploration dynamics of all IMGEP-UGL algorithms, comparing them to the baselines and among themselves. Then, we study specifically the impact of the target embedding dimension (latent space) for the UGL implementations, by observing what exploration dynamics is produced in two cases:
|
| 194 |
+
|
| 195 |
+
• Using a target dimension larger than the true dimension $( l = 1 0 )$ ) • Providing the true embedding dimension to the UGL implementations $( l = 2 , 3$
|
| 196 |
+
|
| 197 |
+
Finally, we specifically study RGE-VAE, using the intrinsic Gaussian prior of these algorithms to replace the $K D E$ estimator of $p ( O )$ in the UGL part.
|
| 198 |
+
|
| 199 |
+
Exploration Performances: In Figure 2, we can see the evolution of the KLC through exploration epochs (one exploration epoch is defined as one experimentation/roll-out of a parameter $\theta$ ). We can see that for both environments, and all values of latent spaces, all IMGEP-UGL algorithms, except RGE-RFVAE, achieve similar or better performance (both in terms of asymptotic KLC and speed to reach it) than the RGE-EFR algorithm using engineered Goal Space features, and much better performance than the RPE algorithm.
|
| 200 |
+
|
| 201 |
+
Figure 3 (see also Figure 8 and 9 in Appendix) show details of the evolution of discovered outcomes in ArmBall (final ball positions after the end of a policy roll-out) and corresponding KLC measures for individual runs with various algorithms. It also shows the evolution of the number of times learners managed to move the ball, which is considered in the KLC measure but not easily visible in the displayed set of outcomes in Figure 3. For instance, we observe that both RPE (Figure 3(a)) and RGE-RFVAE (Figure 3(c)) algorithms perform poorly: they discover very few policies moving the ball at all (pink curves), and these discovered ball moves cover only a small part of the physically possible outcome space. On the contrary, both RGE-EFR (handcrafted features) and RGE-VAE (learned goal space representation with VAE) perform very well, and the KLC of RGE-VAE is even better than the KLC of RGE-EFR, due to the fact that RGE-VAE has discovered more policies (around 2400) that move the ball than RGE-EFR (around 1600, pink curve).
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 2: KL Coverage through epochs for different algorithms on ArmBall and ArmArrow environments. The exploration performance was assessed for both an over-complete representation (10 latent dimensions), and a complete representation (2 and 3 latent dimensions). The shaded area represent a $90 \%$ confidence interval estimated from 5 run of the different algorithms.
|
| 205 |
+
|
| 206 |
+
Impact of target latent space size in IMGEP-UGL algorithms On the ArmBall problem, we observe that if one provides the true target embedding dimension $\mathit { l } = 2 \mathit { \Pi }$ ) to IMGEP-UGL implementations, RGE-Isomap is slightly improving (getting quasi-identical to RGE-EFR), RGE-AE does not change (remains quasi-identical to RGE-EFR), but the performance of RGE-PCA and RGE-VAE is degraded. For ArmArrow, the effect is similar: IMGEP-UGL algorithms with a larger target embedding dimension $\left( l = 1 0 \right)$ ) than the true dimensionality all perform better than RGE-EFR (except RGE-RFVAE which is worse in all cases), while when $l = 2$ only RGE-VAE is significantly better than RGE-EFR. In Appendix F, more examples of exploration curves with attached exploration scatters are shown. For most example runs, increasing the target embedding dimension enables learners to discover more policies moving the ball and, in these cases, the discovered outcomes are more concentrated towards the external boundary of the discus of physically possible outcomes. This behavior, where increasing the target embedding dimension improves the KLC while biasing the discovered outcome towards the boundary the feasible goals, can be understood as a consequence of the following well-known general property of IMGEPs: if goals are sampled outside the convex hull of outcomes already discovered, this has the side-effect of biasing exploration towards policies that will produce outcomes beyond this convex hull (until the boundary of feasible outcomes is reached). Here, as observations in the UGL phase were generated by uniformly moving the objects on the square $[ - 1 , 1 ] ^ { 2 }$ , while the feasible outcome space was the smaller discus of radius 1, goal sampling happened in a distribution of outcomes larger than the feasible outcome space. As one increases the embedding space dimensionality, the ratio between the volume of the corresponding hyper-cube and hyper-discus increases, in turn increasing the probability to sample goals outside the feasible space, which has the side effect of fostering the discovery of novel outcomes and biasing exploration towards the boundaries.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
(a) Rpe
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
(b) Rge-Efr
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
(c) Rge-Rfvae - 10 Latents
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
Figure 3: Examples of achieved outcomes related with the evolution of KL-Coverage in the ArmBall environments. The number of times the ball was effectively handled is also represented.
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Figure 4: Evolution of the Exploration Ratio for RGE-VAE using KDE or Isotropic Gaussian prior. The curves show the mean and standard deviation over 5 independent runs of each condition.
|
| 222 |
+
|
| 223 |
+
Impact of Sampling Kernel Density Estimation Another factor impacting the exploration assessed during our experiments was the importance of the distribution used as stationary Goal Policy. If, in most cases, the representation algorithm gives no particular prior knowledge of $p ( o )$ , in the case of Variational Auto-Encoders, it is assumed in the derivation that $p ( o ) = \mathbf { \bar { \mathcal { N } } } ( 0 , \bar { I } )$ . Hence, the isotropic Gaussian distribution is a better candidate stationary Goal Policy than Kernel Density Estimation. Figure 4 shows a comparison between exploration performances achieved with RGEVAE using a KDE distribution or an isotropic Gaussian as Goal Policy. The performance is not significantly different from the isotropic Gaussian case. Our experiments showed that convergence on the KL term of the loss can be more or less quick depending on the initialization. Since we used a number of iterations as stopping criterion for training (based on early experiments), we found that sometimes, at stop, the divergence was still pretty high despite achieving a low reconstruction error. In those cases the representation was not be perfectly matching an isotropic Gaussian, which could lead to a goal sampling bias when using the isotropic Gaussian Goal Policy.
|
| 224 |
+
|
| 225 |
+
# 5 CONCLUSION
|
| 226 |
+
|
| 227 |
+
In this paper, we proposed a new Intrinsically Motivated Goal Exploration architecture with Unsupervised Learning of Goal spaces (IMGEP-UGL). Here, the Outcome Space (also used as Goal Space) representation is learned using passive observations of world changes through low-level raw sensors (e.g. movements of objects caused by another agent and perceived at the pixel level). Within the perspective of research on Intrinsically Motivated Goal Exploration started a decade ago (Oudeyer & Kaplan, 2007; Baranes & Oudeyer, 2013), and considering the fundamental problem of how AI agents can autonomously explore environments and skills by setting their own goals, this new architecture constitutes a milestone as it is to our knowledge the first goal exploration architecture where the goal space representation is learned, as opposed to hand-crafted.
|
| 228 |
+
|
| 229 |
+
Furthermore, we have shown in two simulated environments (involving a high-dimensional continuous action arm) that this new architecture can be successfully implemented using multiple kinds of unsupervised learning algorithms, including recent advanced deep neural network algorithms like Variational Auto-Encoders. This flexibility opens the possibility to benefit from future advances in unsupervised representation learning research. Yet, our experiments have shown that all algorithms we tried (except RGE-RFVAE) can compete with an IMGEP implementation using engineered feature representations. We also showed, in the context of our test environments, that providing to IMGEP-UGL algorithms a target embedding dimension larger than the true dimensionality of the phenomenon can be beneficial through leveraging exploration dynamics properties of IMGEPs. Though we must investigate more systematically the extent of this effect, this is encouraging from an autonomous learning perspective, as one should not assume that the learner initially knows the target dimensionality.
|
| 230 |
+
|
| 231 |
+
Limits and future work. The experiments presented here were limited to a fairly restricted set of environments. Experimenting over a larger set of environments would improve our understanding of IMGEP-UGL algorithms in general. In particular, a potential challenge is to consider environments where multiple objects/entities can be independently controlled, or where some objects/entities are not controllable (e.g. animate entities). In these cases, previous work on IMGEPs has shown that random Goal Policies should be either replaced by modular Goal Policies (considering a modular goal space representation, see Forestier et al. (2017)), or by active Goal Policies which adaptively focus the sampling of goals in subregions of the Goal Space where the competence progress is maximal (Baranes & Oudeyer, 2013). For learning modular representations of Goal Spaces, an interesting avenue of investigations could be the use of the Independently Controllable Factors approach proposed in (Thomas et al., 2017).
|
| 232 |
+
|
| 233 |
+
Finally, in this paper, we only studied a learning scenario where representation learning happens first in a passive perceptual learning stage, and is then fixed during a second stage of autonomous goal exploration. While this was here motivated both by analogies to infant development and to facilitate evaluation, the ability to incrementally and jointly learn an outcome space representation and explore the world is a stimulating topic for future work.
|
| 234 |
+
|
| 235 |
+
# REFERENCES
|
| 236 |
+
|
| 237 |
+
Peter M Andreae and John H. Andreae. A teachable machine in the real world. International Journal of Man-Machine Studies, 10(3):301–312, 1978.
|
| 238 |
+
|
| 239 |
+
Gianluca Baldassarre, Marco Mirolli, and Andrew G. Barto. Intrinsically motivated learning in natural and artificial systems. Springer, 2013.
|
| 240 |
+
|
| 241 |
+
Adrien Baranes and Pierre-Yves Oudeyer. R-IAC: Robust intrinsically motivated exploration and active learning. IEEE Transactions on Autonomous Mental Development, 1(3):155–169, 2009. doi: 10.1109/TAMD.2009.2037513.
|
| 242 |
+
|
| 243 |
+
Adrien Baranes and Pierre-Yves Oudeyer. Active learning of inverse models with intrinsically motivated goal exploration in robots. Robotics and Autonomous Systems, 61(1), 2013.
|
| 244 |
+
|
| 245 |
+
Andrew G. Barto. Intrinsic motivation and reinforcement learning. In Intrinsically motivated learning in natural and artificial systems, pp. 17–47. Springer, 2013.
|
| 246 |
+
|
| 247 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
|
| 248 |
+
|
| 249 |
+
Daniel E. Berlyne. Curiosity and exploration. Science, 153(3731):25–33, 1966.
|
| 250 |
+
|
| 251 |
+
Leon Bottou. Online Algorithms and Stochastic Approximations. In Online Learning and Neural Networks, pp. 1–34. 1998. ISBN 978-0521117913.
|
| 252 |
+
|
| 253 |
+
Hervé Bourlard and Yves Kamp. Auto-association by multilayer perceptrons and singular value decomposition. Biological Cybernetics, 59(4-5):291–294, 1988. ISSN 03401200. doi: 10.1007/ BF00332918.
|
| 254 |
+
|
| 255 |
+
Serkan Cabi, Sergio G. Colmenarejo, Matthew W. Hoffman, Misha Denil, Ziyu Wang, and Nando De Freitas. The intentional unintentional agent: Learning to solve many continuous control tasks simultaneously. CoRR, abs/1707.03300, 2017.
|
| 256 |
+
|
| 257 |
+
Angelo Cangelosi, Matthew Schlesinger, and Linda B. Smith. Developmental robotics: From babies to robots. MIT Press, 2015.
|
| 258 |
+
|
| 259 |
+
Nuttapong Chentanez, Andrew G Barto, and Satinder P. Singh. Intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pp. 1281–1288, 2005.
|
| 260 |
+
|
| 261 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. Journal of Machine Learning Research, 12:2121–2159, 2011. ISSN 15324435. doi: 10.1109/CDC.2012.6426698. URL http://jmlr.org/papers/ v12/duchi11a.html.
|
| 262 |
+
|
| 263 |
+
Carlos Florensa, David Held, Markus Wulfmeier, and Pieter Abbeel. Reverse curriculum generation for reinforcement learning. arXiv preprint arXiv:1707.05300, 2017.
|
| 264 |
+
|
| 265 |
+
Sébastien Forestier and Pierre-Yves Oudeyer. Modular active curiosity-driven discovery of tool use. In IEEE International Conference on Intelligent Robots and Systems, volume 2016-November, pp. 3965–3972, 2016. ISBN 9781509037629. doi: 10.1109/IROS.2016.7759584.
|
| 266 |
+
|
| 267 |
+
Sébastien Forestier, Yoan Mollard, and Pierre-Yves Oudeyer. Intrinsically motivated goal exploration processes with automatic curriculum learning. CoRR, abs/1708.02190, 2017.
|
| 268 |
+
|
| 269 |
+
Karl J. Friston, Marco Lin, Christopher D. Frith, Giovanni Pezzulo, J. Allan Hobson, and Sasha Ondobaka. Active inference, curiosity and insight. Neural Computation, 2017.
|
| 270 |
+
|
| 271 |
+
Alison Gopnik, Andrew N. Meltzoff, and Patricia K. Kuhl. The scientist in the crib: Minds, brains, and how children learn. William Morrow & Co, 1999.
|
| 272 |
+
|
| 273 |
+
Irina Higgins, Loic Matthey, Xavier Glorot, Arka Pal, Benigno Uria, Charles Blundell, Shakir Mohamed, and Alexander Lerchner. Early visual concept learning with unsupervised deep learning. CoRR, abs/1606.05579, 2016.
|
| 274 |
+
|
| 275 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109–1117, 2016.
|
| 276 |
+
|
| 277 |
+
Auke Jan Ijspeert, Jun Nakanishi, Heiko Hoffmann, Peter Pastor, and Stefan Schaal. Dynamical movement primitives: learning attractor models for motor behaviors. Neural computation, 25(2): 328–73, 2013. ISSN 1530-888X. doi: 10.1162/NECO_a_00393. URL http://www.ncbi. nlm.nih.gov/pubmed/23148415.
|
| 278 |
+
|
| 279 |
+
Frederic Kaplan and Pierre-Yves Oudeyer. Motivational principles for visual know-how development. 2003.
|
| 280 |
+
|
| 281 |
+
Diederik P. Kingma and Jimmy Lei Ba. Adam: a Method for Stochastic Optimization. International Conference on Learning Representations 2015, pp. 1–15, 2015. ISSN 09252312. doi: http: //doi.acm.org.ezproxy.lib.ucf.edu/10.1145/1830483.1830503.
|
| 282 |
+
|
| 283 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes, 2013. URL http:// arxiv.org/abs/1312.6114.
|
| 284 |
+
|
| 285 |
+
Joseph B. Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29(1):1–27, 1964. ISSN 00333123. doi: 10.1007/BF02289565.
|
| 286 |
+
|
| 287 |
+
Daniel Y Little and Friedrich T Sommer. Learning and exploration in action-perception loops. Frontiers in neural circuits, 7, 2013.
|
| 288 |
+
|
| 289 |
+
Georg Martius, Ralf Der, and Nihat Ay. Information driven self-organization of complex robotic behaviors. PloS one, 8(5):e63400, 2013.
|
| 290 |
+
|
| 291 |
+
Shamima Najnin and Bonny Banerjee. A predictive coding framework for a developmental agent: Speech motor skill acquisition and speech production. Speech Communication, 2017.
|
| 292 |
+
|
| 293 |
+
Sao M. Nguyen and Pierre-Yves Oudeyer. Socially guided intrinsic motivation for robot learning of motor skills. Autonomous Robots, 36(3):273–294, 2014. doi: 10.1007/s10514-013-9339-y.
|
| 294 |
+
|
| 295 |
+
P-Y Oudeyer, Jacqueline Gottlieb, and Manuel Lopes. Intrinsic motivation, curiosity, and learning: Theory and applications in educational technologies. In Progress in brain research, volume 229, pp. 257–284. Elsevier, 2016.
|
| 296 |
+
|
| 297 |
+
Pierre-Yves Oudeyer and Frederic Kaplan. What is intrinsic motivation? A typology of computational approaches. Frontiers in Neurorobotics, 3(NOV), 2007. ISSN 16625218. doi: 10.3389/neuro.12.006.2007.
|
| 298 |
+
|
| 299 |
+
Pierre-Yves Oudeyer and Linda B. Smith. How evolution may work through curiosity-driven developmental process. Topics in Cognitive Science, 8(2):492–502, 2016.
|
| 300 |
+
|
| 301 |
+
Pierre-Yves Oudeyer, Frederic Kaplan, and Verena V. Hafner. Intrinsic motivation systems for autonomous mental development. IEEE Transactions on Evolutionary Computation, 11(2):265– 286, 2007. ISSN 1089778X. doi: 10.1109/TEVC.2006.890271.
|
| 302 |
+
|
| 303 |
+
Pierre-Yves Oudeyer, Adrien Baranes, and Frederic Kaplan. Intrinsically motivated learning of realworld sensorimotor skills with developmental constraints. In Intrinsically motivated learning in natural and artificial systems, pp. 303–365. Springer, 2013.
|
| 304 |
+
|
| 305 |
+
Emanuel Parzen. On Estimation of a Probability Density Function and Mode. The Annals of Mathematical Statistics, 33(3):1065–1076, 1962. ISSN 0003-4851. doi: 10.1214/aoms/1177704472. URL http://projecteuclid.org/euclid.aoms/1177704472.
|
| 306 |
+
|
| 307 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In Proceedings of the seventh international conference on machine learning, 2017.
|
| 308 |
+
|
| 309 |
+
Karl Pearson. On lines and planes of closest fit to systems of points in space. Philosophical Magazine Series 6, 2(11):559–572, 1901. ISSN 1941-5982. doi: 10.1080/14786440109462720. URL http://www.tandfonline.com/doi/abs/10.1080/14786440109462720.
|
| 310 |
+
|
| 311 |
+
Danilo J. Rezende and Shakir Mohamed. Variational inference with normalizing flows. In ICML, 2015.
|
| 312 |
+
|
| 313 |
+
Danilo J. Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, volume 32 of JMLR Workshop and Conference Proceedings, pp. 1278–1286. JMLR.org, 2014. URL http://dblp.uni-trier.de/ db/conf/icml/icml2014.html#RezendeMW14.
|
| 314 |
+
|
| 315 |
+
M. Rolf, Jochen J. Steil, and Michael Gienger. Goal babbling permits direct learning of inverse kinematics. IEEE Transactions on Autonomous Mental Development, 2(3), 2010.
|
| 316 |
+
|
| 317 |
+
Murray Rosenblatt. Remarks on Some Nonparametric Estimates of a Density Function. The Annals of Mathematical Statistics, 27(3):832–837, 1956. ISSN 0003-4851. doi: 10.1214/aoms/ 1177728190. URL http://projecteuclid.org/euclid.aoms/1177728190.
|
| 318 |
+
|
| 319 |
+
Christoph Salge, Cornelius Glackin, and Daniel Polani. Changing the environment based on empowerment as intrinsic motivation. Entropy, 16(5):2789–2819, 2014.
|
| 320 |
+
|
| 321 |
+
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, 358 (1431):537–547, 2003.
|
| 322 |
+
|
| 323 |
+
Jurgen Schmidhuber. A possibility for implementing curiosity and boredom in model-building neural controllers. In From animals to animats: Proceedings of the first international conference on simulation of adaptive behavior, pp. 15–21, 1991.
|
| 324 |
+
|
| 325 |
+
Jurgen Schmidhuber. Powerplay: Training an increasingly general problem solver by continually searching for the simplest still unsolvable problem. Frontiers in psychology, 4, 2013.
|
| 326 |
+
|
| 327 |
+
David W. Scott. Multivariate Density Estimation: Theory, Practice, and Visualization, volume 156. 1992. ISBN 0471547700. doi: 10.1002/9780470316849.fmatter. URL http://www.jstor. org/stable/2983087?origin $=$ crossref.
|
| 328 |
+
|
| 329 |
+
Casper K. Sonderby, Tapani Raiko, Lars MaalÃÿe, Soren K. Sonderby, and Ole Winther. Ladder variational autoencoders. Feb 2016. URL http://arxiv.org/abs/1602.02282v3.
|
| 330 |
+
|
| 331 |
+
Kenneth O. Stanley and Joel Lehman. Why greatness cannot be planned: The myth of the objective. Springer, 2015.
|
| 332 |
+
|
| 333 |
+
Richard S. Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In Proceedings of the seventh international conference on machine learning, pp. 216–224, 1990.
|
| 334 |
+
|
| 335 |
+
Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. # exploration: A study of count-based exploration for deep reinforcement learning. In Advances in Neural Information Processing Systems, 2017.
|
| 336 |
+
|
| 337 |
+
Joshua B. Tenenbaum, Veronica De Silva, and John C. Langford. A global geometric framework for nonlinear dimensionality reduction. Science, 290 5500:2319–23, 2000.
|
| 338 |
+
|
| 339 |
+
Valentin Thomas, Jules Pondard, Emmanuel Bengio, Marc Sarfati, Philippe Beaudoin, Marie-Jean Meurs, Joelle Pineau, Doina Precup, and Yoshua Bengio. Independently controllable factors. arXiv preprint arXiv:1708.01289, 2017.
|
| 340 |
+
|
| 341 |
+
Jakub M. Tomczak and Max Welling. Improving variational auto-encoders using householder flow. Dec 2016. URL http://arxiv.org/abs/1611.09630v4.
|
| 342 |
+
|
| 343 |
+
Claes Von Hofsten. An action perspective on motor development. Trends in cognitive sciences, 8 (6):266–272, 2004.
|
| 344 |
+
|
| 345 |
+
# Appendix
|
| 346 |
+
|
| 347 |
+
# A INTRINSICALLY MOTIVATED GOAL EXPLORATION PROCESS
|
| 348 |
+
|
| 349 |
+
Intrinsically Motivated Goal Exploration Processes are algorithmic architectures that can be instantiated into different exploration algorithms depending on the problem to explore. The general architecture is represented in Algorithm 2.
|
| 350 |
+
|
| 351 |
+
# Algorithmic Architecture 2: Intrinsically Motivated Goal Exploration Strategy
|
| 352 |
+
|
| 353 |
+
# Input:
|
| 354 |
+
|
| 355 |
+

|
| 356 |
+
19 return The forward model $\tilde { D } _ { r u n n i n g }$ and the history $\mathcal { H }$
|
| 357 |
+
|
| 358 |
+
# B DEEP REPRESENTATION LEARNING ALGORITHMS
|
| 359 |
+
|
| 360 |
+
The cost functions used to train the different Deep Representation Learning algorithms used in this paper can be motivated by a few theoretical arguments summarized below.
|
| 361 |
+
|
| 362 |
+
Auto-Encoders (AEs) The choice of the cost function can be motivated by considering the network as composed of:
|
| 363 |
+
|
| 364 |
+
• An encoder network parameterized by weights $\theta$ that maps an input $\mathbf { x }$ to its deterministic representation $\mathbf { z } = f _ { \boldsymbol { \theta } } ( \mathbf { x } )$ .
|
| 365 |
+
• A decoder network parameterized by weights $\phi$ that maps a representation $\mathbf { z }$ to a vector $\xi$ parameterizing a distribution $p _ { \xi } ( \mathbf { x } | \mathbf { z } )$ with $\xi = g _ { \phi } ( \mathbf { z } )$ .
|
| 366 |
+
|
| 367 |
+
Under this stochastic decoding assumption, the Maximum Likelihood principle is used to train the model, i.e. AEs can maximize the likelihood of data under the model. In the case of Auto-Encoders, this principle is compatible with gradient descent, and we can use the negative log-likelihood as a cost function to be minimized. If input $\mathbf { x }$ is binary valued, $p ( \mathbf { x } | \mathbf { z } )$ is assumed to follow a multivariate
|
| 368 |
+
|
| 369 |
+
Bernouilli distribution of $\xi$ parameters 13, and the log likelihood of the dataset $\mathcal { D }$ is expressed as:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\log \mathfrak { L } ( \mathcal { D } ) = \sum _ { i = 1 } ^ { N } \log p ( \mathbf { x } ^ { ( i ) } | \xi ^ { ( i ) } ) = \sum _ { i = 1 } ^ { N } \sum _ { k = 1 } ^ { D } \big [ x _ { k } ^ { ( i ) } \log \xi _ { k } ^ { ( i ) } + ( 1 - x _ { k } ^ { ( i ) } ) \log ( 1 - \xi _ { k } ^ { ( i ) } ) \big ] ,
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
with $\xi ^ { ( i ) } = g _ { \phi } ( f _ { \theta } ( \mathbf { x } ^ { ( i ) } ) )$ . For a binary valued input vector $\mathbf { x } ^ { ( i ) }$ , the unitary Cost Function to minimize is:
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\mathcal { I } ( \theta , \phi , \mathbf { x } ^ { ( i ) } ) = - \sum _ { d = 1 } ^ { D } \big [ x _ { d } ^ { ( i ) } \log ( g _ { \phi } ( f _ { \theta } ( \mathbf { x } ^ { ( i ) } ) ) _ { d } ) + ( 1 - x _ { d } ^ { ( i ) } ) \log ( 1 - g _ { \phi } ( f _ { \theta } ( \mathbf { x } ^ { ( i ) } ) ) _ { d } ) \big ] ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
provided that $f _ { \theta }$ is the encoder part of the architecture and $g _ { \phi }$ is the decoding part of the architecture. This Cost Function can be minimized using Stochastic Gradient Descent (Bottou, 1998), or more advanced optimizers such as Adagrad (Duchi et al., 2011) or Adam (Kingma & Ba, 2015).
|
| 382 |
+
|
| 383 |
+
Depending on the depth of the network14, those architectures can prove difficult to train using vanilla Stochastic Gradient Descent. A particularly successful procedure to overcome this difficulty is to greedily train each pairs of encoding-decoding layers and stacking those to sequentially form the complete network. This procedure, known as stacked AEs, accelerates convergence. But it has shown bad results with our problem, and thus was discarded for the sake of clarity.
|
| 384 |
+
|
| 385 |
+
Variational Auto-Encoders (VAEs) If we assume that the observed data are realizations of a random variable $\mathbf { x } \sim p ( \mathbf { x } | \psi )$ , we can hypothesize that they are conditioned by a random vector of independent factors $\mathbf { z } \sim p ( \mathbf { z } | \psi )$ . In this setting, learning the model would amount to searching the parameters $\psi$ of both distributions. We might use the same principle of maximum likelihood as before to find the best parameters by computing the likelihood $\begin{array} { r } { \log \mathfrak { L } ( \mathcal { D } ) = \sum _ { i = 1 } ^ { N } \log p ( \mathbf { x } ^ { ( i ) } | \psi ) } \end{array}$ by using the fact that $\begin{array} { r } { p ( { \mathbf x } | \psi ) = \int p ( { \mathbf x } , { \mathbf z } | \psi ) d { \mathbf z } = \int p ( { \mathbf x } | { \mathbf z } , \psi ) p ( { \mathbf z } | \psi ) d { \mathbf z } . } \end{array}$ . Unfortunately, in most cases, this integral is intractable and cannot be approximated by Monte-Carlo sampling in reasonable time. To overcome this problem, we can introduce an arbitrary distribution $q ( \mathbf { z } | \mathbf { x } , \chi )$ and remark that the following holds:
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\log p ( \mathbf { x } | \psi ) = \mathcal { L } ( q , \psi ) + \mathbb { D } _ { K L } [ q ( \mathbf { z } | \mathbf { x } , \chi ) \| p ( \mathbf { z } | \mathbf { x } , \psi ) ,
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
with the Evidence Lower Bound being:
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { r } { \mathcal { L } ( q , \psi ) = \underbrace { \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } , \psi ) } [ \log p ( \mathbf { x } | \mathbf { z } , \psi ) ] } _ { a } - \underbrace { \mathbb { D } _ { K L } [ q ( \mathbf { z } | \mathbf { x } , \chi ) \| p ( \mathbf { z } , \psi ) ] } _ { b } . } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
Looking at Equation (5), we can see that since the KL divergence is non-negative, $\begin{array} { r } { \mathcal { L } ( q , \psi ) ~ \leq } \end{array}$ $\log p ( \mathbf { x } \mathbf { \bar { | } } \psi ) - \mathbb { D } _ { K L } \big ( [ q ( \mathbf { z } | \mathbf { x } , \chi ) ] | p ( \mathbf { z } | \mathbf { x } , \psi ) \big ]$ whatever the $q$ distribution, hence the name of Evidence Lower Bound (ELBO). Consequently, maximizing the ELBO have the effect to maximize the log likelihood, while minimizing the KL-Divergence between the approximate $q ( \mathbf { z } | \mathbf { x } )$ distribution, and the true unknown posterior $p ( \mathbf { z } | \mathbf { x } , \psi )$ . The approach taken by VAEs is to learn the parameters of both conditional distributions $p ( \mathbf { x } | \mathbf { z } , \psi )$ and $q ( \mathbf { z } | \mathbf { x } , \chi )$ as non-linear functions. Under some restricted conditions, Equation (6) can be turned into a valid cost function to train a neural network. First, we hypothesize that $q ( \mathbf { z } | \mathbf { x } , \chi )$ and $p ( \mathbf { z } | \boldsymbol { \psi } )$ follow Multivariate Gaussian distributions with diagonal covariances, which allows us to compute the $b$ term in closed form. Second, using the Gaussian assumption on $q$ , we can reparameterize the inner sampling operation by $\mathbf { z } = \mu \dot { + } \sigma ^ { 2 } \odot \epsilon$ with $\epsilon \sim \bar { \mathcal { N } } ( 0 , I )$ . Using this trick, the Path-wise Derivative estimator can be used for the $a$ member of the ELBO. Under those conditions, and assuming that $p ( \mathbf { x } | \boldsymbol { \psi } )$ follows a Multivariate Bernouilli distribution, we can write the cost function used to train the neural network as:
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\begin{array} { r l } & { \mathcal { I } ( \psi , \chi , \mathbf { x } ^ { ( i ) } ) = - \displaystyle \frac { 1 } { 2 } \sum _ { j = 1 } ^ { J } ( 1 + \log ( \sigma ( \mathbf { x } ^ { ( i ) } ) _ { j } ^ { 2 } ) - \mu ( \mathbf { x } ^ { ( i ) } ) _ { j } ^ { 2 } - \sigma ( \mathbf { x } ^ { ( i ) } ) _ { j } ^ { 2 } ) } \\ & { \quad \quad \quad - \displaystyle \sum _ { k = 1 } ^ { D } \big [ x _ { k } ^ { ( i ) } \log ( g _ { \psi } ( f _ { \chi } ( \mathbf { x } ^ { ( i ) } ) ) _ { k } ) + ( 1 - x _ { k } ^ { ( i ) } ) \log ( 1 - g _ { \psi } ( f _ { \chi } ( \mathbf { x } ^ { ( i ) } ) ) _ { k } ) \big ] , } \end{array}
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
where $f _ { \chi }$ represents the encoding and sampling part of the architecture and $g _ { \psi }$ represents the decoding part of the architecture. In essence, this derivation simplifies to the initial cost function used in AEs augmented by a term penalizing the divergence between $q ( \mathbf { z } | \mathbf { x } , \chi )$ and the assumed prior that $p ( \mathbf { x } | \psi ) \overset { \mathbf { \bar { \alpha } } } { = } \mathcal { N } ( 0 , I )$ .
|
| 404 |
+
|
| 405 |
+
Normalizing Flow overcomes the problem stated earlier, by permitting more expressive prior distributions (Rezende & Mohamed, 2015). It is based on the classic rule of change of variables for random variables. Considering a random variable ${ \bf z } _ { 0 } \sim { \boldsymbol q } ( { \bf z } _ { 0 } )$ , and an invertible transformation $t : \mathbb { R } ^ { d } \mapsto \mathbb { R } ^ { d }$ , if ${ \bf z } = t ( { \bf z } _ { 0 } )$ , then:
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
q ( \mathbf { z } ) = q ( \mathbf { z } _ { 0 } ) { \bigg | } \operatorname* { d e t } { \frac { \partial t ^ { - 1 } } { \partial \mathbf { z } _ { 0 } } } { \bigg | } = q ( \mathbf { z } _ { 0 } ) { \bigg | } \operatorname* { d e t } { \frac { \partial t } { \partial \mathbf { z } _ { 0 } } } { \bigg | } ^ { - 1 } .
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
We can then directly chain different invertible transformations $t _ { 1 } , t _ { 2 } , \dots , t _ { K }$ to produce a new random variable $\mathbf { z } _ { K } = t _ { K } \circ \cdot \cdot \cdot \circ t _ { 2 } \circ t _ { 1 } ( \mathbf { z } _ { 0 } )$ . In this case, we have:
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\log q ( \mathbf { z } _ { k } ) = \log \left( q ( \mathbf { z } _ { 0 } ) \prod _ { k = 1 } ^ { K } \left| \operatorname* { d e t } { \frac { \partial t _ { k } } { \partial \mathbf { z } _ { k - 1 } } } \right| ^ { - 1 } \right) = \log q ( \mathbf { z } _ { 0 } ) - \sum _ { k = 1 } ^ { K } \log \left| \operatorname* { d e t } { \frac { \partial t _ { k } } { \partial \mathbf { z } _ { k - 1 } } } \right| .
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
This formulation is interesting because the Law Of The Unconscious Statistician allows us to compute expectations over $q ( \mathbf { z } _ { k } )$ without having a precise knowledge of it:
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\begin{array} { r } { \mathbb { E } _ { \mathbf { z } _ { k } \sim q ( \mathbf { z } _ { k } ) } [ h ( \mathbf { z } _ { k } ) ] = \mathbb { E } _ { \mathbf { z } _ { 0 } \sim q ( \mathbf { z } _ { 0 } ) } [ h ( t _ { k } \circ . . . t _ { 2 } \circ t _ { 1 } ( \mathbf { z } _ { 0 } ) ) ] , } \end{array}
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
provided that $h$ does not depends on $q ( \mathbf { z } _ { k } )$ . Using this principle on the ELBO allows us to derive the following:
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\begin{array} { l } { { \displaystyle \mathcal { L } ( q , \theta , \phi ) = \mathbb { E } _ { { \bf z } _ { 0 } \sim q ( { \bf z } _ { 0 } | { \bf x } ) } [ \log p ( { \bf x } | t _ { K } \circ . . . t _ { 2 } \circ t _ { 1 } ( { \bf z } _ { 0 } ) ) ] } } \\ { { \displaystyle - \mathbb { D } _ { K L } [ q ( { \bf z } _ { 0 } | { \bf x } ) \| p ( { \bf z } _ { 0 } ) ] } } \\ { { \displaystyle + 2 \mathbb { E } _ { { \bf z } _ { 0 } \sim q ( { \bf z } _ { 0 } | { \bf x } ) } \left[ \sum _ { k = 1 } ^ { K } \log \left| \operatorname* { d e t } \frac { \partial t _ { k } } { \partial { \bf z } _ { k - 1 } } \right| \right] } } \end{array}
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
This is nothing more than the regular ELBO with an additional term concerning the log-determinant of the transformations. In practice, as before, we use $p ( \mathbf { z } _ { 0 } ) ~ = ~ \mathcal { N } ( \mathbf { z } _ { 0 } ; \mathbf { 0 } , \mathbf { I } )$ , and $q ( \mathbf { z } _ { 0 } | x ) \ =$ $\mathcal { N } ( \mathbf { z } _ { 0 } ; \mu ( x ) , d i a g ( \sigma ( x ) ^ { 2 } ) )$ . We only have to find out parameterized transformations $t$ , whose parameters can be learned and have a defined log-determinant. Using radial flow, which is expressed as:
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
t ( \mathbf { z } ) = \mathbf { z } + \beta h ( \alpha , \mathbf { r } ) ( \mathbf { z } - \mathbf { c } ) ,
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
where $\mathbf { r } = | \mathbf { z } - \mathbf { c } |$ , $\textstyle h ( \alpha , \mathbf { r } ) = { \frac { 1 } { \alpha + \mathbf { r } } }$ and $\alpha , \beta , { \bf c }$ are learnable parameters of the transformation, our cost function can be written as:
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\begin{array} { l l l } { \displaystyle \mathcal { I } ( \psi , \chi , \mathbf { x } ^ { ( i ) } ) = - \frac { 1 } { 2 } \sum _ { j = 1 } ^ { J } ( 1 + \log ( \sigma ( \mathbf { x } ^ { ( i ) } ) _ { j } ^ { 2 } ) - \mu ( \mathbf { x } ^ { ( i ) } ) _ { j } ^ { 2 } - \sigma ( \mathbf { x } ^ { ( i ) } ) _ { j } ^ { 2 } ) } \\ { \displaystyle \qquad - \sum _ { d = 1 } ^ { D } [ x _ { d } ^ { ( i ) } \log ( g _ { \psi } ( f _ { \chi } ( \mathbf { x } ^ { ( i ) } ) ) _ { d } ) + ( 1 - x _ { d } ^ { ( i ) } ) \log ( 1 - g _ { \psi } ( f _ { \chi } ( \mathbf { x } ^ { ( i ) } ) ) _ { d } ) ] } \\ { \displaystyle \qquad \quad - 2 \sum _ { k = 1 } ^ { K } \log [ 1 + \beta _ { k } h ( \alpha _ { k } , \mathbf { r } ) ) ] ^ { D - 1 } [ 1 + \beta _ { k } h ( \alpha , \mathbf { r } ) ) + \beta _ { k } h ^ { \prime } ( \alpha , r ) r ] , } \end{array}
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
provided that $f _ { \chi }$ represents the encoding, sampling ad transforming part of the architecture, $g _ { \psi }$ represents the decoding part of the architecture, and $\beta _ { k } , \alpha _ { k } , c _ { k }$ are the parameters of the different transformations. Other types of transformations have been proposed lately. The Householder flow (Tomczak & Welling, 2016) is a volume preserving transformation, meaning that its log determinant equals 1, with the consequence that it can be used with no modifications of the loss function. A more convoluted type of transformations based on a masked autoregressive auto-encoder, the Inverse Autoregressive Flow, was proposed in Kingma & Welling (2013). We did not explore those two last approaches.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 5: Effect of a Radial Flow transformation on an Isotropic Gaussian Distribution.
|
| 445 |
+
|
| 446 |
+

|
| 447 |
+
Figure 6: A DMP executed on the Arm-Ball environment.
|
| 448 |
+
|
| 449 |
+
# C EXPERIMENTAL ENVIRONMENTS
|
| 450 |
+
|
| 451 |
+
The following environments were considered:
|
| 452 |
+
|
| 453 |
+
• Arm-Ball: A 7 joints arm, controlled in angular position, can move around in an environment containing a ball. The environment state is perceived visually as a $5 0 \mathrm { x } 5 0$ pixels image. The arm has a sticky arm tip: if the tip of the arm touches the ball, the ball sticks to the arm until the end of the movement. The underlying state of the environment is hence parameterized by two bounded continuous factors which represent the coordinates of the ball. A situation can be sampled by the experimenter by taking a random point in $[ 0 , 1 ] ^ { 2 }$ .
|
| 454 |
+
|
| 455 |
+
• Arm-Arrow: The same arm can manipulate an arrow in a plane, an arrow being considered as an object with a single symmetry that can be oriented in space. Consequently, the underlying state of the environment is parameterized by two bounded continuous factors representing the coordinates of the arrow , and one periodic continuous factor representing its orientation. A particular situation can hence be sampled by taking a random point in $[ 0 , 1 ] ^ { 3 }$ .
|
| 456 |
+
|
| 457 |
+
The physical situations were represented by small $7 0 \mathrm { x } 7 0$ images very similar to the dSprites dataset proposed by Higgins et al. $( 2 0 \dot { 1 } 6 ) ^ { 1 5 }$ . The arm was not depicted in the field of view of the (virtual) camera used to gather images for representation learning. We used a robotic arm composed of 7 joints, whose motions were parameterized by DMPs using 3 basis functions (hence action policies have 21 continuous parameters), during 50 time-steps. An example of such a DMP executed in the environment is represented in Figure 6. The first phase, where the learner observes changes of the environment $\left( = \right.$ ball moves) caused by another agent, is modeled by a process which samples iteratively a random state in the underlying state space, e.g. in the case of Arm-Ball $s \sim \mathcal { U } ( [ 0 , \bar { 1 } ] ^ { 2 } )$ , and then generating the corresponding image $x = f ( s )$ that is observed by the learner.
|
| 458 |
+
|
| 459 |
+
# D ALGORITHMIC IMPLEMENTATION
|
| 460 |
+
|
| 461 |
+
For the experiments, we instantiated the Algorithmic Architecture 1 into Algorithm 3.
|
| 462 |
+
|
| 463 |
+
In the text, Algorithm 3 is denoted (RGE- $\star$ ), where $\star$ denotes any representation learning algorithm: (RGE-AE) for Auto-Encoders, (RGE-VAE) for Variational Auto-Encoders, (RGE-RFVAE)
|
| 464 |
+
|
| 465 |
+
for Radial Flow Variational Auto-Encoders, (RGE-ISOMAP) for Isomap, (RGE-PCA) for Principal Component Analysis and (RGE-FI) for Full Information.
|
| 466 |
+
|
| 467 |
+
Algorithm 3: Random Goal Exploration with Unsupervised Goal Space Learning
|
| 468 |
+
|
| 469 |
+
# Input:
|
| 470 |
+
|
| 471 |
+
$k$ -neighbors regressor $\tilde { D }$ , History $\mathcal { H }$ , Meta-Policy $\Pi$ is a tabular minimization over $\mathcal { H }$ ,
|
| 472 |
+
Unsupervised representation learning algorithm $\mathcal { A }$ (e.g. AE, VAE, Isomap), Kernel Density
|
| 473 |
+
Estimator algorithm $\kappa D \mathcal { E }$ , Random exploration noise $\gamma _ { m }$ , Random exploration ratio $\Gamma _ { e }$
|
| 474 |
+
1 begin
|
| 475 |
+
2 for 10000 Observation Iterations do
|
| 476 |
+
3 Observe a random environment image $x _ { i }$
|
| 477 |
+
4 Add this image to a database $\mathcal { D } = \{ x _ { i } \} _ { i \in [ 0 , 1 0 0 0 0 ] }$ 1
|
| 478 |
+
5 Learn an embedding function ${ \tilde { R } } : { \mathrm { ~ } } x \to o$ using algorithm $\mathcal { A }$ on data $\mathcal { D }$
|
| 479 |
+
6 Estimate the outcome distribution $p _ { k d e } ( o )$ from $\{ \tilde { R } ( x _ { i } ) \} _ { i \in [ 0 , 1 0 0 0 0 ] }$ using algorithm $\kappa D \mathcal { E }$
|
| 480 |
+
7 Set the Goal Policy $\gamma = p _ { k d e }$ to be the estimated outcome distribution
|
| 481 |
+
8 for 100 Bootstrapping iterations do
|
| 482 |
+
9 Sample a random parameterization $\theta _ { i } \sim p ( \theta )$
|
| 483 |
+
10 Execute the experiment $\theta _ { i }$ $\stackrel { } { = }$ run a controller with parameters $\theta _ { i }$ )
|
| 484 |
+
11 Retrieve the outcome from raw image $o _ { i } = \tilde { R } ( x _ { i } )$
|
| 485 |
+
12 Update the forward model with ${ \tilde { D } } ( \theta _ { i } ) \triangleq o _ { i }$
|
| 486 |
+
13 ${ \mathcal { H } } = { \mathcal { H } } \cup \{ \theta , o \}$
|
| 487 |
+
14 for 5000 Exploration iterations do
|
| 488 |
+
15 if $u \sim \mathcal { U } ( 0 , 1 ) < \Gamma _ { e }$ then
|
| 489 |
+
16 Sample a random parameterization $\theta _ { i } \sim p ( \theta )$
|
| 490 |
+
17 else
|
| 491 |
+
18 Sample a goal $g _ { i } \sim \gamma$
|
| 492 |
+
19 Sample an exploration noise $\epsilon \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$
|
| 493 |
+
20 Execute $\Pi$ to find $\begin{array} { r } { \theta _ { i } = \arg \operatorname* { m i n } _ { \theta \in \mathcal { H } } C _ { \tau } \big ( D _ { r u n n i n g } ( \theta ) \big ) } \end{array}$
|
| 494 |
+
21 $\theta _ { i } = \theta _ { i } + \epsilon$
|
| 495 |
+
22 Execute the experiment $\theta _ { i }$
|
| 496 |
+
23 Retrieve the outcome from raw image $o _ { i } = \tilde { R } ( x _ { i } )$
|
| 497 |
+
24 Update the forward model with ${ \tilde { D } } ( \theta _ { i } ) \triangleq o _ { i }$
|
| 498 |
+
25 ${ \mathcal { H } } = { \mathcal { H } } \cup \{ \theta , o \}$
|
| 499 |
+
|
| 500 |
+
26 return The forward model $\tilde { D }$ , the history $\mathcal { H }$ and the embedding $\tilde { R }$
|
| 501 |
+
|
| 502 |
+
# E DETAILS OF NEURAL ARCHITECTURES
|
| 503 |
+
|
| 504 |
+
Fig. 7 shows the neural networks architectures used for Deep Representation Learning algorithms.
|
| 505 |
+
Those architectures are based on the one proposed in Higgins et al. (2016).
|
| 506 |
+
|
| 507 |
+
Auto-Encoder The architecture was trained directly without particular stacking. The AdaGrad optimizer was used, with initial learning rate of $1 e - 3$ , with batches of size 100, until convergence at $2 e 5$ epochs.
|
| 508 |
+
|
| 509 |
+
Variational Auto-Encoder The architecture was trained with a deterministic warm-up of 1e4 epochs, as proposed in Sonderby et al. (2016), which shows improved convergence rate. The Adam optimizer was used, with initial learning rate of $1 e - 3$ , with batches of size 100, until convergence at 1e5 epochs.
|
| 510 |
+
|
| 511 |
+
Radial Flow Variational Auto-Encoder The architecture was trained with a deterministic warm$u p$ of 1e4 epochs. The complete flow was made out of 10 planar flows as proposed in Rezende & Mohamed (2015), whose parameters were learned by the encoder. The Adam optimizer was used, with initial learning rate of $1 e - 3$ , with batches of size 100, until convergence at 5e4 epochs.
|
| 512 |
+
|
| 513 |
+

|
| 514 |
+
Figure 7: Layers of the different neural networks architectures.
|
| 515 |
+
|
| 516 |
+

|
| 517 |
+
(a) Rge-Ae - 10 Latents
|
| 518 |
+
|
| 519 |
+

|
| 520 |
+
(b) Rge-Ae - 2 Latents
|
| 521 |
+
|
| 522 |
+

|
| 523 |
+
(c) Rge-Pca - 10 Latents
|
| 524 |
+
|
| 525 |
+

|
| 526 |
+
Figure 8: Examples of achieved outcomes related with the evolution of KL-Coverage in the ArmBall environments. The number of times the ball was effectively handled is also represented.
|
| 527 |
+
|
| 528 |
+

|
| 529 |
+
(a) Rge-Isomap - 10 Latents
|
| 530 |
+
|
| 531 |
+

|
| 532 |
+
(b) Rge-Isomap - 2 Latents
|
| 533 |
+
|
| 534 |
+

|
| 535 |
+
(c) Rge-Vae - 2 Latents
|
| 536 |
+
|
| 537 |
+

|
| 538 |
+
Figure 9: Examples of achieved outcomes related with the evolution of KL-Coverage in the ArmBall environments. The number of times the ball was effectively handled is also represented.
|
md/train/S1Dh8Tg0-/S1Dh8Tg0-.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FIX YOUR CLASSIFIER: THE MARGINAL VALUE OFTRAINING THE LAST WEIGHT LAYER
|
| 2 |
+
|
| 3 |
+
Elad Hoffer, Itay Hubara, Daniel Soudry
|
| 4 |
+
Department of Electrical Engineering
|
| 5 |
+
Technion
|
| 6 |
+
Haifa, 320003, Israel
|
| 7 |
+
elad.hoffer, itay.hubara, daniel.soudry@gmail.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Neural networks are commonly used as models for classification for a wide variety of tasks. Typically, a learned affine transformation is placed at the end of such models, yielding a per-class value used for classification. This classifier can have a vast number of parameters, which grows linearly with the number of possible classes, thus requiring increasingly more resources.
|
| 12 |
+
|
| 13 |
+
In this work we argue that this classifier can be fixed, up to a global scale constant, with little or no loss of accuracy for most tasks, allowing memory and computational benefits. Moreover, we show that by initializing the classifier with a Hadamard matrix we can speed up inference as well. We discuss the implications for current understanding of neural network models.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Deep neural network have become a widely used model for machine learning, achieving state-ofthe-art results on many tasks. The most common task these models are used for is to perform classification, as in the case of convolutional neural networks (CNNs) used to classify images to a semantic category. CNN models are currently considered the standard for visual tasks, allowing far better accuracy than preceding approaches (Krizhevsky et al., 2012; He et al., 2016; Szegedy et al., 2015).
|
| 18 |
+
|
| 19 |
+
Training NN models and using them for inference requires large amounts of memory and computational resources, thus, extensive amount of research has been done lately to reduce the size of networks. Han et al. (2015) used weight sharing and specification, Micikevicius et al. (2017) used mixed precision to reduce the size of the neural networks by half. Tai et al. (2015) and Jaderberg et al. (2014) used low rank approximations to speed up NNs.
|
| 20 |
+
|
| 21 |
+
Hubara et al. (2016b), Li et al. (2016) and Zhou et al. (2016), used a more aggressive approach, in which weights, activations and gradients were quantized to further reduce computation during training. Although aggressive quantization benefits from smaller model size, the extreme compression rate comes with a loss of accuracy.
|
| 22 |
+
|
| 23 |
+
Past work noted the fact that predefined (Park & Sandberg, 1991) and random (Huang et al., 2006) projections can be used together with a learned affine transformation to achieve competitive results on several tasks. In this study suggest the reversed proposal - that common NN models used can learn useful representation even without modifying the final output layer, which often holds a large number of parameters that grows linearly with number of classes.
|
| 24 |
+
|
| 25 |
+
# 1.1 CLASSIFIERS IN CONVOLUTIONAL NEURAL NETWORKS
|
| 26 |
+
|
| 27 |
+
Convolutional neural networks (CNNs) are commonly used to solve a variety of spatial and temporal tasks. CNNs are usually composed of a stack of convolutional parameterized layers, spatial pooling layers and fully connected layers, separated by non-linear activation functions. Earlier architectures of CNNs (LeCun et al., 1998; Krizhevsky et al., 2012) used a set of fully-connected layers at later stage of the network, presumably to allow classification based on global features of an image. The final classifier can also be replaced with a convolutional layer with output feature maps matching the number of classes, as demonstrated by Springenberg et al. (2014).
|
| 28 |
+
|
| 29 |
+
Despite the enormous number of trainable parameters these layers added to the model, they are known to have a rather marginal impact on the final performance of the network (Zeiler & Fergus, 2014) and are easily compressed and reduced after a model was trained by simple means such as matrix decomposition and sparsification (Han et al., 2015). Further more, modern architecture choices are characterized with the removal of most of the fully connected layers (Lin et al., 2013; Szegedy et al., 2015; He et al., 2016), which was found to lead to better generalization and overall accuracy, together with a huge decrease in the number of trainable parameters.
|
| 30 |
+
|
| 31 |
+
Additionally, numerous works showed that CNNs can be trained in a metric learning regime (Bromley et al., 1994; Schroff et al., 2015; Hoffer & Ailon, 2015), where no explicit classification layer was introduced and the objective regarded only distance measures between intermediate representations. Hardt & Ma (2017) suggested an all-convolutional network variant, where they kept the original initialization of the classification layer fixed with no negative impact on performance on the Cifar10 dataset. All of these properties provide evidence that fully-connected layers are in fact redundant and play a small role in learning and generalization.
|
| 32 |
+
|
| 33 |
+
Despite the apparent minor role they play, fully-connected layers are still commonly used as classification layers, transforming from the dimension of network features $N$ to the number of required class categories $C$ . Therefore, each classification model must hold $N \cdot C$ number of trainable parameters that grows in a linear manner with the number of classes. This property still holds when the fully-connected layer is replaced with a convolutional classifier as shown by Springenberg et al. (2014).
|
| 34 |
+
|
| 35 |
+
In this work we claim that for common use-cases of convolutional network, the parameters used for the final classification transform are completely redundant, and can be replaced with a predetermined linear transform. As we will show for the first time, this property holds even in largescale models and classification tasks, such as recent architectures trained on the ImageNet benchmark (Deng et al., 2009).
|
| 36 |
+
|
| 37 |
+
The use of a fixed transform can, in many cases, allow a huge decrease in model parameters, and a possible computational benefit. We suggest that existing models can, with no other modification, devoid their classifier weights, which can help the deployment of those models in devices with low computation ability and smaller memory capacity. Moreover, as we keep the classifier fixed, less parameters need to be updated, reducing the communication cost for models deployed in distributed systems. The use of a fixed transform which does not depend on the number classes can allow models to scale to a large number of possible outputs, without a linear cost in the number of parameters. We also suggest that these finding might shed light on the importance of the preceding non-linear layers to learning and generalization.
|
| 38 |
+
|
| 39 |
+
# 2 USING A FIXED CLASSIFIER
|
| 40 |
+
|
| 41 |
+
# 2.1 FULLY-CONNECTED CLASSIFIERS
|
| 42 |
+
|
| 43 |
+
We focus our attention on the final representation obtained by the network (the last hidden layer), before the classifier. We denote these representation as $x = F ( z ; \theta )$ where $F$ is assumed to be a deep neural network with input $z$ and parameters $\theta$ , e.g., a convolutional network, trained by backpropagation.
|
| 44 |
+
|
| 45 |
+
In common NN models, this representation is followed by an additional affine transformation
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\boldsymbol { y } = \boldsymbol { W } ^ { T } \boldsymbol { x } + \boldsymbol { b }
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $W$ and $b$ are also trained by back-propagation.
|
| 52 |
+
|
| 53 |
+
For input $x$ of $N$ length, and $C$ different possible outputs, $W$ is required to be a matrix of $N \times$ $C$ . Training is done using cross-entropy loss, by feeding the network outputs through a softmax activation
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
v _ { i } = \frac { e ^ { y _ { i } } } { \sum _ { j } ^ { C } e ^ { y _ { j } } } , i \in \{ 1 , \ldots , C \}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
and reducing the expected negative log likelihood with respect to ground-truth target $t \in \{ 1 , \ldots , C \}$ , by minimizing
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathcal { L } ( \boldsymbol { x } , t ) = - \log \boldsymbol { v _ { t } } = - \boldsymbol { w _ { t } } \cdot \boldsymbol { x } - b _ { t } + \log \left( \sum _ { j } ^ { C } e ^ { \boldsymbol { w _ { j } } \cdot \boldsymbol { x } + b _ { j } } \right)
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $w _ { i }$ is the $i$ -th column of $W$ .
|
| 66 |
+
|
| 67 |
+
# 2.2 CHOOSING THE PROJECTION MATRIX
|
| 68 |
+
|
| 69 |
+
To evaluate our conjecture regarding the importance of the final classification transformation, we replaced the trainable parameter matrix $W$ with a fixed orthonormal projection $Q \in \mathbb { R } ^ { N \times C }$ , such that $\forall i \neq j : q _ { i } \cdot q _ { j } = 0$ and $\| q _ { i } \| _ { 2 } = 1$ , where $q _ { i }$ is the ith column of $Q$ . This can be ensured by a simple random sampling and singular-value decomposition
|
| 70 |
+
|
| 71 |
+
As the rows of classifier weight matrix are fixed with an equally valued $L _ { 2 }$ norm, we find it beneficial to also restrict the representation of $x$ by normalizing it to reside on the $n$ -dimensional sphere
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
{ \hat { x } } = { \frac { x } { \| x \| _ { 2 } } }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
This allows faster training and convergence, as the network does not need to account for changes in the scale of its weights.
|
| 78 |
+
|
| 79 |
+
We now face the problem that $q _ { i } \cdot { \hat { x } }$ is bounded between $- 1$ and 1. This causes convergence issues, as the softmax function is scale sensitive, and the network is affected by the inability to re-scale its input. This is similar to the phenomenon described by Vaswani et al. (2017) with respect to softmax function used for attention mechanisms. In the same spirit, we can amend this issue with a fixed scale $T$ applied to softmax inputs $\begin{array} { r } { f ( y ) = \mathrm { s o f t m a x } ( \frac { 1 } { T } y ) } \end{array}$ , also known as a softmax temperature. However, this introduces an additional hyper-parameter which may differ between networks and datasets. Instead, we suggest to introduce a single scalar parameter $\alpha$ to learn the softmax scale, effectively functioning as an inverse of the softmax temperature $\textstyle { \frac { 1 } { T } }$ .
|
| 80 |
+
|
| 81 |
+
Using normalized weights and an additional scale coefficient is similar in spirit to weightnormalization (Salimans $\&$ Kingma, 2016), with the difference that we use a single scale for all entries in the weight matrix, in contrast to a scale for each row that Salimans & Kingma (2016) uses.
|
| 82 |
+
|
| 83 |
+
We keep the additional vector of bias parameters $b \in \mathbb { R } ^ { C }$ , and train using the same negative-loglikelihood criterion. More explicitly, our classifier output is now
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
v _ { i } = \frac { e ^ { \alpha q _ { i } \cdot \hat { x } + b _ { i } } } { \sum _ { j } ^ { C } e ^ { \alpha q _ { j } \cdot \hat { x } + b _ { j } } } , ~ i \in \{ 1 , \dots , C \}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
and we minimize the loss:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathcal { L } ( x , t ) = - \alpha q _ { t } \cdot \frac { x } { \| x \| _ { 2 } } + b _ { t } + \log \left( \sum _ { i = 1 } ^ { C } \exp \left( \alpha q _ { i } \cdot \frac { x } { \| x \| _ { 2 } } + b _ { i } \right) \right)
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where we recall $x$ is the final representation obtained by the network for a specific sample, and $t \in \{ 1 , \ldots , C \}$ is the ground-truth label for that sample.
|
| 96 |
+
|
| 97 |
+
Observing the behavior of the $\alpha$ parameter over time revealed a logarithmic growth depicted in graph 1. Interestingly, this is the same behavior exhibited by the norm of a learned classifier, first described by Hoffer et al. (2017) and linked to the generalization of the network. This was recently explained by the under-review work of Soudry et al. (2018) as convergence to a max margin classifier. We suggest that using a single parameter will enable a simpler examination and possible further exploration of this phenomenon and its implications.
|
| 98 |
+
|
| 99 |
+
We note that as $- 1 \leq q _ { i } \cdot \hat { x } \leq 1$ , we also found it possible to train the network with a simple cosine angle loss:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r } { \mathcal { L } ( \hat { x } , t ) = \left\{ \begin{array} { l l } { q _ { i } \cdot \hat { x } - 1 , } & { \mathrm { i f ~ } i = t , } \\ { q _ { i } \cdot \hat { x } + 1 , } & { \mathrm { o t h e r w i s e . } } \end{array} \right. } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
allowing to discard the softmax function and its scale altogether, but resulting in a slight decrease in final validation accuracy compared to original models.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 1: The softmax scale coefficient $\alpha$ was observed to follow a logarithmic growth over the course of training.
|
| 109 |
+
|
| 110 |
+
# 2.3 USING A FIXED HADMARD MATRIX
|
| 111 |
+
|
| 112 |
+
We further suggest the use of a Hadamard matrix (Hedayat et al., 1978) as the final classification transform. Hadamard matrix $H$ is an $n \times n$ matrix, where all of its entries are either $+ 1$ or $- 1$ . Further more, $H$ is orthogonal, such that $H H ^ { T } = n I _ { n }$ where $I _ { n }$ is the identity matrix.
|
| 113 |
+
|
| 114 |
+
We can use a truncated Hadamard matrix $\hat { H } \in \{ - 1 , 1 \} ^ { C \times N }$ where all $C$ rows are orthogonal as our final classification layer such that
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\boldsymbol { y } = \hat { H } \hat { \boldsymbol { x } } + \boldsymbol { b }
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
This usage allows two main benefits:
|
| 121 |
+
|
| 122 |
+
• A deterministic, low-memory and easily generated matrix that can be used to classify. • Removal of the need to perform a full matrix-matrix multiplication - as multiplying by a Hadamard matrix can be done by simple sign manipulation and addition.
|
| 123 |
+
|
| 124 |
+
We note that $n$ must be a multiple of 4, but it can be easily truncated to fit normally defined networks.
|
| 125 |
+
|
| 126 |
+
We also note the similarity of using a Hadamard matrix as a final classifier to methods of weight binarization such as the one suggested by Courbariaux et al. (2015). As the classifier weights are fixed to need only 1-bit precision, it is now possible to focus our attention on the features preceding it.
|
| 127 |
+
|
| 128 |
+
# 3 EXPERIMENTAL RESULTS
|
| 129 |
+
|
| 130 |
+
Table 1: Validation accuracy results on learned vs. fixed classifier
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Network</td><td>Dataset</td><td>Learned</td><td>Fixed</td><td>#Params</td><td>% Fixed params</td></tr><tr><td>Resnet56 (He et al., 2016)</td><td>Cifar10</td><td>93.03%</td><td>93.14%</td><td>855,770</td><td>0.07%</td></tr><tr><td>DenseNet(k=12)(Huang et al.,2017)</td><td>Cifar100</td><td>77.73%</td><td>77.67%</td><td>800,032</td><td>4.2%</td></tr><tr><td>Resnet50 (He et al.,2016)</td><td>ImageNet</td><td>75.3%</td><td>75.3%</td><td>25,557,032</td><td>8.01%</td></tr><tr><td>DenseNeti69(Huang et al.,2017)</td><td>ImageNet</td><td>76.2%</td><td>76%</td><td>14,149,480</td><td>11.76%</td></tr><tr><td>ShuffleNet(Zhang et al.,2017b)</td><td>ImageNet</td><td>65.9%</td><td>65.4%</td><td>1,826,555</td><td>52.56%</td></tr></table>
|
| 133 |
+
|
| 134 |
+
# 3.1 CIFAR10/100
|
| 135 |
+
|
| 136 |
+
We used the well known Cifar10 and Cifar100 datasets by Krizhevsky (2009) as an initial test-bed to explore the idea of a fixed classifier. Cifar10 is an image classification benchmark dataset containing 50, 000 training images and 10, 000 test images. The images are in color and contain $3 2 \times 3 2$ pixels. There are 10 possible classes of various animals and vehicles. Cifar100 holds the same number of images of same size, but contains 100 different classes.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 2: Comparing training and validation error of fixed and learned classifier (ResNet56, Cifar10)
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 3: Comparing fixed vs. trained variable scale $\alpha$ (ResNet56, Cifar10)
|
| 143 |
+
|
| 144 |
+
We trained a residual network of He et al. (2016) on the Cifar10 dataset. We used a network of depth 56 and the same hyper-parameters used in the original work. We compared two variants: the original model with a learned classifier, and our version, where a fixed transformation is used. The results shown in figure 2 demonstrate that although the training error is considerably lower for the network with learned classifier, both models achieve the same classification accuracy on the validation set. Our conjecture is that with our new fixed parameterization, the network can no longer increase the norm of a given sample’s representation - thus learning its label requires more effort. As this may happen for specific seen samples - it affects only training error.
|
| 145 |
+
|
| 146 |
+
We also compared using a fixed scale variable $\alpha$ at different values vs. a learned parameter. Results for $\alpha = \{ 0 . 1 , 1 , 1 0 \}$ are depicted in figure 3 for both training and validation error. As can be seen, similar validation accuracy can be obtained using a fixed scale value (in this case $\alpha = 1$ or 10 will suffice) at the expense of another hyper-parameter to seek. In all our experiments we opted to train this parameter instead. In all experiments the $\alpha$ scale parameter was regularized with the same weight decay coefficient used on original classifier.
|
| 147 |
+
|
| 148 |
+
We then followed to train a model on the Cifar100 dataset. We used the DenseNet-BC model of Huang et al. (2017) with depth of 100 layers and $k = 1 2$ . We continued to train according to the original regime and setting described for this network and dataset. Naturally, the higher number of classes caused the number of parameters to grow and encompass about $4 \%$ of the whole model. Validation accuracy for the fixed-classifier model remained equally good as the original model, and we continued to observe the same training curve.
|
| 149 |
+
|
| 150 |
+
# 3.2 IMAGENET
|
| 151 |
+
|
| 152 |
+
In order to validate our results on a more challenging dataset, we used the Imagenet dataset introduced by Deng et al. (2009). The Imagenet dataset spans over 1000 visual classes, and over 1.2 million samples. CNNs used to classify Imagenet such as Krizhevsky et al. (2012), He et al. (2016),
|
| 153 |
+
|
| 154 |
+
Szegedy et al. (2016) usually have a hidden representation leading to the final classifier of at least 1024 dimensions. This architectural choice, together with the large number of classes, causes the size of classifier to exceed millions of parameters and taking a sizable share from the entire model size.
|
| 155 |
+
|
| 156 |
+
We evaluated our fixed classifier method on Imagenet using Resnet50 by He et al. (2016) with the same training regime and hyper-parameters. By using a fixed classifier, approximately 2-million parameters were removed from the model, accounting for about $8 \%$ of the model parameters. Following the same procedure, we trained a Densenet169 model (Huang et al., 2017) for which a fixed classifier reduced about $1 2 \%$ of the parameters. Similarly to results on Cifar10 dataset, we observed the same convergence speed and approximately the same final accuracy on both the validation and training sets.
|
| 157 |
+
|
| 158 |
+
Furthermore, we were interested in evaluating more challenging models where the classifier parameters constitutes the majority amount. For this reason we chose the Shufflenet architecture (Zhang et al., 2017b), which was designed to be used in low memory and limited computing platforms. The Shufflenet network contains about 1.8 million parameters, out of which 0.96 million are part of the final classifier. Fixing the classifier resulted with a model with only 0.86 million parameters. This model was trained and found, again, to converge to similar validation accuracy as the original.
|
| 159 |
+
|
| 160 |
+
Interestingly, this method allowed Imagenet training in an under-specified regime, where there are more training samples than number of parameters. This is an unconventional regime for modern deep networks, which are usually over-specified to have many more parameters than training samples (Zhang et al., 2017a). Moreover, many recent theoretical results related to neural network training (Soudry & Hoffer, 2017; Xie et al., 2016; Safran & Shamir, 2016; Soltanolkotabi et al., 2017; Soudry & Carmon, 2016) and even generalization (Gunasekar et al., 2017; Advani & Saxe, 2017; Wilson et al., 2017) usually assume over-specification.
|
| 161 |
+
|
| 162 |
+
Table 1 summarizes our fixed-classifier results on convolutional networks, comparing to originally reported results. We offer our drop-in replacement for learned classifier that can be used to train models with fixed classifiers and replicate our results1.
|
| 163 |
+
|
| 164 |
+
# 3.3 LANGUAGE MODELING
|
| 165 |
+
|
| 166 |
+
As language modeling requires classification of all possible tokens available in the task vocabulary, we were interested to see if a fixed classifier can be used, possible saving a very large number of trainable parameters (vocabulary size can have tens or even hundreds of thousands of different words). Recent works have already found empirically that using the same weights for both word embedding and classifier can yield equal or better results than using a separate pair of weights (Inan et al., 2016; Press & Wolf, 2017; Vaswani et al., 2017). This is compliant with our findings that the linear classifier is largely redundant. To examine further reduction in the number of parameters, we removed both classifier and embedding weights and replaced them with a fixed transform.
|
| 167 |
+
|
| 168 |
+
We trained a language model on the WikiText2 dataset described in Merity et al. (2016), using the same setting in Merity et al. (2017). We used a recurrent model with 2-layers of LSTM (Hochreiter & Schmidhuber, 1997) and embedding $^ +$ hidden size of 512. As the vocabulary of WikiText2 holds about $3 3 K$ different words, the expected number of parameters in embedding and classifier is about 34-million. This number makes for about $8 9 \%$ from the $3 8 M$ parameters used for the whole model.
|
| 169 |
+
|
| 170 |
+
We found that using a random orthogonal transform yielded poor results compared to learned embedding. We suspect that, in oppose to image classification benchmarks, the embedding layer in language models holds information of the words similarities and relations, thus requiring a fine initialization. To test our intuition, we opted to use pre-trained embeddings using word2vec algorithm by Mikolov et al. (2013) or PMI factorization as suggested by Levy & Goldberg (2014). We find that using fixed word2vec embeddings, we achieve much better results. Specifically, we use $8 9 \%$ less parameters than the fully learned model, and obtain only somewhat worse perplexity.
|
| 171 |
+
|
| 172 |
+
We argue that this implies a required structure in word embedding that stems from semantic relatedness between words and the natural imbalance between classes. However, we suggest that with a much more cost effective ways to train word embeddings (e.g., Mikolov et al. (2013)), we can narrow the gap and avoid their cost when training bigger models.
|
| 173 |
+
|
| 174 |
+
Table 2: Validation perplexity results
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Network</td><td>Dataset</td><td>Learned</td><td>Fixed</td><td>#Params</td><td>% Fixed params</td></tr><tr><td>2-layer LSTM (h=512)</td><td>WikiText-2</td><td>74.1</td><td>81.2</td><td>38,312,446</td><td>88.94%</td></tr></table>
|
| 177 |
+
|
| 178 |
+
# 4 DISCUSSION
|
| 179 |
+
|
| 180 |
+
# 4.1 IMPLICATIONS TO FUTURE DNN MODELS AND USE CASES
|
| 181 |
+
|
| 182 |
+
In the last couple of years a we observe a rapid growth in the number of classes benchmark datasets contain, for example: Cifar100 (Krizhevsky, 2009), ImageNet1K, ImageNet22k (Deng et al., 2009) and language modeling (Merity et al., 2016). Therefore the computational demands of the final classifier will increase as well and should be considered no less than the architecture chosen. We use the work by Sun et al. (2017) as our use case, which introduced JFT-300M - an internal Google dataset with over 18K different classes. Using a Resnet50 (He et al., 2016), with a 2048 sized representation, this led to a model with over 36M parameters. This means that over $6 0 \%$ of the model parameters reside in the final classification layer.
|
| 183 |
+
|
| 184 |
+
Sun et al. (2017) further describes the difficulty in distributing this amount of parameters between the training servers, and the need to split them between 50 sub-layers. We also note the fact that the training procedure needs to account for synchronization after each parameter update - which must incur a non-trivial overhead.
|
| 185 |
+
|
| 186 |
+
Our work can help considerably in this kind of scenario - where using a fixed classifier removes the need to do any gradient synchronization for the final layer. Furthermore, using a Hadamard matrix, we can remove the need to save the transformation altogether, and make it more efficient, allowing considerable memory and computational savings.
|
| 187 |
+
|
| 188 |
+
# 4.2 POSSIBLE CAVEATS
|
| 189 |
+
|
| 190 |
+
We argue that our method works due to the ability of preceding layers in the network to learn separable representations that are easily classified even when the classifier itself is fixed. This property can be affected when the ratio between learned features and number of classes is small – that is, when $C > N$ . We’ve been experimenting with such cases, for example Imagenet classification $C = 1 0 0 0 ^ { \circ } ,$ ) using mobilenet-0.5 (Howard et al., 2017) where $N = 5 1 2$ , or reduced version of ResNet (He et al., 2016) where $N = 2 5 6$ . In both scenarios, our method converged similarly to a fully learned classifier reaching the same final validation accuracy. This is strengthening our finding, showing that even in cases in which $C > N$ , fixed classifier can provide equally good results.
|
| 191 |
+
|
| 192 |
+
Another possible issue may appear when the possible classes are highly correlated. As a fixed orthogonal classifier does not account for this kind of correlation, it may prove hard for the network to learn in this case. This may suggest another reason for the difficulties we experienced in training a language model using an orthogonal fixed classifier, as word classes tend to have highly correlated instances.
|
| 193 |
+
|
| 194 |
+
# 4.3 FUTURE WORK
|
| 195 |
+
|
| 196 |
+
Understanding that linear classifiers used in NN models are largely redundant allows us to consider new approaches in training and understanding these models.
|
| 197 |
+
|
| 198 |
+
Recent works (Neyshabur et al., 2017; Bartlett et al., 2017) suggested a connection between generalization capabilities of models and various norm-related quantities of their weights. Such results might be potentially simplified in our model, since we have a single scalar variable (i.e., scale), which seems to be the only relevant parameter in the model (since we normalize the last hidden layer, and fix the last weight layer).
|
| 199 |
+
|
| 200 |
+
The use of fixed classifiers might be further simplified in Binarized Neural Networks (Hubara et al., 2016a), where the activations and weights are restricted to $\pm 1$ during propagations. In this case the norm of the last hidden layer is constant for all samples (equal to the square root of the hidden layer width). This constant can be absorbed into the scale constant $\alpha$ , and there is no need in a per-sample normalization as in eq. 1.
|
| 201 |
+
|
| 202 |
+
We also plan to further explore more efficient ways to learn word embedding, where similar redundancy in classifier weights may suggest simpler forms of token representations - such as low-rank or sparse versions, allowing similar benefits to the fixed transformations we suggested.
|
| 203 |
+
|
| 204 |
+
# 5 CONCLUSION
|
| 205 |
+
|
| 206 |
+
In this work we suggested removing the parameters from the classification layer used in deep neural networks. We showed empirical results suggesting that keeping the classifier fixed cause little or no decline in classification performance for common balanced datasets such as Cifar and Imagenet, while allowing a noticeable reduction in trainable parameters. We argue that fixing the last layer can reduce the computational complexity for training as well as the communication cost in distributed learning. Furthermore, using a Hadamard matrix as classifier might lead to some computational benefits when properly implemented, and save memory otherwise spent on large amount of transformation coefficients. As datasets tend to become more complex by time (e.g., Cifar100, ImageNet1K, ImageNet22k, JFT-300M, and language modeling) we believe that resource hungry affine transformation should remain fixed during training, at least partially.
|
| 207 |
+
|
| 208 |
+
We also found that new efficient methods to create pre-defined word embeddings should be explored, as they require huge amount of parameters that can possibly be avoided when learning a new task. Based on these findings, we recommend future research to focus on representations learned by the non-linear part of neural networks - up to the final classifier, as it seems to be highly redundant.
|
| 209 |
+
|
| 210 |
+
# ACKNOWLEDGMENTS
|
| 211 |
+
|
| 212 |
+
The research leading to these results has received funding from the Taub Foundation, and the European Research Council under European Unions Horizon 2020 Program, ERC Grant agreement no. 682203 SpeedInfTradeoff.
|
| 213 |
+
|
| 214 |
+
# REFERENCES
|
| 215 |
+
|
| 216 |
+
Madhu S Advani and Andrew M Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017.
|
| 217 |
+
|
| 218 |
+
Peter Bartlett, Dylan J Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for neural networks. arXiv preprint arXiv:1706.08498, 2017.
|
| 219 |
+
|
| 220 |
+
Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Sackinger, and Roopak Shah. Signature verifi- ¨ cation using a” siamese” time delay neural network. In Advances in Neural Information Processing Systems, pp. 737–744, 1994.
|
| 221 |
+
|
| 222 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems, pp. 3123–3131, 2015.
|
| 223 |
+
|
| 224 |
+
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.
|
| 225 |
+
|
| 226 |
+
Suriya Gunasekar, Blake Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nathan Srebro. Implicit regularization in matrix factorization. arXiv preprint arXiv:1705.09280, 2017.
|
| 227 |
+
|
| 228 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 229 |
+
|
| 230 |
+
Moritz Hardt and Tengyu Ma. Identity matters in deep learning. 2017.
|
| 231 |
+
|
| 232 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 233 |
+
|
| 234 |
+
A Hedayat, WD Wallis, et al. Hadamard matrices and their applications. The Annals of Statistics, 6 (6):1184–1238, 1978.
|
| 235 |
+
|
| 236 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 237 |
+
|
| 238 |
+
Elad Hoffer and Nir Ailon. Deep metric learning using triplet network. In International Workshop on Similarity-Based Pattern Recognition, pp. 84–92. Springer, 2015.
|
| 239 |
+
|
| 240 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. 2017.
|
| 241 |
+
|
| 242 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 243 |
+
|
| 244 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 245 |
+
|
| 246 |
+
Guang-Bin Huang, Qin-Yu Zhu, and Chee-Kheong Siew. Extreme learning machine: theory and applications. Neurocomputing, 70(1):489–501, 2006.
|
| 247 |
+
|
| 248 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In Advances in Neural Information Processing Systems 29 (NIPS’16), 2016a.
|
| 249 |
+
|
| 250 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:1609.07061, 2016b.
|
| 251 |
+
|
| 252 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. arXiv preprint arXiv:1611.01462, 2016.
|
| 253 |
+
|
| 254 |
+
Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014.
|
| 255 |
+
|
| 256 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 257 |
+
|
| 258 |
+
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.
|
| 259 |
+
|
| 260 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 261 |
+
|
| 262 |
+
Omer Levy and Yoav Goldberg. Neural word embedding as implicit matrix factorization. In Advances in neural information processing systems, pp. 2177–2185, 2014.
|
| 263 |
+
|
| 264 |
+
Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016.
|
| 265 |
+
|
| 266 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
|
| 267 |
+
|
| 268 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 269 |
+
|
| 270 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and Optimizing LSTM Language Models. arXiv preprint arXiv:1708.02182, 2017.
|
| 271 |
+
|
| 272 |
+
Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaev, Ganesh Venkatesh, et al. Mixed precision training. arXiv preprint arXiv:1710.03740, 2017.
|
| 273 |
+
|
| 274 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed tations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
|
| 275 |
+
|
| 276 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. Exploring generalization in deep learning. arXiv preprint arXiv:1706.08947, 2017.
|
| 277 |
+
|
| 278 |
+
Jooyoung Park and Irwin W Sandberg. Universal approximation using radial-basis-function networks. Neural computation, 3(2):246–257, 1991.
|
| 279 |
+
|
| 280 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. EACL 2017, pp. 157, 2017.
|
| 281 |
+
|
| 282 |
+
Itay Safran and Ohad Shamir. On the quality of the initial basin in overspecified neural networks. In International Conference on Machine Learning, pp. 774–782, 2016.
|
| 283 |
+
|
| 284 |
+
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.
|
| 285 |
+
|
| 286 |
+
Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 815–823, 2015.
|
| 287 |
+
|
| 288 |
+
Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. arXiv preprint arXiv:1707.04926, 2017.
|
| 289 |
+
|
| 290 |
+
Daniel Soudry and Yair Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. arXiv preprint arXiv:1605.08361, 2016.
|
| 291 |
+
|
| 292 |
+
Daniel Soudry and Elad Hoffer. Exponentially vanishing sub-optimal local minima in multilayer neural networks. arXiv preprint arXiv:1702.05777, 2017.
|
| 293 |
+
|
| 294 |
+
Daniel Soudry, Elad Hoffer, and Nathan Srebro. The implicit bias of gradient descent on separable data. 2018.
|
| 295 |
+
|
| 296 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 297 |
+
|
| 298 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. arXiv preprint arXiv:1707.02968, 2017.
|
| 299 |
+
|
| 300 |
+
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.
|
| 301 |
+
|
| 302 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016.
|
| 303 |
+
|
| 304 |
+
Cheng Tai, Tong Xiao, Yi Zhang, Xiaogang Wang, et al. Convolutional neural networks with lowrank regularization. arXiv preprint arXiv:1511.06067, 2015.
|
| 305 |
+
|
| 306 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. 2017.
|
| 307 |
+
|
| 308 |
+
Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nathan Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. arXiv preprint arXiv:1705.08292, 2017.
|
| 309 |
+
|
| 310 |
+
Bo Xie, Yingyu Liang, and Le Song. Diversity leads to generalization in neural networks. arXiv preprint arXiv:1611.03131, 2016.
|
| 311 |
+
|
| 312 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pp. 818–833. Springer, 2014.
|
| 313 |
+
|
| 314 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017a. URL https://arxiv. org/abs/1611.03530.
|
| 315 |
+
|
| 316 |
+
Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. arXiv preprint arXiv:1707.01083, 2017b.
|
| 317 |
+
|
| 318 |
+
Shuchang Zhou, Zekun Ni, Xinyu Zhou, He Wen, Yuxin Wu, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
md/train/S1E3Ko09F7/S1E3Ko09F7.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/S1EHOsC9tX/S1EHOsC9tX.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS THE FIRST ADVERSARIALLY ROBUST NEURAL NETWORK MODEL ON MNIST
|
| 2 |
+
|
| 3 |
+
Lukas Schott1-3∗, Jonas Rauber1-3∗, Matthias Bethge1,3,4† & Wieland Brendel1,3†
|
| 4 |
+
|
| 5 |
+
1Centre for Integrative Neuroscience, University of Tübingen 2International Max Planck Research School for Intelligent Systems 3Bernstein Center for Computational Neuroscience Tübingen 4Max Planck Institute for Biological Cybernetics ∗Joint first authors †Joint senior authors firstname.lastname@bethgelab.org
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Despite much effort, deep neural networks remain highly susceptible to tiny input perturbations and even for MNIST, one of the most common toy datasets in computer vision, no neural network model exists for which adversarial perturbations are large and make semantic sense to humans. We show that even the widely recognized and by far most successful $L _ { \infty }$ defense by Madry et al. (1) has lower $L _ { 0 }$ robustness than undefended networks and is still highly susceptible to $L _ { 2 }$ perturbations, (2) classifies unrecognizable images with high certainty, (3) performs not much better than simple input binarization and (4) features adversarial perturbations that make little sense to humans. These results suggest that MNIST is far from being solved in terms of adversarial robustness. We present a novel robust classification model that performs analysis by synthesis using learned class-conditional data distributions. We derive bounds on the robustness and go to great length to empirically evaluate our model using maximally effective adversarial attacks by (a) applying decision-based, score-based, gradient-based and transfer-based attacks for several different $L _ { p }$ norms, (b) by designing a new attack that exploits the structure of our defended model and (c) by devising a novel decision-based attack that seeks to minimize the number of perturbed pixels $( L _ { 0 } )$ . The results suggest that our approach yields state-of-the-art robustness on MNIST against $L _ { 0 }$ , $L _ { 2 }$ and $L _ { \infty }$ perturbations and we demonstrate that most adversarial examples are strongly perturbed towards the perceptual boundary between the original and the adversarial class.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Deep neural networks (DNNs) are strikingly susceptible to minimal adversarial perturbations (Szegedy et al., 2013), perturbations that are (almost) imperceptible to humans but which can switch the class prediction of DNNs to basically any desired target class.
|
| 14 |
+
|
| 15 |
+
One key problem in finding successful defenses is the difficulty of reliably evaluating model robustness. It has been shown time and again (Athalye et al., 2018; Athalye & Carlini, 2018; Brendel & Bethge, 2017) that basically all defenses previously proposed did not increase model robustness but prevented existing attacks from finding minimal adversarial examples, the most common reason being masking of the gradients on which most attacks rely. The few verifiable defenses can only guarantee robustness within a small linear regime around the data points (Hein & Andriushchenko, 2017; Raghunathan et al., 2018).
|
| 16 |
+
|
| 17 |
+
The only defense currently considered effective (Athalye et al., 2018) is a particular type of adversarial training (Madry et al., 2018). On MNIST, as of today this method is able to reach an accuracy of $8 8 . 7 9 \%$ for adversarial perturbations with an $L _ { \infty }$ norm bounded by $\epsilon = 0 . 3$ (Zheng et al., 2018). In other words, if we allow an attacker to perturb the brightness of each pixel by up to 0.3 (range $[ 0 , 1 ] \cdot$ ), then he can only trick the model on $\approx 1 0 \%$ of the samples. This is a great success, but does the model really learn more causal features to classify MNIST? We here demonstrate that this is not the case: For one, the defense by Madry et al. (SOTA on $L _ { \infty }$ ) has lower $L _ { 0 }$ robustness than undefended networks and is still highly susceptible in the $L _ { 2 }$ metric. Second, the robustness results by Madry et al. can also be achieved with a simple input quantization because of the binary nature of single pixels in MNIST (which are typically either completely black or white) (Schmidt et al., 2018). Third, it is straight-forward to find unrecognizable images that are classified as a digit with high certainty. Finally, the minimum adversarial examples we find for the defense by Madry et al. make little to no sense to humans.
|
| 18 |
+
|
| 19 |
+
Taken together, even MNIST cannot be considered solved with respect to adversarial robustness. By “solved” we mean a model that reaches at least $9 9 \%$ accuracy (see accuracy-vs-robustness trade-off (Tsipras et al., 2018; Bubeck et al., 2018)) and whose adversarial examples carry semantic meaning to humans (by which we mean that they start looking like samples that could belong to either class). Hence, despite the fact that MNIST is considered “too easy” by many and a mere toy example, finding adversarially robust models on MNIST is still an open problem.
|
| 20 |
+
|
| 21 |
+
A potential solution we explore in this paper is inspired by unrecognizable images (Nguyen et al., 2015) or distal adversarials. Distal adversarials are images that do not resemble images from the training set but which typically look like noise while still being classified by the model with high confidence. It seems difficult to prevent such images in feedforward networks as we have little control over how inputs are classified that are far outside of the training domain. In contrast, generative models can learn the distribution of their inputs and are thus able to gauge their confidence accordingly. By additionally learning the image distribution within each class we can check that the classification makes sense in terms of the image features being present in the input (e.g. an image of a bus should contain actual bus features). Following this line of thought from an information-theoretic perspective, one arrives at the well-known concept of Bayesian classifiers. We here introduce a fine-tuned variant based on variational autoencoders (Kingma & Welling, 2013) that combines robustness with high accuracy.
|
| 22 |
+
|
| 23 |
+
In summary, the contributions of this paper are as follows:
|
| 24 |
+
|
| 25 |
+
• We show that MNIST is unsolved from the point of adversarial robustness: the SOTA defense of Madry et al. (2018) is still highly vulnerable to tiny perturbations that are meaningless to humans. • We introduce a new robust classification model and derive instance-specific robustness guarantees. • We develop a strong attack that leverages the generative structure of our classification model. • We introduce a novel decision-based attack that minimizes $L _ { 0 }$ . We perform an extensive evaluation of our defense across many attacks to show that it surpasses SOTA on $L _ { 0 }$ , $L _ { 2 }$ and $L _ { \infty }$ and features many adversarials that carry semantic meaning to humans.
|
| 26 |
+
|
| 27 |
+
We have evaluated the proposed defense to the best of our knowledge, but we are aware of the (currently unavoidable) limitations of evaluating robustness. We will release the model architecture and trained weights as a friendly invitation to fellow researchers to evaluate our model independently.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
The many defenses against adversarial attacks can roughly be subdivided into four categories:
|
| 32 |
+
|
| 33 |
+
Adversarial training: The training data is augmented with adversarial examples to make models more robust (Madry et al., 2018; Szegedy et al., 2013; Tramèr et al., 2017; Ilyas et al., 2017).
|
| 34 |
+
• Manifold projections: An input sample is projected onto a learned data manifold (Samangouei et al., 2018; Ilyas et al., 2017; Shen et al., 2017; Song et al., 2018).
|
| 35 |
+
• Stochasticity: Certain inputs or hidden activations are shuffled or randomized (Prakash et al., 2018; Dhillon et al., 2018; Xie et al., 2018).
|
| 36 |
+
• Preprocessing: Inputs or hidden activations are quantized, projected into a different representation or are otherwise preprocessed (Buckman et al., 2018; Guo et al., 2018; Kabilan et al., 2018).
|
| 37 |
+
|
| 38 |
+
There has been much work showing that basically all defenses suggested so far in the literature do not substantially increase robustness over undefended neural networks (Athalye et al., 2018; Brendel &
|
| 39 |
+
|
| 40 |
+
I. Optimize latent distribution ${ \sf p } ( { \sf z } | { \bf x } )$ in each digit model to find likelihood of sample $\pmb { \times }$ under each model.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
II. Decide based on most likely class
|
| 44 |
+
Figure 1: Overview over model architecture. In a nutshell: I) for each sample x we compute a lower bound on the log-likelihood (ELBO) under each class using gradient descent in the latent space. II) A class-dependent scalar weighting of the class-conditional ELBOs forms the final class prediction.
|
| 45 |
+
|
| 46 |
+
Bethge, 2017). The only widely accepted exception according to Athalye et al. (2018) is the defense by Madry et al. (2018) which is based on data augmentation with adversarials found by iterative projected gradient descent with random starting points. However, as we see in the results section, this defense is limited to the metric it is trained on $( L _ { \infty } )$ and it is straight-forward to generate small adversarial perturbations that carry little semantic meaning for humans.
|
| 47 |
+
|
| 48 |
+
Some other defenses have been based on generative models. Typically these defenses use the generative model to project onto the (learned) manifold of “natural” inputs. This includes in particular DefenseGAN (Samangouei et al., 2018), Adversarial Perturbation Elimination GAN (Shen et al., 2017) and Robust Manifold Defense (Ilyas et al., 2017), all of which project an image onto the manifold defined by a generator network $G$ . The generated image is then classified by a discriminator in the usual way. A similar idea is used by PixelDefend (Song et al., 2018) which uses an autoregressive probabilistic method to learn the data manifold. Other ideas in similar directions include the use of denoising autoencoders (Liao et al., 2017) as well as MagNets (Meng & Chen, 2017), which projects or rejects inputs depending on their distance to the data manifold. All of these proposed defenses except for the defense by Ilyas et al. (2017) have been tested by Athalye et al. (2018); Athalye & Carlini (2018); Carlini & Wagner (2017) and others, and shown to be ineffective. It is straight-forward to understand why: For one, many adversarials still look like normal data points to humans. Second, the classifier on top of the projected image is as vulnerable to adversarial examples as before. Hence, for any data set with a natural amount of variation there will almost always be a certain perturbation against which the classifier is vulnerable and which can be induced by the right inputs.
|
| 49 |
+
|
| 50 |
+
We here follow a different approach by modeling the input distribution within each class (instead of modeling a single distribution for the complete data), and by classifying a new sample according to the class under which it has the highest likelihood. This approach, commonly referred to as a Bayesian classifier, gets away without any additional and vulnerable classifier. A very different but related approach is the work by George et al. (2017) which suggested a generative compositional model of digits to solve cluttered digit scenes like Captchas (adversarial robustness was not evaluated).
|
| 51 |
+
|
| 52 |
+
# 3 MODEL DESCRIPTION
|
| 53 |
+
|
| 54 |
+
Intuitively, we want to learn a causal model of the inputs (Schölkopf, 2017). Consider a cat: we want a model to learn that cats have four legs and two pointed ears, and then use this model to check whether a given input can be generated with these features. This intuition can be formalized as follows. Let $\left( \mathbf { x } , y \right)$ with $\mathbf { x } \in \mathbb { R } ^ { N }$ be an input-label datum. Instead of directly learning a posterior $p ( y | \mathbf { x } )$ from inputs to labels we now learn generative distributions $p ( \mathbf { x } | y )$ and classify new inputs using Bayes formula,
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
p ( y | \mathbf x ) = \frac { p ( \mathbf x | y ) p ( y ) } { p ( \mathbf x ) } \propto p ( \mathbf x | y ) p ( y ) .
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
The label distribution $p ( y )$ can be estimated from the training data. To learn the class-conditional sample distributions $p ( \mathbf { x } | y )$ we use variational autoencoders (VAEs) (Kingma & Welling, 2013). VAEs estimate the log-likelihood $\log p ( \mathbf { x } )$ by learning a probabilistic generative model $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$
|
| 61 |
+
|
| 62 |
+
with latent variables $\mathbf { z } \sim p ( \mathbf { z } )$ and parameters $\theta$ (see Appendix A.3 for the full derivation). For class-conditional VAEs we can derive a lower bound on the log-likelihood $\log p ( \mathbf { x } | y )$ as
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r } { \log p ( \mathbf { x } | y ) \geq \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } , y ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } , y ) \right] - \mathcal { D } _ { K L } \left[ q _ { \phi } ( \mathbf { z } | \mathbf { x } , y ) | | p ( \mathbf { z } ) \right] = : \ell _ { y } ( \mathbf { x } ) , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $p ( \mathbf { z } ) = \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } )$ is a simple normal prior and $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ is the variational posterior with parameters $\phi$ . The first term on the RHS is basically a reconstruction error while the second term on the RHS is the mismatch between the variational and the true posterior. The term on the RHS is the so-called evidence lower bound (ELBO) on the log-likelihood (Kingma & Welling, 2013). We implement the conditional distributions $p _ { \theta } ( \mathbf { x } | \mathbf { z } , y )$ and $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ as normal distributions for which the means are parametrized as DNNs (all details and hyperparameters are reported in Appendix A.7).
|
| 69 |
+
|
| 70 |
+
Our Analysis by Synthesis model (ABS) is illustrated in Figure 1. It combines several elements to simultaneously achieve high accuracy and robustness against adversarial perturbations:
|
| 71 |
+
|
| 72 |
+
• Class-conditional distributions: For each class $y$ we train a variational autoencoder $\mathrm { V A E } _ { y }$ on the samples of class $y$ to learn the class-conditional distribution $p ( \mathbf { x } | y )$ . This allows us to estimate a lower bound $\ell _ { y } ( \mathbf { x } )$ on the log-likelihood of sample $\mathbf { x }$ under each class $y$ .
|
| 73 |
+
|
| 74 |
+
• Optimization-based inference: The variational inference $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ is itself a neural network susceptible to adversarial perturbations. We therefore only use variational inference during training and perform “exact” inference over $p _ { \theta } ( \mathbf { x } | \mathbf { z } , y )$ during evaluation. This “exact” inference is implemented using gradient descent in the latent space (with fixed posterior width) to find the optimal $\mathbf { z } _ { y }$ which maximizes the lower bound on the log-likelihood for each class:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\ell _ { y } ^ { * } ( \mathbf { x } ) = \mathop { \operatorname* { m a x } } _ { \mathbf { z } } ~ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } , y ) - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Note that we replaced the expectation in equation 2 with a maximum likelihood sample to avoid stochastic sampling and to simplify optimization. To avoid local minima we evaluate 8000 random points in the latent space of each VAE, from which we pick the best as a starting point for a gradient descent with 50 iterations using the Adam optimizer (Kingma & Ba, 2014).
|
| 81 |
+
|
| 82 |
+
• Classification and confidence: Finally, to perform the actual classification, we scale all $\ell _ { y } ^ { * } ( \mathbf x )$ with a factor $\alpha$ , exponentiate, add an offset $\eta$ and divide by the total evidence (like in a softmax),
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
p ( y | \mathbf { x } ) = \left( e ^ { \alpha \ell _ { y } ^ { * } ( \mathbf { x } ) } + \eta \right) / \sum _ { c } \left( e ^ { \alpha \ell _ { c } ^ { * } ( \mathbf { x } ) } + \eta \right) .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
We introduced $\eta$ for the following reason: even on points far outside the data domain, where all likelihoods $q ( \mathbf { x } , y ) = e ^ { \alpha \ell _ { y } ^ { * } ( \mathbf { x } ) } + \eta$ are small, the standard softmax $( \eta = 0$ ) can lead to sharp posteriors $p ( y | \mathbf { x } )$ with high confidence scores for one class. This behavior is in stark contrast to humans, who would report a uniform distribution over classes for unrecognizable images. To model this behavior we set $\eta > 0$ : in this case the posterior $p ( y | \mathbf { x } )$ converges to a uniform distribution whenever the maximum $q ( \mathbf { x } , y )$ gets small relative to $\eta$ . We chose $\eta$ such that the median confidence $p ( \boldsymbol { y } | \mathbf { x } )$ is 0.9 for the predicted class on clean test samples. Furthermore, for a better comparison with cross-entropy trained networks, the scale $\alpha$ is trained to minimize the cross-entropy loss. We also tested this graded softmax in standard feedforward CNNs but did not find any improvement with respect to unrecognizable images.
|
| 89 |
+
|
| 90 |
+
Binarization (Binary ABS only): The pixel intensities of MNIST images are almost binary. We exploit this by projecting the intensity $b$ of each pixel to 0 if $b < 0 . 5$ or 1 if $b \geq 0 . 5$ during testing.
|
| 91 |
+
|
| 92 |
+
• Discriminative finetuning (Binary ABS only): To improve the accuracy of the Binary ABS model we multiply $\ell _ { y } ^ { * } ( \mathbf x )$ with an additional class-dependent scalar $\gamma _ { y }$ . The scalars are learned discriminatively (see A.7) and reach values in the range $\gamma _ { y } \in [ 0 . 9 6 , 1 . 0 6 ]$ for all classes $y$ .
|
| 93 |
+
|
| 94 |
+
On important ingredient for the robustness of the ABS model is the Gaussian posterior in the reconstruction term which ensures that small changes in the input (in terms of L2) can only entail small changes to the posterior likelihood and thus to the model decision.
|
| 95 |
+
|
| 96 |
+
# 4 TIGHT ESTIMATES OF THE LOWER BOUND FOR ADVERSARIAL EXAMPLES
|
| 97 |
+
|
| 98 |
+
The decision of the model depends on the likelihood in each class, which for clean samples is mostly dominated by the posterior likelihood $p ( \mathbf { x } | \mathbf { z } )$ . Because we chose this posterior to be Gaussian, the
|
| 99 |
+
|
| 100 |
+
class-conditional likelihoods can only change gracefully with changes in $\mathbf { x }$ , a property which allows us to derive lower bounds on the model robustness. To see this, note that equation 3 can be written as,
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\ell _ { c } ^ { * } ( \mathbf { x } ) = \underset { \mathbf { z } } { \mathrm { m a x } } - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] - \frac { 1 } { 2 \sigma ^ { 2 } } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 } ^ { 2 } + C ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where we absorbed the normalization constants of $p ( \mathbf { x } | \mathbf { z } )$ into $C$ and $\mathbf { G } _ { c } ( \mathbf { z } )$ is the mean of $p ( \mathbf { x } | \mathbf { z } , c )$ Let $y$ be the ground-truth class and let $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ be the optimal latent for the clean sample $\mathbf { x }$ for class $y$ . We can then estimate a lower bound on $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for a perturbation $\pmb { \delta }$ with size $\epsilon = { \left\| \delta \right\| } _ { 2 }$ (see derivation in Appendix A.4),
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\ell _ { y } ^ { * } ( \mathbf { x } + \boldsymbol { \delta } ) \geq \ell _ { y } ^ { * } ( \mathbf { x } ) - \frac { 1 } { \sigma ^ { 2 } } \epsilon \| \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \| _ { 2 } - \frac { 1 } { 2 \sigma ^ { 2 } } \epsilon ^ { 2 } + C .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Likewise, we can derive an upper bound of $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for all other classes $c \neq y$ (see Appendix A.5),
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\ell _ { c } ^ { * } ( \mathbf { x } + \delta ) \leq - { \mathcal { D } _ { K L } } \left[ { \mathcal { N } } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | { \mathcal { N } } ( \mathbf { 0 } , \mathbb { 1 } ) \right] + C - \left\{ \begin{array} { l l } { \frac { 1 } { 2 \sigma ^ { 2 } } ( d _ { c } - \epsilon ) ^ { 2 } } & { \mathrm { i f ~ } d _ { c } \geq \epsilon } \\ { 0 } & { \mathrm { e l s e } } \end{array} \right. .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
for $d _ { c } = \operatorname* { m i n } _ { z } \left\| \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right\| _ { 2 }$ . Now we can find $\epsilon$ for a given image $\mathbf { x }$ by equating $( 7 ) = ( 6 )$ ,
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\epsilon _ { x } = \underset { c \neq y } { \mathrm { m i n } } \mathrm { m a x } \left. 0 , \frac { d _ { c } + \ell _ { y } ^ { \ast } ( \mathbf { x } ) - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] } { 2 ( d _ { c } + \| \mathbf { G } _ { y } ( \mathbf { z _ { x } ^ { \ast } } ) - \mathbf { x } \| _ { 2 } ) } \right. .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Note that one assumption we make is that we can find the global minimum of $\| \mathbf G _ { c } ( \mathbf z ) - \mathbf x \| _ { 2 } ^ { 2 }$ . In practice we generally find a very tight estimate of the global minimum (and thus the lower bound) because we optimize in a smooth and low-dimensional space and because we perform an additional brute-force sampling step. We provide quantitative values for $\epsilon$ in section 7.
|
| 125 |
+
|
| 126 |
+
# 5 ADVERSARIAL ATTACKS
|
| 127 |
+
|
| 128 |
+
Reliably evaluating model robustness is difficult because each attack only provides an upper bound on the size of the adversarial perturbations (Uesato et al., 2018). To make this bound as tight as possible we apply many different attacks and choose the best one for each sample and model combination (using the implementations in Foolbox v1.3 (Rauber et al., 2017) which often perform internal hyperparameter optimization). We also created a novel decision-based $L _ { 0 }$ attack as well as a customized attack that specifically exploits the structure of our model. Nevertheless, we cannot rule out that more effective attacks exist and we will release the trained model for future testing.
|
| 129 |
+
|
| 130 |
+
Latent Descent attack This novel attack exploits the structure of the ABS model. Let $\mathbf { x } _ { t }$ be the perturbed sample $\mathbf { x }$ in iteration $t$ . We perform variational inference $p ( \mathbf { z } | \mathbf { x } _ { t } , y ) = \mathcal { N } ( \mu _ { y } ( \mathbf { x } _ { t } ) , \sigma _ { q } I )$ to find the most likely class $\tilde { y }$ that is different from the ground-truth class. We then make a step towards the maximum likelihood posterior $p ( \mathbf { x } | \mathbf { z } , \tilde { y } )$ of that class which we denote as $\tilde { \mathbf { x } } _ { \tilde { y } }$ ,
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\mathbf { x } _ { t } \mapsto ( 1 - \epsilon ) \mathbf { x } _ { t } + \epsilon \tilde { \mathbf { x } } _ { \tilde { y } } .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
We choose $\epsilon = 1 0 ^ { - 2 }$ and iterate until we find an adversarial. For a more precise estimate we perform a subsequent binary search of 10 steps within the last $\epsilon$ interval. Finally, we perform another binary search between the adversarial and the original image to reduce the perturbation as much as possible.
|
| 137 |
+
|
| 138 |
+
Decision-based attacks We use several decision-based attacks because they do not rely on gradient information and are thus insensitive to gradient masking or missing gradients. In particular, we apply the Boundary Attack (Brendel et al., 2018), which is competitive with gradient-based attacks in minimizing the $L _ { 2 }$ norm, and introduce the Pointwise Attack, a novel decision-based attack that greedily minimizes the $L _ { 0 }$ norm. It first adds salt-and-pepper noise until the image is misclassified and then repeatedly iterates over all perturbed pixels, resetting them to the clean image if the perturbed image stays adversarial. The attack ends when no pixel can be reset anymore. We provide an implementation of the attack in Foolbox (Rauber et al., 2017). Finally, we apply two simple noise attacks, the Gaussian Noise attack and the Salt&Pepper Noise attack as baselines.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2: Accuracy-distortion plots for each distance metric and all models. In (b) we see that a threshold at 0.3 favors Madry et al. while a threshold of 0.35 would have favored the Binary ABS.
|
| 142 |
+
|
| 143 |
+
Transfer-based attacks Transfer attacks also don’t rely on gradients of the target model but instead compute them on a substitute: given an input $\mathbf { x }$ we first compute adversarial perturbations $\pmb { \delta }$ on the substitute using different gradient-based attacks ( $\ L _ { 2 }$ and $L _ { \infty }$ Basic Iterative Method (BIM), Fast Gradient Sign Method (FGSM) and $L _ { 2 }$ Fast Gradient Method) and then perform a line search to find the smallest $\epsilon$ for which ${ \bf x } + \epsilon \delta$ (clipped to the range [0, 1]) is still an adversarial for the target model.
|
| 144 |
+
|
| 145 |
+
Gradient-based attacks We apply the Momentum Iterative Method (MIM) (Dong et al., 2017) that won the NIPS 2017 adversarial attack challenge, the Basic Iterative Method (BIM) (Kurakin et al., 2016) (also known as Projected Gradient Descent (PGD))—for both the $L _ { 2 }$ and the $L _ { \infty }$ norm—as well as the Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014) and its $L _ { 2 }$ variant, the Fast Gradient Method (FGM). For models with input binarization (Binary CNN, Binary ABS), we obtain gradients using the straight-through estimator (Bengio et al., 2013).
|
| 146 |
+
|
| 147 |
+
Score-based attacks We additionally run all attacks listed under Gradient-based attacks using numerically estimated gradients (possible for all models). We use a simple coordinate-wise finite difference method (NES estimates (Ilyas et al., 2018) performed comparable or worse) and repeat the attacks with different values for the step size of the gradient estimator.
|
| 148 |
+
|
| 149 |
+
Postprocessing (binary models only) For models with input binarization (sec. 6) we postprocess all adversarials by setting pixel intensities either to the corresponding value of the clean image or the binarization threshold (0.5). This reduces the perturbation size without changing model decisions.
|
| 150 |
+
|
| 151 |
+
# 6 EXPERIMENTS
|
| 152 |
+
|
| 153 |
+
We compare our ABS model as well as two ablations—ABS with input binarization during test time (Binary ABS) and a CNN with input binarization during train and test time (Binary CNN)—against three other models: the SOTA $L _ { \infty }$ defense (Madry et al., 2018)1, a Nearest Neighbour (NN) model (as a somewhat robust but not accurate baseline) and a vanilla CNN (as an accurate but not robust baseline), see Appendix A.7. We run all attacks (see sec. 5) against all applicable models.
|
| 154 |
+
|
| 155 |
+
For each model and $L _ { p }$ norm, we show how the accuracy of the models decreases with increasing adversarial perturbation size (Figure 2) and report two metrics: the median adversarial distance (Table 1, left values) and the model’s accuracy against bounded adversarial perturbations (Table 1, right values). The median of the perturbation sizes (Table 1, left values) is robust to outliers and summarizes most of the distributions quite well. It represents the perturbation size for which the particular model achieves $5 0 \%$ accuracy and does not require the choice of a threshold. Clean samples that are already misclassified are counted as adversarials with a perturbation size equal to 0, failed attacks as $\infty$ . The commonly reported model accuracy on bounded adversarial perturbations, on the other hand, requires a metric-specific threshold that can bias the results. We still report it (Table 1, right values) for completeness and set $\epsilon _ { L _ { 2 } } = 1 . 5$ , $\epsilon _ { L _ { \infty } } = 0 . 3$ and $\epsilon _ { L _ { 0 } } = 1 2 $ as thresholds.
|
| 156 |
+
|
| 157 |
+
<table><tr><td></td><td>CNN</td><td>Binary CNN</td><td>Nearest Neighbor</td><td>Madry et al.</td><td>Binary ABS</td><td>ABS</td></tr><tr><td>Clean</td><td>99.1%</td><td>98.5%</td><td>96.9%</td><td>98.8%</td><td>99.0%</td><td>99.0%</td></tr><tr><td>L2-metric (ε = 1.5)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Transfer Attacks</td><td>1.1/14%</td><td>1.4 /38%</td><td>5.4/90%</td><td>3.7/94%</td><td>2.5/86%</td><td>4.6 /94%</td></tr><tr><td>Gaussian Noise</td><td>5.2/96%</td><td>3.4/92%</td><td>0/91%</td><td>5.4/96%</td><td>5.6/89%</td><td>10.9/98%</td></tr><tr><td>Boundary Attack</td><td>1.2/ 21%</td><td>3.3/84%</td><td>2.9/73%</td><td>1.4/37%</td><td>6.0/91%</td><td>2.6/83%</td></tr><tr><td>Pointwise Attack</td><td>3.4/91%</td><td>1.9 /71%</td><td>3.5/89%</td><td>1.9 /71%</td><td>3.1/86%</td><td>4.6 /94%</td></tr><tr><td>FGM</td><td>1.4/48%</td><td>1.4/50%</td><td></td><td>080/96%</td><td></td><td></td></tr><tr><td>FGM w/ GE</td><td>1.4/42%</td><td>2.8/51%</td><td>3.7/79%</td><td>8/88%</td><td>1.9 /68%</td><td>3.5/89%</td></tr><tr><td>DeepFool</td><td>1.2/18%</td><td>1.0 /11%</td><td></td><td>9.0/91%</td><td></td><td></td></tr><tr><td>DeepFool w/ GE</td><td>1.3 /30%</td><td>0.9/ 5%</td><td>1.6/ 55%</td><td>5.1/90%</td><td>1.4 / 41%</td><td>2.4/83%</td></tr><tr><td>L2 BIM</td><td>1.1/13%</td><td>1.0 /11%</td><td></td><td>4.8/88%</td><td></td><td></td></tr><tr><td>L2 BIM w/ GE</td><td>1.1/37%</td><td>00/50%</td><td>1.7 / 62%</td><td>3.4/88%</td><td>1.6 / 63%</td><td>3.1/87%</td></tr><tr><td>Latent Descent Attack</td><td></td><td></td><td></td><td></td><td>2.6/97%</td><td>2.7/85%</td></tr><tr><td>All L2 Attacks</td><td>1.1/ 8%</td><td>0.9/ 3%</td><td>1.5/53%</td><td>1.4/35%</td><td>1.3/39%</td><td>2.3 / 80%</td></tr><tr><td>Lo-metric (ε= 0.3)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Transfer Attacks</td><td>0.08/0%</td><td>0.44/ 85%</td><td></td><td>0.42/78%</td><td>0.39 /92%</td><td>0.49 /88%</td><td>0.34 / 73%</td></tr><tr><td>FGSM</td><td>0.10/ 4%</td><td>0.43 / 77%</td><td></td><td></td><td>0.45/93%</td><td></td><td></td></tr><tr><td>FGSM w/GE</td><td>0.10 /21%</td><td>0.42/ 71%</td><td></td><td>0.38/68%</td><td>0.47/89%</td><td>60.49/85%</td><td>0.27 /34%</td></tr><tr><td>LoDeepFool</td><td>0.08/ 0%</td><td>0.38 /74%</td><td></td><td></td><td>0.42/90%</td><td></td><td></td></tr><tr><td>LDeepFool w/ GE</td><td>0.09/ 0%</td><td>0.37 / 67%</td><td></td><td>0.21/26%</td><td>0.53/90%</td><td>0.46 /78%</td><td>0.27/39%</td></tr><tr><td>BIM</td><td>0.08/ 0%</td><td>0.36/ 70%</td><td></td><td></td><td>0.36 /90%</td><td></td><td></td></tr><tr><td>BIM w/ GE</td><td>0.08/37%</td><td></td><td>0/70%</td><td>0.25 /43%</td><td>0.46 /89%</td><td>0.49 /86%</td><td>0.25 /13%</td></tr><tr><td>MIM</td><td>0.08/ 0%</td><td></td><td>0.37 / 71%</td><td></td><td>0.34/90%</td><td></td><td></td></tr><tr><td>MIM w/ GE</td><td>0.09 /36%</td><td></td><td>00/69%</td><td>0.19 /26%</td><td>0.36 /89%</td><td>0.46 /85%</td><td>0.26 /17%</td></tr><tr><td>All L Attacks</td><td>0.08/0%</td><td>0.34/ 64%</td><td></td><td>0.19 /22%</td><td>0.34/88%</td><td>0.44 / 77%</td><td>0.23/ 8%</td></tr><tr><td>Lo-metric (ε = 12)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Salt&Pepper Noise</td><td>44.0 /91%</td><td></td><td></td><td>44.0/88% 161.0/88%</td><td></td><td></td><td>13.5 /56% 146.0/94% 165.0/94%</td></tr><tr><td>Pointwise Attack 10x</td><td>9.0/19%</td><td></td><td>11.0 /39%</td><td>10.0/34%</td><td>4.0/0%</td><td>22.0/77%</td><td>16.5/69%</td></tr><tr><td>All Lo Attacks</td><td>9.0/19%</td><td></td><td>11.0 /38%</td><td>10.0 /34%</td><td>4.0/ 0%</td><td>21.5 / 77%</td><td>16.5 /69%</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 1: Results for different models, adversarial attacks and distance metrics. Each entry shows the median adversarial distance across all samples (left value, black) as well as the model’s accuracy against adversarial perturbations bounded by the thresholds $\epsilon _ { L _ { 2 } } = 1 . 5$ , $\epsilon _ { L _ { \infty } } = 0 . 3$ and $\epsilon _ { L _ { 0 } } = 1 2 $ (right value, gray). $" \mathrm { { w } } / G E ^ { \prime \prime }$ indicates attacks that use numerical gradient estimation.
|
| 160 |
+
|
| 161 |
+
# 7 RESULTS
|
| 162 |
+
|
| 163 |
+
Minimal Adversarials Our robustness evaluation results of all models are reported in Table 1 and Figure 2. All models except the Nearest Neighbour classifier perform close to $9 9 \%$ accuracy on clean test samples. We report results for three different norms: $L _ { 2 }$ , $L _ { \infty }$ and $L _ { 0 }$ .
|
| 164 |
+
|
| 165 |
+
• For $L _ { 2 }$ our ABS model outperforms all other models by a large margin. • For $L _ { \infty }$ , our Binary ABS model is state-of-the-art in terms of median perturbation size. In terms of accuracy (perturbations $< 0 . 3$ ), Madry et al. seems more robust. However, as revealed by the accuracy-distortion curves in Figure 2, this is an artifact of the specific threshold (Madry et al. is optimized for 0.3). A slightly larger one (e.g. 0.35) would strongly favor the Binary ABS model. For $L _ { 0 }$ , both ABS and Binary ABS are much more robust than all other models. Interestingly, the model by Madry et al. is the least robust, even less than the baseline CNN.
|
| 166 |
+
|
| 167 |
+
In Figure 3 we show adversarial examples. For each sample we show the minimally perturbed $L _ { 2 }$ adversarial found by any attack. Adversarials for the baseline CNN and the Binary CNN are almost imperceptible. The Nearest Neighbour model, almost by design, exposes (some) adversarials that interpolate between two numbers. The model by Madry et al. requires perturbations that are clearly visible but make little semantic sense to humans. Finally, adversarials generated for the ABS models are semantically meaningful for humans and are sitting close to the perceptual boundary between the original and the adversarial class. For a more thorough comparison see appendix Figures 5, 6 and 7.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Adversarial examples for the ABS models are perceptually meaningful: For each sample (randomly chosen from each class) we show the minimally perturbed $L _ { 2 }$ adversarial found by any attack. Our ABS models have clearly visible and often semantically meaningful adversarials. Madry et al. requires perturbations that are clearly visible, but their semantics are less clear.
|
| 171 |
+
|
| 172 |
+
Lower bounds on Robustness For the ABS models and the $L _ { 2 }$ metric we estimate a lower bound of the robustness. The lower bound for the mean perturbation2 for the MNIST test set is $\epsilon =$ $0 . 6 9 0 \pm 0 . 0 0 5$ for the ABS and $\epsilon = 0 . 6 0 1 \pm 0 . 0 0 5$ for the binary ABS. We estimated the error by using different random seeds for our optimization procedure and standard error propagation over 10 runs. With adversarial training Hein & Andriushchenko (2017) achieve a mean $L _ { 2 }$ robustness guarantee of $\epsilon = 0 . 4 8$ while reaching $9 9 \%$ accuracy. In the $\operatorname { \cal L } _ { i n f }$ metric we find a median robustness of 0.06.
|
| 173 |
+
|
| 174 |
+
Distal Adversarials We probe the behavior of CNN, Madry et al. and our ABS model outside the data distribution. We start from random noise images and perform gradient ascent to maximize the output probability of a fixed label until $p ( y | \mathbf { x } ) \geq 0 . 9$ (as computed by the modified softmax from equation (8)). The results are visualized in Figure 4. Standard CNNs and Madry et al.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 4: Images of ones classified with a probability above $90 \%$ .
|
| 178 |
+
|
| 179 |
+
provide high confidence class probabilities for unrecognizable images. Our ABS model does not provide high confidence predictions in out-of-distribution regions.
|
| 180 |
+
|
| 181 |
+
# 8 DISCUSSION & CONCLUSION
|
| 182 |
+
|
| 183 |
+
In this paper we demonstrated that, despite years of work, we as a community failed to create neural networks that can be considered robust on MNIST from the point of human perception. In particular, we showed that even today’s best defense is susceptible to small adversarial perturbations that make little to no semantic sense to humans. We presented a new approach based on analysis by synthesis that seeks to explain its inference by means of the actual image features. We performed an extensive analysis to show that minimal adversarial perturbations in this model are large across all tested $L _ { p }$ norms and semantically meaningful to humans. Note that our architecture derives its robustness from its design and does not require any additionally training with adversarial examples.
|
| 184 |
+
|
| 185 |
+
We acknowledge that it is not easy to reliably evaluate a model’s adversarial robustness and most defenses proposed in the literature have later been shown to be ineffective. In particular, the structure of the ABS model prevents the computation of gradients which might give the model an unfair advantage. We put a lot of effort into an extensive evaluation of adversarial robustness using a large collection of powerful attacks, including one specifically designed to be particularly effective against the ABS model (the Latent Descent attack), and we will release the model architecture and trained weights as a friendly invitation to fellow researchers to evaluate our model.
|
| 186 |
+
|
| 187 |
+
Looking at the results of individual attacks (Table 1) we find that there is no single attack that works best on all models, thus highlighting the importance for a broad range of attacks. Without the Boundary Attack, for example, Madry et al. would have looked more robust to $L _ { 2 }$ adversarials than it is. For similar reasons Figure 6b of Madry et al. (2018) reports a median $L _ { 2 }$ perturbation size larger than 5, compared to the 1.4 achieved by the Boundary Attack. Moreover,the combination of all attacks of one metric $( A l l L _ { 2 } / L _ { \infty } / L _ { 0 }$ Attacks) is often better than any individual attack, indicating that different attacks are optimal on different samples.
|
| 188 |
+
|
| 189 |
+
Our conceptual implementation of the ABS model with one VAE per class neither scales efficiently to more classes nor to more complex datasets (a preliminary experiment on CIFAR10 provided only $54 \%$ test accuracy). However, first experiments on two class CIFAR indicate that the proposed model is also robust on CIFAR (we reach a median L2 robustness of 2.6 compared to 0.8 for a vanilla CNN, see Appendix A.1) for details). To increase the accuracy, there are many ways in which the ABS model can be improved, ranging from better and faster generative models (e.g. flow-based) to better training procedures.
|
| 190 |
+
|
| 191 |
+
In a nutshell, we demonstrated that MNIST is still not solved from the point of adversarial robustness and showed that our novel approach based on analysis by synthesis has great potential to reduce the vulnerability against adversarial attacks and to align machine perception with human perception.
|
| 192 |
+
|
| 193 |
+
# ACKNOWLEDGMENTS
|
| 194 |
+
|
| 195 |
+
This work has been funded, in part, by the German Federal Ministry of Education and Research (BMBF) through the Bernstein Computational Neuroscience Program Tübingen (FKZ: 01GQ1002) as well as the German Research Foundation (DFG CRC 1233 on “Robust Vision”). The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting L.S. and J.R.; J.R. acknowledges support by the Bosch Forschungsstiftung (Stifterverband, T113/30057/17); W.B. was supported by the Carl Zeiss Foundation (0563-2.8/558/3); M.B. acknowledges support by the Centre for Integrative Neuroscience Tübingen (EXC 307); W.B. and M.B. were supported by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior / Interior Business Center (DoI/IBC) contract number D16PC00003.
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Anish Athalye and Nicholas Carlini. On the robustness of the cvpr 2018 white-box adversarial example defenses. arXiv preprint arXiv:1804.03286, 2018.
|
| 200 |
+
|
| 201 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
|
| 202 |
+
|
| 203 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 204 |
+
|
| 205 |
+
W. Brendel and M. Bethge. Comment on “biologically inspired protection of deep networks from adversarial attacks”. arXiv preprint arXiv:1704.01547, 2017.
|
| 206 |
+
|
| 207 |
+
Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\equiv$ SyZI0GWCZ.
|
| 208 |
+
|
| 209 |
+
Sébastien Bubeck, Eric Price, and Ilya Razenshteyn. Adversarial examples from computational constraints. arXiv preprint arXiv:1805.10204, 2018.
|
| 210 |
+
|
| 211 |
+
Jacob Buckman, Aurko Roy, Colin Raffel, and Ian Goodfellow. Thermometer encoding: One hot way to resist adversarial examples. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ S18Su--CW.
|
| 212 |
+
|
| 213 |
+
Nicholas Carlini and David Wagner. Magnet and" efficient defenses against adversarial attacks" are not robust to adversarial examples. arXiv preprint arXiv:1711.08478, 2017.
|
| 214 |
+
|
| 215 |
+
Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 216 |
+
|
| 217 |
+
Guneet S. Dhillon, Kamyar Azizzadenesheli, Jeremy D. Bernstein, Jean Kossaifi, Aran Khanna, Zachary C. Lipton, and Animashree Anandkumar. Stochastic activation pruning for robust adversarial defense. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1uR4GZRZ.
|
| 218 |
+
|
| 219 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Xiaolin Hu, Jianguo Li, and Jun Zhu. Boosting adversarial attacks with momentum. arxiv preprint. arXiv preprint arXiv:1710.06081, 2017.
|
| 220 |
+
|
| 221 |
+
Dileep George, Wolfgang Lehrach, Ken Kansky, Miguel Lázaro-Gredilla, Christopher Laan, Bhaskara Marthi, Xinghua Lou, Zhaoshi Meng, Yi Liu, Huayan Wang, Alex Lavin, and D. Scott Phoenix. A generative vision model that trains with high data efficiency and breaks text-based captchas. Science, 358(6368), 2017. ISSN 0036-8075. doi: 10.1126/science.aag2612. URL http://science.sciencemag.org/content/ 358/6368/eaag2612.
|
| 222 |
+
|
| 223 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 224 |
+
|
| 225 |
+
Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ SyJ7ClWCb.
|
| 226 |
+
|
| 227 |
+
Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems 30, pp. 2266–2276. Curran Associates, Inc., 2017.
|
| 228 |
+
|
| 229 |
+
Andrew Ilyas, Ajil Jalal, Eirini Asteri, Constantinos Daskalakis, and Alexandros G Dimakis. The robust manifold defense: Adversarial training using generative models. arXiv preprint arXiv:1712.09196, 2017.
|
| 230 |
+
|
| 231 |
+
Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. arXiv preprint arXiv:1804.08598, 2018.
|
| 232 |
+
|
| 233 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 234 |
+
|
| 235 |
+
Vishaal Munusamy Kabilan, Brandon Morris, and Anh Nguyen. Vectordefense: Vectorization as a defense to adversarial examples. arXiv preprint arXiv:1804.08529, 2018.
|
| 236 |
+
|
| 237 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 238 |
+
|
| 239 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 240 |
+
|
| 241 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 242 |
+
|
| 243 |
+
Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Jun Zhu, and Xiaolin Hu. Defense against adversarial attacks using high-level representation guided denoiser. arXiv preprint arXiv:1712.02976, 2017.
|
| 244 |
+
|
| 245 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJzIBfZAb.
|
| 246 |
+
|
| 247 |
+
Dongyu Meng and Hao Chen. Magnet: a two-pronged defense against adversarial examples. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 135–147. ACM, 2017.
|
| 248 |
+
|
| 249 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015.
|
| 250 |
+
|
| 251 |
+
Aaditya Prakash, Nick Moran, Solomon Garber, Antonella DiLillo, and James Storer. Deflecting adversarial attacks with pixel deflection. arXiv preprint arXiv:1801.08926, 2018.
|
| 252 |
+
|
| 253 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/ forum?id $\equiv$ Bys4ob-Rb.
|
| 254 |
+
|
| 255 |
+
Jonas Rauber, Wieland Brendel, and Matthias Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. arXiv preprint arXiv:1707.04131, 2017. URL http://arxiv.org/abs/ 1707.04131.
|
| 256 |
+
|
| 257 |
+
Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-GAN: Protecting classifiers against adversarial attacks using generative models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ BkJ3ibb0-.
|
| 258 |
+
|
| 259 |
+
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. CoRR, abs/1804.11285, 2018. URL http://arxiv.org/abs/ 1804.11285.
|
| 260 |
+
|
| 261 |
+
Bernhard Schölkopf. Causal learning, 2017. URL https://icml.cc/Conferences/2017/ Schedule?showEvent $= 9 3 1$ . Thirty-fourth International Conference on Machine Learning.
|
| 262 |
+
|
| 263 |
+
Shiwei Shen, Guoqing Jin, Ke Gao, and Yongdong Zhang. Ape-gan: Adversarial perturbation elimination with gan. arXiv preprint arXiv:1707.05474, 2017.
|
| 264 |
+
|
| 265 |
+
Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJUYGxbCW.
|
| 266 |
+
|
| 267 |
+
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.
|
| 268 |
+
|
| 269 |
+
Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 270 |
+
|
| 271 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. There is no free lunch in adversarial robustness (but there are unexpected benefits). arXiv preprint arXiv:1805.12152, 2018.
|
| 272 |
+
|
| 273 |
+
Jonathan Uesato, Brendan O’Donoghue, Pushmeet Kohli, and Aaron van den Oord. Adversarial risk and the dangers of evaluating against weak attacks. In Proceedings of the 35th International Conference on Machine Learning, 2018. URL http://proceedings.mlr.press/v80/uesato18a.html.
|
| 274 |
+
|
| 275 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ Sk9yuql0Z.
|
| 276 |
+
|
| 277 |
+
Tianhang Zheng, Changyou Chen, and Kui Ren. Distributionally adversarial attack. arXiv preprint arXiv:1808.05537, 2018.
|
| 278 |
+
|
| 279 |
+
A APPENDIX
|
| 280 |
+
|
| 281 |
+
# A.1 TWO CLASS CIFAR
|
| 282 |
+
|
| 283 |
+
We estimate the robustness of our ABS model on two class CIFAR (airplane vs. automobile). Preliminary results suggest that our robustness is not limited to MNIST.
|
| 284 |
+
|
| 285 |
+
In order to adapt to CIFAR, we modified the ABS slightly by modifying encoder and decoder to fit $( 3 2 \mathbf { x } 3 2 \mathbf { x } 3 )$ CIFAR images. We also increased the number of dimensions in the latent space form 8 to 20.
|
| 286 |
+
|
| 287 |
+
Table 2: Accuracy and estimated robustness on two class CIFAR.
|
| 288 |
+
|
| 289 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>CNN</td><td rowspan=1 colspan=1>ABS</td></tr><tr><td rowspan=1 colspan=1>Accuracy</td><td rowspan=1 colspan=1>97.1%</td><td rowspan=1 colspan=1>89.7%</td></tr><tr><td rowspan=1 colspan=1>Median L2 distance</td><td rowspan=1 colspan=1>0.8 (with BIM)</td><td rowspan=1 colspan=1>2.5 (with Latent Descent attack)</td></tr></table>
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 5: $L _ { 0 }$ error quantiles: We always choose the minimally perturbed $L _ { 0 }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ). Where $1 0 0 \%$ corresponds to the maximal (over samples) minimum (over attacks) perturbation found for each model.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 6: $L _ { 2 }$ error quantiles: We always choose the minimally perturbed $L _ { 2 }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample 4 images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ).
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 7: $L _ { \infty }$ error quantiles: We always choose the minimally perturbed $L _ { \infty }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ).
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 8: Distribution of minimal adversarials for each model and distance metric. In (b) we see that a threshold at 0.3 favors Madry et al. while a threshold of 0.35 would have favored the Binary ABS.
|
| 302 |
+
|
| 303 |
+
# A.3 DERIVATION I
|
| 304 |
+
|
| 305 |
+
Derivation of the ELBO in equation 2.
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\log p _ { \boldsymbol \theta } ( \mathbf { x } ) = \log \int \mathbf { d z } p _ { \boldsymbol \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) ,
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
where $p ( \mathbf { z } ) = \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } )$ is a simple normal prior. Based on the idea of importance sampling using a variational posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ with parameters $\phi$ and using Jensen’s inequality we arrive at
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r l } & { = \log \int \mathrm { d } z \frac { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) , } \\ & { = \log \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \frac { p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { \geq \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log \frac { p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) + \log \frac { p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \mathcal { D } _ { K L } \left[ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \right] \left. p ( \mathbf { z } ) \right] . } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
This lower bound is commonly referred to as ELBO.
|
| 318 |
+
|
| 319 |
+
# A.4 DERIVATION II: LOWER BOUND FOR $L _ { 2 }$ ROBUSTNESS ESTIMATION
|
| 320 |
+
|
| 321 |
+
Derivation of equation 6. Starting from equation 3 we find that for a perturbation $\pmb { \delta }$ with size $\epsilon = { \left\| \delta \right\| } _ { 2 }$ of sample $\mathbf { x }$ the lower bound $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ can itself be bounded by,
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { r l r } { { \ell _ { y } ^ { * } ( \mathbf x + \delta ) = \operatorname* { m a x } _ { \mathbf z } - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } } \\ & { } & { \geq - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z _ { \mathbf x } ^ { * } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z _ { \mathbf x } ^ { * } ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ is the optimal latent vector for the clean sample $\mathbf { x }$ for class $_ y$ ,
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\begin{array} { r l } & { = \ell _ { y } ^ { * } ( \mathbf { x } ) + \frac { 1 } { \sigma ^ { 2 } } \boldsymbol { \delta } ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \frac { 1 } { 2 \sigma ^ { 2 } } \boldsymbol { \epsilon } ^ { 2 } + C , } \\ & { \geq \ell _ { y } ^ { * } ( \mathbf { x } ) - \frac { 1 } { \sigma ^ { 2 } } \boldsymbol { \epsilon } \| \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \| _ { 2 } - \frac { 1 } { 2 \sigma ^ { 2 } } \boldsymbol { \epsilon } ^ { 2 } + C . } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
A.5 DERIVATION III: UPPER BOUND FOR $L _ { 2 }$ ROBUSTNESS ESTIMATION
|
| 334 |
+
|
| 335 |
+
Derivation of equation 7.
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\begin{array} { r l r } { { \ell _ { c } ^ { * } ( \mathbf { x } + \delta ) = \operatorname* { m a x } _ { \mathbf { \mu } _ { \mathbf { z } } } - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { y } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } + C , } } \\ & { } & { \leq - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \underset { \mathbf { z } } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } , } \\ & { } & { \leq - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \underset { \mathbf { z } , \delta } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } , } \\ & { } & { = - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \{ \frac { 1 } { 2 \sigma ^ { 2 } } ( d _ { c } - \epsilon ) ^ { 2 } \quad \mathrm { i f ~ } d _ { c } \geq \epsilon . } \end{array}
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
for $d _ { c } = \mathrm { m i n } _ { z } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 }$ . The last equation comes from the solution of the constrained optimization problem $\operatorname* { m i n } _ { d } ( d - \epsilon ) ^ { 2 } d$ s.t. $d > d _ { c }$ . Note that a tighter bound might be achieved by assuming single $\pmb { \delta }$ for upper and lower bound.
|
| 342 |
+
|
| 343 |
+
# A.6 $L _ { \infty }$ ROBUSTNESS ESTIMATION
|
| 344 |
+
|
| 345 |
+
We proceed in the same way as for $L _ { 2 }$ . Starting again from
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\ell _ { c } ^ { * } ( \mathbf { x } ) = \underset { \mathbf { z } } { \mathrm { m a x } } - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] - \frac { 1 } { 2 \sigma ^ { 2 } } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 } ^ { 2 } + C ,
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
let $_ y$ be the predicted class and let $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ be the optimal latent for the clean sample $\mathbf { x }$ for class $y$ . We can then estimate a lower bound on $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for a perturbation $\pmb { \delta }$ with size $\epsilon = \| \pmb { \delta } \| _ { \infty }$ ,
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\begin{array} { r l r } { { \ell _ { y } ^ { * } ( \mathbf x + \delta ) = \operatorname* { m a x } _ { \mathbf z } - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } } \\ & { } & { \geq - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z _ { \mathbf x } ^ { * } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z _ { \mathbf x } ^ { * } ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } \end{array}
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
where $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ is the optimal latent for the clean sample $\mathbf { x }$ for class $y$ .
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\begin{array} { l } { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + \frac { 1 } { \sigma ^ { 2 } } \delta ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \frac { 1 } { 2 \sigma ^ { 2 } } \| \delta \| _ { 2 } ^ { 2 } + C , } \\ { \displaystyle \geq \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \operatorname* { m i n } \left( 2 \delta ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \| \delta \| _ { 2 } ^ { 2 } \right) , } \\ { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \operatorname* { m i n } \left( 2 \delta _ { i } [ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ] _ { i } - \delta _ { i } ^ { 2 } \right) , } \\ { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \left\{ \left[ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \right] _ { i } ^ { 2 } \right. \qquad \mathrm { i f ~ } [ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ] _ { i } | \leq \epsilon \ . } \end{array}
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
Similarly, we can estimate an upper bound on $\ell _ { c } ^ { * } ( \mathbf { x } + \delta )$ on all other classes $c \neq y$ ,
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\begin{array} { l } { { \displaystyle \ell _ { c } ^ { * } ( { \bf x } + \delta ) \leq - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) ] + C - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } { \bf G } _ { c } ( { \bf z } ) - { \bf x } - \delta _ { 2 } ^ { 2 } , } } \\ { { \displaystyle \leq - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C - \underset { \bf z , \delta } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } { \bf G } _ { c } ( { \bf z } ) - { \bf x } - \delta _ { 2 } ^ { 2 } , } } \\ { ~ } \\ { { \displaystyle = - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \underset { \sigma _ { i } } { \operatorname* { m i n } } ( [ { \bf G } _ { c } ( { \bf z } ) - { \bf x } ] _ { i } - \delta _ { i } ) ^ { 2 } , } } \\ { { \displaystyle = - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C } ~ } \\ \displaystyle ~ - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \{ \begin{array} { l l } { \displaystyle 0 ( \mathbf { E } _ { y } ( { \bf z } _ { \mathbf { x } } ^ { * } ) - { \bf x } ) _ { i } - \boldsymbol { \cal K } ^ { 2 } \} } & { { \displaystyle \mathrm { i f } [ \mathbf { G } _ { y } ( { \bf z } _ { \mathbf { x } } ^ { * } ) - { \bf x } ] _ { i } \leq \epsilon } } \\ \displaystyle ( [ \end{array} \end{array}
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
In this case there is no closed-form solution for the minimization problem on the RHS (in terms of the minimum of $\| \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \| _ { 2 } )$ but we can still compute the solution for each given $\epsilon$ which allows us perform a line search along $\epsilon$ to find the point where equation $1 3 =$ equation 14.
|
| 370 |
+
|
| 371 |
+
# A.7 MODEL & TRAINING DETAILS
|
| 372 |
+
|
| 373 |
+
Hyperparameters and training details for the ABS model The binary ABS and ABS have the same weights and architecture: The encoder has 4 layers with kernel s $\mathrm { i z e s } = [ 5 , 4 , 3 , 5 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ and feature map sizes $=$ [32, 32, 64, 2∗8]. The first 3 layers have ELU activation functions (Clevert et al., 2015), the last layer is linear. All except the last layer use Batch Normalization (Ioffe & Szegedy, 2015). The Decoder architecture has also 4 layers with kernel $\mathrm { s i z e s } = [ 4 , 5 , 5 , 3 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ and feature map size $=$ [32, 16, 16, 1]. The first 3 layers have ELU activation functions, the last layer has a sigmoid activation function, and all layers except the last one use Batch Normalization.
|
| 374 |
+
|
| 375 |
+
We trained the VAEs with the Adam optimizer (Kingma & Ba, 2014). We tuned the dimension $L$ of the latent space of the class-conditional VAEs (ending up with $L = 8$ ) to achieve $9 9 \%$ test error; started with a high weight for the KL-divergence term at the beginning of training (which was gradually decreased from a factor of 10 to 1 over 50 epochs); estimated the weighting $\gamma = [ 1 , 0 . 9 6 , 1 . 0 0 1 , 1 . 0 6 , 0 . 9 8 , 0 . 9 6 , 1 . 0 3 , 1 , 1 , 1 ]$ of the lower bound via a line search on the training accuracy. The parameters maximizing the test cross entropy3 and providing a median confidence of $p ( y | x ) = 0 . 9$ for our modified softmax (equation 8) are $\eta = 0 . 0 0 0 0 3 9$ and $\alpha = 4 4 0$ . For our latent prior, we chose $\sigma _ { q } = 1$ and for the posterior width we choose $\sigma = 1 / \sqrt { 2 }$
|
| 376 |
+
|
| 377 |
+
Hyperparameters for the CNNs The CNN and Binary CNN share the same architecture but have different weights. The architecture has kernel size $\mathfrak { s } = [ 5 , 4 , 3 , 5 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ , and feature map sizes $= [ 2 0 , 7 0 , 2 5 6 , 1 0 ]$ . All layers use ELU activation functions and all layers except the last one apply Batch Normalization. The CNNs are both trained on the cross entropy loss with the Adam optimizer (Kingma & Ba, 2014). The parameters maximizing the test cross entropy and providing a median confidence of $p ( y | x ) = 0 . 9$ of the CNN for our modified softmax (equation 8) are $\eta = 1 4 3 9 0 0$ and $\alpha = 1$ .
|
| 378 |
+
|
| 379 |
+
Hyperparameters for Madry et al. We adapted the pre-trained model provided by Madry et al4. Basically the architecture contains two convolutional, two pooling and two fully connected layers. The network is trained on clean and adversarial examples minimizing the cross cross-entropy loss. The parameters maximizing the test cross entropy and providing a median confidence of $p ( y | x ) = 0 . 9$ for our modified softmax (equation 8) are $\eta = 6 0$ and $\alpha = 1$ .
|
| 380 |
+
|
| 381 |
+
Hyperparameters for the Nearest Neighbour classifier For a comparison with neural networks, we imitate logits by replacing them with the negative minimal distance between the input and all samples within each class. The parameters maximizing the test cross entropy and providing a median confidence of $\hat { p ( y | x ) } = 0 . 9$ for our modified softmax (equation 8) are $\eta = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 4$ and $\alpha = 5$ .
|
md/train/S1Euwz-Rb/S1Euwz-Rb.md
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
|
| 2 |
+
|
| 3 |
+
Drew A. Hudson
|
| 4 |
+
Department of Computer Science Stanford University
|
| 5 |
+
dorarad@cs.stanford.edu
|
| 6 |
+
|
| 7 |
+
Christopher D. Manning Department of Computer Science Stanford University manning@cs.stanford.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We present Compositional Attention Networks, a novel fully differentiable neural network architecture, designed to facilitate explicit and expressive reasoning. While many types of neural networks are effective at learning and generalizing from massive quantities of data, this model moves away from monolithic blackbox architectures towards a design that provides a strong prior for iterative reasoning, allowing it to support explainable and structured learning, as well as generalization from a modest amount of data. The model builds on the great success of existing recurrent cells such as LSTMs: It sequences a single recurrent Memory, Attention, and Control (MAC) cell, and by careful design imposes structural constraints on the operation of each cell and the interactions between them, incorporating explicit control and soft attention mechanisms into their interfaces. We demonstrate the model’s strength and robustness on the challenging CLEVR dataset for visual reasoning, achieving a new state-of-the-art $9 8 . 9 \%$ accuracy, halving the error rate of the previous best model. More importantly, we show that the new model is more computationally efficient and data-efficient, requiring an order of magnitude less time and/or data to achieve good results.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
This paper considers how best to design neural networks to perform the iterative reasoning necessary for complex problem solving. Putting facts and observations together to arrive at conclusions is a central necessary ability as we work to move neural networks beyond their current great success with sensory perception tasks (LeCun et al., 1998; Krizhevsky et al., 2012) towards displaying Artificial General Intelligence.
|
| 16 |
+
|
| 17 |
+
Concretely, we develop a novel model that we apply to the CLEVR dataset (Johnson et al., 2016) for visual question answering (VQA). VQA (Antol et al., 2015; Gupta, 2017) is a challenging multimodal task that requires responding to natural language questions about images. However, Agrawal et al. (2016) show how the first generation of successful models on VQA tasks tend to acquire only superficial comprehension of both the image and the question, exploiting dataset biases rather than capturing a sound perception and reasoning process that would lead to the correct answer (Sturm, 2014). CLEVR was created to address this problem. As illustrated in figure 1, instances in the dataset consist of rendered images featuring 3D objects of several shapes, colors, materials and sizes, coupled with unbiased, compositional questions that require an array of challenging reasoning skills such as following transitive relations, counting objects and comparing their properties, without allowing any shortcuts around such reasoning. Notably, each instance in CLEVR is also accompanied by a tree-structured functional program that was both used to construct the question and reflects its reasoning procedure – a series of predefined operations – that can be composed together to answer it.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: A sample image from the CLEVR dataset, with a question: “There is a purple cube behind a metal object left to a large ball; what material is it?”
|
| 21 |
+
|
| 22 |
+
Most neural networks are essentially very large correlation engines that will hone in on any statistical, potentially spurious pattern that allows them to model the observed data more accurately. In contrast, we seek to create a model structure that requires combining sound inference steps to solve a problem instance. At the other extreme, some approaches adopt symbolic structures that resemble the expression trees of programming languages to perform reasoning (Andreas et al., 2016b; Hu et al., 2017). In particular, some approaches to CLEVR use the supplied functional programs for supervised or semi-supervised training (Andreas et al., 2016a; Johnson et al., 2017). Not only do we wish to avoid using such supervision in our work, but we in general suspect that the rigidity of these structures and the use of an inventory of operation-specific neural modules undermines robustness and generalization, and at any rate requires more complex reinforcement learning methods.
|
| 23 |
+
|
| 24 |
+
To address these weaknesses, while still seeking to use a sound and transparent underlying reasoning process, we propose Compositional Attention Networks, a novel, fully differentiable, non-modular architecture for reasoning tasks. Our model is a straightforward recurrent neural network with attention; the novelty lies in the use of a new Memory, Attention and Composition (MAC) cell. The constrained and deliberate design of the MAC cell was developed as a kind of strong structural prior that encourages the network to solve problems by stringing together a sequence of transparent reasoning steps. MAC cells are versatile but constrained neural units. They explicitly separate out memory from control, both represented recurrently. The unit contains three sub-units: The control unit updates the control representation based on outside instructions (for VQA, the question), learning to successively attend to different parts of the instructions; the read unit gets information out of a knowledge base (for VQA, the image) based on the control signal and the previous memory; the write unit updates the memory based on soft self-attention to previous memories, controlled by the retrieved information and the control signal. A universal MAC unit with a single set of parameters is used throughout the reasoning process, but its behavior can vary widely based on the context in which it is applied – the input to the control unit and the contents of the knowledge base. With attention, our MAC network has the capacity to represent arbitrarily complex acyclic reasoning graphs in a soft manner, while having physically sequential structure. The result is a continuous counterpart to module networks that can be trained end-to-end simply by backpropagation.
|
| 25 |
+
|
| 26 |
+
We test the behavior of our new network on CLEVR and its associated datasets. On the primary CLEVR reasoning task, we achieve an accuracy of $9 8 . 9 \%$ , halving the error rate compared to the previous state-of-the-art FiLM model (Perez et al., 2017). In particular, we show that our architecture yields better performance on questions involving counting and aggregation. In supplementary studies, we show that the MAC network learns more quickly (both in terms of number of training epochs and training time) and more effectively from limited amounts of training data. Moreover, it also achieves a new state-of-the-art performance of $8 2 . 5 \%$ on the more varied and difficult humanauthored questions of the CLEVR-Humans dataset. The careful design of our cell encourages compositionality, versatility and transparency. We achieve these properties by defining attention-based interfaces that constrict the cell’s input and output spaces, and so constrain the interactions both between and inside cells in order to guide them towards simple reasoning behaviors. Although each cell’s functionality has only a limited range of possible continuous reasoning behaviors, when chained together in a MAC network, the whole system becomes expressive and powerful. In the future, we believe that the architecture will also prove beneficial for other multi-step reasoning and inference tasks, for instance in machine comprehension and textual question answering.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
There have been several prominent models that address the CLEVR task. By and large they can be partitioned into two groups: module networks, which in practice have all used the strong supervision provided in the form of tree-structured functional programs that accompany each data instance, and large, relatively unstructured end-to-end differentiable networks that complement a fairly standard stack of CNNs with components that aid in performing reasoning tasks. In contrast to modular approaches (Andreas et al., 2016a;b; Hu et al., 2017; Johnson et al., 2017), our model does not require additional supervision and makes use of a single computational cell chained in sequence (like an LSTM) rather than a collection of custom modules deployed in a rigid tree structure. In contrast to augmented CNN approaches (Santoro et al., 2017; Perez et al., 2017), we suggest that our approach provides an ability for relational reasoning with better generalization capacity and higher computational efficiency. These approaches and other related work are discussed and contrasted in more detail in the supplementary material in section C.
|
| 31 |
+
|
| 32 |
+
# 3 COMPOSITIONAL ATTENTION NETWORKS
|
| 33 |
+
|
| 34 |
+
Compositional Attention Networks is an end-to-end architecture for question-answering tasks that sequentially performs an explicit reasoning process by stringing together small building blocks, called MAC cells, each is responsible for performing one reasoning step.
|
| 35 |
+
|
| 36 |
+
We now provide an overview of the model, and a detailed discussion of the MAC cell. The model is composed of three components: an Input unit, the core MAC network, and an output unit. A TensorFlow implementation of the network, along with pretrained models will be made publicly available.
|
| 37 |
+
|
| 38 |
+
In this paper we explore the model in the context of VQA. However, it should be noted that while the input and output units are naturally domain-specific and should be designed to fit the task at hand, the MAC network has been designed to be generic and more broadly applicable, and may prove useful in contexts beyond those explored in the paper, such as machine comprehension or question answering over knowledge bases, which in our belief is a promising avenue for future work.
|
| 39 |
+
|
| 40 |
+
# 3.1 THE INPUT UNIT
|
| 41 |
+
|
| 42 |
+
The input unit processes the raw inputs given to the system into distributed vector representations. It receives a text question (or in general, a query), and an image (or in general, a Knowledge Base (KB)) and processes each of them with a matching sub-unit, for the query and the KB, here a biLSTM and a CNN. More details can be found in the supplementary material, section A.
|
| 43 |
+
|
| 44 |
+
At the end of this stage, we get from the query sub-unit a series of biLSTM output states, which we refer to as contextual words, $[ c w _ { 1 } , . . . , c w _ { S } ]$ , where $S$ is the length of the question. In addition, we get $q = [ \overleftrightarrow { \lambda \omega _ { 1 } } , \overrightarrow { c w _ { S } } ]$ , the concatenation of the hidden states from the backward and forward LSTM passes. We refer to $q$ as the question representation. Furthermore, we get from the Knowledge-Base sub-unit a static representation of the knowledge base. For the case of VQA, it will be represented by a continuous matrix $K B _ { V }$ of dimension $H , W , d$ , where $H = W = 1 4$ are the height and width of the transformed image, corresponding to each of its regions.
|
| 45 |
+
|
| 46 |
+
# 3.2 THE MAC CELL
|
| 47 |
+
|
| 48 |
+
The MAC network, which is the heart of our model, chains a sequence of small building blocks, called MAC cells, each responsible for performing one reasoning step. The model is provided access to a Knowledge Base (KB), which is, for the specific case of VQA, the given image, and then upon receiving a query, i.e. a question, the model iteratively focuses, in $p$ steps, on the query’s various parts, each reflects in turn the current reasoning step, which we term the control. Consequently, guided by this control, it retrieves the relevant information from the KB, that is then passed to the next cell in a recurrent fashion.
|
| 49 |
+
|
| 50 |
+
Drawing inspiration from the Model-View-Controller paradigm used in software design and from the commonly exercised separation between control and data paths in computer architecture, the MAC cell is composed of three units: control unit, read unit and write unit. Each has a clearly defined role and an interface through which it interacts with the other units. See figure 2.
|
| 51 |
+
|
| 52 |
+
The careful design and imposed interfaces that constrain the interaction between the units inside the MAC cell, as described below, serve as structural prior that limits the space of hypotheses it can learn, thereby guiding it towards acquiring the intended reasoning behaviors. As such, this prior facilitates the learning process and mitigate overfitting issues.
|
| 53 |
+
|
| 54 |
+
In particular, and similar in spirit to Perez et al. (2017), we allow the question to interact with the Knowledge Base – the image for the case of VQA, only through indirect means: by guiding the cell to attend to different elements in the KB, as well as controlling its operation through gating mechanisms. Thus, in both cases, the interaction between these mediums, visual and textual, or knowledge and query, is mediated through probability distributions, either in the form of attention maps, or as gates, further detailed below. This stands in stark contrast to many common approaches that fuse the question and image together into the same vector space through linear combinations, multiplication, or concatenation. Rather, our controlled interaction distills the influence that the query should have in processing the Knowledge Base, casting it onto discrete probability distributions instead.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: The MAC cell, which is a recurrent unit comprised of a Control Unit, Read Unit, and Write Unit. Blue shows the control flow and red shows the memory flow. See section 3.2 for details.
|
| 58 |
+
|
| 59 |
+
The MAC cell has been designed to replace the discrete and predefined “modules” used in the modular approach (Andreas et al., 2016a;b; Hu et al., 2017; Johnson et al., 2017). Rather, we create one universal and versatile cell that is applied across all the reasoning steps, sharing both its architecture as well as its parameters, across all of its instantiations. In contrast to the discrete modules, each trained to specialize to some specific elementary reasoning task, the MAC cell is capable of demonstrating a continuous range of possible reasoning behaviors conditioned on the context in which it is applied – namely, the inputs it receives from the prior cell.
|
| 60 |
+
|
| 61 |
+
Each cell $M A C _ { i }$ maintains two dual states: control $c _ { i }$ and memory $m _ { i }$ , both are continuous vectors of dimension $d$ . The control $c _ { i }$ represents the reasoning operation the MAC cell should accomplish in the current step – focusing only on some aspect of the whole question. This is represented by a weighted-average attention-based sum of the question words. The memory $m _ { i }$ represents the current context information deemed relevant to respond to the query, or answer the question.This is represented practically by a weighted average over elements from the KB, or for the case of VQA, regions in the image. $m _ { 0 }$ and $c _ { 0 }$ are initialized each to a random vector parameter of dimension $d$ . The memory and control states are passed from one cell to the next in a recurrent fashion, and used in a way reminiscent of Key-Value memory networks (Miller et al., 2016), as discussed below.
|
| 62 |
+
|
| 63 |
+
# 3.2.1 THE CONTROL UNIT
|
| 64 |
+
|
| 65 |
+
The control unit determines the reasoning operation that should be applied at this step. It receives the contextual words $[ c w _ { 1 } , . . . , c w _ { S } ]$ , the question representation $q$ , and the control state from the previous MAC cell $c _ { i - 1 }$ , all of which are vectors of dimension $d$ .
|
| 66 |
+
|
| 67 |
+
We would like to allow our MAC cell to perform continuously varied and adaptive range of behaviors, as demanded by the question. Therefore, we define the behavior of each cell to be a function of the contextual words $[ c w _ { 1 } , . . . , c w _ { S } ]$ , weighted-averaged according to the attention distribution that the control unit produces at each step. This will allow the cell to adapt its behavior – the reasoning operation it performs – to the question it receives, instead of having a fixed set of predefined behaviours as is the case in competing approaches Andreas et al. (2016a;b); Johnson et al. (2017).
|
| 68 |
+
|
| 69 |
+
The formal specification of the control unit is shown in figure 3. The question $q$ is linearly transformed into a vector $q _ { i }$ of the same dimension, which in turn is concatenated with the previous control state $c _ { i - 1 }$ and linearly transformed again to a $d$ -dimensional vector $c q _ { i }$ .
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { c } { q _ { i } = W _ { i } ^ { d , d } \cdot q + b _ { i } ^ { d } } \\ { c q _ { i } = W ^ { 2 d , d } \left[ q _ { i } , c _ { i - 1 } \right] + b ^ { d } } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Note that in contrast to all other parameters of the cell, which are shared across its instantiations at the different steps $i = 1 , . . . , p$ , the parameters $W _ { i } ^ { d , d }$ and $b _ { i } ^ { d }$ are different for each iteration. This is done to allow each cell to attend more readily to different aspects (i.e. parts) of the questions, depending on the index of the current step – its relative stage in the context of the whole reasoning process.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 3: The Control Unit (CU) of the MAC cell. See section 3.2.1 for details. Best viewed in color.
|
| 79 |
+
|
| 80 |
+
$c q _ { i }$ represents the current reasoning operation we would like to perform in a continuous way, taking into account both the overall meaning of the question $q _ { i }$ , as well as the words the model attended to in the previous step, $c _ { i - 1 }$ .
|
| 81 |
+
|
| 82 |
+
However, we would like to prevent the cell from diverging in the reasoning operations it tries to perform, and instead anchor it back in the question words, by using them to represent the reasoning operation of the current step. We can achieve that by computing an attention distribution $c v _ { i }$ over the contextual words $[ c w _ { 1 } , . . . , c w _ { S } ]$ based on their similarity to $c q _ { i }$ . Then, summing the contextual words according to the attention distribution $c v _ { i }$ will allow us to have a new control state, $c _ { i }$ , which is represented again in terms of words from the question. Intuitively, it is the gist of the question that is relevant to the reasoning operation we would like to perform in the current step.
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { c l c r } { { c v _ { i , s } = \displaystyle \mathrm { s o f t m a x } \big ( W ^ { d , 1 } \big ( c q _ { i } \circ c w _ { s } \big ) + b ^ { 1 } \big ) } } \\ { { \big . } } \\ { { c _ { i } = \displaystyle \sum _ { s = 1 } ^ { S } c v _ { i , s } \cdot c w _ { s } } } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Finally, the control unit returns the current control state $c _ { i }$ , along with an attention map $c v _ { i }$ over the contextual words.
|
| 89 |
+
|
| 90 |
+
# 3.2.2 THE READ UNIT
|
| 91 |
+
|
| 92 |
+
The Read Unit is provided with access to the knowledge base $K B _ { V }$ , along with the previous memory state $m _ { i - 1 }$ and the current control $c _ { i }$ . It is responsible for retrieving relevant content from the Knowledge Base $K B _ { V }$ for the reasoning task that the MAC cell should accomplish at this step, which is represented by the current control state $c _ { i }$ , as explained above. Figure 4 shows a diagram.
|
| 93 |
+
|
| 94 |
+
The relevance of the new information is judged in two stages by the “relatedness” of each element in the KB (or for the case of VQA, each region in the image) to either the memory $m _ { i - 1 }$ that has accumulated relevant information from previous iterations, or to the current control $c _ { i }$ , pointing towards the next piece of information that should be taken into account. Here, relatedness is measured by trained linear transformations comparing each element to the previous memory and the current control.
|
| 95 |
+
|
| 96 |
+
More formally, at the first stage, the interaction between each element $K B _ { h , w }$ , where $\begin{array} { r l } { h } & { { } = } \end{array}$ $1 , . . . , H , w = 1 , . . . , W$ , and the previous memory $m _ { i - 1 }$ is computed by:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
m _ { i - 1 } ^ { \prime } = W ^ { d , d } \cdot m _ { i - 1 } + b ^ { d }
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r l } { \boldsymbol { K } \boldsymbol { B } _ { h , w } ^ { \prime } = \boldsymbol { W } ^ { d , d } \cdot \boldsymbol { K } \boldsymbol { B } _ { h , w } + \boldsymbol { b } ^ { d } } & { { } } \\ { \big ( \boldsymbol { I } _ { m - K B } \big ) _ { h , w } = \boldsymbol { m } _ { i - 1 } ^ { \prime } \circ \boldsymbol { K } \boldsymbol { B } _ { h , w } ^ { \prime } } & { { } } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 4: The Read Unit (RU) diagram. Blue refers to control flow, purple to knowledge flow and red to memory flow. See section 3.2.2 for description.
|
| 108 |
+
|
| 109 |
+
These memory-KB interactions measure the relatedness of each element in the KB to the memory accumulated so far, which holds information that has been deemed relevant to handle previous reasoning steps towards addressing the question. They allow the model to perform transitive inference, retrieving a new piece of information that now seems important in light of the recent memory retrieved in a prior iteration.
|
| 110 |
+
|
| 111 |
+
However, there are cases which necessitate the model to temporarily ignore current memories, when choosing the new information to retrieve. Logical OR is a classical example: when the model has to look at two different objects at the same time, and assuming it stored one of them at the first iteration, it should briefly ignore it, considering new information that is relevant to the question but is unrelated to the memory. In order to achieve such capability, the read unit concatenates the original KB elements to each corresponding memory-KB interaction, which are then projected back to $d$ -dimensional space (equation 6a):
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { c } { { I _ { m - K B } , ^ { \prime } = W ^ { 2 d , d } \left[ I _ { m - K B } , K B _ { h , w } \right] + b ^ { d } } } \\ { { I _ { c m - K B } = c _ { i } \circ \left( I _ { m - K B } \right) ^ { \prime } } } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
At the second stage, the read unit compares the current $c _ { i }$ with these memory-KB interactions, in order to focus on the information that is relevant to the current reasoning operation that the MAC cell seeks to accomplish. The result is then passed to a softmax layer yielding an attention map $m v _ { i }$ over the KB, which is used in turn to retrieve the relevant information to perform the current reasoning step.
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { r } { m v _ { i } = \operatorname { s o f t m a x } \left( W ^ { d , d } \cdot I _ { c m - K B } + b ^ { d } \right) } \\ { m _ { n e w } = \displaystyle \sum _ { h , w = 1 , 1 } ^ { H , W } \left( m v _ { i } \right) _ { h , w } \cdot K B _ { h , w } } \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Finally, the read unit returns the newly retrieved information $m _ { n e w }$ , along with an attention map $m v _ { i }$ over the Knowledge Base.
|
| 124 |
+
|
| 125 |
+
To give an example of the read unit operation, assume a given question $q$ such as “What object is located left to the blue ball?”, whose associated answer is “cube”. Initially, no cue is provided to the model to attend to that cube, since no direct information about it presents in the question. Instead, based on its comprehension of the question, the model may start by focusing on the blue ball at the first iteration, such that the memory state $m _ { 1 }$ will capture the blue ball. However, in the second iteration, the control unit, after re-examining the question, may realize it should now look left, storing the word “left” in $c _ { 2 }$ . Then, when considering both $m _ { 1 }$ and $c _ { 2 }$ , the read unit will realize it should perform a reasoning operation corresponding to the word “left” (stored in $c _ { 2 }$ ) given a memory representing the blue ball in $m _ { 1 }$ , thereby allowing it to look left to the blue ball and find the cube.
|
| 126 |
+
|
| 127 |
+
# 3.2.3 THE WRITE UNIT
|
| 128 |
+
|
| 129 |
+
The Write Unit is responsible for creating the new memory state $m _ { i }$ that will reflect all the information considered to be important to answer the question so far, i.e. up to the current iteration in the
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 5: The Write Unit (WU) diagram. Blue refers to control flow and red to memory flow. See section 3.2.3 for description.
|
| 133 |
+
|
| 134 |
+
reasoning process. It receives the last memory state $m _ { i - 1 }$ from the previous MAC cell, along with the newly retrieved information from the read unit in the current iteration, $m _ { n e w }$ . See figure 5 for a diagram.
|
| 135 |
+
|
| 136 |
+
In the main design we have explored, merging the new information with the previous memory state is done simply by a linear transformation.
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
m _ { i } ^ { \prime } = W ^ { 2 d , d } [ m _ { n e w } , m _ { i - 1 } ] + b ^ { d }
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
In addition, we have explored two variations of this design. The first, self-attention, allows considering any previous memories rather than just the last one $m _ { i - 1 }$ , thus providing the network with the capacity to model non-sequential reasoning processes. The second variation is adding gating mechanisms to the writing unit. These may allow the model to dynamically adjust the practical length of the computation to the question complexity and stabilize the memory content throughout the sequential network (similarly to GRUs and LSTMs).
|
| 143 |
+
|
| 144 |
+
Self-Attention. The current architecture that we have presented allows the model to perform reasoning steps in a sequence, passing control and memory states from one cell to the following. However, we would like to grant the system with more flexibility. Particularly, we would like to allow it to capture more complicated reasoning processes such as trees and graphs - Directed Acyclic Graph (DAG) in particular, where several branches of reasoning sub-processes are merged together in later stages. Indeed, the CLEVR dataset includes cases where the questions embody tree-like reasoning process, rather than just sequences, which we would like to address correctly in our model.
|
| 145 |
+
|
| 146 |
+
We achieve that by adding self-attention connections between each MAC cell and all the prior cells. Since each cell can look on all the prior reasoning steps and their corresponding memories retrieved from the Knowledge Base, it can virtually capture any directed acyclic graph, while still having physically sequential layout.
|
| 147 |
+
|
| 148 |
+
More formally, the current MAC cell, of the $i ^ { t h }$ iteration, is granted with access to $c _ { 1 } , . . . , c _ { i - 1 }$ along with the corresponding $m _ { 1 } , . . . , m _ { i - 1 }$ , that have been computed by the prior MAC cells. It begins by computing the similarity between $c _ { i }$ and $c _ { 1 } , . . . , c _ { i - 1 }$ , and use it to derive an attention map over the prior MAC cells $s a _ { i , j }$ for $j = 1 , . . . , i - 1$ . This represents the relevance of the $j ^ { t h }$ prior reasoning step to the current one $i$ (equation 9a).
|
| 149 |
+
|
| 150 |
+
Then, we average the previous memories according to this resulted attention map $s a _ { i j }$ . We obtain $m _ { s a }$ , representing the information from all the other reasoning steps that is relevant to the current one (equation 9b).
|
| 151 |
+
|
| 152 |
+
This resembles the approach of Key-Value networks (Miller et al., 2016). The similarity between control states, corresponding to the reasoning operations that are performed in each prior step, allows the model to select which memories should be taken into account, when creating the new memory – namely, which branches of the reasoning process should be merged together at this point.
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\begin{array} { c } { { s a _ { i j } = \displaystyle \mathrm { s o f t m a x } \left( W ^ { d , 1 } ( c _ { i } \circ c _ { j } ) + b ^ { 1 } \right) } } \\ { { ( m _ { s a } ) _ { i } = \displaystyle \sum _ { j = 1 } ^ { i - 1 } s a _ { i j } \cdot m _ { j } } } \end{array}
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
Finally, we use $m _ { s a }$ along with $m _ { i } ^ { \prime }$ to compute $m _ { i } ^ { \prime \prime }$ , the new memory content in this variation.
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
m _ { i } ^ { \prime \prime } = W ^ { 2 d , d } [ m _ { n e w } , m _ { i } ^ { \prime } ] + b ^ { d }
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
Memory Gate. The currently presented MAC network has some fixed number $p$ of concatenated MAC cells, representing the length of the overall reasoning process we perform. However, not all questions require reasoning sequence of the same length. Some questions are simpler while others more complex.
|
| 165 |
+
|
| 166 |
+
Motivated by this observation, we add a gate over the new memory computed at each step, that may selectively keep content of the previous memory $m _ { i - 1 }$ unchanged. Practically, the gate functions in a similar way to a highway network (Srivastava et al., 2015), where the gate value is conditioned on the current reasoning operation, $c _ { i }$ .
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\begin{array} { c } { { { c _ { i } } ^ { \prime } = W ^ { d , d } \cdot c _ { i } + b ^ { d } } } \\ { { m _ { i } = \mathrm { s i g m o i d } \left( c _ { i } ^ { \prime } \right) \cdot m _ { i - 1 } + ( 1 - \mathrm { s i g m o i d } \left( c _ { i } ^ { \prime } \right) ) \cdot m _ { i } ^ { \prime \prime } } } \end{array}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
The write unit returns the new memory state $m _ { i }$ , that will be passed along with $c _ { i }$ to the next MAC cell.
|
| 173 |
+
|
| 174 |
+
# 3.2.4 DISCUSSION
|
| 175 |
+
|
| 176 |
+
Overall, when designing the MAC cell, we have attempted to formulate the inner workings of an elementary, yet generic reasoning skills: the model decomposes the problem into steps, focusing on one at a time. At each such step, it takes into account:
|
| 177 |
+
|
| 178 |
+
• The control $c _ { i }$ : Some aspect of the task - pointing to the future work that has left to be done.
|
| 179 |
+
• The previous memory or memories: The partial solution or evidence the cell has acquired so far – pointing to the past work that has already been achieved.
|
| 180 |
+
• The newly retrieved information $m _ { n e w }$ : that is retrieved from the knowledge base $K B$ and may or may not be transitively related to that partial solution or evidence - the present, or current work.
|
| 181 |
+
|
| 182 |
+
Considering these three sources of information together, the cell finally adds the new information up into its working memory, $m _ { i }$ , progressing one more step towards the final answer.
|
| 183 |
+
|
| 184 |
+
# 3.3 THE OUTPUT UNIT
|
| 185 |
+
|
| 186 |
+
The output unit receives the question representation $q$ , along with the memory state passed from the last MAC cell $m _ { p }$ , where $p$ is the number of MAC cells in the network – representing the number of reasoning steps in the whole process. It inspects both and predicts an answer based on their concatenation. Intuitively, we would like our model to consider both the question as well as the relevant information that has been progressively retrieved from the KB, deemed the necessary information to answer it.
|
| 187 |
+
|
| 188 |
+
Note that considering both $q$ and $m _ { p }$ is critical to answer the question. While $m _ { p }$ represents the information collected from KB, we still need to recall what has been asked about it to be able to answer accordingly. This is especially true in our case, when all other interactions between the question and the KB are mediated through attention distributions, rather than being transformed into a shared continuous vector space.
|
| 189 |
+
|
| 190 |
+
The prediction is built out of a standard 2-layers fully-connected softmax-based classifier with hidden dimension $d$ and output dimension that matches the number of possible answers in the dataset. The classifier receives $[ m _ { p } , q ]$ as input and returns a probability distribution over the answers.
|
| 191 |
+
|
| 192 |
+
Table 1: CLEVR accuracy by baseline methods, competing methods, and our method (MAC) - for our method we show test results with GLoVE initialization and validation results with and without GLoVE. (\*) denotes use of extra supervisory information through program labels. $( ^ { \dagger } )$ denotes use of data augmentation. $( ^ { \ddagger } )$ denotes training from raw pixels. $( ^ { \circ } )$ denotes GLoVE word vector initialization.
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Model</td><td>Overall</td><td>Count</td><td>Exist</td><td>Compare Numbers</td><td>Query Attribute</td><td>Compare Attribute</td></tr><tr><td>Human (Johnson et al., 2017)</td><td>92.6</td><td>86.7</td><td>96.6</td><td>86.5</td><td>95.0</td><td>96.0</td></tr><tr><td>Q-type baseline (Johnson et al., 2017)</td><td>41.8</td><td>34.6</td><td>50.2</td><td>51.0</td><td>36.0</td><td>51.3</td></tr><tr><td>LSTM (Johnson et al., 2017)</td><td>46.8</td><td>41.7</td><td>61.1</td><td>69.8</td><td>36.8</td><td>51.8</td></tr><tr><td>CNN+LSTM (Johnson et al., 2017)</td><td>52.3</td><td>43.7</td><td>65.2</td><td>67.1</td><td>49.3</td><td>53.0</td></tr><tr><td>CNN+LSTM+SA (Johnson et al., 2016)</td><td>76.6</td><td>64.4</td><td>82.7</td><td>77.4</td><td>82.6</td><td>75.4</td></tr><tr><td>N2NMN* (Hu et al. 2017)</td><td>83.7</td><td>68.5</td><td>85.7</td><td>84.9</td><td>90.0</td><td>88.7</td></tr><tr><td>PG+EE (9K prog.)* (Johnson et al., 2017)</td><td>88.6</td><td>79.7</td><td>89.7</td><td>79.1</td><td>92.6</td><td>96.0</td></tr><tr><td>PG+EE (70oK prog.)* (Johnson et al., 2017)</td><td>96.9</td><td>92.7</td><td>97.1</td><td>98.7</td><td>98.1</td><td>98.9</td></tr><tr><td>CNN+LSTM+RN†‡ (Santoro et al.,2017)</td><td>95.5</td><td>90.1</td><td>97.8</td><td>93.6</td><td>97.9</td><td>97.1</td></tr><tr><td>CNN+GRU+FiLM (Perez et al.,2017)</td><td>97.7</td><td>94.3</td><td>99.1</td><td>96.8</td><td>99.1</td><td>99.1</td></tr><tr><td>CNN+GRU+FiLM* (Perez et al., 2017)</td><td>97.6</td><td>94.3</td><td>99.3</td><td>93.4</td><td>99.3</td><td>99.3</td></tr><tr><td>CNN+GRU+FiLM (Perez et al., 2017)</td><td>97.7</td><td>94.3</td><td>99.1</td><td>96.8</td><td>99.1</td><td>99.1</td></tr><tr><td>MAC (this paper)-val</td><td>98.9</td><td>97.1</td><td>99.5</td><td>99.3</td><td>99.2</td><td>99.2</td></tr><tr><td>MAC-val</td><td>99.0</td><td>97.2</td><td>99.5</td><td>99.5</td><td>99.5</td><td>99.4</td></tr><tr><td>MAC-test</td><td>98.9</td><td>97.2</td><td>99.5</td><td>99.4</td><td>99.3</td><td>99.5</td></tr></table>
|
| 195 |
+
|
| 196 |
+
# 4 EXPERIMENTS
|
| 197 |
+
|
| 198 |
+
We evaluate our model on the recent CLEVR dataset (Johnson et al., 2016). CLEVR is a synthetic dataset consisting of 700K tuples; each consists of a 3D-rendered image featuring objects of various shapes, colors, materials and sizes, coupled with compositional multi-step questions that measure performance on an array of challenging reasoning skills such as following transitive relations, counting objects and comparing their properties. In addition, each question is associated with a formal program, specifying the reasoning operations that should be performed to compute the answer, among 28 possibilities.
|
| 199 |
+
|
| 200 |
+
We first perform experiments on the original 700k CLEVR dataset (Johnson et al., 2016), comparing to prior work. As shown in table 1, our model matches or outperforms all existing models both in overall accuracy, as well as in each category, testing different reasoning skills. In particular, for the overall performance, we achieve $9 8 . 9 4 \%$ accuracy, more than halving the error rate of the prior best model, FiLM (Perez et al., 2017).
|
| 201 |
+
|
| 202 |
+
Counting and Numerical Comparison. Remarkably, our performance on questions testing counting and numerical comparisons is significantly higher than the competing models, which consistently struggle on this question type. Again, we nearly halve the corresponding error rate. These results demonstrate the aptitude of attention mechanisms to perform counting, reduction and aggregation, in contrast to alternative, CNN-based approaches.
|
| 203 |
+
|
| 204 |
+
Training Length and Computational-Efficiency. We examine the learning curves of our and competing models. We have trained all models on the same architecture and used the author code for the other models. Aiming at having equal settings for comparison, we ran all models including ours with learned random words vectors. In order to make sure the results are statistically significant we ran each model multiple (10) times, and plotted the averages and confidence intervals (figure 4). The results show that our model learns significantly faster than the other leading methods, FiLM (Perez et al., 2017) and $\mathrm { P G + E E }$ (Johnson et al., 2017). While we do not have learning curves for the Relational Network model, Santoro et al. (2017) report approximately 1.4 million iterations to achieve $9 5 . 5 \%$ accuracy, which are equivalent to 125 epochs approximately, whereas our model achieves a comparable accuracy after 3 epochs only, yielding 40x reduction in the length of the training process.
|
| 205 |
+
|
| 206 |
+
Naturally, the smaller number of required training steps also translates to comparably shorter training time. Perez et al. (2017) report training time of 4 days, equivalent to 80 epochs, to reach accuracy of $9 7 . 7 \%$ . In contrast, we achieve higher accuracy in 6 epochs, taking 9.5 hours overall, leading to $1 0 \mathrm { x }$ reduction in training time.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 6: Training curves and accuracies for MACs (our model), FiLM (Perez et al., 2017), $\mathrm { P G + E E }$ (Johnson et al., 2017) and stacked-attention (Yang et al., 2016; Johnson et al., 2017). (Note: $\mathrm { P G + E E }$ uses the supported CLEVR programs as strong supervision.) Left: Training curve (accuracy/epoch). Right: Learning curve: Accuracy for $1 \%$ , $2 \%$ , $5 \%$ , $10 \%$ , $2 5 \%$ , $50 \%$ and $100 \%$ of the $7 0 0 \mathrm { k }$ CLEVR samples.
|
| 210 |
+
|
| 211 |
+
Table 2: Accuracy on CLEVR-Humans of previous methods and our method (MAC), before (left) and after (right) fine-tuning on the CLEVR-Humans training data. $\mathrm { P G + E E }$ uses supervised data. For our method (MAC) we show test results with GLoVE initialization and validation results with and without GLoVE.
|
| 212 |
+
|
| 213 |
+
<table><tr><td>Model</td><td>Train CLEVR</td><td>Train CLEVR + fine-tune HUMANS</td></tr><tr><td>LSTM (Johnson et al.,2017)</td><td>27.5</td><td>36.5</td></tr><tr><td>CNN+LSTM (Johnson et al.,2017)</td><td>37.7</td><td>43.2</td></tr><tr><td>CNN+LSTM+SA+MLP (Johnson et al.,2016)</td><td>50.4</td><td>57.6</td></tr><tr><td>PG+EE (18K prog.)* (Johnson et al.,2017)</td><td>54.0</td><td>66.6</td></tr><tr><td>CNN+GRU+FiLM (Perez et al., 2017)</td><td>56.6</td><td>75.9</td></tr><tr><td>MAC-val</td><td>56.9</td><td>81.2</td></tr><tr><td>MAC-val</td><td>58.5</td><td>82.0</td></tr><tr><td> MAC-test</td><td>58.6</td><td>82.5</td></tr></table>
|
| 214 |
+
|
| 215 |
+
# 4.1 DATA EFFICIENCY
|
| 216 |
+
|
| 217 |
+
We have explored the performance of our and other leading approaches on smaller subsets of the CLEVR dataset, in order to study the ability of models to generalize from smaller amount of data. We sampled at random subsets of CLEVR, with $10 \%$ , $2 5 \%$ and $50 \%$ of its original $7 0 0 \mathrm { k }$ size, and used them to train our and other 3 proposed models for the CLEVR task: FiLM (Perez et al., 2017), the strongly-supervised $\mathrm { P G + E E }$ (Johnson et al., 2017), and stacked-attention networks (Johnson et al., 2017; Yang et al., 2016).
|
| 218 |
+
|
| 219 |
+
As shown in figure 4, our model outperforms the other models by a wide margin for all subsets of the CLEVR dataset. For $50 \%$ of the data, equivalent to $3 5 0 \mathrm { k }$ samples, other models obtain accuracies ranging between $70 \%$ and $92 \%$ , while our model achieves $9 7 . 9 \%$ . The gap becomes larger as the dataset size reduces: for $2 5 \%$ of the data, equivalent to $1 7 5 \mathrm { k }$ samples, performance of other models is between $50 \%$ and $7 7 \%$ , while our model maintains a high $9 5 . 4 \%$ accuracy.
|
| 220 |
+
|
| 221 |
+
Finally, for $10 \%$ of the data $- 7 0 \mathrm { k }$ samples, still a sizeable amount – our model is the only one that manages to generalize, with performance of $8 4 . 7 \%$ on average, whereas the other three models fail, achieving $4 7 . 6 \% - 5 7 . 5 \%$ . Note that as pointed out by (Johnson et al., 2016) a simple baseline that predicts the most frequent answer for each of the question types achieves already $4 2 . 1 \%$ , suggesting that answering half of the questions correctly means that the competing models barely learn to generalize from the smaller dataset. These results demonstrate the robustness of our architecture and its key role as a structural prior guiding our network to learn the intended reasoning skills.
|
| 222 |
+
|
| 223 |
+
4.2 CLEVR HUMANS - NATURAL LANGUAGE QUESTIONS
|
| 224 |
+
|
| 225 |
+
We analyze our model performance on the CLEVR-Humans dataset (Johnson et al., 2017), consisting of natural language questions collected through crowdsourcing. As such, the dataset has diverse vocabulary and linguistic variations, and it also demands more varied reasoning skills.
|
| 226 |
+
|
| 227 |
+
Since the training set is relatively small, consisting of $1 8 \mathrm { k }$ samples, we use it to finetune a model pretrained on the standard CLEVR dataset. However, since most of the vocabulary in CLEVRHumans is not covered by CLEVR, we do not train the word vectors during the pre-training stage, so to prevent drift in their meaning compared to other uncovered words in CLEVR-Humans that may be semantically related.
|
| 228 |
+
|
| 229 |
+
As shown in table 2, our model achieves state-of-the-art performance on CLEVR-Humans both before and after fine-tuning. It surpasses the next-best FiLM model, (Perez et al., 2017) by $6 . 6 \%$ percent, achieving $8 2 . 5 \%$ .
|
| 230 |
+
|
| 231 |
+
The results substantiate the model’s robustness against linguistic variations and noise, as well as its ability to adapt to diverse vocabulary and varied reasoning skills. Arguably, the soft attention performed over the question words allows the model to focus on the words that are most critical to answer the question and translate them to corresponding reasoning operations, giving less attention to irrelevant linguistic variations.
|
| 232 |
+
|
| 233 |
+
# 4.3 ABLATIONS
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 7: Ablations and variations of the MAC network. See text for full detail.
|
| 237 |
+
|
| 238 |
+
Based on the validation set, we have conducted an ablation study on our model to understand better the contribution of each of its component to the overall performance. We tested each setting on the standard 700K CLEVR dataset as well as on $10 \%$ subset of the dataset. See table 3 for the numerical results. In addition, figure 4.3 presents the training curves for the different settings trained on the standard dataset. Overall, the results demonstrate the robustness of the model to hyperparameter variations such as network dimension and length, and also the impact of different aspect and components of MAC on its performance.
|
| 239 |
+
|
| 240 |
+
Table 3: Ablations Results for the full standard CLEVR dataset and $10 \%$ subset of it. See text for full details.
|
| 241 |
+
|
| 242 |
+
<table><tr><td>Model</td><td>Standard CLEVR</td><td>10% CLEVR</td></tr><tr><td>MAC standard model (dimension 512)</td><td>98.9</td><td>84.5</td></tr><tr><td>dimension 256</td><td>98.4</td><td>76.3</td></tr><tr><td>dimension 128</td><td>97.6</td><td>77.0</td></tr><tr><td>w/o control</td><td>55.6</td><td>51.5</td></tr><tr><td>w/o word-attention</td><td>95.3</td><td>63.2</td></tr><tr><td>full-question-as-control</td><td>80.7</td><td>65.0</td></tr><tr><td> w/o positional encoding</td><td>99.1</td><td>80.0</td></tr><tr><td>linear position encoding</td><td>99.0</td><td>83.2</td></tr><tr><td>identity writing unit</td><td>98.5</td><td>84.5</td></tr><tr><td>only-gating writing unit</td><td>99.3</td><td>83.1</td></tr><tr><td>+ self-attention</td><td>83.2</td><td>99.2</td></tr><tr><td>+ gating</td><td>99.4</td><td>83.1</td></tr><tr><td> + self-attention and gating</td><td>99.5</td><td>85.5</td></tr><tr><td>gate bias 0</td><td>98.7</td><td>84.9</td></tr><tr><td>gate bias 1</td><td>99.4</td><td>68.5</td></tr><tr><td>gate bias -1</td><td>99.0</td><td>77.1</td></tr><tr><td>unshared weights</td><td>97.8</td><td>67.5</td></tr><tr><td>prediction without question information</td><td>97.8</td><td>64.7</td></tr></table>
|
| 243 |
+
|
| 244 |
+
Network Length. We have tested the model performance as a function of the network’s length – the number of MAC cells that were sequenced together. The results show the positive correlation between the network length and its performance. We can see that for 1 cell the scores are relatively $1 0 \mathrm { w } - 7 5 \%$ , but adding at least one more cell leads to a significant increase in performance above $9 5 \%$ . The performance keeps improving up to lengths 8-16 that achieve $9 8 . 9 – 9 9 . 1 \%$ . The results also teach us about the complexity of the dataset, by showing the relatively significant benefits of having at least 4 cells, each modeling a reasoning step.
|
| 245 |
+
|
| 246 |
+
Network Dimension. We have varied the state dimension to check the robustness of the model to hyperparameters. The results on the standard CLEVR dataset show the model is able to maintain high performance with dimension of 128, albeit after a longer training process, achieving $9 7 . 6 \%$ , compared to $9 8 . 9 4 \%$ achieved with dimension of 512. However, for $10 \%$ of CLEVR, the larger 512-dimension allows accuracy increase by $7 . 5 \%$ over dimension of 128.
|
| 247 |
+
|
| 248 |
+
Weight Sharing. We have tested the impact of sharing weights between cell has on the model performance for network of length $p = 1 2$ . The results show that for the standard dataset there is only a small difference between these settings of $1 \%$ . However, for less data, we see much more significant drop $1 6 . 9 \%$ in the unshared-parameters setting compared to the shared one. Indeed, we observe that a model with less parameter is more data-efficient and has a lower tendency to overfit the data.
|
| 249 |
+
|
| 250 |
+
Control Unit. We have performed several ablations in the control unit to understand its contribution to the overall model performance. Based on the results, first, we can see the the question information is crucial for the model to handle the questions, as can be noted by the low performance of the model when there is no use of control signal whatsoever. Second, we have tested the model performance when using the continuous control state computed by question (2) in section 3.2.1, without having word-attention, in order to understand its relative contribution. Based on the results, we can indeed see that using word-attention is useful for accelerating the training process and achieving higher accuracies both for the standard dataset as well as for the small subset, where using word-attention increases results in $2 1 . 4 \%$ . We also see that using the “contextual words” produced by the questionunit LSTM is useful in accelerating the model performance, when compared to using the wordvectors directly.
|
| 251 |
+
|
| 252 |
+
Reading Unit. We have conducted several ablations for the reading unit to better understand its behavior and contribution to the performance of the model. The standard MAC reading unit uses the control state – which averages the question words based on attention distributions computed per each reasoning step. In this ablation experiment, we have tested using the full question representation $q$ instead across all reasoning steps to gain better understanding of the the contribution of wordattention to the model performance. Indeed, we can see that using $q$ rather then the control state $c _ { i }$ results in a significant drops in performance $- 1 9 . 4 \%$ for the full CLEVR dataset and $1 9 . 5 \%$ for $10 \%$ of the data.
|
| 253 |
+
|
| 254 |
+
We have conducted additional ablation experiment to better understand the contribution of using the KB features directly in the first-stage information retrieval process described in section 3.2.2, compared to using only the dot-products of the KB elements with the previous memory state $m _ { i - 1 }$ . For the full CLEVR dataset, we can see that this component has only a small impact in the final performance - ultimately resulting in $0 . 0 6 \%$ performance difference. However, for the $10 \%$ of the data, we can see that the difference in performance when ablating this component is much larger - $1 1 . 2 \%$ .
|
| 255 |
+
|
| 256 |
+
Writing Unit Ablations. In our main MAC model variant, the memory unit merges the new information $m _ { n e w }$ with the previous memory state $m _ { i - 1 }$ by combining them through a linear transformation. In this experiment, we have explored other variations, such as assigning $m _ { n e w }$ to $m _ { i }$ directly – ignoring previous memories, or doing a linear transformation based on $m _ { n e w }$ only. The results show that in fact such variant is only slightly worse than our main variant – $0 . 4 \%$ . We also conducted an experiment in which we merge the new information with the previous memory just by a having a gate that does a weighted average of them. The results show that this variant performs equivalently to our standard linear-transformation variant.
|
| 257 |
+
|
| 258 |
+
Writing Unit Additions. We have explored the impact of the writing unit variants described in section 3.2.3 – adding self-attention, gating mechanisms, or both, compared to our standard main model that uses a linear transformation to merge the newly retrieved information $m _ { n e w }$ with the previous memory $m _ { i }$ . For the complete CLEVR dataset we can see that indeed both these variants are very helpful in increasing the model performance. Compared to our standard MAC model that achieves $9 8 . 9 4 \%$ on the validation set, self-attention yields accuracy of $9 9 . 2 3 \%$ , gating yields $9 9 . 3 6 \%$ and adding both achieves $9 9 . 4 8 \%$ .
|
| 259 |
+
|
| 260 |
+
Output Unit. In our standard model, the final predictions made in the output unit are based on the final memory state $m _ { p }$ as well as question representation $q$ (stands for the final hidden states of the backward and forwards passes of the LSTM). We have explored the contribution of basing the model prediction on the latter, by testing the model performance when prediction is based on memory alone, for the complete and $10 \%$ datasets. We can see that in both settings basing the model’s predictions on the question representation allows faster training and higher accuracies. Notable is the gap in performance for the $10 \%$ CLEVR - $1 9 . 8 \%$ increase by using the question representation to make predictions. These results are very reasonable intuitively, since the model is structured such that the memory holds only information that was retrieved from the image. Thus, questions that may ask for instance on different aspects (such as color or shape) of the same object in the image may result in the same memory content, which is thus does not directly contain enough information to respond such questions.
|
| 261 |
+
|
| 262 |
+
Position. In our standard model, similarly to the practice of competing models (Santoro et al., 2017; Perez et al., 2017; Hu et al., 2017), we have concatenated positional information to each region of the image, in order to increase the model capability to perform spatial reasoning. We have explored both simple linear maps at a constant $[ - 1 , 1 ]$ as well as more complex positional encoding suggested by (Vaswani et al., 2017). However, the results for both the standard dataset and the $10 \%$ version show a very negligible improvement at best when adding positional encoding information, demonstrating the capability of MAC to perform spatial reasoning without data augmentation.
|
| 263 |
+
|
| 264 |
+
Gate Bias Initialization. For our model variant with gating mechanism (described in section 3.2.3) we have tested the effect of setting different values for the gate bias - $- 1 , 0$ and 1. for $- 1$ the model is initialized to biased for keeping the previous memory value whereas for 1 it will be biased for using the new memory instead. We can see that for the complete dataset setting the bias to 1 is optimal – apparently since the model has enough data to learn to apply each cell effectively. In contrast, for the small $10 \%$ CLEVR data, setting the bias to 0 shows better performance, biasing the model to using less cells overall which results ultimately in a theoretically-simpler model that can fit less data more effectively.
|
| 265 |
+
|
| 266 |
+
# 4.4 INTERPRETABILITY
|
| 267 |
+
|
| 268 |
+
We have looked into attention maps over the image and question that the model produces during its computation and provide a few examples in figure 4.4. The first example shows us how the model parses the question in steps, first focusing on the main entity that the question is about, then on
|
| 269 |
+
|
| 270 |
+
relation of this entity to the “brown matte thing” which is then located in the image. Finally, the model correctly focuses on the small brown cube and predicts the right answer – brown.
|
| 271 |
+
|
| 272 |
+
The second example shows a model with 4 cells instead of 6, that similarly parse the question in iterations and focuses on the relevant objects at each step, though we can see that the reasoning process looks somewhat different when the MAC network has fewer cells.
|
| 273 |
+
|
| 274 |
+
The last example shows how how the model handles counting and OR operations. It starts from identifying the task - computing a number, and then red objects as well as the cylinder, one at a time, allowing it ultimately to respond correctly, with the answer 2.
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
|
| 278 |
+
Figure 8: Three examples of attention maps for the image and the question. See text for full details.
|
| 279 |
+
|
| 280 |
+
# 5 CONCLUSION
|
| 281 |
+
|
| 282 |
+
We have given a first demonstration of how a sequence of Memory, Attention and Control (MAC) cells combined into a Compositional Attention Network provides a very effective tool for neural reasoning. In future work, we wish to explore this promising architecture for other tasks and domains, including real-world VQA, machine comprehension and textual question answering.
|
| 283 |
+
|
| 284 |
+
# REFERENCES
|
| 285 |
+
|
| 286 |
+
Aishwarya Agrawal, Dhruv Batra, and Devi Parikh. Analyzing the behavior of visual question answering models. arXiv preprint arXiv:1606.07356, 2016.
|
| 287 |
+
|
| 288 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 39–48, 2016a.
|
| 289 |
+
|
| 290 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to compose neural networks for question answering. arXiv preprint arXiv:1601.01705, 2016b.
|
| 291 |
+
|
| 292 |
+
Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2425–2433, 2015.
|
| 293 |
+
|
| 294 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 295 |
+
|
| 296 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 297 |
+
|
| 298 |
+
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.
|
| 299 |
+
|
| 300 |
+
Alex Graves, Navdeep Jaitly, and Abdel-rahman Mohamed. Hybrid speech recognition with deep bidirectional lstm. In Automatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on, pp. 273–278. IEEE, 2013.
|
| 301 |
+
|
| 302 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
|
| 303 |
+
|
| 304 |
+
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538 (7626):471–476, 2016.
|
| 305 |
+
|
| 306 |
+
Akshay Kumar Gupta. Survey of visual question answering: Datasets and techniques. arXiv preprint arXiv:1705.03865, 2017.
|
| 307 |
+
|
| 308 |
+
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.
|
| 309 |
+
|
| 310 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 311 |
+
|
| 312 |
+
Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. arXiv preprint arXiv:1704.05526, 2017.
|
| 313 |
+
|
| 314 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 315 |
+
|
| 316 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. arXiv preprint arXiv:1612.06890, 2016.
|
| 317 |
+
|
| 318 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. arXiv preprint arXiv:1705.03633, 2017.
|
| 319 |
+
|
| 320 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 321 |
+
|
| 322 |
+
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.
|
| 323 |
+
|
| 324 |
+
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 International Conference on Machine Learning, pp. 1378–1387, 2016.
|
| 325 |
+
|
| 326 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 327 |
+
|
| 328 |
+
Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In Advances In Neural Information Processing Systems, pp. 289– 297, 2016.
|
| 329 |
+
|
| 330 |
+
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.
|
| 331 |
+
|
| 332 |
+
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), pp. 1532–1543, 2014.
|
| 333 |
+
|
| 334 |
+
Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. arXiv preprint arXiv:1709.07871, 2017.
|
| 335 |
+
|
| 336 |
+
Adam Santoro, David Raposo, David GT Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. arXiv preprint arXiv:1706.01427, 2017.
|
| 337 |
+
|
| 338 |
+
Rupesh Kumar Srivastava, Klaus Greff, and Jurgen Schmidhuber. Highway networks. ¨ arXiv preprint arXiv:1505.00387, 2015.
|
| 339 |
+
|
| 340 |
+
Bob L Sturm. A simple method to determine if a music information retrieval system is a horse. IEEE Transactions on Multimedia, 16(6):1636–1644, 2014.
|
| 341 |
+
|
| 342 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 343 |
+
|
| 344 |
+
Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic memory networks for visual and textual question answering. In International Conference on Machine Learning, pp. 2397–2406, 2016.
|
| 345 |
+
|
| 346 |
+
Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked attention networks for image question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 21–29, 2016.
|
| 347 |
+
|
| 348 |
+
SUPPLEMENTARY MATERIAL
|
| 349 |
+
|
| 350 |
+
# A DETAILS OF INPUT UNIT
|
| 351 |
+
|
| 352 |
+
The input unit processes the raw inputs given to the system into distributed vector representations. It receives a text question (or in general, a query), and an image (or in general, a Knowledge Base (KB)) and processes each of them with a matching sub-unit. Here we provide details of the Query Unit and the Image Unit used in this work.
|
| 353 |
+
|
| 354 |
+
# A.0.1 THE QUERY UNIT
|
| 355 |
+
|
| 356 |
+
We encode a query of $S$ words into a continuous representation using a bidirectional LSTM (Hochreiter & Schmidhuber, 1997; Graves et al., 2013). Each word is associated with a word embedding $w _ { s }$ , where $s = 1 , . . . , S$ . In our case, we use GloVE words embeddings (Pennington et al., 2014). Then, these embeddings are processed by a bidirectional LST M of dimension $d$ that outputs:
|
| 357 |
+
|
| 358 |
+
• a matching sequence of $d$ -dimensional output states, which we refer to as contextual words, $[ c w _ { 1 } , . . . , c w _ { S } ]$ • $d$ -dimensional hidden state $q = [ \overleftrightarrow { \lambda \omega _ { 1 } } , \overrightarrow { c w _ { S } } ]$ , the concatenation of the hidden states from the backward and forward passes. We refer to $q$ as the question representation.
|
| 359 |
+
|
| 360 |
+
Intuitively, each contextual word $c w _ { s }$ represents the meaning of $s ^ { t h }$ word, in the context of the question, while the hidden state $q$ represents the overall (compositional) meaning of the question.
|
| 361 |
+
|
| 362 |
+
# A.0.2 THE IMAGE UNIT
|
| 363 |
+
|
| 364 |
+
Given an image, and following prior work on CLEVR (?Santoro et al., 2017; Perez et al., 2017), we extract conv4 features from ResNet101 (He et al., 2016) pretrained on ImageNet (Krizhevsky et al., 2012) which we treat as a fixed initial representation of the image, $x$ of dimension $H , W , C$ where $H = W = 1 4$ are the height and width of the transformed image and $C = 1 0 2 4$ is the number of channels. Each feature $x _ { h , w }$ represents one region in the original image.
|
| 365 |
+
|
| 366 |
+
Similar to prior work (Hu et al., 2017; Santoro et al., 2017; Perez et al., 2017), we would like to allow our model to reason explicitly about spatial locations, as required by many of the questions in CLEVR, and therefore we concatenate to this representation a spatial map that represents each of the positions in the image. However, in contrast to prior work that uses a linear meshgrid feature map with 2 features $h$ and $w$ ranging from $- 1$ to 1, and to allow better representation of the positions, we use the positional encoding scheme proposed by Vaswani et al. (2017):
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\begin{array} { l } { p _ { ( h , 2 i ) } = \sin { \Big ( h / 1 0 0 0 0 ^ { 2 i / p _ { d } } \Big ) } } \\ { p _ { ( h , 2 i + 1 ) } = \cos { \Big ( h / 1 0 0 0 0 ^ { 2 i / p _ { d } } \Big ) } } \end{array}
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
And similarly for $w$ , where $p _ { d }$ is a hyperparameter. Overall, the positional encoding of a feature at position $( h , w )$ is $[ p _ { h } , p _ { w } ]$ , the concatenation of the positional encodings for $h$ and $w$ .
|
| 373 |
+
|
| 374 |
+
This positional encoding scheme allows better correspondence between the distance of 2 positions $( x , y )$ and $( x , y )$ in the image and a vector similarity of their positional encodings, even when $p _ { d }$ is larger than two.
|
| 375 |
+
|
| 376 |
+
We then concatenate the obtained spatial map with $x$ , receiving a spatially-aware image representation $x _ { p }$ . Then, we pass this representation through two CNN layers with $d$ output channels and obtain a final representation of the image, which we refer to as our Visual Knowledge Base $( K B _ { V }$ that is used in further components of the model.
|
| 377 |
+
|
| 378 |
+
# B IMPLEMENTATION AND TRAINING DETAILS
|
| 379 |
+
|
| 380 |
+
For the question processing, we use GloVE (Pennington et al., 2014) word-vectors with dimension 300. For the image processing, we extract conv4 features from ResNet101 (He et al., 2016) pretrained on ImageNet (Krizhevsky et al., 2012), with dimension $H , W , C$ where $H = W = 1 4$ and $C = 1 0 2 4$ , followed by 2 CNN layers with kernel size 2. We use MAC network with $p = 1 2$ cells, and train it using Adam (Kingma & Ba, 2014), with learning rate $1 0 ^ { - 4 }$ . We train our model for $1 0 - 2 0$ epochs, with batch size 64, and use early stopping based on validation accuracies. During training, the moving averages of all weights of the model are maintained with the exponential decay rate of 0.999. At test time, the moving averages instead of the raw weights are used. We use dropout 0.85, and ELU (Clevert et al., 2015) which in our experience has reduce the training process compared to RELU.The training process takes roughly 10-20 hours on a single Titan X GPU.
|
| 381 |
+
|
| 382 |
+
# C FURTHER DISCUSSION OF RELATED WORK
|
| 383 |
+
|
| 384 |
+
In this section we provide detailed discussion of related work. Several models have been applied to the CLEVR task. These can be partitioned into two groups, module networks that use the strong supervision provided as a tree-structured functional program associated with each instance, and end-to-end, fully differentiable networks that combine a fairly standard stack of CNNs with components that aid them in performing reasoning tasks. We also discuss the relation of MAC to other approaches, such as memory networks and neural computers.
|
| 385 |
+
|
| 386 |
+
# C.1 MODULE NETWORKS
|
| 387 |
+
|
| 388 |
+
The modular approach (Andreas et al., 2016a;b; Hu et al., 2017; Johnson et al., 2017) first translates the given question into a tree-structured action plan, aiming to imitate the ground-truth programs provided as a form of strong-supervision. Then, it constructs a tailor-made network that executes the plan on the image in multiple steps. This network is composed of discrete units selected out of a collection of predefined modules, each responsible for an elementary reasoning operation, such as identifying an objects color, filtering them for their shape, or comparing two amounts. Each module has its own set of learned parameters (Johnson et al., 2017), or even hand-crafted design (Andreas et al., 2016a) to guide it towards its intended behavior.
|
| 389 |
+
|
| 390 |
+
Overall, this approach makes discrete choices at two levels: the identity of each module – the behavior it should learn among a fixed set of possible types of behaviors, and the network layout – the way in which these modules are wired together to compute the answer progressively. Hence, their differentiability is confined to the boundaries of a single module, disallowing end-to-end training.
|
| 391 |
+
|
| 392 |
+
Several key differences exist between our approaches. First, our model replaces the fixed modules collection with one versatile and universal cell that shares both its architecture and parameters across all of its instantiations, and is applied across all the reasoning steps. Second, it replaces the dynamic recursive tree structures with a sequential topology, augmented by soft attention mechanisms, as done in Bahdanau et al. (2014). This confers our network with a virtual capacity to represent arbitrarily complex Directed Acyclic Graphs (DAGs) while still having efficient and readily deployed physical sequential structure. Together, both of these relaxations allow us to effectively train our model end-to-end by backpropagation alone, whereas module networks demand a more involved training scheme that relies on the strongly-supervised programs at the first stage, and on various Reinforcement Learning (RL) techniques at the second. Furthermore, while our model can be train without the strong supervisory programs, developing adaptive reasoning skills to address the task is it trained for, the modular approach reliance on questions structured and formal representation hinder its applicability to real-world tasks.
|
| 393 |
+
|
| 394 |
+
# C.2 AUGMENTED CONVOLUTIONAL NEURAL NETWORKS
|
| 395 |
+
|
| 396 |
+
Alternative approaches for the CLEVR task that do not rely on the provided programs as a strong supervision signal are Santoro et al. (2017) and Perez et al. (2017). Both complement standard multi-layer Convolutional Neural Networks (CNNs) with components that aid them in handling compositional and relational questions.
|
| 397 |
+
|
| 398 |
+
Relational Networks. Santoro et al. (2017) appends a Relation Network (RN) layer to the CNN. This layer inspects all pairs of pixels in the image, thereby enhancing the network capacity to reason over binary relations between objects. While this approach is very simple and elegant conceptually, it suffers from quadratic computational complexity, in contrast to our and other leading approaches. But beyond that, closer inspection reveals that this direct pairwise comparison might be unnecessary. Based on the analogy suggested by Santoro et al. (2017), according to which pixels are equivalent to objects and their pairwise interactions to relations, a RN layer attempts to grasp the induced graph between objects all at once in one shallow and broad layer. Conversely, our attention-based model proceeds in steps. It basically compares the image to its current memory and control for this step, aggregates the attended regions into the new memory, and repeats the process. By the same analogy, it traverses a narrow and deep path, progressively following transitive relations. Consequently, our model exhibits a relational capacity while circumventing the computational inefficiency.
|
| 399 |
+
|
| 400 |
+
FiLM. FiLM (Perez et al., 2017) is a recently proposed method that interleaves standard CNN layers that process the given image with linear layers, reminiscent of layer normalization techniques (Ba et al., 2016; Ioffe & Szegedy, 2015). Each of these layers, called FiLM, is conditioned on the question: the question words are processed by a GRU, and its output is linearly transformed into matching biases and variances for each of the CNN layers, tilting its activations to reflect the specifics of the given question and affect the computation done over the image.
|
| 401 |
+
|
| 402 |
+
Similarly to our model, this approach features distant modulation between the question and the image, where rather than being fused together into the same vector space, the question can affect the image processing only through constrained means – for the case of FiLM – linear transformations. However, since the same transformation is applied to all the activations homogeneously, agnostic to both their spatial location as well as the features values, this approach does not allow the question to differentiate between regions in the image based on the objects or concepts they represent – on the content of the image. This stands in stark contrast to our attention-based model, which readily allows and actually encourages the question to inform the model about relevant regions to focus on. We speculate that this still distant, yet more direct interaction between the question and the data, or image, for the case of VQA, facilitates learning and increases generalizability. It may be more suitable to VQA tasks, and CLEVR in particular, where the questions demand the responder to focus on specific objects, and reason about their properties or relations, rather than respond based only on a holistic view of the image that may lead to sub-optimal results (Yang et al., 2016), as is the case of FiLM. Indeed, as demonstrated in 4, there is significant evidence showing our models better generalization capacity, allowing it to achieve high accuracies much faster, and from less data than FiLM and other competing methods.
|
| 403 |
+
|
| 404 |
+
# C.3 MEMORY AND ATTENTION
|
| 405 |
+
|
| 406 |
+
Our architecture draws inspiration from recent research on memory and attention (Kumar et al., 2016; Xiong et al., 2016; Graves et al., 2014; 2016). Kumar et al. (2016); Xiong et al. (2016) propose the Dynamic Memory Network model that proceeds in an iterative process, applying soft attention to retrieve relevant information from a visual or textual KB, which is in turn accumulated into memory passed from one iteration to the next. However, in contrast to our model, it views the question as an atomic unit, whereas our model decomposes it into a multi-step action plan informing each cell in our sequential network about its current objective. Another key difference is the distant interaction between the question and the KB that characterizes our model. Conversely, DMN fuses their corresponding representations together into the same vector space.
|
| 407 |
+
|
| 408 |
+
Graves et al. (2016; 2014) complements a neural network with a memory array it can interact with, through the means of soft attention. Analogously to our model, it partitions the model into a core neural network, called controller, as well as reading and writing heads that interact with external memory array. However, a main point distinguishing our model from this approach, is the use of dynamic memory, as in Kumar et al. (2016), instead of a fixed-array memory. Each MAC cell is associated with a memory state, our reading unit inspects only the latest memory passed from the previous state, and our writing unit creates a new memory state rather than writing to multiple slots in a fixed shared external memory. Notably, our approach is much more reminiscent of the widely successful RNN structure, rather than to Graves et al. (2016; 2014) .
|
| 409 |
+
|
| 410 |
+
Finally, our approach has potential ties to the VQA models Hu et al. (2017); Lu et al. (2016) which also attend both the to question words and the image while progressively addressing the given question. However, both of these models have distinct specialized designs for each of their attention layers or modules, and have a discrete or fixed layout in which they are composed together. In contrast, our approach relax both of these limitations, having one universal cell design and one universal self-attending sequential network layout.
|
| 411 |
+
|
| 412 |
+
# C.4 ATTENTION VS. CONVOLUTION
|
| 413 |
+
|
| 414 |
+
Compared to other leading methods, our model stands out by being heavily based on soft attention, whereas most competing approaches are CNN-based, surprisingly lack any attention mechanism. Since attention is commonly used in models designed for standard VQA (Antol et al., 2015; Gupta, 2017; Lu et al., 2016; Yang et al., 2016), it is reasonable to assume that it would be beneficial to incorporate such methods into visual reasoning systems for the CLEVR task as well. In fact, attention mechanisms should be especially useful for multi-step reasoning questions such as those present in CLEVR. Such questions refer to several relations between different objects in the image and feature compositional structure that may be approached one step at a time. Thus, it should be beneficial for a cogent responder to have the capacity to selectively focus on on one or some objects at each step, traversing the relevant relational links one after the other, both at the image level, and at the question level.
|
| 415 |
+
|
| 416 |
+
Moreover, attention mechanisms enhance our model’s ability to perform reasoning skills that pertain to aggregation of information across different regions, such as counting, finding maximum value, or performing other reduction operations over information that is spread across the image. Indeed, as discussed in 4, all existing models for visual reasoning, most of which lacking any attention mechanism, struggle with the counting and numerical comparisons questions present in CLEVR. Conversely, our model proves much more capable of performing these reasoning skills, outperforming the other approaches by a wide margin. Noticeably, incorporating soft attention into our model makes it much more adept at performing such aggregation reasoning skills, successfully addressing the this type of questions.
|
| 417 |
+
|
| 418 |
+
Finally, as pointed out by Lu et al. (2016); Yang et al. (2016), soft attention confers the model with robustness to noise introduced from irrelevant information presents in the image, and higher capacity for handling larger and more diverse vocabulary, the latter being demonstrated in 4. It allows the model to separate the wheat from the chaff, selectively attending to the relevant information only, and arguably, being more resilient to both visual and linguistic variations.
|