diff --git a/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_content_list.json b/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..90770025a684064d150c569944ffe344dcf53016 --- /dev/null +++ b/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5e22f3a22921e4b5e509ebcced35c4aeb8ec5b2b95cacea8bb19351e310d8fc +size 95859 diff --git a/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_model.json b/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fbb768956396f5a716ac85e5d73015f96a5b215f --- /dev/null +++ b/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a36135f8b4be9422ae0d287bc30a7ca57923372c39db91e635a794be9091888b +size 115410 diff --git a/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_origin.pdf b/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..89caad5a9d697e292e53464c9a532cc3055995f6 --- /dev/null +++ b/informationbottleneckexactanalysisofquantizedneuralnetworks/f90d8ccd-bde8-47d2-8a2b-669281f54c48_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c6252516da670703b42a6d29ee04e5dea0c2465652184b302b164ec05d973aa +size 23746068 diff --git a/informationbottleneckexactanalysisofquantizedneuralnetworks/full.md b/informationbottleneckexactanalysisofquantizedneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9f05971f50070873d0b4502b6027096aeb0811b1 --- /dev/null +++ b/informationbottleneckexactanalysisofquantizedneuralnetworks/full.md @@ -0,0 +1,362 @@ +# INFORMATION BOTTLENECK: EXACT ANALYSIS OF (QUANTIZED) NEURAL NETWORKS + +Stephan S. Lorenzen, Christian Igel & Mads Nielsen + +Department of Computer Science + +University of Copenhagen + +{lorenzen,igel,madsn}@di.ku.dk + +# ABSTRACT + +The information bottleneck (IB) principle has been suggested as a way to analyze deep neural networks. The learning dynamics are studied by inspecting the mutual information (MI) between the hidden layers and the input and output. Notably, separate fitting and compression phases during training have been reported. This led to some controversy including claims that the observations are not reproducible and strongly dependent on the type of activation function used as well as on the way the MI is estimated. Our study confirms that different ways of binning when computing the MI lead to qualitatively different results, either supporting or refusing IB conjectures. To resolve the controversy, we study the IB principle in settings where MI is non-trivial and can be computed exactly. We monitor the dynamics of quantized neural networks, that is, we discretize the whole deep learning system so that no approximation is required when computing the MI. This allows us to quantify the information flow without measurement errors. In this setting, we observed a fitting phase for all layers and a compression phase for the output layer in all experiments; the compression in the hidden layers was dependent on the type of activation function. Our study shows that the initial IB results were not artifacts of binning when computing the MI. However, the critical claim that the compression phase may not be observed for some networks also holds true. + +# 1 INTRODUCTION + +Improving our theoretical understanding of why over-parameterized deep neural networks generalize well is arguably one of main problems in current machine learning research (Poggio et al., 2020). Tishby & Zaslavsky (2015) suggested to analyze deep neural networks based on their Information Bottleneck (IB) concept, which is built on measurements of mutual information (MI) between the activations of hidden layers and the input and target (Tishby et al., 1999), for an overview see Geiger (2020). Shwartz-Ziv & Tishby (2017) empirically studied the IB principle applied to neural networks and made several qualitative observations about the training process; especially, they observed a fitting phase and a compression phase. The latter information-theoretic compression is conjectured to be a reason for good generalization performance and has widely been considered in the literature (Abrol & Tanner, 2020; Balda et al., 2018; 2019; Chelombiev et al., 2019; Cheng et al., 2019; Darlow & Storkey, 2020; Elad et al., 2019; Fang et al., 2018; Gabrie et al., 2019; Goldfeld et al., 2019; Jónsson et al., 2020; Kirsch et al., 2020; Tang Nguyen & Choi, 2019; Noshad et al., 2019; Schiemer & Ye, 2020; Shwartz-Ziv & Alemi, 2020; Wickström et al., 2019; Yu et al., 2020). The work and conclusions by Shwartz-Ziv & Tishby (2017) received a lot of critique, with the generality of their claims being doubted; especially Saxe et al. (2018) argued that the results by Shwartz-Ziv & Tishby do not generalize to networks using a different activation function. Their critique was again refuted by the original authors with counter-claims about incorrect estimation of the MI, highlighting an issue with the approximation of MI in both studies. + +Our goal is to verify the claims by Shwartz-Ziv & Tishby and the critique by Saxe et al. in a setting where the MI can be computed exactly. These studies consider neural networks as theoretical entities working with infinite precision, which makes computation of the information theoretic quantities problematic (for a detailed discussion we refer to Geiger, 2020, see also Section 3). Assuming + +continuous input distributions, a deterministic network using any of the standard activation functions (e.g., RELU, TANH) can be shown to have infinite MI (Amjad & Geiger, 2019). If an empirical input distribution defined by a data set $\mathcal{D}$ is considered (as it is the case in many of the previous studies), then randomly-initialized deterministic neural networks with invertible activation functions will most likely result in trivial measurements of MI in the sense that the MI is finite but always maximal, that is, equal to $\log |\mathcal{D}|$ (Goldfeld et al., 2019; Amjad & Geiger, 2019). In order to obtain non-trivial measurements of MI, real-valued activations are usually discretized by binning the values, throwing away information in the process. The resulting estimated MI can be shown to be highly dependent on this binning, we refer to Geiger (2020) for a detailed discussion. Instead of approximating the MI in this fashion, we take advantage of the fact that modern computers – and thus neural networks – are discrete in the sense that a floating point value can typically take at most $2^{32}$ different values. Because 32-bit precision networks may still be too precise to observe compression (i.e., information loss), we apply quantization to the neural network system to an extent that we can compute informative quantities, that is, we amplify the effect of the information loss due to the discrete computations in the neural network. One may argue that we just moved the place where the discretization is applied. This is true, but leads to a fundamental difference: previous studies applying the discretization post-hoc rely on the in general false assumption that the binned MI approximates the continuous MI well – and thus introduce measurement errors, which may occlude certain phenomena and/or lead to artifactual observations. In contrast, our computations reflect the true information flow in a network during training. Our study confirms that estimation of MI by binning may lead to strong artifacts in IB analyses and shows that: + +- Both fitting and compression phases occur in the output SOFTMAX layer. +- For the hidden layers, the fitting phase occurs for both TANH and RELU activations. +- When using TANH in the hidden layers, compression is only observed in the last hidden layer. +- When using RELU, we did not observe compression in the hidden layers. +- Even when applying low precision quantization, more complex networks with many neurons in each layer are observed to be too expressive to exhibit compression, as no information is lost. +- Our setting excludes that the MI approximation is the reason for these different IB dynamics. + +The next section introduces the IB concept with a focus on its application to neural networks including the critique and controversy as well as related work. Section 3 discusses issues relating to the estimation of MI, and the idea behind our contribution. Section 4 presents our experiments, results and discussion before we conclude in Section 5. + +# 2 THE INFORMATION BOTTLENECK + +Preliminaries. Given a continuous random variable (r.v.) $X$ with density function $p(x)$ and support $\mathcal{X}$ , the continuous entropy $\mathrm{H}(X)$ of $X$ is a measure of the uncertainty associated with $X$ and is given by $\mathrm{H}(X) = -\int_{\mathcal{X}} p(x) \log p(x) \, \mathrm{d}x$ . Given two r.v.s $X$ and $Y$ with density functions $p(x)$ and $q(y)$ and supports $\mathcal{X}$ and $\mathcal{Y}$ , the mutual information $\mathrm{I}(X; Y)$ of $X$ and $Y$ is a measure of the mutual "knowledge" between the two variables. The symmetric $\mathrm{I}(X; Y)$ is given by $\mathrm{I}(X; Y) = \int_{\mathcal{Y}} \int_{\mathcal{X}} p(x, y) \log \frac{p(x, y)}{p(x)p(y)} \, \mathrm{d}x \, \mathrm{d}y$ . In many cases it is impossible to compute the continuous entropy and MI for continuous r.v.s exactly, due to limited samples or computational limits, or because it may not be finite (Geiger, 2020). Instead, we often estimate the quantities by their discrete counterparts. When $X$ is a discrete r.v., we consider the Shannon entropy $\mathrm{H}(X) = -\sum P(x) \log P(x)$ . Correspondingly, the mutual information $\mathrm{I}(X; Y)$ of two discrete r.v.s $X, Y$ , is given by $\mathrm{I}(X; Y) = \sum_{x, y} P(x, y) \log \frac{P(x, y)}{P(x)P(y)}$ . We have the following useful identity for both the continuous and discrete MI: + +$$ +\mathrm {I} (X; Y) = \mathrm {H} (X) - \mathrm {H} (X | Y), \tag {1} +$$ + +where $\mathrm{H}(X|Y)$ is the conditional entropy of $X$ given $Y$ . + +IB Definition. The IB method was proposed by Tishby et al. (1999). It is an information theoretic framework for extracting relevant components of an input r.v. $X$ with respect to an output r.v. $Y$ . These relevant components are found by "squeezing" the information from $X$ through a bottleneck, in the form of an r.v. $T$ . In other words, $T$ is a compression of $X$ . The idea generalizes rate distortion theory, in which we wish to compress $X$ , obtaining $T$ , such that $I(X;T)$ is maximized subject to a constraint on the expected distortion $d(x,t)$ wrt. the joint distribution $p(x,t)$ (Tishby et al., 1999). In the IB framework, the distortion measure $d$ is replaced by the negative loss in MI between $T$ and the output $Y$ , $I(T;Y)$ . Both IB and rate distortion are lossy compression schemes. $^{1}$ + +The data processing inequality (DPI) $\operatorname{I}(Y;X) \geq \operatorname{I}(Y;T)$ holds for the IB; that is, the bottleneck r.v. cannot contain more information about the label than the input. + +One drawback of the information bottleneck method is the dependence on the joint distribution, $p(x,y)$ , which is generally not known. Shamir et al. (2010) addressed this issue and showed that the MI, the main ingredient in the method, can be estimated reliably with fewer samples than required for estimating the true joint distribution. As common in the IB literature, whenever we discuss the MI computed on a finite data set $\mathcal{D}$ , we assume that $p(x,y)$ corresponds to the empirical distribution defined by $\mathcal{D}$ , which is true for the experiments in Section 4.1. In practice, the assumption has to be relaxed to the data being drawn i.i.d. from $p(x,y)$ . However, any uncertainty resulting from the finite sample estimation in the latter case is not considered in our discussions. + +IB In Deep Learning. Tishby & Zaslavsky (2015) applied the IB concept to neural networks. They view the layers of a deep neural network (DNN) as consecutive compressions of the input. They consider the Markov chain + +$$ +Y \rightarrow X \rightarrow T _ {1} \rightarrow T _ {2} \rightarrow \ldots \rightarrow T _ {L} = \hat {Y}, +$$ + +where $T_{i}$ denotes the $i$ 'th hidden layer of the $L$ -layer network and $T_{L} = \hat{Y}$ denotes the output of the network. Again, the bottleneck must satisfy the DPI: + +$$ +\mathrm {I} (Y; X) \geq \mathrm {I} (Y; T _ {1}) \geq \mathrm {I} (Y; T _ {2}) \geq \dots \geq \mathrm {I} (Y; \hat {Y}), \tag {2} +$$ + +$$ +I (X; X) \geq I (X; T _ {1}) \geq I (X; T _ {2}) \geq \dots \geq I (X; \hat {Y}). \tag {3} +$$ + +Estimating the MI of continuous variables is difficult (Alemi et al., 2017), as evident from the many different methods proposed (Kriskov et al., 2004; Kolchinsky & Tracey, 2017; Noshad et al., 2019). In the discrete case, $\operatorname{I}(X;T)$ and $\operatorname{I}(T;Y)$ can be computed as + +$$ +\mathrm {I} (X; T) = \mathrm {H} (T) - \mathrm {H} (T | X) = \mathrm {H} (T), \tag {4} +$$ + +$$ +\mathrm {I} (T; Y) = \mathrm {I} (Y; T) = \mathrm {H} (T) - \mathrm {H} (T | Y), \tag {5} +$$ + +following from (1) and using in (4) the assumption that $T$ is a deterministic function of $X$ . However, for deterministic neural networks the continuous entropies may not be finite (Goldfeld et al., 2019; Saxe et al., 2018; Amjad & Geiger, 2019). + +Shwartz-Ziv & Tishby (2017) estimate the MI via (4) and (5) by discretizing $T$ and then computing the discrete entropy. They trained a network (shown in Figure 1a) on a balanced synthetic data set consisting of 12-bit binary inputs and binary labels. The network was trained for a fixed number of epochs while training and test error were observed. For every epoch and every layer $T$ , The discretization is done by binning of $T$ : Given upper and lower bounds $b_{u}, b_{l}$ , and $m \in \mathbb{N}$ , we let $B: \mathbb{R} \to [m]$ denote the binning operation, that maps $x \in [b_{l}, b_{u}]$ to the index of the corresponding bin from the set of $m$ uniformly distributed bins in $[b_{l}, b_{u}]$ . Overloading the notation, we apply $B$ directly to a vector in $\mathbb{R}^d$ in order to obtain the resulting vector in $[m]^d$ of bin indices. Using discretized $T' = B(T)$ , $\operatorname{I}(X; T')$ and $\operatorname{I}(T'; Y)$ are then computed directly by (4) and (5), using estimates of $P(T')$ , $P(Y)$ and $P(T'|Y)$ over all samples $\mathcal{D}$ of $X$ . + +Shwartz-Ziv & Tishby used the TANH activation function for the hidden layers, with $b_{l} = -1$ , $b_{u} = 1$ ( $b_{l} = 0$ for the output SOFTMAX layer) and $m = 30$ bins. The estimated I ( $X;T$ ) and I ( $T;Y$ ) are plotted in the information plane, providing a visual representation of the information flow in + +![](images/7f7fc31de4f0bc1127080cfb21fa03f011d6a439eec27da2a1c3d4741e78ed19.jpg) +(a) + +![](images/b2c055536c3c4821d92ffea1417264935d74ba391eaf0c947120a2c6342e389b.jpg) +(b) +Figure 1: (a) The network used in the standard setting, with the number of neurons in each fully connected layer. The output layer activation function is SOFTMAX, while either TANH or RELU is used for the hidden layers. (b) An example of an information plane for a 6 layer network, with the observed phases marked. Only the last three layers are distinguishable. + +the network during training (see example in Figure 1b). Based on the obtained results, Shwartz-Ziv & Tishby (2017) make several observations; one notable observation is the occurrence of two phases: an empirical risk minimization phase and a compression phase. The first phase, also referred to as fitting phase, is characterized by increasing $\mathrm{I}(T;Y)$ related to a decreasing loss. The subsequent compression phase is characterized by decreasing $\mathrm{I}(X;T)$ , and it has been argued that this compression leads to better generalization. + +Critique and Controversy. The work by Tishby & Zaslavsky (2015) and Shwartz-Ziv & Tishby (2017) has jump-started an increasing interest in the IB method for deep learning, with several papers investigating or extending their contributions, see the review by Geiger (2020). However, as mentioned, their work also received criticism. In particular, the compression phase as a general phenomenon has been called into question. Saxe et al. (2018) published a paper refuting several of the claims made by Shwartz-Ziv & Tishby (2017). They based their criticism on a replication of the experiment done by Shwartz-Ziv & Tishby (2017) where they replaced the bounded TANH activation function with the unbounded RELU activation function. When discretizing, they used the maximum activation observed across all epochs for the upper binning bound $b_{u}$ . The article claims that the two phases observed by Shwartz-Ziv & Tishby occurred because the activations computed using TANH saturate close to the boundaries $-1$ and $1$ . The claim is supported by experiments using RELU activations and $m = 100$ bins, in which the two phases are not observed. + +The critique paper by Saxe et al. was published at ICLR 2018, but started a discussion already during the review process the previous year, when Shwartz-Ziv & Tishby defended their paper in the online discussion forum OpenReview.net², posting a response titled “Data falsifying the claims of this ICLR submission all together” (Saxe et al., 2017). The response specifically states that “The authors don’t know how to estimate mutual information correctly”, referring to Saxe et al. (2018), and goes on to provide an example with a network using RELU activations, which does indeed exhibit the two phases. In response, Saxe et al. performed further experiments using different estimators for MI: a state-of-the-art non-parametric KDE approach (Kolchinsky & Tracey, 2017) and a $k$ -NN based estimator (Kriskov et al., 2004). The authors still did not observe the two phases claimed by Shwartz-Ziv & Tishby. + +Following the discussion on OpenReview.net, several other papers have also commented on the controversy surrounding the information bottleneck. Noshad et al. (2019) presented a new MI estimator EDGE, based on dependency graphs, and tested it on the specific counter example using + +RELU activations as suggested by Saxe et al. (2018), and they observed the two phases. Table I in the review by Geiger (2020) provides a nice overview over empirical IB studies and if the compression phase was observed (Darlow & Storkey, 2020; Jónsson et al., 2020; Kirsch et al., 2020; Noshad et al., 2019; Raj et al., 2020; Shwartz-Ziv & Tishby, 2017) or not (Abrol & Tanner, 2020; Balda et al., 2018; 2019; Tang Nguyen & Choi, 2019; Shwartz-Ziv & Alemi, 2020; Yu et al., 2020) or the results were mixed (Chelombiev et al., 2019; Cheng et al., 2019; Elad et al., 2019; Fang et al., 2018; Gabrié et al., 2019; Goldfeld et al., 2019; Saxe et al., 2018; Schiemer & Ye, 2020; Wickstrøm et al., 2019). In conclusion, an important part of the controversy surrounding the IB hinges on the estimation of the information-theoretic quantities – this issue has to be solved before researching the information flow. + +Related Work. The effect of estimating MI by binning has been investigated before, we again refer to Geiger (2020) for a good overview and discussion. Shwartz-Ziv & Alemi (2020) consider infinite ensembles of infinitely-wide networks, which renders MI computation feasible, but do not observe a compression phase. Chelombiev et al. (2019) applies adaptive binning, which, while less prone to issues caused by having the "wrong" number of bins, is still an estimation and thus also suffers from the same problems. Goldfeld et al. (2019) explores IB analysis by use of stochastic neural networks which allow them to show that the compression phase in these noisy networks occurs due to clustering of the hidden representations. While theoretically interesting, the stochastic neural networks are still qualitatively different from deterministic ones and thus not directly applicable in practice. Raj et al. (2020) conducted an IB analysis of binary networks, where both the activations and weights can only be $\pm 1$ , which allows for exact computation of MI. The binary networks are significantly different from the networks used in the original studies, whereas applying the IB analysis to quantized versions of networks from these studies allows for a more direct comparison. At a first glance, the work by Raj et al. (2020) could be viewed as taking our approach to the extreme. However, the computations and training dynamics of the binary networks are qualitatively different from our study and the original IB work. For example, the binary networks require modifications for gradient estimation (e.g., Raj et al. consider straight-through-estimator, approximate sign, and swish sign). + +# 3 ESTIMATING ENTROPY AND MUTUAL INFORMATION IN NEURAL NETWORKS + +The IB principle is defined for continuous and discrete input and output, however continuous MI in neural networks is in general infeasible to compute, difficult to estimate, and conceptually problematic. + +# 3.1 Binning and LOW COMPRESSION IN PRECISE NETWORKS + +Consider for a moment a deterministic neural network on a computer with infinite precision. Assuming a constant number of training and test patterns, a constant number of update steps, invertible activation functions in the hidden layers and pairwise different initial weights (e.g., randomly initialized). Given any two different input patterns, two neurons will have different activations with probability one (Goldfeld et al., 2019; Geiger, 2020). Thus, on any input, a hidden layer $T$ will be unique, meaning that, when analysing data set $\mathcal{D}$ , all observed values of $T$ will be equally likely, and the entropy $\mathrm{H}(T)$ will be trivial in the sense that it is maximum, that is, $\log |\mathcal{D}|$ . + +However, when applying the binning $T' = B(T)$ , information is dropped, as $B$ is surjective and several different continuous states may map to the same discrete state; for $m$ bins and $d_{T}$ neurons in $T$ the number of different states of $T'$ is $m^{d_{T}}$ , and thus more inputs from $\mathcal{D}$ will map to the same state. As a consequence, the estimated entropy is decreased. Furthermore, the rate of decrease follows the number of bins; the smaller the number of bins $m$ , the smaller the estimated $\mathrm{H}(T)$ (as more values will map to the same state). The entropy $\mathrm{H}(T')$ , and therefore $\mathrm{I}(X; T')$ in deterministic networks, is upper bounded by $d_{T} \log m$ . Thus, changing the number of bins used in the estimation changes the results. We also refer to Geiger (2020) for a more detailed discussion of this phenomenon3. + +Computations in digital computers are not infinitely precise, a 32-bit floating point variable, for instance, can take at most $2^{32}$ different values. In theory, this means that we can actually consider the states of a neural network discrete and compute the exact MI directly. In practice, we expect the precision to be high enough, that - when using invertible activation functions - the entropy of the + +layers will be largely uninformative, as almost no information loss/compression will occur. However, using low precision quantized neural networks, we can compute the exact MI in the network without $\mathrm{H}(T)$ being trivial – what we regard as the ideal setting to study IB conjectures. + +# 3.2 EXACT MUTUAL INFORMATION IN QUANTIZED NETWORKS + +Quantization of neural networks was originally proposed as a means to create more efficient networks, space-wise and in terms of inference running time, for instance to make them available on mobile devices (Jacob et al., 2018; Hubara et al., 2017). The idea is to use low precision $k$ -bit weights (typically excluding biases) and activations, in order to reduce storage and running time. For our use case, we are mainly interested in quantized activations, as they contain the information that is moving through the network. + +The naive approach is to quantize after training (post-training quantization). In terms of estimating the entropy/MI, this corresponds to applying a binning with $2^{k}$ bins to the non-quantized activations as done in the previous studies (Shwartz-Ziv & Tishby, 2017; Saxe et al., 2018), as information available to the network at the time of training is dropped, and thus we expect it to show similar artifacts. Instead, we investigate networks trained using quantization aware training (QAT), in which activations are quantized on the fly during training (Jacob et al., 2018). Specifically, forward passes are quantized while backward passes remain non-quantized. However, the IB and all MI computations in the quantized networks only refer to quantized quantities (i.e., forward pass computations) and thus measure the true information in the network at the considered training step. The actual quantization happens after each layer (after application of the activation function). During training, the algorithm keeps track of the minimum $a_{l}^{(T)}$ and maximum $a_{u}^{(T)}$ activations in each layer $T$ across the epoch, and the activation of each neuron in $T$ is mapped to one of $2^{k}$ uniformly distributed values between $a_{l}^{(T)}$ and $a_{u}^{(T)}$ , before being passed to the next layer (Jacob et al., 2018). Thus for each epoch, the neurons in a layer $T$ take at most $2^{k}$ different values, meaning at most $2^{kd_{T}}$ different states for $T$ (because of the SOFTMAX activation function the effective number of states is $2^{k(d_{Y}-1)}$ for the final layer $\hat{Y}$ ). + +# 4 EXPERIMENTS + +We conducted the exact bottleneck analysis in two different setups: + +- The setting of Shwartz-Ziv & Tishby (2017) and Saxe et al. (2018) using the network shown in Figure 1a with either TANH or RELU activations, fitted on the same synthetic data set consisting of $|\mathcal{D}| = 2^{12}$ 12-bit binary input patterns with balanced binary output (Section 4.1). +- Learning a two-dimensional representation for the MNIST handwritten digits, where a fully connected network similar to the one in the previous setting using a bottleneck architecture with RELU activations for all hidden layers is trained (Section 4.2). + +For each setting, we applied $k = 8$ bit quantization aware training to the given network. As in previous studies (Shwartz-Ziv & Tishby, 2017; Saxe et al., 2018), we used an $80\% / 20\%$ training/test split to monitor fitting, while computing the MI based on the entire data set (training and test data). The networks were trained using mini batches of size 256 and the Adam optimizer with a learning rate of $10^{-4}$ . Weights of layer $T$ were initialized using a truncated normal with mean 0 and standard deviation $1 / \sqrt{d_T}$ . + +In addition, we also replicated the experiments of Shwartz-Ziv & Tishby (2017) and Saxe et al. (2018) using varying number of bins, and we investigated 32- and 4-bit quantization. We also considered IB analysis of a few other architectures for the MNIST task, including architectures with wider bottlenecks, without a bottleneck, and using convolutions. These experiments are described in Supplementary Material A, C, and E. + +Our implementation is based on Tensorflow (Abadi et al., 2016). Experiments were run on an Intel Core i9-9900 CPU with 8 3.10GHz cores and a NVIDIA Quadro P2200 GPU.4. + +![](images/62fc9f4dd5b15a5c0cfc1e9ec687ee5c2087fc221fa2fcae3960260dd888419f.jpg) +Figure 2: The quantized TANH network, trained in the standard setting with the discrete MI computed exactly. The full information plane (left) and the upper right area (right) are shown. Plotted MI values are the means over the 50 repetitions. + +![](images/99cddfbcbc6e2595c57b0f98c803267716a49bb0d46eeec0ee8090dd39244eef.jpg) + +![](images/186d41e69119898784519c236a64a90f080c3ee022fdc4f674ff4243300f4ab6.jpg) +Figure 3: The quantized RELU network, trained in the standard setting with the discrete MI computed exactly. The full information plane (left) and the upper right area (right) are shown. Plotted MI values are the means over the 50 repetitions. + +![](images/d009202614aff9b51d898f5512c6e25a53a201888711393aeb4b453a3f5abcc9.jpg) + +# 4.1 EXACT MUTUAL INFORMATION FOR SYNTHETIC DATA + +The 8-bit quantized network from Figure 1a was fitted for 8000 epochs to the synthetic data set considered in Shwartz-Ziv & Tishby (2017), using either TANH or RELU for the hidden layers. The experiment was repeated 50 times and the means of obtained measurements are reported. + +Figure 2 and Figure 3 show the information planes for the quantized TANH and RELU networks respectively; additional plots showing the variance of the repetitions are included in Supplementary Material B. Both quantized networks obtained good fits with similar accuracies to non-quantized networks; see Figure F.14 and Figure F.15 in the supplementary material. + +For the quantized TANH network, the information plane is very similar to the plane obtained in the standard setting using $2^{8} = 256$ bins. We clearly observe a fitting and compression phase in the output layer, while I $(X;T)$ and I $(T;Y)$ in general are large for the input and hidden layers. Looking at the hidden layer before the output layer, we do observe a fitting and a compression phase, but + +![](images/d86acc97267342784e51b8ce105665c2e950d9499f769bec5773fb37ad00ea85.jpg) +Figure 4: The information plane for the bottleneck structured network fitted on MNIST. Plotted MI values are the means over the 20 repetitions. The compression phase in the 2 neuron layer is highlighted. + +with the fitting phase interrupted by a small compression phase. For the remaining layers, the MI measurements with input and label remained almost constant throughout the training process. + +Likewise, the information plane for the quantized RELU network looks very similar to the plane obtained with binning. The MI is slightly higher, but the most notably difference is the occurrence of a slight increase in $\mathrm{I}(X;T)$ after approximately 1800 epochs, observed only for the hidden layer before the output layer. For the remaining hidden layers, only the fitting phase is observed, with no or very little compression; an observation mirrored in the binning experiments by Saxe et al. (2018). + +# 4.2 EXACT MUTUAL INFORMATION FOR LEARNING AN MNIST REPRESENTATION + +We considered the task of leaning a two-dimensional representation of the MNIST handwritten digits (Bottou et al., 1994; Deng, 2012). We fitted a network with four hidden layers with RELU activations and 16, 8, 4 and 2 neurons, respectively, where the last two neurons feed into a 10 neuron SOFTMAX output layer. The network was trained for 3000 epochs, and the experiment was repeated 20 times. + +The bottleneck architecture for learning a two-dimensional representation leads to a non-trivial IB analysis. Using more expressive networks (e.g., without or with a wider bottleneck) resulted in trivial, constant maximum MI measurements (see Supplementary Material E). + +Figure 4 shows the information plane obtained for the network; additional plots showing the variance between repetitions are included in Supplementary Material B. The network exhibits sub-par performance due to the limiting bottleneck structure, obtaining a maximum accuracy of around $90\%$ (see Figure F.16 in the supplementary material). However, the architecture does admit a non-trivial analysis with a clear fitting phase in the output layer and the three last hidden layers. Small compression phases are also observed in the RELU layers around 1500 epochs, similar to the last hidden layer of the network trained on synthetic data. The compression indicates that the learnt representations for digits from the same class become more similar. + +# 4.3 DISCUSSION + +Our experiments largely confirm the findings by Saxe et al. (2018): we observe no compression phase in the quantized RELU network for the synthetic data. While the quantized networks do not directly correspond to the networks in the original studies (Shwartz-Ziv & Tishby, 2017; Saxe et al., 2018), they amplify the effect of the networks being executed on a digital computer. Note that using quantization (as often done for mobile and edge computing as well as when working on encrypted data) does not violate any assumption in the IB theory – on the contrary, as argued before, it prevents the information theoretic measures from becoming trivial. + +The MI generally being higher in our experiments confirms our discussion from Section 3; information is well-preserved through the network. There is no longer a loss of information from the + +estimation method. All information loss – and hence the dynamics observed – is a result of the neural network learning. Performing the same experiments with the full 32-bit non-quantized networks, this is even more pronounced, as almost no loss of information is observed between layers. This setting approaches the continuous case, in which we would get $H(T) = \log |\mathcal{D}|$ for invertible activation functions. We include information planes for 32-bit networks with exact MI computation in Supplementary Material C, Figure C.11. Conversely, when training networks with even lower precision, we see a higher information loss between layers. This can be expected from $H(T) \leq 2^{d_Tk}$ and the small, decreasing number $d_{T}$ of neurons in layer $T$ (see Figure 1b). Using $k = 4$ bit precision, more layers are clearly distinguishable, with results similar to those obtained by estimating MI by binning; however, the 4-bit quantized networks also provide a worse fit – indicating that when estimating MI by binning, information vital to the network is neglected in the analysis. We provide information planes for 4-bit quantized networks in Supplementary Material C, Figure C.10. + +A similar observation could be made for the network fitted on MNIST. Using the low complexity bottleneck architecture, we obtained non-trivial information measurements. Having only two neurons in the smallest layer limits the network in terms of performance, yielding a sub-optimal accuracy around $90\%$ . Using more complex networks, for instance, with a wider bottleneck or without a bottleneck, we obtained accuracies over $95\%$ (see Figure F.16), but, even when using 8-bit quantization, the information planes were trivial, with only the last layer discernible (see Supplementary Material E). We observed similar trivial information planes for a convolutional architecture, further supporting that only very little information is actually lost in the complex networks (even with quantization), making the information bottleneck, when computed exactly, a limited tool for analysing deep learning. + +# 5 CONCLUSIONS AND LIMITATIONS + +The experiments and discussion of Shwartz-Ziv & Tishby (2017) and Saxe et al. (2018), as well as several follow-up studies, indicate that estimating MI by binning may lead to strong artifacts. We empirically confirmed these issues (see Supplementary Material A): varying the number of bins in the discretization procedure, we observed large differences in the qualitative analysis of the same network, confirming that the results of previous studies highly depend on the estimation method. + +To alleviate these issues, we computed the exact MI in quantized neural networks. In our experiments using 8-bit quantized networks, the fitting phase was observed for TANH and RELU network architectures. The compression phase was observed in the output SOFTMAX layer in both cases. For the TANH network, the MI was only non-trivial for the last two layers, but not for the other hidden layers. We observed compression in the last hidden layer when using TANH activations; similar to the phase observed by Shwartz-Ziv & Tishby (2017). For the RELU network, the MI was below its upper bound in all layers; however, no compression was observed in any of the hidden layers using RELU activations. The latter observation confirms the statements by Saxe et al. (2018) about the IB in RELU networks. + +Applying the analysis to a network trained on MNIST, we found that a bottleneck architecture learning a low-dimensional representation showed a compression phase. The compression indicates that the learnt representations for digits from the same class become more similar, as intended for representation learning. When applied to networks without a bottleneck (e.g., a simple convolutional architecture), the IB analysis produced only trivial information planes, which shows the limitations of the IB analysis (even with exact computations) for deep learning in practice. + +The main contribution of our work is that we eliminated measurements artifacts from experiments studying the IB in neural networks. By doing so, future research on the IB concept for deep learning can focus on discussing the utility of the IB principle for understanding learning dynamics – instead of arguing about measurement errors. + +The proposed quantization as such is no conceptual limitation, because for invertible activation functions studying a (hypothetical) truly continuous system would lead to trivial results. The biggest limitation of our study is obviously that we could not (yet) resolve the controversy about the compression phase (which was, admittedly, our goal), because our experiments confirmed that it depends on the network architecture whether the phase is observed or not. However, the proposed framework now allows for accurate future studies of this and other IB phenomena. + +# REPRODUCIBILITY STATEMENT + +Source code and instructions for reproducing our experiments are available online: https://github.com/StephanLorenzen/ExactIBAnalysisInQNNs + +# ACKNOWLEDGEMENTS + +The authors would like to thank the anonymous reviewers for their constructive comments. SSL acknowledges funding by the Danish Ministry of Education and Science, Digital Pilot Hub and Skylab Digital. MN acknowledges support through grant NNF20SA0063138 from Novo Nordisk Fonden. CI acknowledges support by the Villum Foundation through the project Deep Learning and Remote Sensing for Unlocking Global Ecosystem Resource Dynamics (DeReEco). The authors acknowledge support by the Pioneer Centre for AI (The Danish National Research Foundation, grant no. P1). + +# REFERENCES + +Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI) 16, pp. 265-283, 2016. +Vinayak Abrol and Jared Tanner. Information-bottleneck under mean field initialization. In International Conference on Machine Learning (ICML): Workshop on Uncertainty and Robustness in Deep Learning, 2020. +Alexander Amir Alemi, Ian S. Fischer, Joshua V. Dillon, and Kevin Murphy. Deep variational information bottleneck. arXiv, 1612.00410, 2017. +Rana Ali Amjad and Bernhard C. Geiger. Learning representations for neural network-based classification using the information bottleneck principle. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(9):2225-2239, 2019. +Emilio Rafael Balda, Arash Behboodi, and Rudolf Mathar. An information theoretic view on learning of artificial neural networks. In International Conference on Signal Processing and Communication Systems (ICSPCS), pp. 1-8. IEEE, 2018. +Emilio Rafael Balda, Arash Behboodi, and Rudolf Mathar. On the trajectory of stochastic gradient descent in the information plane, 2019. URL https://openreview.net/forum?id=SkMON20ctX. +Léon Bottou, Corinna Cortes, John S. Denker, Harris Drucker, Isabelle Guyon, L.D. Jackel, Yann LeCun, Urs A. Müller, Eduard Säckinger, Patrice Simard, and Vladimir Vapnik. Comparison of classifier methods: a case study in handwritten digit recognition. In International Conference on Pattern Recognition (ICPR), pp. 77-82, 1994. +Ivan Chelombiev, Conor Houghton, and Cian O'Donnell. Adaptive estimators show information compression in deep neural networks. In International Conference on Learning Representations (ICLR), 2019. +Hao Cheng, Dongze Lian, Shenghua Gao, and Yanlin Geng. Utilizing information bottleneck to evaluate the capability of deep neural networks for image classification. Entropy, 21(5):456, 2019. +Luke Nicholas Darlow and Amos Storkey. What information does a resnet compress? arXiv, 2003.06254, 2020. +Li Deng. The MNIST database of handwritten digit images for machine learning research. IEEE Signal Processing Magazine, 29(6):141-142, 2012. +Adar Elad, Doron Haviv, Yochai Blau, and Tomer Michaeli. Direct validation of the information bottleneck principle for deep nets. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops, pp. 0-0, 2019. + +Hui Fang, Victoria Wang, and Motonori Yamaguchi. Dissecting deep learning networks—visualizing mutual information. Entropy, 20(11):823, 2018. +Marylou Gabrie, Andre Manoel, Clément Luneau, Jean Barbier, Nicolas Macris, Florent Krzakala, and Lenka Zdeborova. Entropy and mutual information in models of deep neural networks. Journal of Statistical Mechanics: Theory and Experiment, 2019(12):124014, 2019. +Bernhard C. Geiger. On information plane analyses of neural network classifiers - a review. arXiv, 2003.09671, 2020. +Ziv Goldfeld, Ewout Van Den Berg, Kristjan Greenewald, Igor Melnyk, Nam Nguyen, Brian Kingsbury, and Yury Polyanskiy. Estimating information flow in deep neural networks. In International Conference on Machine Learning (ICML), pp. 2299-2308, 2019. +Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. Journal of Machine Learning Research, 18(1):6869-6898, 2017. +Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2704-2713, 2018. +Hlynur Jónsson, Giovanni Cherubini, and Evangelos Eleftheriou. Convergence behavior of dnns with mutual-information-based regularization. Entropy, 22(7):727, 2020. +Andreas Kirsch, Clare Lyle, and Yarin Gal. Scalable training with information bottleneck objectives. In International Conference on Machine Learning (ICML): Workshop on Uncertainty and Robustness in Deep Learning, 2020. +Artemy Kolchinsky and Brendan Tracey. Estimating mixture entropy with pairwise distances. Entropy, 19, 2017. doi: 10.3390/e19070361. +Alexander Kraskov, Harald Stögbauer, and Peter Grassberger. Estimating mutual information. Physical Review E, 69:066138, 2004. +Morteza Noshad, Yu Zeng, and Alfred O Hero. Scalable mutual information estimation using dependence graphs. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 2962-2966. IEEE, 2019. +Tomaso Poggio, Andrzej Banburski, and Qianli Liao. Theoretical issues in deep networks. Proceedings of the National Academy of Sciences, 117(48):30039-30045, 2020. +Vishnu Raj, Nancy Nayak, and Sheetal Kalyani. Understanding learning dynamics of binary neural networks via information bottleneck. arXiv, 2006.07522, 2020. +Andrew M. Saxe, Yamini Bansal, Joel Dapello, Madhu Advani, Artemy Kolchinsky, and Brendan D. Tracey. Discussion on openreview.net. https://openreview.net/forum?id=ry_WPG-A-, 2017. Accessed January 2017. +Andrew M. Saxe, Yamini Bansal, Joel Dapello, Madhu Advani, Artemy Kolchinsky, and Brendan D. Tracey. On the information bottleneck theory of deep learning. In International Conference on Learning Representations (ICLR), 2018. +Martin Schiemer and Juan Ye. Revisiting the information plane, 2020. URL https://openreview.net/forum?id=Hyljn1SFwr. +Ohad Shamir, Sivan Sabato, and Naftali Tishby. Learning and generalization with the information bottleneck. Theoretical Computer Science, 411(29):2696-2711, 2010. +Ravid Shwartz-Ziv and Alexander A Alemi. Information in infinite ensembles of infinitely-wide neural networks. In Symposium on Advances in Approximate Bayesian Inference, pp. 1-17, 2020. +Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv, abs/1703.00810, 2017. + +Thanh Tang Nguyen and Jaesik Choi. Markov information bottleneck to improve information flow in stochastic neural networks. Entropy, 21(10):976, 2019. +Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop (ITW), pp. 1-5, 2015. +Naftali Tishby, Fernando C. Pereira, and William Bialek. The information bottleneck method. In *The 37'th Allerton Conference on Communication, Control and Computing*, 1999. +Kristoffer Wickström, Sigurd Løkse, Michael Kampffmeyer, Shujian Yu, Jose Principe, and Robert Jenssen. Information plane analysis of deep neural networks via matrix-based Renyi's entropy and tensor kernels. arXiv, 1909.11396, 2019. +Shujian Yu, Kristoffer Wickström, Robert Jenssen, and José C Principe. Understanding convolutional neural networks with information theory: An initial exploration. IEEE Transactions on Neural Networks and Learning Systems, 32:435-442, 2020. + +# A ESTIMATING MUTUAL INFORMATION BY BINNING + +This section presents a replication of the experiments from Shwartz-Ziv & Tishby (2017) and Saxe et al. (2018), but varying the number of bins for estimating MI. Non-quantized TANH and RELU networks were trained in the standard setting, and MI was estimated using 30, 100 and 256 bins. The number of bins were chosen to match the numbers used in the earlier works (30 used by Shwartz-Ziv & Tishby, 100 used by Saxe et al.) and to match the discretization in the quantized neural networks considered in Section 4.1. + +![](images/bbb61ed8f27afbab8b7dd13a5a0d6f2ff58b8a94a52529881c357ca5aadbe50e.jpg) +Figure A.5: Information planes for the TANH network with various number of bins. 30 bins corresponds to a replication of the results from Shwartz-Ziv & Tishby (2017). The network is trained in the standard setting, and the average of 50 runs is plotted. + +![](images/a289d373f8b1592c2ba9d9e5606a4eed885e5bb73d0ff656779446d0a5b75cb4.jpg) +Figure A.6: Information planes for the RELU network with various number of bins. 100 bins replicate the results from Saxe et al. (2018). The network is trained in the standard setting, and the average of 50 runs is plotted. + +The resulting information planes are shown for the TANH and RELU networks in Figure A.5 and Figure A.6 respectively. + +From Figure A.5, we clearly see the results of Shwartz-Ziv & Tishby (2017) replicated using 30 bins for the TANH network; two phases are clearly visible in each layer. As expected, for every layer $T$ with binned $T' = B(T)$ , $\mathrm{I}(X;T')$ and $\mathrm{I}(T';Y)$ increase with the number of bins used with the phases still remaining visible in the distinguishable layers. + +For the RELU network with 100 bins, the results of Saxe et al. (2018) were also replicated, that is, the compression phase was not observed. When using only 30 bins for the RELU network, the estimation broke down completely in the sense that the DPI (2) is violated: I $(T'; Y)$ is non-monotone, a phenomenon occurring because of the estimation, which has also been observed by Geiger (2020). Again, we see for any layer $T$ that I $(X; T')$ and I $(T'; Y)$ increase with $m$ , although to a lesser degree + +![](images/f564b2e2d8d9cfa7c248e21b5303ad4fc1fcfebeb1815162b4449303bdf801d6.jpg) +Figure B.7: Mean and variance for $\operatorname{I}(X;T)$ (left) and $\operatorname{I}(T;Y)$ (center), and the information plane for the median deviating (L2-distance from the mean) repetition (right), for the TANH network in the standard setting. + +![](images/eb3a98582b872c8f5a003ba3f442601dbffafba8fcc17df501baf0b490f5a725.jpg) + +![](images/2b66a0e8780cf09079f799a144a3b734d06bc06defa6de544176c7329a1a36b1.jpg) + +![](images/c073922d4198ebe606b1f52a5171b448d7b362394bd7c7b72417acf364d8ee4f.jpg) +Figure B.8: Mean and variance for $\mathrm{I}(X;T)$ (left) and $\mathrm{I}(T;Y)$ (center), and the information plane for the median deviating (L2-distance from the mean) repetition (right), for the RELU network in the standard setting. + +![](images/f132ac437d65a23fee270d56a3dfa924fe0a5b2ac28c48545bd7487245274935.jpg) + +![](images/8fae22b87fbb08a8eac469c9f3c24686a3e0099c10963ef3211c7dc74f63b8a6.jpg) + +than for the TANH network, most likely due to the RELU activation functions actually dropping information (by zeroing negative activations). + +In general, the estimation of MI in either network is highly dependable on the number of bins used, indicating that the interpretation of the information plane is not straight forward, when using binning for estimation. + +# B MI VARIANCE + +In this work, we investigate the effect of MI approximation in previous IB studies. These original studies are based on a qualitative analysis of mean curves. However, the question arises of whether mean curves correctly represent individual learning processes. While we do not investigate this question in detail, the following section provides plots illustrating the variance between experimental trials. + +Figures B.7, B.8 and B.9 show the mean and variance of $\mathrm{I}(X;T)$ (left) and $\mathrm{I}(T;Y)$ (center), as well as the information plane for a single trial (right), for the TANH and RELU networks in the standard setting, and the bottleneck network applied to MNIST, respectively. For the single trial, we selected the median deviating repetition, ranked by the L2-distance from the mean. + +From the plots, we see that when the mean MI is large, the variance is usually low. The variance is similar across the different networks (note the different scaling of the y-axes), with slightly larger variance for the RELU activations. Together with the median deviating information plane, the plots suggest that the mean information plane, which averages out less pronounced phases of MI increase and decrease, represents individual repetitions fairly well. + +![](images/4edec9b6f45ae60da0810b191f19315fe6394fe92bd4ff77897a6b430e66a332.jpg) +Figure B.9: Mean and variance for $\mathrm{I}(X;T)$ (left) and $\mathrm{I}(T;Y)$ (center), and the information plane for the median deviating (L2-distance from the mean) repetition (right), for the Bottleneck network applied to MNIST. + +![](images/9bed0ad33e86d346e1b42b8f4dc731afa0a7d504232135b22017440d0f6daa4f.jpg) + +![](images/712b0dad6e38819455a19a9b9114f3b1489ec3cca1400a4786c119a9dec64170.jpg) + +![](images/8edcd25fba53330d88d9404f8fd8f50d013890a3a6737249a1b6f2f77b4a9ec8.jpg) +Figure C.10: Information planes for 4-bit quantized TANH network (left) and RELU network (right). The mean of 30 runs is plotted. + +![](images/da469bd34eb22a4e62ae9a015708c73e860ced8b5aa0473328db96a68daf5878.jpg) + +Additionally, the compression phase in the TANH network can clearly be seen in Figure B.7 (left), while it is absent in the RELU network (Figure B.8). + +# C EFFECT OF THE QUANTIZATION PRECISION + +This section presents information planes obtained using 4- and 32-bit quantized neural networks trained in the standard setting, in order to investigate the effect of the precision used in the quantization. + +Figure C.10 depicts the resulting information planes for the 4-bit networks. As each neuron can take only $2^{4} = 16$ different values, the total number of possible states per layer decreases significantly in this setting, and as expected we see lower overall MI measurements. For the TANH network, several more layers become distinguishable. The observed information planes look similar to those observed in the original experiments by Shwartz-Ziv & Tishby (2017) and Saxe et al. (2018). However, the network accuracy has now degraded compared to the non-quantized networks (see Supplementary Material F), which indicates that the binning used in the estimation of the MI in previous experiments has discarded information vital to the network. + +Figure C.11 shows the resulting information planes for the 32-bit networks. As expected, we see an overall increase in MI; the information drops only very slowly through the network. Each layer has many possible states and – given the small data set – we get closer to the behavior of a continuous system. + +![](images/556727a588b145e80d194e4c8ca203d1f46fbfb9d6ff8b5cf93458d632ace470.jpg) +Figure C.11: Information planes for 32-bit quantized TANH network (left) and RELU network (right). The mean of 30 runs is plotted. + +![](images/6d8a5fa22b195384258e8a26efc41d14db3e099731bdbe83b8c31b51b62352d6.jpg) + +![](images/a545d3c895e7dbac4958dd1445e7db855cdbd00d6ae4004273d9f18e628f7785.jpg) +Figure D.12: The information planes for the TANH (left) and RELU (right) networks when prefetching on random labels for 1000 epochs. The means of 20 repetitions are shown. In the plots, $Y$ always refers to the true labels. + +![](images/46c7383270c637765b2e673ffa63d2655c92b7728ad16c003ae8830f89a14b2d.jpg) + +# D QUANTIZED NETWORK WITH RANDOMIZED PREFITTING + +This section presents results for the standard setting using 8-bit quantized networks, but with weights prefitted to random labels. First, the network is fitted for 1000 epochs to the synthetic data set with the labels shuffled. The network is then trained for 8000 epochs with correct labels (as done in Section 4.1). The experiment is repeated 20 times. The resulting information planes for the TANH and the RELU network are presented in Figure D.12, left and right respectively. + +Inspecting the plots, we see that, for all discernible layers, $\mathrm{I}(X;T)$ appears to increase when fitted to random labels. This is not surprising as the input is not shuffled. + +As a consequence of the increase in $\mathrm{I}(X;T)$ , the hidden layers (most notable in the RELU network) also see an increase in $\mathrm{I}(T;Y)$ . As the ability to distinguish different inputs from a hidden layer $T$ increases, so does $\mathrm{I}(T;Y)$ . + +As expected, the network accuracy does not increase when training on random labels, and accordingly there is no lateral movement in the information plane for the output layer. + +![](images/0813f7d718c00b6397141ca65dd2906e7499b8d92f3490f33625df0aa6688ddf.jpg) + +![](images/f30632f0506eadfbc0403d3dc95774fceaac03b316b993e3d374530e5728fb87.jpg) + +![](images/a97f88ca37a3b302b872b7ee79fd4001ae4ff0df5ac18138f6537d3f7ada159c.jpg) +Figure E.13: Information planes for the additional networks trained on MNIST. Note for HOURGLASS that the three last hidden layers almost coincide completely. + +![](images/7ef57e0c6cc742d2a1e52766a1f63365493c03ddb479be9d0e749f215e6f5a91.jpg) + +# E MNIST WITH OTHER NETWORK ARCHITECTURES + +This section presents the results of training a number of 8-bit quantized networks with varying architectures on MNIST. We consider the same setup as in Section 4.2, but with the following architectures (all using RELU activations in the hidden layers and a final 10 layer SOFTMAX output): + +- The BOTTLENECK-4 network with 4 hidden layers of widths 16, 12, 8 and 4, i.e. the bottleneck has width 4. +- The HOURGLASS network with 6 hidden layers of widths 16, 8, 4, 2, 4, 8. The bottleneck width is still 2, but the network expands again after the bottleneck, creating an hourglass shape. +- The $4 \times 10$ network with 4 hidden layers, each of width 10. +- The CONV network, a simple convolutional network with structure: CV-MP-CV-MP-FC, where CV denotes a (3,3) 2-channel convolutional layer, MP denotes a (2,2) max pooling and FC denotes a fully connected RELU layer with 20 neurons. + +Below, we denote the network used in Section 4.2 by BOTTLENECK-2. Each experiment is repeated 20 times and the resulting information planes are reported in Figure E.13. As expected, given the increased complexity, all networks exhibit better performance than the bottleneck structured network considered in Section 4.2 (the accuracy of all networks are presented in Figure F.16 in Supplementary + +Material F), obtaining accuracies close to or above $95\%$ for all networks except the HOURGLASS network. + +From Figure E.13, we observe the information curves for the BOTTLENECK-4 network to be similar in shape to the BOTTLENECK-2, but with higher MI measurements in general. This is not surprising, as the layers are wider and thus more expressive. + +As expected, the HOURGLASS network also exhibits information curves similar to BOTTLENECK-2 (as the architecture is similar for the first few layers). Not surprisingly, the two expanding layers of widths 4 and 8 almost coincide completely with the bottleneck layer; information cannot increase but is also not decreased significantly. + +The two more expressive networks without bottlenecks, 4x10 and CONV, have almost completely trivial information curves. Limited fitting for the output layer in 4x10 and compression in the output layers for both networks can be observed. The experiments indicate the limitations of exact IB analysis for complex, large scale networks. + +# F NETWORK ACCURACIES + +![](images/cfb3f7d5f6c46c3b5d567f143302009660d7ce6869256624f786dde462cc5127.jpg) +Figure F.14 and Figure F.15 report the accuracies obtained by the TANH and RELU networks when fitted on the synthetic data, respectively. As can be seen, the networks suffers only slightly when +Figure F.14: Accuracies of the quantized TANH networks (three on the left) and the non-quantized TANH network (right). The means and $95\%$ confidence intervals over 50 repetitions are reported. + +![](images/6e70f5433c200187113759b2f3c57432e85f048a58afe367622379b07d3f2763.jpg) +Figure F.15: Accuracies of the quantized RELU networks (three on the left) and the non-quantized RELU network (right). The means and $95\%$ confidence intervals over 50 repetitions are reported. + +using only 4 bits in the quantization. + +Figure F.16 reports the accuracy of the networks fitted to MNIST. Unsurprisingly, the more complex networks (BOTTLNECK-4, 4x10, CONV) obtain better accuracy with lower variance, compared to the networks with a low-width bottleneck (BOTTLNECK-2, HOURGLASS). + +![](images/d9ac575e3754f93a00b08569bc06ea31b8b4c4d3d496cd2323177b4c58c93b7d.jpg) +Figure F.16: Accuracies of the quantized networks applied to MNIST. The means and $95\%$ confidence intervals over 20 repetitions are reported. The decrease in training accuracy for the bottleneck structured network (left) is due to the optimization objective being cross-entropy. \ No newline at end of file diff --git a/informationbottleneckexactanalysisofquantizedneuralnetworks/images.zip b/informationbottleneckexactanalysisofquantizedneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0b31f6453697a21b08102cebf9c5752400d86217 --- /dev/null +++ b/informationbottleneckexactanalysisofquantizedneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c474024fa4f1bdce3cdaaf1e0ddce9683535b1e6e6655b2f08dc9a9c049f811c +size 713045 diff --git a/informationbottleneckexactanalysisofquantizedneuralnetworks/layout.json b/informationbottleneckexactanalysisofquantizedneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2522a9fb79d4a7b44cfb89251c56cb75d4f83e7c --- /dev/null +++ b/informationbottleneckexactanalysisofquantizedneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c9fa5eb24380aec7ca7ef1c9542341a9e60d710f725fb8f7cd1e461b94bb098 +size 543403 diff --git a/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_content_list.json b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..63c12dc32dea34673b0e54787904df1f5b707833 --- /dev/null +++ b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f169adc783656647e93353f1d8746f4fd9d9c9f6e516651265c9549772a90aa +size 110836 diff --git a/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_model.json b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_model.json new file mode 100644 index 0000000000000000000000000000000000000000..86c94efd5b9193fafd31e353912a847ec4f0a96c --- /dev/null +++ b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9111d5f9502079d8913a4fb0bb91b35d074282cfd40929c242a80fff1a94a545 +size 133370 diff --git a/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_origin.pdf b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d3bcd80054ad223c6f46d56cadc168bf556359a7 --- /dev/null +++ b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/50c49b8d-afb3-43ce-b691-048d4ff346ee_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73cf7ac4607e926243f754561c366a6df48c1eebfa3ff2bdbe0d6fdcec51e102 +size 1765024 diff --git a/informationgainpropagationanewwaytographactivelearningwithsoftlabels/full.md b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2187f67c7748c9ab7e1b3be9929eed609e94d464 --- /dev/null +++ b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/full.md @@ -0,0 +1,475 @@ +# INFORMATION GAIN PROPAGATION: A NEW WAY TO GRAPH ACTIVE LEARNING WITH SOFT LABELS + +Wentao Zhang $^{1}$ , Yexin Wang $^{1}$ , Zhenbang You $^{1}$ , Meng Cao $^{2}$ , Ping Huang $^{2}$ , Jiulong Shan $^{2}$ , Zhi Yang $^{1,3}$ , Bin Cui $^{1,3,4}$ + +1School of CS, Peking University 2Apple +$^{3}$ National Engineering Laboratory for Big Data Analysis and Applications +$^{4}$ Institute of Computational Social Science, Peking University (Qingdao), China +$^{1}$ {wentao.zhang, yexinwang, zhenbangyou, liyang.cs, yangzhi, bin.cui} @oku.edu.cn +2{mengcao,Huang.ping,jlshan} $@$ apple.com + +# ABSTRACT + +Graph Neural Networks (GNNs) have achieved great success in various tasks, but their performance highly relies on a large number of labeled nodes, which typically requires considerable human effort. GNN-based Active Learning (AL) methods are proposed to improve the labeling efficiency by selecting the most valuable nodes to label. Existing methods assume an oracle can correctly categorize all the selected nodes and thus just focus on the node selection. However, such an exact labeling task is costly, especially when the categorization is out of the domain of individual expert (oracle). The paper goes further, presenting a soft-label approach to AL on GNNs. Our key innovations are: i) relaxed queries where a domain expert (oracle) only judges the correctness of the predicted labels (a binary question) rather than identifying the exact class (a multi-class question), and ii) new criteria of maximizing information gain propagation for active learner with relaxed queries and soft labels. Empirical studies on public datasets demonstrate that our method significantly outperforms the state-of-the-art GNN-based AL methods in terms of both accuracy and labeling cost. + +# 1 INTRODUCTION + +Graph Neural Networks (GNNs) have recently achieved remarkable success in various graph-based tasks, ranging from traffic networks, biology, to social networks (Zhang et al., 2020b; Wang et al., 2019; Li et al., 2019; Do et al., 2019; Wu et al., 2020b). Despite their effectiveness and popularity, GNNs typically require a large amount of labeled data to achieve satisfactory performance. However, obtaining these labels is a time-consuming, laborious, and costly process. Therefore, how to do this economically and efficiently has attracted great attention both in academia and industry. One of the most popular strategies to tackle this challenge is Active Learning (AL) (Aggarwal et al., 2014). By combining model training and node selection for labeling, AL significantly reduces labeling cost by selecting the most valuable nodes to label. + +However, previous AL methods assume the hard label (namely the exact label, that is, the label specifying the exact class of the node) can always be provided by the oracle. As illustrated in Fig. 1, for any selected node, the active learners in the aforementioned methods ask questions like "which category does it exactly belong to?". Such queries and assumptions exceed the capability of oracle in many labeling tasks requiring domain knowledge. For example, the task in ogbn-papers100M is to leverage the citation graph to infer the labels of the arXiv papers into 172 arXiv subject areas (a single-label, 172-class classification problem). In this example, a specialist/expert in the subject areas of machine learning is incapable of labeling query instances with subject areas of finance (such as mathematical finance or computational finance), which is out of his domain knowledge. + +In this paper, we propose a novel active learning paradigm for GNNs in which only soft labels are required. Two salient features of our paradigm are as follows: + +![](images/116fdd03ba552e8e9abf0d3d62875e510340671d548a0de5f7a30c4eb8fb4e1e.jpg) +Figure 1: An example of our new node labeling strategy. + +![](images/4b01925e5b711dfbdc9eb69ede29c1ed72b84cf7350fa9431e4fa8d02e8e42b4.jpg) +Figure 2: An example of IGP. + +First, we propose relaxed queries where domain expert (oracle) only judges the correctness of the predicted labels (by GNN models) rather than the exact categorization. Specifically, we propose to select the class label with the highest predicted probability and then ask the oracle to judge whether the class label is correct rather than directly asking for the exact class label. In this way, the multi-class classification task is relaxed into a binary-class classification task for the oracle. Under such queries, if the model prediction is incorrect (we assume the oracle does not make mistakes), we annotate the node with the soft label by re-normalizing the model predicted softmax outputs over the remaining classes. As illustrated in Fig.1, we allow relaxed queries such as "Does the sample belong to this class?" (e.g., the first class in Fig. 1), since this query is specific to the domain of experts, hence more ready to be answered. As far as we are concerned, no previous AL methods can deal with such relaxed queries. + +Second, the node selection criteria in previous AL methods are specially designed for hard-labeling oracles. As one of the most commonly used AL query strategies, uncertainty sampling queries the labels of the nodes which current model is least certain with, ensuring the largest entropy reduction on a single node when given the hard label from oracle. However, under our relaxed queries, we prove that the uncertainty sampling cannot guarantee the largest information gain (i.e., entropy reduction) on a single node. In this paper, we propose a new criterion to explicitly maximize information gain propagation (IGP) for active learners with relaxed queries and soft labels on graph. As shown in Fig. 2, the labeled nodes (with color) can propagate their label information with different influence magnitude and then reduce the uncertainty of adjacent unlabeled nodes (without color). Considering the influence propagation in GNNs, we select the nodes that can maximize expected information gain in total under the relaxed queries, i.e., reducing the aggregated uncertainty of a neighborhood region beyond a single node. To the best of our knowledge, this is the first work to propose the information gain propagation with relaxed queries, and showing that it is highly effective. + +In summary, the core contributions of this work are the following: First, we provide a new AL paradigm for GNNs methodology with relaxed queries and soft labels. Second, we propose a novel node selection criterion that explicitly maximizes propagation of information gain under the new AL paradigm on GNNs. Third, experimental results show our paradigm significantly outperforms the compared baselines by a large margin in five open graph datasets. + +# 2 PRELIMINARY + +# 2.1 PROBLEM FORMULATION + +Let $\mathcal{G} = (\mathcal{V},\mathcal{E})$ with $|\mathcal{V}| = N$ nodes and $|\mathcal{E}| = M$ edges be the graph, and $c$ is the number of classes. $\mathbf{X} = \{\pmb{x}_1,\pmb{x}_2\dots,\pmb{x}_N\}$ is the node feature matrix, the one-hot vector $\pmb{y}_i\in \mathbb{R}^c$ and and $\pmb{x}_i\in \mathbb{R}^d$ are the ground-truth label and node feature for node $v_{i}\in \mathcal{V}$ , respectively. We consider a general AL setting in this work. Suppose the full node set $\mathcal{V}$ is partitioned into training set $\mathcal{V}_{train}$ , validation set $\mathcal{V}_{val}$ , and test set $\mathcal{V}_{test}$ , and $\mathcal{V}_{train}$ can further be partitioned into the labeled set $\mathcal{V}_l$ and unlabeled set $\mathcal{V}_u$ , respectively. Given the labeling size $\mathcal{B}$ , the loss function $\ell$ , the goal of graph-based AL is to select a subset $\mathcal{V}_l\subset \mathcal{V}_{train}$ to label, so that the model $f$ trained with the supervision of $\mathcal{V}_l$ can get the lowest loss on $\mathcal{V}_{test}$ : + +$$ +\underset {\mathcal {V} _ {l}: \left| \mathcal {V} _ {l} \right| = \mathcal {B}} {\arg \min } \mathbb {E} _ {v _ {i} \in \mathcal {V} _ {t e s t}} \left[ \ell \left(\boldsymbol {y} _ {i}, \hat {\boldsymbol {y}} _ {i}\right) \right], \tag {1} +$$ + +where $\hat{y}_i$ is the softmax outputs of node $v_i$ given by the model $f$ . + +Different from the previous setting, $\mathcal{B}$ is the labeling cost (i.e., money) rather than the size in our new scenario. As the experts are hard to annotate the node out of their domain, we assume the conventional + +query cost $c - 1$ times as much as our relaxed query for each selected node. Correspondingly, the objective in our new scenario is + +$$ +\underset {\mathcal {V} _ {l}: M (\mathcal {V} _ {l}) = \mathcal {B}} {\arg \min } \mathbb {E} _ {v _ {i} \in \mathcal {V} _ {t e s t}} \left[ \ell \left(\boldsymbol {y} _ {i}, \hat {\boldsymbol {y}} _ {i}\right) \right], \tag {2} +$$ + +where $M(\mathcal{V}_l)$ is the labeling cost for annotating $\mathcal{V}_l$ , and we focus on $f$ being GNNs due to their state-of-the-art performance in many semi-supervised node classification tasks. + +# 2.2 GRAPH NEURAL NETWORKS + +Unlike the images, text or tabular data, where training data are independently and identically distributed, samples are connected by edges in the graph, and each node in a GNN can aggregate the node embedding or feature from its neighbors to enhance their embedding along edges. Let $f\left( {\mathbf{A},{\mathbf{X}}^{\left( k\right) };{\mathbf{W}}^{\left( k\right) }}\right)$ be any GNN,where $\mathbf{A}$ is an adjacency matrix, ${\mathbf{X}}^{\left( k\right) }$ is the feature matrix of $k$ -th layer,and ${\mathbf{W}}^{\left( k\right) }$ are the learned weights of $k$ -th layer. + +Taking the widely used Graph Convolution Network (GCN) (Kipf & Welling, 2017a) as an example, each GCN layer can be formulated as: + +$$ +\mathbf {X} ^ {(k + 1)} = f \left(\mathbf {A}, \mathbf {X} ^ {(k)}, \mathbf {W} ^ {(k)}\right) = \delta \left(\widetilde {\mathbf {D}} ^ {- 1} \widetilde {\mathbf {A}} \mathbf {X} ^ {(k)} \mathbf {W} ^ {(k)}\right), \tag {3} +$$ + +where $\mathbf{X}$ (and $\mathbf{X}^{(0)}$ ) is the original node feature, $\mathbf{X}^{(k)}$ and $\mathbf{X}^{(k + 1)}$ are the embeddings of layer $k$ and $k + 1$ respectively. Besides, $\widetilde{\mathbf{D}}$ is the diagonal node degree matrix for normalization and $\widetilde{\mathbf{A}} = \mathbf{A} + \mathbf{I}_N$ is the adjacent matrix with self connection, where $\mathbf{I}_N$ is the identity matrix. Compared with the DNN layer which formulated as $\mathbf{X}^{(k + 1)} = \delta (\mathbf{X}^{(k)}\mathbf{W}^{(k)})$ , the feature matrix $\mathbf{X}^{(k)}$ will be firstly enhanced with the feature propagation operation $\widetilde{\mathbf{D}}^{-1}\widetilde{\mathbf{A}}\mathbf{X}^{(k)}$ , and then boosts the semi-supervised node classification performance by getting more nodes involved in the model training. + +# 2.3 ACTIVE LEARNING + +Common AL. AL can improve labeling efficiency by selecting the most valuable samples to label. Considering the informativeness, Uncertainty Sampling (Yang et al., 2015; Zhu et al., 2008) selects the nodes which has the most uncertain model prediction. Based on ensembles (Zhang et al., 2020a), Query-by-Committee (Burbidge et al., 2007; Melville & Mooney, 2004) trains a committee of models, and selects samples according to the extent to which the models disagree. Furthermore, Density-based (Zhu et al., 2008; Tang et al., 2002) and Clustering-based (Du et al., 2015; Nguyen & Smeulders, 2004) and Diversity-based (Wu et al., 2020a; Jiang & Gupta, 2021) methods can effectively select the most representative samples. All the methods above are proposed for binary or multi-class classification, and some methods (Qi et al., 2008; Yan & Huang, 2018) are proposed for the multi-label classification problem. Besides, considering the class imbalance, some methods (Aggarwal et al., 2020; Attenberg & Provost, 2010) are also proposed to tackle this issue with AL. + +GNN-based AL. Despite the effectiveness of common AL methods, it is unsuitable to directly apply them to GNNs since the characteristic of influence propagation has not been considered. To tackle this issue, both AGE (Cai et al., 2017) and ANRMAB (Gao et al., 2018) introduce the density of node embedding and PageRank centrality into the node selection criterion. SEAL (Li et al., 2020) devises a novel AL query strategy in an adversarial way, and RIM (Zhang et al., 2021b) considers the noisy oracle in the node labeling process of graph data. Besides, ALG (Zhang et al., 2021a) proposes to maximize the effectiveness of all influenced nodes of GNNs. Recently, Grain (Zhang et al., 2021c) introduces a new diversity influence maximization objective, which takes the diversity of influenced nodes into consideration. + +Both AGE (Cai et al., 2017) and ANRMAB (Gao et al., 2018) are designed for AL on GNNs, which adopt the uncertainty, density, and node degree to select nodes. ANRMAB improves AGE by introducing a multi-armed bandit mechanism for adaptive decision-making. Considering the high training time of GNN, ALG (Zhang et al., 2021a) decouples the GNN model and proposes a new node selection metric that maximizes the effective reception field. Grain (Zhang et al., 2021c) further generalizes the reception field to the number of activated nodes in social influence maximization and introduces the diversity influence maximization for node selection. However, all these AL methods + +assume the oracle knows the information of all categories, thereby being able to correctly annotate all the selected nodes. This is impractical if the oracle encounters some areas that they are not familiar with, especially when the number of categories is large. IGP is the first work to actively labeling graph data under domain-specific experts. + +# 3 PROPOSED METHOD + +This section presents IGP, the first graph-based AL framework that considers the relaxed queries and soft labels. IGP can operate on any GNN model $f$ . We measure the information gain of selecting a single node in Sec. 3.1. To extend the information gain of a single node to the full graph, we firstly estimate the influence magnitude of graph propagation in Sec. 3.2, and then combine it with the information gain and introduce the new criterion: information gain propagation in Sec. 3.3. Last, we propose to select nodes which can maximize the information gain propagation in Sec. 3.4. + +# 3.1 INFORMATION GAIN + +Different from the previous annotation method, which asks the oracle to directly provide annotated class $l$ , the oracle in IGP only needs to judge whether the model prediction $\hat{\pmb{y}}$ is correct. Rather than discard the incorrect prediction, we propose that both the correct and incorrect predictions will provide the information gain and thus enhance the label supervision. + +An oracle is required to answer whether the model prediction is correct, i.e., $\hat{y}$ belongs to class $l$ . After the judgement of the oracle, the uncertainty of the node labels will be decreased. Therefore, we define the normalized soft label by combining the model prediction and oracle judgement as follows. + +Definition 3.1 (Normalized Label). For node $v_{i}$ , the soft label (model predicted softmax output) is denoted as $\hat{y}_i = [a_1, a_2, \dots, a_c]$ . The pseudo label (denoted as $l$ ) is set as the class with the highest value in $\hat{y}_i$ . After the oracle judges whether $v_{i}$ belongs to class $l$ , each element $a_t'$ in the normalized soft label $\hat{y}_i' = [a_1', a_2', \dots, a_c']$ is defined as + +$$ +a _ {t} ^ {\prime} = \left\{ \begin{array}{l l} \mathbb {1} (t = l) & v _ {i} \text {b e l o n g s t o c l a s s} l \\ \frac {a _ {t} \cdot \mathbf {1} (t = l)}{\sum_ {j \neq l} a _ {j}} & v _ {i} \text {d o e s n o t b e l o n g t o c l a s s} l \end{array} \right. \tag {4} +$$ + +After the query, $\hat{\pmb{y}}_i$ is updated as the normalized soft label $\hat{\pmb{y}}_i^{\prime}$ by Eq. 4 (See more details in Appendix B). + +The oracle may agree with the pseudo label (denoted as $v_{i+}$ ), or disagree (denoted as $v_{i-}$ ). In either cases, the entropy drops. + +The expected information gain (IG) is calculated based on these two cases. + +Definition 3.2 (Information Gain (IG)). For node $v_{i}$ , the IG of annotating it is defined as + +$$ +I G (v _ {i}) = H (\hat {\mathbf {y}} _ {i}) - P (v _ {i} -) H \left(\hat {\mathbf {y}} _ {i} ^ {\prime}, v _ {i} -\right), \tag {5} +$$ + +where $H$ is the entropy (well-known in the information theory), e.g., $H(\hat{\mathbf{y}}_i) = -\sum_{p=1}^k a_p \log a_p$ ( $\log$ always stands for $\log_2$ in this paper). Therefore, $H(\hat{\mathbf{y}}_i)$ and $H(\hat{\mathbf{y}}_i')$ stand for the entropy of $v_i$ before and after annotation respectively. Also, $H(\hat{\mathbf{y}}_i', v_i+)$ and $H(\hat{\mathbf{y}}_i', v_i-)$ are the two cases of $H(\hat{\mathbf{y}}_i')$ where $v_i+$ and $v_i-$ occurs respectively. + +IG is exactly the expectation of entropy reduction, as proved in Appendix C. + +The confidence of the model in the pseudo label is shown in the soft label. Hence, before the annotation, this is a good measurement for the probability that the oracle will agree with the pseudo label, namely $P(v_{i} + )$ . + +Here following theorem shows the difference between IG and entropy. + +Theorem 3.1. The node with the highest entropy is not necessarily the node that brings the highest IG. + +The proof of this theorem can be found in Appendix A. + +More examples about IG in differing cases, that is, the oracle may agree or disagree with the pseudo label, can be found in Appendix D. + +# 3.2 INFLUENCE MAGNITUDE ESTIMATION + +Each newly annotated node will propagate its label information to its $k$ -hop neighbors in a $k$ -layer GNN and correspondingly influences the label distribution of these nodes. Since the influence of a node on its different neighbors can be various, we measure it by calculating how much change in the input label of node $v_{i}$ affects the propagated label of node $v_{j}$ after $k$ -steps propagation (Wang & Leskovec, 2020; Xu et al., 2018). + +Definition 3.3 (Influence Magnitude). The influence magnitude score of node $v_{i}$ on node $v_{j}$ after $k$ -step propagation is the L1-norm of the expected Jacobian matrix $\hat{I}_{f}(v_{j}, v_{i}, k) = \left\| \mathbb{E}[\partial \mathbf{X}_{j}^{(k)} / \partial \mathbf{X}_{i}^{(0)}] \right\|_{1}$ . Formally, we normalize the influence magnitude score as: + +$$ +I _ {f} \left(v _ {j}, v _ {i}, k\right) = \frac {\hat {I _ {f}} \left(v _ {j} , v _ {i} , k\right)}{\sum_ {v _ {w} \in \mathcal {V}} \hat {I _ {f}} \left(v _ {j} , v _ {w} , k\right)}. \tag {6} +$$ + +For a $k$ -layer GNN, the influence magnitude score $I_{f}(v_{j}, v_{i}, k)$ captures the sum over probabilities of all possible influential paths with length of $k$ from node $v_{i}$ to $v_{j}$ . Intuitively, node $v_{i}$ will influence $v_{j}$ by a larger extent and thus $I_{f}(v_{j}, v_{i}, k)$ is larger if $v_{i}$ is easier to achieve at $v_{j}$ after the random walk. In our AL setting, larger $I_{f}(v_{j}, v_{i}, k)$ means the label distribution of node $v_{j}$ will be influenced more by node $v_{i}$ if $v_{i}$ is labeled. + +# 3.3 INFORMATION GAIN PROPAGATION + +For a $k$ -layer GNN, the supervision signal of one node can be propagated to its $k$ -hop neighborhood nodes and then influences the label distribution of these neighbors. Therefore, it is unsuitable to just consider the information gain of the node itself in the node selection process. So, we extend the information gain of a single node defined in Def. 3.2 to its $k$ -hop neighbors in the graph. We firstly combine the influence magnitude with the normalized soft label and then measure the information gain propagation of all the influenced nodes. Concretely, the information gain propagation of node $v_{j}$ from the labeled node $v_{i}$ is defined as follows. + +Definition 3.4 (information gain propagation). Given the model predicted softmax outputs $\hat{y}_i$ of node $v_i$ , the influence magnitude $I_f(v_j, v_i, k)$ of node $v_i$ on $v_j$ , the information gain propagation of node $v_j$ from labeling node $v_i$ is defined as: + +$$ +I G P \left(v _ {j}, v _ {i}, k\right) = H \left(\sum_ {v _ {m} \in \mathcal {V} _ {l}} I _ {f} \left(v _ {j}, v _ {m}, k\right) \hat {\boldsymbol {y}} _ {m} ^ {\prime}\right) - H \left(\sum_ {v _ {m} \in \mathcal {V} _ {l} \cup \{v _ {i} \}} I _ {f} \left(v _ {j}, v _ {m}, k\right) \hat {\boldsymbol {y}} _ {m} ^ {\prime}\right). \tag {7} +$$ + +Since the new soft label $\hat{\pmb{y}}_i^{\prime}$ is unavailable for node $v_{i}$ before the annotation, the expected information gain propagation (IGP) is calculated by + +$$ +I G P \left(v _ {j}, v _ {i}, k\right) = P \left(v _ {i} +\right) I G P \left(v _ {j}, v _ {i}, k, v _ {i} +\right) + P \left(v _ {i} -\right) I G P \left(v _ {j}, v _ {i}, k, v _ {i} -\right), \tag {8} +$$ + +where $IGP(v_{j}, v_{i}, k, v_{i+})$ is the IGP when the oracle agrees with the pseudo label. In this case, $\hat{\pmb{y}}_{i}^{\prime}$ is a one-hot vector according to E.q. 4. + +# 3.4 MAXIMIZING INFORMATION GAIN PROPAGATION + +To maximize the uncertainty of all the influenced nodes in the semi-supervised GNN training, we aim to select and annotate a subset $\mathcal{V}_l$ from $\mathcal{V}$ so that the maximum information gain propagation can be achieved according to Eq. 9. Specifically, we optimize this problem by defining the information gain propagation maximization objective as below. + +Objective. Specifically, we propose to maximize the following objective: + +$$ +\max _ {\mathcal {V} _ {l}} F (\mathcal {V} _ {l}) = \sum_ {v _ {i} \in \mathcal {V} _ {l}} \sum_ {v _ {j} \in R F (v _ {i})} I G P (v _ {j}, v _ {i}, k), \mathbf {s}. \mathbf {t}. \mathcal {V} _ {l} \subseteq \mathcal {V}, | \mathcal {V} _ {l} | = \mathcal {B}. \tag {9} +$$ + +where $RF(v_{i})$ is the receptive field of node $v_{i}$ , i.e., the node itself with its $k$ -hop neighbors in a $k$ -layer GNN. Considering the influence propagation, the proposed objective can be used to find a subset $\mathcal{V}_{l}$ that can maximize the information gain of all influenced nodes as more as possible. + +![](images/598f3a4fd948c812a77430215b3b94ee6af35b7c18adc7cbccb4acee92a4f1e8.jpg) +Figure 3: An overview of the proposed IGP framework. + +Algorithm 1: Working pipeline of IGP +Input: Initial labeled set $\mathcal{V}_0$ query batch size $b$ Output: Labeled set $\nu_{l}$ +1 Stage 1: Node Selection +2 $\mathcal{V}_l = \mathcal{V}_0,\mathcal{V}_b = \emptyset$ . +3 for $t = 1,2,\ldots ,b$ do Select the most valuable node: $v_{i} = \arg \max_{v\in \mathcal{V}_{train}\backslash \mathcal{V}_{l}}F(\mathcal{V}_{l}\cup \{v\})$ . +5 $\mathcal{V}_l = \mathcal{V}_l\cup \{v_i\} ,\mathcal{V}_b = \mathcal{V}_b\cup \{v_i\} ,\mathcal{V}_{train} = \mathcal{V}_{train}\setminus \{v_i\} ;$ +6 Stage 2: Node Labeling +7 for $v_{i}\in \mathcal{V}_{b}$ do Judge the correctness of the predicted pseudo label $\bar{y}_i$ if $\bar{y}_i$ is correct (agreed by the oracle) then. Labeling $v_{i}$ with $\hat{\pmb{y}}_i^{\prime}$ according to Eq.4; else. Labeling $v_{i}$ with $\hat{\pmb{y}}_i^{\prime}$ according to Eq.4; $\mathcal{V}_l = \mathcal{V}_l\setminus \{v_i\} ,\mathcal{V}_{train} = \mathcal{V}_{train}\cup \{v_i\} ;$ +14 Return V + +# 4 IGP FRAMEWORK + +# 4.1 FRAMEWORK OVERVIEW + +As shown in Fig. 3, for each batch of node selection, IGP first trains the GNN model with the soft labels. With the model prediction, IGP measures the expected information gain of labeling each node. Considering both the influence magnitude and information gain, IGP further measures the information gain propagation of each unlabeled node and selects a batch of nodes that can maximize the information gain propagation on the graph. After that, with the relaxed queries, the oracle only judges the correctness of the model prediction, and the label distribution will be normalized correspondingly. At last, we re-train the GNN model with update the model prediction. The above process is repeated until the labeling cost $\mathcal{B}$ runs out. + +# 4.2 WORKING PIPELINE + +Node Selection. Without losing generality, consider a batch setting where $b$ nodes are selected in each iteration. Algorithm 1 provides a sketch of our greedy selection method for GNNs. Given the training set $\mathcal{V}_{train}$ , and query batch size $b$ , we first select the node $v_{i}$ , which generates the maximum marginal gain (Line 3). We then update the labeled set $\mathcal{V}_l$ , the oracle annotated set $\mathcal{V}_b$ , and the training set $\mathcal{V}_{train}$ (Line 4). This process is repeated until a batch of $b$ nodes have been selected. Note that the normalized soft label $\hat{\pmb{y}}_i'$ is unavailable before the node labeling process. For better efficiency, we assume $\hat{\pmb{y}}_i'$ is the model predicted soft label $\hat{\pmb{y}}_i$ in the node selection process. If $\hat{\pmb{y}}_i$ is not confident (i.e., [0.4,0.3,0.3] for a three-classification problem), it will be of little influence on the label distribution of its neighbors. On the contrary, if $\hat{\pmb{y}}_i$ is closer to $\hat{\pmb{y}}_i'$ if it is confident. Consequently, it is reasonable to make such an assumption. + +Node Labeling After getting a batch of the selected node-set $\nu_{b}$ , we acquire the label from an oracle. As introduced before, different from previous works which require the oracle to annotate the hard + +label directly, the oracle in our framework only needs to judge the correctness of the pseudo label $\bar{y}_i$ (Line 8). If $\bar{y}_i$ is correct, we update its soft label $\hat{\pmb{y}}_i'$ according to Eq. 4 (Line 10). Note that we can still get information gain even if $\bar{y}_i$ is incorrect. For any node $v_i$ with an incorrect pseudo label, we firstly update its soft label $\hat{\pmb{y}}_i'$ (Line 10). After that, we remove it from $\mathcal{V}_l$ and add it to $\mathcal{V}_{train}$ (Line 13). In this way, this node has the chance to be re-selected in the next batch. Note that the model will produce a different label given the fact that the oracle rejects the previously predicted label. + +Model Training Intuitively, a node with smaller entropy contains contributes more to the training process. In other words, a one-hot label contributes most, while other normalized soft labels also provide weak supervision. For GNN model training, we use the weighted loss function as follows + +$$ +\mathcal {L} = - \sum_ {v _ {i} \in \mathcal {V} _ {l}, H (v _ {i}) = 0} \hat {\mathbf {y}} _ {i} ^ {\prime} \log \hat {\mathbf {y}} _ {i} + \alpha \sum_ {v _ {i} \in \mathcal {V} _ {l}, H (v _ {i}) \neq 0} \hat {\mathbf {y}} _ {i} ^ {\prime} \log \frac {\hat {\mathbf {y}} _ {i} ^ {\prime}}{\tilde {\mathbf {y}} _ {i}}, \tag {10} +$$ + +where $\alpha$ is a hyper-parameter which controls the importance of the incorrectly predicted nodes by the model. Note that the labeled set has two types of labels: 1) one-hot hard labels (i.e., $H(v_{i}) = 0$ ), which is correctly predicted by the model; 2) soft labels (i.e., $H(v_{i}) \neq 0$ ), which has incorrect model prediction but also provides weak supervision. We adopt the KL divergence as the loss function to learn from the weak supervised soft label in both cases (cross-entropy is just a special case of KL divergence). Note that KL divergence measures the distance between the ground truth and the current prediction, and it is especially appropriate for methods with a basis of information theory. + +# 4.3 EFFICIENCY OPTIMIZATION + +By leveraging some recent works on scalable and parallelizable social influence maximization (Aral & Dhillon, 2018), we could enable IGP to efficiently deal with large-scale graphs. The key idea is to identify and dismiss uninfluential nodes to dramatically reduce the amount of computation for evaluating the information gain propagation. For example, we can use the node degree or the distribution of random walkers throughout the nodes (Kim et al., 2017) to filter out a vast number of uninfluential nodes. + +# 5 EXPERIMENTS + +# 5.1 EXPERIMENTAL SETTINGS + +Datasets. We evaluate IGP in both inductive and transductive settings (Hamilton et al., 2017): three citation networks (i.e., Citeseer, Cora, and PubMed) (Kipf & Welling, 2017a), one large social network (Reddit), and one OGB dataset (ogbn-arxiv). + +GNN Models. We conduct experiments using the widely used GCN model and demonstrate the generalization of IGP on other GNNs such as SGC (Wu et al., 2019), APPNP (Klicpera et al., 2019) and MVGRL (Hassani & Khasahmadi, 2020). + +Baselines. We compare IGP with the following baselines: Random, AGE (Cai et al., 2017), ANRMAB (Gao et al., 2018), GPA (Hu et al., 2020), SEAL (Li et al., 2020), ALG (Zhang et al., 2021a), and GRAIN (Zhang et al., 2021c) + +Settings. For each method, we use the hyper-parameter tuning toolkit (Li et al., 2021a;b) or follow the original papers to find the optimal hyper-parameters. To eliminate randomness, we repeat each method ten times and report the mean performance. Specifically, for each method, we choose a small set of labeled nodes as an initial pool - two nodes are randomly selected for each class. + +# 5.2 PERFORMANCE COMPARISON + +End-to-end Comparison. We choose the labeling budget as 20 labels per class to show the end-to-end accuracy. Table 1 shows that GRAIN, ALG, AGE, and ANRMAB outperform Random in all the datasets, as they are specially designed for GNNs. GRAIN and ALG perform better than other baselines except for IGP because they consider the RF. However, IGP further boosts the accuracy by a significant margin. Remarkably, IGP improves the test accuracy of the best baseline, i.e., GRAIN, by $1.6 - 2.2\%$ on the three citation networks, $0.9\%$ on Reddit, and $0.6\%$ on ogn-arxiv. + +Table 1: The test accuracy (%) on different datasets with the same labeling budget. + +
MethodCoraCiteseerPubMedRedditogbn-arxiv
Random78.8(±0.8)70.8(±0.9)78.9(±0.6)91.1(±0.5)68.2(±0.4)
AGE82.5(±0.6)71.4(±0.6)79.4(±0.4)91.6(±0.3)68.9(±0.3)
ANRMAB82.4(±0.5)70.6(±0.6)78.2(±0.3)91.5(±0.3)68.7(±0.2)
GPA82.8(±0.4)71.6(±0.4)79.9(±0.5)91.8(±0.2)69.2(±0.3)
SEAL83.2(±0.5)72.1(±0.4)80.3(±0.4)92.1(±0.3)69.5(±0.1)
ALG83.6(±0.6)73.6(±0.5)80.9(±0.3)92.4(±0.3)70.1(±0.2)
GRAIN84.2(±0.3)74.2(±0.3)81.8(±0.2)92.5(±0.1)70.3(±0.2)
IGP86.4(±0.6)75.8(±0.3)83.6(±0.5)93.4(±0.2)70.9(±0.3)
+ +![](images/83cc33b271d71546e0690db94b9b08175ee4837411e63f0f751083a0313772a9.jpg) +(a) Cora + +![](images/fb895407113e17a5dda43a9c09c44326205661f40e93fd95d1c374c6143b04e6.jpg) +(b) Citeseer + +![](images/7284191aca0e79d7190565d89d79ccbc3bd50cfc6c42908f640aab4b95245a3b.jpg) +(c) PubMed +Figure 4: The test accuracy across different labeling budgets for model training. + +Accuracy under Different Labeling Budgets. To show the influence of the labeling budget, we test the accuracy of different AL methods under different labeling budgets on three citation datasets. Concretely, we range the budgets of oracle labels from $2C$ to $20C$ ( $C$ is the number of classes) and show the test accuracy of GCN in Figure 4. The experimental results demonstrate that with the increase of labeling budget, the accuracy of IGP grows fairly fast, thereby outperforming the baselines with an even greater margin. + +Generalization. In addition to GCN, IGP can also be applied to a large variety of GNN variants. GCN, SGC, MVGRL, and APPNP are four representative GNNs (Chen et al., 2021) which adopt different message passings. Unlike the coupled GCN, both SGC and APPNP are decoupled, while their orderings when doing feature propagation and transformation are different. Besides, MVGRL is a classic self-supervised GNN. We test the generalization ability of IGP by evaluating the aforementioned four types of GNNs on $20C$ ( $C$ is the number of classes) nodes selected by IGP and other baselines in the AL scenario, and the corresponding results are shown in Table 2. The results suggest that IGP consistently outperforms the other baselines, regardless of whether the GCC is decoupled. Moreover, the result also shows our proposed method IGP can significantly outperform the compared baselines on the top of more sophisticated self-supervised GNN such as MVGRL (Hassani & Khasahmadi, 2020). As shown in the table, the test accuracy of IGP could outperform ALG and GRAIN by more than $1.8\%$ on PubMed. Therefore, we draw a conclusion that IGP can generalize to different types of GNNs well. + +Ablation study. IGP combines informative selecting, informative training, and information quantity in the method. To verify the necessity of each component, we evaluate IGP on GCN by disabling one component at a time. We evaluate IGP: (i) without the node labeled with soft label when training (called “No Informative Training (IT)”; (ii) without the information gain propagation when selecting nodes (called “No Informative Selection (IS)”; (iii) without the influence magnitude and regarding the information among all the nodes as the same (called “No Information Quantity (IM)”);(iv) without the normalized soft label and set the soft label uniformly (called “No Normalized Label (NL)”); Table 3 displays the results of these three settings, and from the table we can learn the following information. 1) If informative training is ignored, the test accuracy will decrease in all three datasets, e.g., the accuracy gap is as large as $2.9\%$ on PubMed. This is because informative training help utilizing the information of the nodes labeled by probability. 2) Lacking information selecting will lead to worse accuracy, since the information gain of the nodes can not only benefit itself but also its neighbors in the graph. It is more important than other components since removing the information selecting will lead to a more substantial accuracy gap. For example, the gap on Cora is $2.5\%$ , which is higher than the other gap $(2.3\%)$ . 3) Information quantity also significantly impacts model accuracy on all datasets, because it will lead to a wrong preference on the nodes with larger degree, although some of them have little influence on other nodes. 4) If we remove normalized label and set the soft + +Table 2: Test accuracy of different models on PubMed. + +
MethodSGCAPPNPGCNMVGRL
Random77.6(±0.8)79.2(±0.6)78.9(±0.6)79.3(±0.5)
AGE78.8(±0.5)79.9(±0.5)79.4(±0.4)79.9(±0.4)
ANRMAB77.8(±0.4)78.7(±0.5)78.2(±0.3)78.9(±0.3)
GPA79.5(±0.6)80.2(±0.4)79.9(±0.5)80.4(±0.3)
SEAL79.8(±0.5)80.5(±0.5)80.3(±0.4)80.7(±0.3)
ALG80.5(±0.4)81.2(±0.5)80.9(±0.3)81.3(±0.2)
GRAIN81.1(±0.3)82.0(±0.4)81.8(±0.2)82.1(±0.1)
IGP83.2(±0.6)83.7(±0.5)83.6(±0.5)83.9(±0.4)
+ +Table 3: Influence of different components in test accuracy(%) + +
MethodCoraΔCiteseerΔPubMedΔ
No IT84.1(±0.7)-2.373.2(±0.3)-2.680.7(±0.5)-2.9
No IS83.9(±0.5)-2.573.1(±0.4)-2.780.4(±0.4)-3.2
No IM84.5(±0.6)-1.973.6(±0.5)-2.281.5(±0.6)-2.1
No NL84.4(±0.5)-2.073.4(±0.3)-2.481.3(±0.4)-2.3
IGP86.4(±0.6)-75.8(±0.3)-83.6(±0.5)-
+ +![](images/15eccf121227579ee2d204a8c2999d577d9dd0360fe7d41ffe682eee1604e929.jpg) +Figure 5: The node distribution with different labels of different methods on the Cora dataset. + +![](images/f673c04456a6c82b97777409d30cf14a9ad5be484ca76a7176bc9945822a367e.jpg) + +label uniformly, the test accuracy will decrease apparently. Although the performance degradation is smaller than no IT and no IS, the results still show the necessity of normalized label. + +Interpretability To show the insight of IGP, we evaluate and draw the distribution of the nodes with soft labels (in red color) and hard labels (in blue color), also those without labels (in gray color) for two methods: AGE and IGP when the labeling budget is $6C$ for Cora in GCN, the more information entropy the nodes have, the smaller its radium (one-hot labeled node has the largest radium). The result in Figure 5 shows that compared to AGE, IGP has enough labeled nodes with a balanced distribution, both in probability and one-hot, which could explain the better performance of NC-ALG in node classification. We also show the influence on information entropy in Appendix. + +# 6 CONCLUSION + +This paper presents Informationoin Gain Propagation (IGP), the first GNN-based AL method which explicitly considers AL with soft labels. Concretely, we provide a new way for active learners to exhaustively label nodes with a limited budget, using a combination of domain experts and GNN model. IGP allows us to use relaxed queries where domain expert (oracle) only judges the correctness of the predicted labels rather than the exact categorization, and ii) new criteria of maximizing information gain propagation for the active learner with relaxed queries and soft labels. Empirical studies on real-world graphs show that our approach outperforms competitive baselines by a large margin, especially when the number of classes is large. + +# 7 REPRODUCIBILITY + +The source code of IGP can be found in Github (https://github.com/zwt233/IGP). To ensure reproducibility, we have provided the overview of datasets in Section F.1 and Table 4 in Appendix F. The detailed hyperparameter settings for our IGP can be found in Appendix F.2. Our experimental environment is presented in Appendix F.2, and please refer to "README.md" in the Github repository for more details. + +# ACKNOWLEDGMENTS + +This work is supported by NSFC (No. 61832001, 61972004), Beijing Academy of Artificial Intelligence (BAAI), and PKU-Tencent Joint Research Lab. Bin Cui is the corresponding author. + +# REFERENCES + +Charu C Aggarwal, Xiangnan Kong, Quanquan Gu, Jiawei Han, and S Yu Philip. Active learning: A survey. In Data Classification: Algorithms and Applications, pp. 571-605. CRC Press, 2014. +Umang Aggarwal, Adrian Popescu, and Céline Hudelot. Active learning for imbalanced datasets. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 1428-1437, 2020. +Sinan Aral and Paramveer S Dhillon. Social influence maximization under empirical influence models. Nature human behaviour, 2(6):375-382, 2018. +Josh Attenberg and Foster Provost. Why label when you can search? alternatives to active learning for applying human resources to build classification models under extreme class imbalance. In Proceedings of the 16th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 423-432, 2010. +Robert Burbidge, Jem J Rowland, and Ross D King. Active learning for regression based on query by committee. In International conference on intelligent data engineering and automated learning, pp. 209-218. Springer, 2007. +Hongyun Cai, Vincent W Zheng, and Kevin Chen-Chuan Chang. Active learning for graph embedding. arXiv preprint arXiv:1705.05085, 2017. +Lei Chen, Zhengdao Chen, and Joan Bruna. On graph neural networks versus graph-augmented mlps. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021, 2021. +Kien Do, Truyen Tran, and Svetha Venkatesh. Graph transformation policy network for chemical reaction prediction. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pp. 750-760, 2019. +Bo Du, Zengmao Wang, Lefei Zhang, Liangpei Zhang, Wei Liu, Jialie Shen, and Dacheng Tao. Exploring representativeness and informativeness for active learning. IEEE transactions on cybernetics, 47(1):14-26, 2015. +Li Gao, Hong Yang, Chuan Zhou, Jia Wu, Shirui Pan, and Yue Hu. Active discriminative network representation learning. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, July 13-19, 2018, Stockholm, Sweden, pp. 2142-2148, 2018. +William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 1024-1034, 2017. +Kaveh Hassani and Amir Hosein Khasahmadi. Contrastive multi-view representation learning on graphs. In International Conference on Machine Learning, pp. 4116-4126. PMLR, 2020. + +Shengding Hu, Zheng Xiong, Meng Qu, Xingdi Yuan, Marc-Alexandre Côté, Zhiyuan Liu, and Jian Tang. Graph policy network for transferable active learning on graphs. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. +Heinrich Jiang and Maya R. Gupta. Bootstrapping for batch active sampling. In KDD '21: The 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, Singapore, August 14-18, 2021, pp. 3086-3096, 2021. +Seungkeol Kim, Dongeun Kim, Jinoh Oh, Jeong-Hyon Hwang, Wook-Shin Han, Wei Chen, and Hwanjo Yu. Scalable and parallelizable influence maximization with random walk ranking and rank merge pruning. Information Sciences, 415:171-189, 2017. +Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017a. +Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings, 2017b. +Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019. +Jia Li, Zhichao Han, Hong Cheng, Jiao Su, Pengyun Wang, Jianfeng Zhang, and Lujia Pan. Predicting path failure in time-evolving graphs. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pp. 1279-1289, 2019. +Yang Li, Yu Shen, Wentao Zhang, Yuanwei Chen, Huajun Jiang, Mingchao Liu, Jiawei Jiang, Jinyang Gao, Wentao Wu, Zhi Yang, et al. Openbox: A generalized black-box optimization service. arXiv preprint arXiv:2106.00421, 2021a. +Yang Li, Yu Shen, Wentao Zhang, Jiawei Jiang, Bolin Ding, Yaliang Li, Jingren Zhou, Zhi Yang, Wentao Wu, Ce Zhang, et al. Volcanoml: Speeding up end-to-end automl via scalable search space decomposition. arXiv preprint arXiv:2107.08861, 2021b. +Yayong Li, Jie Yin, and Ling Chen. Seal: Semisupervised adversarial active learning on attributed graphs. IEEE Transactions on Neural Networks and Learning Systems, 32(7):3136-3147, 2020. +Prem Melville and Raymond J Mooney. Diverse ensembles for active learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 74, 2004. +Hieu T Nguyen and Arnold Smeulders. Active learning using pre-clustering. In Proceedings of the twenty-first international conference on Machine learning, pp. 79, 2004. +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, pp. 8024-8035, 2019. +Guo-Jun Qi, Xian-Sheng Hua, Yong Rui, Jinhui Tang, and Hong-Jiang Zhang. Two-dimensional active learning for image classification. In 2008 IEEE conference on computer vision and pattern recognition, pp. 1-8. IEEE, 2008. +Min Tang, Xiaoqiang Luo, and Salim Roukos. Active learning for statistical natural language parsing. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pp. 120-127, 2002. +Hao Wang, Tong Xu, Qi Liu, Defu Lian, Enhong Chen, Dongfang Du, Han Wu, and Wen Su. MCNE: an end-to-end framework for learning multiple conditional network representations of social network. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pp. 1064-1072, 2019. + +Hongwei Wang and Jure Leskovec. Unifying graph convolutional neural networks and label propagation. CoRR, abs/2002.06755, 2020. +Felix Wu, Amauri H. Souza Jr., Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Q. Weinberger. Simplifying graph convolutional networks. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, pp. 6861-6871, 2019. +Jian Wu, Victor S. Sheng, Jing Zhang, Hua Li, Tetiana Dadakova, Christine Leon Swisher, Zhiming Cui, and Pengpeng Zhao. Multi-label active learning algorithms for image classification: Overview and future promise. ACM Comput. Surv., 53(2):28:1-28:35, 2020a. +Shiwen Wu, Fei Sun, Wentao Zhang, and Bin Cui. Graph neural networks in recommender systems: a survey. arXiv preprint arXiv:2011.02260, 2020b. +Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In ICML, pp. 5449-5458, 2018. +Yifan Yan and Sheng-Jun Huang. Cost-effective active learning for hierarchical multi-label classification. In IJCAI, pp. 2962-2968, 2018. +Yi Yang, Zhigang Ma, Feiping Nie, Xiaojun Chang, and Alexander G Hauptmann. Multi-class active learning by uncertainty sampling with diversity maximization. International Journal of Computer Vision, 113(2):113-127, 2015. +Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor K. Prasanna. Graphsaint: Graph sampling based inductive learning method. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, 2020. +Wentao Zhang, Jiawei Jiang, Yingxia Shao, and Bin Cui. Snapshot boosting: a fast ensemble framework for deep neural networks. Science China Information Sciences, 63(1):1-12, 2020a. +Wentao Zhang, Yu Shen, Yang Li, Lei Chen, Zhi Yang, and Bin Cui. ALG: fast and accurate active learning framework for graph convolutional networks. In SIGMOD '21: International Conference on Management of Data, Virtual Event, China, June 20-25, 2021, pp. 2366-2374, 2021a. +Wentao Zhang, Yexin Wang, Zhenbang You, Meng Cao, Ping Huang, Jiulong Shan, Zhi Yang, and Bin Cui. Rim: Reliable influence-based active learning on graphs. Advances in Neural Information Processing Systems, 34, 2021b. +Wentao Zhang, Zhi Yang, Yexin Wang, Yu Shen, Yang Li, Liang Wang, and Bin Cui. Grain: Improving data efficiency of graph neural networks via diversified influence maximization. Proc. VLDB Endow., 14(11):2473-2482, 2021c. +Ziwei Zhang, Peng Cui, and Wenwu Zhu. Deep learning on graphs: A survey. IEEE Transactions on Knowledge and Data Engineering, 2020b. +Jingbo Zhu, Huizhen Wang, Tianshun Yao, and Benjamin K Tsou. Active learning with sampling by uncertainty and density for word sense disambiguation and text classification. In Proceedings of the 22nd International Conference on Computational Linguistics, pp. 1137-1144, 2008. + +# A PROOFS + +Theorem A.1. The node with highest entropy (in terms of the soft label given by the model) is not necessarily the node that brings highest expected information gain. + +Let us consider a three classification problem. Assume there is a node $s$ with soft label $[1 - 2a, a, a]$ , where $0 \leq a \leq \frac{1}{3}$ so that $1 - 2a \geq a$ . Therefore, the entropy of $s$ is given by + +$$ +H (s) = - (1 - 2 a) \log (1 - 2 a) - a \log a - a \log a = - (1 - 2 a) \log (1 - 2 a) - 2 a \log a \tag {11} +$$ + +When the oracle gives a negative answer, the soft label will become $[0, 0.5, 0.5]$ , and thus the entropy will become $-0.5\log 0.5 - 0.5\log 0.5 = \log 2 = 1$ . Consequently, the expected information gain of $s$ is given by + +$$ +I G (s) = (1 - 2 a) (H (s) - 0) + 2 a (H (s) - 1) = H (s) - 2 a \tag {12} +$$ + +Take the derivatives of the above two variables, we have + +$$ +\begin{array}{l} \frac {\mathrm {d} H (s)}{\mathrm {d} a} = \left[ - (1 - 2 a) \log (1 - 2 a) - 2 a \log a \right] ^ {\prime} \\ = - \left\{\left[ (1 - 2 a) \log (1 - 2 a) \right] ^ {\prime} + 2 (a \log a) ^ {\prime} \right\} \\ = - \left\{\left[ \log (1 - 2 a) + \frac {1}{\ln 2} \right] * (- 2) + 2 \left(\log a + \frac {1}{\ln 2}\right) \right\} \tag {13} \\ = 2 \left[ \log (1 - 2 a) - \log a \right] \\ = 2 \log \frac {1 - 2 a}{a} \\ \end{array} +$$ + +$$ +\begin{array}{l} \frac {\mathrm {d} I G (s)}{\mathrm {d} a} = \frac {\mathrm {d} (H (s) - 2 a)}{\mathrm {d} a} \\ = \frac {\mathrm {d} H (s)}{\mathrm {d} a} - 2 \tag {14} \\ = 2 \log {\frac {1 - 2 a}{a}} - 2 \\ = 2 (\log \frac {1 - 2 a}{a} - 1) \\ \end{array} +$$ + +Since $0 \leq a \leq \frac{1}{3}$ , $\frac{\mathrm{d}H(s)}{\mathrm{d}a}$ is always greater than or equal to zero. In other words, $H(s)$ increases with $a$ . + +However, $\frac{\mathrm{d}IG(s)}{\mathrm{d}a}$ is greater than or equal to zero when $0 \leq a \leq \frac{1}{4}$ , and less than zero when $\frac{1}{4} < a \leq \frac{1}{3}$ . That being said, when $a$ is less than $\frac{1}{4}$ , $IG(s)$ increases with $a$ ; nonetheless, when $a$ is greater than $\frac{1}{4}$ , $IG(s)$ decreases with $a$ , although $H(s)$ keeps increasing in this case. + +To give a specific counterexample, let $a_1 = 0.25$ and $a_2 = 0.3$ and denote these nodes as $s_1$ and $s_2$ respectively. Thus, the soft labels of $s_1$ and $s_2$ are $[0.5, 0.25, 0.25]$ and $[0.4, 0.3, 0.3]$ , and we have $H(s_1) = 1.5$ , $H(s_2) \approx 1.571$ , $IG(s_1) = 1$ and $IG(s_2) \approx 0.971$ . Evidently, $H(s_1) < H(s_2)$ and $IG(s_1) > IG(s_2)$ . + +Therefore, the theorem follows. + +# B NORMALIZED LABEL + +For a certain node, if the soft label given by the model is $[a_1, a_2, \dots, a_c]$ , and the oracle indicates that the node does not belong to class $l$ , then the probability that the node belongs to class $i$ ( $i \neq l$ ) is given by + +$$ +\frac {a _ {i}}{\sum_ {j \neq l} a _ {j}} \tag {15} +$$ + +In essence, this is a conditional probability. Formally, let $j$ be the ground truth label of the node, and then our target can be expressed as + +$$ +P (j = i \mid j \neq l) \tag {16} +$$ + +With the definition of conditional probability, the above can be transformed as follows + +$$ +P (j = i \mid j \neq l) = \frac {P (j = i , j \neq l)}{P (j \neq l)} = \frac {P (j = i)}{P (j \neq l)} \tag {17} +$$ + +According to the known condition, $P(j = i) = a_{i}$ and $P(j \neq l) = \sum_{j \neq l} a_{j}$ . Therefore, the theorem follows. The theorem suggests that, when the oracle gives a negative answer, the normalized soft label should be set with accordance to the soft label given by the model, rather than the uniform distribution. + +Table 4: Overview of the Five Datasets + +
Dataset#Nodes#Features#Edges#Classes#Train/Val/TestTask typeDescription
Cora2,7081,4335,42971,208/500/1,000Transductivecitation network
Citeseer3,3273,7034,73261,827/500/1,000Transductivecitation network
Pubmed19,71750044,338318,217/500/1,000Transductivecitation network
ogbn-arxiv169,3431281,166,2434090,941/29,799/48,603Transductivecitation network
Reddit232,96560211,606,91941155,310/23,297/54,358Inductivesocial network
+ +# C INFORMATION GAIN (IG) + +For node $v_{i}$ , the IG of annotating it is defined as + +$$ +I G (v _ {i}) = H \left(\hat {\mathbf {y}} _ {i}\right) - P (v _ {i} -) H \left(\hat {\mathbf {y}} _ {i} ^ {\prime}, v _ {i} -\right), \tag {18} +$$ + +Starting from the expectation of entropy reduction, we show how it is transformed into IG as follows. Note that if the oracle agrees with the pseudo label, i.e., event $v_{i} +$ , the hard label will be obtained, thus the entropy dropping to 0. + +$$ +\begin{array}{l} \operatorname {E} \left[ H \left(\hat {\mathbf {y}} _ {i}\right) - H \left(\hat {\mathbf {y}} _ {i} ^ {\prime}\right) \right] = P \left(v _ {i} +\right) \left(H \left(\hat {\mathbf {y}} _ {i}\right) - H \left(\hat {\mathbf {y}} _ {i} ^ {\prime}, v _ {i} +\right)\right) + P \left(v _ {i} -\right) \left(H \left(\hat {\mathbf {y}} _ {i}\right) - H \left(\hat {\mathbf {y}} _ {i} ^ {\prime}, v _ {i} -\right)\right) \\ = P \left(v _ {i} +\right) \left(H \left(\hat {\boldsymbol {y}} _ {i}\right) - 0\right) + P \left(v _ {i} -\right) \left(H \left(\hat {\boldsymbol {y}} _ {i}\right) - H \left(\hat {\boldsymbol {y}} _ {i} ^ {\prime}, v _ {i} -\right)\right) \tag {19} \\ = \left(P \left(v _ {i} +\right) + P \left(v _ {i} -\right)\right) H \left(\hat {\mathbf {y}} _ {i}\right) - P \left(v _ {i} -\right) H \left(\hat {\mathbf {y}} _ {i} ^ {\prime}, v _ {i} -\right) \\ = I G (v _ {i}) \\ \end{array} +$$ + +# D EXAMPLE OF EXPECTED INFORMATION GAIN + +- Case 1: $v_{i}$ belongs to the oracle annotated class $l$ . The prediction is correct in this case, and the information changes from the uncertain soft label to the one-hot label. Suppose the model predicted softmax outputs $\hat{y}_{i}$ is [0.5, 0.3, 0.2], the label is changed into [1, 0, 0] and the corresponding information gain is defined as $H([0.5, 0.3, 0.2]) - H([1, 0, 0])$ , where $H(\cdot)$ is the entropy function. +- Case 2: $v_{i}$ doesn't belong to the oracle annotated class $l$ . In this case, the model prediction is incorrect, but the uncertainty of the soft label is also decreased because we have already known that the true label may belong to the remaining classes except for the class $l$ . Similar to case 1, suppose the predicted label $\hat{y}_{i}$ is [0.5, 0.3, 0.2], the soft label is changed into [0, 0.6, 0.4] and the corresponding information gain is defined as $H([0.5, 0.3, 0.2]) - H([0, 0.6, 0.4])$ . + +# E TIME COMPLEXITY ANALYSIS + +Given a $K$ -layer GNN, the propagation matrix $(N\times N$ , with $M$ nonzero values) and label matrix $(N\times c)$ should be multiplied $K$ times in IGP. Therefore, in the stage of node selection (line 3-5 in Algorithm 1), selecting the node that maximizes the propagation of information gain $F(\mathcal{V}_l\cup \{v\})$ from unlabeled nodes requires $\mathcal{O}(KMc)$ , where $K$ is the number of layers of GNNs, $M$ is the number of edges and $c$ is the number of classes. All in all, the cost of selecting a batch of b nodes is $\mathcal{O}(bKMc)$ . Suppose we filter out all but $n$ nodes with a degree larger than a threshold and get the corresponding propagation matrix $(n\times N$ , with $m$ nonzero values), we can reduce the overall time complexity to $\mathcal{O}(bKmc)$ . + +# F EXPERIMENTAL DETAILS + +# F.1 DATASET DESCRIPTION + +Cora, Citeseer, and Pubmed are three popular citation network data-sets, and we follow the public training/validation/test split in GCN Kipf & Welling (2017b). In these three networks, papers from + +![](images/727dd881db237ea246358205cb9fe15012340b1b6b4acd996cccdeb1b6d29d23.jpg) +Figure 6: the change of information entropy for the whole dataset when labeling budget grows. + +different topics are considered as nodes, and the edges are citations among the papers. The node attributes are binary word vectors, and class labels are the topics papers belong to. + +Reddit is a social network dataset derived from the community structure of numerous Reddit posts. It is a well-known inductive training dataset, and the training/validation/test split in our experiment is the same as that in GraphSAGE Hamilton et al. (2017). The public version provided by GraphSAINT2 Zeng et al. (2020) is used in our paper. + +ogbn-arxiv is a directed graph, representing the citation network among all Computer Science (CS) arXiv papers indexed by MAG. The training/validation/test split in our experiment is the same as the public version. The public version provided by $\mathrm{OGB}^3$ is used in our paper. + +For more specifications about the five aforementioned datasets, see Table 4. + +# F.2 IMPLEMENTATION DETAILS + +For GPA Hu et al. (2020), to achieve the highest accuracy, we directly use the pre-trained model by its authors on Github. Specifically, for Cora, we choose the model pre-trained on PubMed and Citeseer; for PubMed, we choose the model pre-trained on Cora and Citeseer; for Citeseer and Reddit, we choose the model pre-trained on Cora and PubMed; for ogbn-arxiv, we choose the model pre-trained on PubMed and Reddit. Other hyper-parameters are all identical to the open-source code. + +For AGE Cai et al. (2017) and ANRMAB Gao et al. (2018), to procure well-trained models and guarantee that their model-based selection criteria work well, GCN is trained for 200 epochs in each node selection iteration. AGE is implemented with its open-source version and ANRMAB in accordance with its original paper. + +For ALG Zhang et al. (2021a) and GRAIN Zhang et al. (2021c), we follow the public code released by the original paper. + +For the hyperparameter $\alpha$ , we set it as 1 in CiteSeer, PubMed and ogbn-arxiv, and as 2 for Cora and Reddit. Besides, the degree for dismissing uninfluential nodes in IGP is 8 for Cora, CiteSeer, PubMed, and 15 for Reddit and ogbn-arxiv. + +We carry out all the experiments on an Ubuntu 16.04 system with Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz, 4 NVIDIA GeForce GTX 1080 Ti GPUs and 256 GB DRAM. All the experiments are implemented in Python 3.6 with Pytorch 1.7.1 Paszke et al. (2019) on CUDA 10.1. + +# G INTERPRETABILITY ANALYSIS + +We test the change of information entropy for Citeseer dataset when the labeling budget grows from $2c$ to $20c$ ( $c$ is the number of classes) and report the result in Figure 6. Compare to other methods that bring fixed information entropy decrease, IGP has much less information entropy and the gap becomes larger when the labeling budget grow, which explains the better performance of our method. + +Table 5: Performance along with running time on the Reddit dataset. + +
MethodANRMABGPAAGESEALALGIGPIGGRAIN
Relative Running Time340.00331.258.254.001.631.381.251.00
Test Accuracy(%)91.5(±0.3)91.8(±0.2)91.6(±0.3)92.1(±0.3)92.4(±0.3)93.4(±0.2)91.7(±0.3)92.5(±0.1)
+ +Table 6: The test accuracy (%) on different hyperparameters on the PubMed dataset + +
parametersα=0α=0.5α=1α=2
SGC79.6(±0.7)82.8(±0.6)83.2(±0.6)82.9(±0.5)
APPNP80.4(±0.6)83.4(±0.4)83.7(±0.5)83.6(±0.5)
GCN80.7(±0.4)83.5(±0.5)83.6(±0.5)83.4(±0.6)
MVGRL80.5(±0.6)83.2(±0.5)83.9(±0.4)83.5(±0.4)
+ +# H EFFICIENCY ANALYSIS + +To test the efficiency of IGP, we also compare its running time per AL iteration with other baselines in a batch of node selection in the Reddit dataset. Besides, to measure the influence of the extra computational cost in maximizing the propagation of information gain in the local neighborhood, we remove the propagation part in IGP and name this baseline IG. + +We set the training time of GRAIN as the baseline, the relative training time and the test accuracy of each method are provided in Table 5. As shown in Table 5, our method IGP can get comparable efficiency as GRAIN while achieving the accuracy improvement of $0.9\%$ . Besides, removing the propagation part in IGP will make the AL process a little faster, but it also leads to large performance degradation of $1.7\%$ compared with IGP. + +# I EXPLORATION OF HYPERPARAMETERS + +Our proposed IGP has only one hyperparameter $\alpha$ , which controls the importance of the weak label. To investigate its impact on IGP, we set $\alpha$ to different values and then report the corresponding test accuracy with different base GNN models on different datasets. The experimental results in Table 6 show that removing the weak label will lead to large performance degradation in different models, which verifies the effectiveness of our proposed weak label. Besides, our method IGP is robust to the choice of $\alpha$ since its performance is stable on different models when we increase $\alpha$ from 0.5 to 2. + +# J INFLUENCE OF THE NUMBER OF CLASSES + +To clarify the influence of the number of classes, we examine the model accuracies as a function of the number of classes on the ogbn-arxiv dataset. Specifically, we gradually increase the number of classes and the corresponding number of nodes of the ogbn-arxiv dataset, and report the mean test accuracy of 10 runs with and without the soft-label. As shown in the newly added Figure 7(a), although more classes increase the complexity of a classification problem (thus a decreasing model accuracy), we see that the performance gain of adding soft labels decreases slightly as the number of classes increases. + +The reason is that although the soft-max is taken over the remaining classes, the distribution of the output of soft-max (i.e., soft label) is expected to be highly skewed, which can help to alleviate the effect of increased class number on the quality of the soft label. To demonstrate this, we add a new Figure 7(b) showing the percentage of the node whose top-K accuracy is larger than $80\%$ . As the percentages of top K class increases (i.e., K/total class number), more than $90\%$ nodes only need the predicted top $20\%$ classes to guarantee the top-K accuracy larger than $80\%$ , which means few classes predominate the softmax distribution. + +![](images/5ea1eab79fb0f059347595d51b00baf94fa8df2852da077ec6ff0149e081e20b.jpg) +(a) The influence of soft label. + +![](images/5cf0ffc61df2c80c2d03a997ebef675d36352e153986a4e9c6a8049dbf56a97a.jpg) +(b) The analysis of class distribution. +Figure 7: (Left) The test accuracy of the different number of classes with and without the soft label. (Right) The relationship of probability and percentage of top-K class in all of the classes. + +Table 7: The test accuracy (%) with different filtering degrees on the Reddit dataset. + +
Filtering Degree051015
Test Accuracy (%)93.6(±0.3)93.5(±0.3)93.4(±0.2)93.4(±0.2)
+ +# K ANALYSIS OF SAMPLE COMPLEXITY + +With a non-perfect oracle, our method could reduce sample complexity compared with other AL strategies because we improve the utilization of queries and samples. Traditional AL algorithms have to discard the data samples of queries that have not obtained hard labels from non-perfect Oracle. By contrast, we could still leverage these data samples in a soft-label manner, thus reducing the error quickly than other AL algorithms. + +Although some AL algorithms enjoy theoretical guarantees on the traditional linear machine learning models (e.g., linear regression), analyzing the sample complexity of AL for deep learning is quite difficult due to the non-linear nature of neural networks. Most sample complexity is analyzed under the passive learning for neural networks in the literature. In addition to the non-linear nature of neural networks, the graph neural networks (GNNs) are even more complicated as graph data is no longer independent and identically distributed (iid), making the theoretical analysis of sample complexity extremely difficult for GNN-based AL. + +# L ANALYSIS OF THE FILTERING DEGREE + +To clarify how much accuracy would drop when we filter the small-degree nodes, we increase the filtering degree from 0 to 15 and then report the corresponding mean test accuracy of 10 runs with GCN in Table 7. Note that the threshold we used in the previous experiments is 15 in Reddit. + +As shown in Table 7, the test accuracy only drops slightly by $0.2\%$ when we increase the threshold from 0 to 15, meaning that our efficiency optimization will not introduce a large negative influence on the prediction ability of the GCN model. Compared with the uninfluential nodes with small node degrees, labeled nodes will larger degrees will propagate their label information to more adjacent nodes and thus make larger entropy reduction for the whole dataset. As a result, nodes with larger degrees have a larger probability of being selected in IGP even if the efficiency optimization is not introduced (i.e., setting the filtering degree to 0). \ No newline at end of file diff --git a/informationgainpropagationanewwaytographactivelearningwithsoftlabels/images.zip b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fc1d5ef3dc3fb28d6e3f0ac77d43bce0eaaf69a6 --- /dev/null +++ b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d72a1ac200b46f098e3f261fd1afc4f85c616a52863d419f1d73626c354247b2 +size 540654 diff --git a/informationgainpropagationanewwaytographactivelearningwithsoftlabels/layout.json b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8ecc6efe106d0365904d5fc8b21f7536f9f4ff46 --- /dev/null +++ b/informationgainpropagationanewwaytographactivelearningwithsoftlabels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4941c9a709d8aae4fe3e656d1e751cf5e84094d3060fd03c27eb7005c3f29b35 +size 672033 diff --git a/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_content_list.json b/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..df22a80d3b7004a65443bab0011d2cc89f7fa6a8 --- /dev/null +++ b/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ee7a13689cec859e8007b9ff80e236b01d9f5819d06ea0c60881fe42933e1d7 +size 145662 diff --git a/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_model.json b/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dbe5e5f5806bf3d2825c0ae326d716b02d702cc5 --- /dev/null +++ b/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7ab724955ac74e8caaefce3941b83e6a3ea5fcb0254749f2316355f518b7d3d +size 168485 diff --git a/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_origin.pdf b/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2e4f18ca4d75aea9b1c474c04988bfa8a812bd99 --- /dev/null +++ b/informationprioritizationthroughempowermentinvisualmodelbasedrl/a35129a3-6656-45f4-9e8b-cce6cada067a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34138153fec67b6a0c0448ce5a6e7a94b8510fe8128fdf3b7c2dc9270465421e +size 4902478 diff --git a/informationprioritizationthroughempowermentinvisualmodelbasedrl/full.md b/informationprioritizationthroughempowermentinvisualmodelbasedrl/full.md new file mode 100644 index 0000000000000000000000000000000000000000..25afc58d89ac5a0470c294beeeffe5e08c24ddf2 --- /dev/null +++ b/informationprioritizationthroughempowermentinvisualmodelbasedrl/full.md @@ -0,0 +1,626 @@ +# INFORMATION PRIORITIZATION THROUGH EMPOWERMENT IN VISUAL MODEL-BASED RL + +Homanga Bharadhwaj * + +Carnegie Mellon University + +Mohammad Babaeizadeh + +Google Research, Brain Team + +Dumitru Erhan + +Google Research, Brain Team + +Sergey Levine + +Google Research, Brain Team + +University of California Berkeley + +# ABSTRACT + +Model-based reinforcement learning (RL) algorithms designed for handling complex visual observations typically learn some sort of latent state representation, either explicitly or implicitly. Standard methods of this sort do not distinguish between functionally relevant aspects of the state and irrelevant distractors, instead aiming to represent all available information equally. We propose a modified objective for model-based RL that, in combination with mutual information maximization, allows us to learn representations and dynamics for visual model-based RL without reconstruction in a way that explicitly prioritizes functionally relevant factors. The key principle behind our design is to integrate a term inspired by variational empowerment into a state-space model based on mutual information. This term prioritizes information that is correlated with action, thus ensuring that functionally relevant factors are captured first. Furthermore, the same empowerment term also promotes faster exploration during the RL process, especially for sparse-reward tasks where the reward signal is insufficient to drive exploration in the early stages of learning. We evaluate the approach on a suite of vision-based robot control tasks with natural video backgrounds, and show that the proposed prioritized information objective outperforms state-of-the-art model based RL approaches with higher sample efficiency and episodic returns. + +# 1 INTRODUCTION + +Model-based reinforcement learning (RL) provides a promising approach to accelerating skill learning: by acquiring a predictive model that represents how the world works, an agent can quickly derive effective strategies, either by planning or by simulating synthetic experience under the model. However, in complex environments with high-dimensional observations (e.g., images), modeling the full observation space can present major challenges. While large neural network models have made progress on this problem (Finn & Levine, 2017; Ha & Schmidhuber, 2018; Hafner et al., 2019a; Watter et al., 2015; Babaeizadeh et al., 2017), effective learning in visually complex environments necessitates some mechanism for learning representations that prioritize functionally relevant factors for the current task. This needs to be done without wasting effort and capacity on irrelevant distractors, and without detailed reconstruction. Several recent works have proposed contrastive objectives that maximize mutual information between observations and latent states (Hjelm et al., 2018; Ma et al., 2020; Oord et al., 2018; Srinivas et al., 2020). While such objectives avoid reconstruction, they still do not distinguish between relevant and irrelevant factors of variation. We thus pose the question: can we devise non-reconstructive representation learning methods that explicitly prioritize information that is most likely to be functionally relevant to the agent? + +In this work, we derive a model-based RL algorithm from a combination of representation learning via mutual information maximization (Poole et al., 2019) and empowerment (Mohamed & Rezende, 2015). The latter serves to drive both the representation and the policy toward exploring and representing functionally relevant factors of variation. By integrating an empowerment-based term into a + +![](images/47cfd3d1de38b16dd19e19014b10e30cc9720118faf188736beadb1803ea6c37.jpg) +Figure 1: Overview of InfoPower. $I(\mathcal{O}_t;Z_t)$ is the contrastive learning objective for learning an encoder to map from image $\mathcal{O}$ to latent $Z$ . $I(A_{t - 1};Z_t|Z_{t - 1})$ is the empowerment objective that prioritizes encoding controllable representations in $Z$ . $-I(i_{t + 1};Z_{t + 1}|Z_t,A_t)$ helps learn a latent forward dynamics model so that future $Z_{t + k}$ can be predicted from current $Z_{t}$ . $I(R_{t};Z_{t})$ helps learn a reward prediction model, such that the agent can learn a plan $A_{t},..A_{t + k},..$ through latent rollouts. Together, this combination of terms produces a latent state space model for MBRL that captures all necessary information at convergence, while prioritizing the most functionally relevant factors via the empowerment term. + +mutual information framework for learning state representations, we effectively prioritize information that is most likely to have functional relevance, which mitigates distractions due to irrelevant factors of variation in the observations. By integrating this same term into policy learning, we further improve exploration, particularly in the early stages of learning in sparse-reward environments, where the reward signal provides comparatively little guidance. + +Our main contribution is InfoPower, a model-based RL algorithm for control from image observations that integrates empowerment into a mutual information based, non-reconstructive framework for learning state space models. Our approach explicitly prioritizes information that is most likely to be functionally relevant, which significantly improves performance in the presence of time-correlated distractors (e.g., background videos), and also accelerates exploration in environments when the reward signal is weak. We evaluate the proposed objectives on a suite of simulated robotic control tasks with explicit video distractors, and demonstrate up to $20\%$ better performance in terms of cumulative rewards at 1M environment interactions with $30\%$ higher sample efficiency at 100k interactions. + +# 2 PROBLEM STATEMENT AND NOTATION + +A partially observed Markov decision process (POMDP) is a tuple $(S, \mathcal{A}, T, R, \mathcal{O})$ that consists of states $s \in S$ , actions $a \in \mathcal{A}$ , rewards $r \in R$ , observations $o \in \mathcal{O}$ , and a state-transition distribution $T(s'|s, a)$ . In most practical settings, the agent interacting with the environment doesn't have access to the actual states in $S$ , but to some partial information in the form of observations $\mathcal{O}$ . The underlying state-transition distribution $T$ and reward distribution $R$ are also unknown to the agent. + +In this paper, we consider the observations $o \in \mathcal{O}$ to be high-dimensional images, and so the agent should learn a compact representation space $Z$ for the latent state-space model. The problem statement is to learn effective representations from observations $\mathcal{O}$ when there are visual distractors present in the scene, and plan using the learned representations to maximize the cumulative sum of discounted rewards, $J = \mathbb{E}[\sum_{t} \gamma^{t-1} r_t]$ . The value of a state $V(Z_t)$ is defined as the expected cumulative sum of discounted rewards starting at state $Z_t$ . + +We use $q(\cdot)$ to denote parameterized variational approximations to learned distributions. We denote random variables with capital letters and use lowercase letters to denote particular realizations (e.g., $z_{t}$ denotes the value of $Z_{t}$ ). Since the underlying distributions are unknown, we evaluate all expectations through Monte-Carlo sampling with observed state-transition tuples $(o_{t}, a_{t-1}, o_{t-1}, z_{t}, z_{t-1}, r_{t})$ . + +# 3 INFORMATION PRIORITIZATION FOR THE LATENT STATE-SPACE MODEL + +Our goal is to learn a latent state-space model with a representation $Z$ that prioritizes capturing functionally relevant parts of observations $\mathcal{O}$ , and devise a planning objective that explores with the learned representation. To achieve this, our key insight is integration of empowerment in the visual model-based RL pipeline. For representation learning we maximize $\mathrm{MI}\max_ZI(\mathcal{O},Z)$ subject to a prioritization of the empowerment objective $\max_{Z}I(A_{t - 1};Z_{t}|Z_{t - 1})$ . For planning, we maximize the empowerment objective along with reward-based value with respect to the policy $\max_{A}I(A_{t - 1};Z_{t}|Z_{t - 1}) + I(R_{t};Z_{t})$ . + +In the subsequent sections, we elaborate on our approach, InfoPower, and describe lower bounds to MI that yield a tractable algorithm. + +# 3.1 LEARNING CONTROLLABLE FACTORS AND PLANNING THROUGH EMPOWERMENT + +Controllable representations are features of the observation that correspond to entities which the agent can influence through its actions. For example, in quadrupedal locomotion, this could include the joint positions, velocities, motor torques, and the configurations of any object in the environment that the robot can interact with. For robotic manipulation, it could include the joint actuators of the robot arm, and the configurations of objects in the scene that it can interact with. Such representations are denoted by $S^{+}$ in Fig. 2, which we can formally define through conditional independence as the smallest subspace of $S$ , $S^{+} \leq S$ , such that $I(A_{t-1}; S_t | S_t^{+}) = 0$ . This conditional independence relation can be seen in Fig. 2. We explicitly priori + +![](images/51409ce436f7dba7b939ad06300c85cde07f6f8a6ea44d90a0cc1956846f5af9.jpg) +Figure 2: PGM showing decomposition of state $S$ into controllable parts $S^{+}$ (directly influenced by actions $A$ ), parts not influenced by actions that still influence the reward, $\tilde{S}^{-}$ , and distractors $DS^{-}$ . $\tilde{S}_{t + 1}^{-}$ may be influenced by $\tilde{S}_t^-$ (arrow not shown to reduce clutter) but not by $\tilde{S}_t^+$ . + +tize the learning of such representations in the latent space by drawing inspiration from variational empowerment (Mohamed & Rezende, 2015). + +The empowerment objective can be cast as maximizing a conditional information term $I(A_{t-1}; Z_t | Z_{t-1}) = \mathcal{H}(A_{t-1} | Z_{t-1}) - \mathcal{H}(A_{t-1} | Z_t, Z_{t-1})$ . The first term $\mathcal{H}(A_{t-1} | Z_{t-1})$ encourages the chosen actions to be as diverse as possible, while the second term $-\mathcal{H}(A_{t-1} | Z_t, Z_{t-1})$ encourages the representations $Z_t$ and $Z_{t+1}$ to be such that the action $A_t$ for transition is predictable. While prior approaches have used empowerment in the model-free setting to learn policies by exploration through intrinsic motivation (Mohamed & Rezende, 2015), we specifically use this objective in combination with MI maximization for prioritizing the learning of controllable representations from distracting images in the latent state-space model. + +We include the same empowerment objective in both representation learning and policy learning. For this, we augment the maximization of the latent value function that is standard for policy learning in visual model-based RL (Sutton, 1991), with $\max_A I(A_{t-1}; Z_t | Z_{t-1})$ . This objectives complements value-based-learning and further improves exploration by seeking controllable states. We empirically analyze the benefits of this in sections 4.3 and 4.5. + +In Appendix A.1 we next describe two theorems regarding learning controllable representations. We observe that the $\max \sum_{t} I(A_{t-1}; Z_t | Z_{t-1})$ objective for learning latent representations $Z$ , when used along with the planning objective, provably recovers controllable parts of the observation $\mathcal{O}$ , namely $S^{+}$ . This result in Theorem 1 is important because in practice, we may not be able to represent every possible factor of variation in a complex environment. In this situation, we would expect that when $|Z| \ll |\mathcal{O}|$ , learning $Z$ under the objective $\max \sum_{t} I(A_{t-1}; Z_t | Z_{t-1})$ would encode $S^{+}$ . + +We further show through Theorem 2 that the inverse information objective alone can be used to train a latent-state space model and a policy through an alternating optimization algorithm that converges to a local minimum of the objective $\max \sum_{t} I(A_{t-1}; Z_t | Z_{t-1})$ at a rate inversely proportional to + +the number of iterations. In Section 4.3 we empirically show how this objective helps achieve higher sample efficiency compared to pure value-based policy learning. + +# 3.2 MUTUAL INFORMATION MAXIMIZATION FOR REPRESENTATION LEARNING + +For visual model-based RL, we need to learn a representation space $Z$ , such that a forward dynamics model defining the probability of the next state in terms of the current state and the current action can be learned. The objective for this is $\sum_{t} - I(i_{t};Z_{t}|Z_{t - 1},A_{t - 1})$ . Here, $i_t$ denotes the dataset indices that determine the observations $p(o_{t}|i_{t}) = \delta (o_{t} - o_{t^{\prime}})$ . In addition to the forward dynamics model, we need to learn a reward predictor by maximizing $\sum_{t}I(R_{t};Z_{t})$ , such that the agent can plan ahead in the future by rolling forward latent states, without having to execute actions and observe rewards in the real environment. + +Finally, we need to learn an encoder for encoding observations $\mathcal{O}$ to latents $Z$ . Most successful prior works have used reconstruction-loss as a natural objective for learning this encoder (Babaeizadeh et al., 2017; Hafner et al., 2019b;a). A reconstruction-loss can be motivated by considering the objective $I(\mathcal{O}, Z)$ and computing its BA lower + +bound (Agakov, 2004). $I(o_{t};z_{t}) \geq \mathbb{E}_{p(o_{t},z_{t})}[\log q_{\phi^{\prime}}(o_{t}|z_{t})] + \mathcal{H}(p(o_{t}))$ . The first term here is the reconstruction objective, with $q_{\phi^{\prime}}(o_t|z_t)$ being the decoder, and the second term can be ignored as it doesn't depend on $Z$ . However, this reconstruction objective explicitly encourages encoding the information from every pixel in the latent space (such that reconstructing the image is possible) and hence is prone to not ignoring distractors. + +In contrast, if we consider other lower bounds to $I(\mathcal{O}, Z)$ , we can obtain tractable objectives that do not involve reconstructing high-dimensional images. We can obtain an $NCE$ -based lower bound (Hjelm et al., 2018): $I(o_{t}; z_{t}) \geq \mathbb{E}_{q_{\phi}(z_{t} | o_{t}) p(o_{t})}[\log f_{\theta}(z_{t}, o_{t}) - \log \sum_{t' \neq t} f_{\theta}(z_{t}, o_{t'})]$ , where $q_{\phi}(z_{t} | o_{t})$ is the learned encoder, $o_{t}$ is the observation at timestep $t$ (positive sample), and all observations in the replay buffer $o_{t'}$ are negative samples. $f_{\theta}(z_{t}, o_{t'}) = \exp(z_{t}^{T} W_{\theta} z_{t'})$ . The lower-bound is a form of contrastive learning as it maximizes compatibility of $z_{t}$ with the corresponding observation $o_{t}$ while minimizing compatibility with all other observations across time and batch. + +Although prior work has explored NCE-based bounds for contrastive learning in RL (Srinivas et al., 2020), to the best of our knowledge, prior work has not used this in conjunction with empowerment for prioritizing information in visual model-based RL. Similarly, the Nguyen-Wainwright-Jordan (NWJ) bound (Nguyen et al., 2010), which to the best our knowledge has not been used by prior works in visual model-based RL, can be obtained as, + +$$ +I (o _ {t}; z _ {t}) \geq \mathbb {E} _ {q _ {\phi} (z _ {t} | o _ {t}) p (o _ {t})} [ f _ {\theta} (z _ {t}, o _ {t}) ] - e ^ {- 1} \mathbb {E} _ {q _ {\phi} (z _ {t} | o _ {t}) p (o _ {t})} e ^ {f _ {\theta} (z _ {t}, o _ {t})}, +$$ + +where $f_{\theta}$ is a critic. There exists an optimal critic function for which the bound is tightest and equality holds. + +We refer to the InfoNCE and NWJ lower bound based objectives as contrastive learning, in order to distinguish them from a reconstruction-loss based objective, though both are bounds on mutual + +Algorithm 1: Information Prioritization in Visual Model-based RL (InfoPower) + +Initialize dataset $\mathcal{D}$ with random episodes. + +Initialize model parameters $\phi, \chi, \psi, \eta$ . + +Initialize dual variable $\lambda$ + +while not converged do + +for update step $c = 1..C$ do + +// Model learning + +Sample data $\{(a_t, o_t, r_t)\}_{t = k}^{k + L} \sim \mathcal{D}$ . + +Compute latents $z_{t} \sim p_{\phi}(z_{t}|z_{t - 1},a_{t - 1},o_{t})$ + +Calculate $\mathcal{L}$ based on section 3.4. + +$$ +\left(\phi , \chi , \psi , \eta\right) \leftarrow \left(\phi , \chi , \psi , \eta\right) + \nabla_ {\phi , \chi , \psi , \eta} \mathcal {L} +$$ + +$$ +\lambda \leftarrow \lambda - \nabla_ {\lambda} \mathcal {L} +$$ + +// Behavior learning + +Rollout latent plan, $S\gets S\cup \{z_t,a_t,r_t\}$ + +$$ +V (z _ {t}) \approx \mathbb {E} _ {\pi} \left[ \ln q _ {\eta} \left(r _ {t} \mid z _ {t}\right) + \ln q _ {\psi} \left(a _ {t - 1} \mid z _ {t}, z _ {t - 1}\right) \right] +$$ + +Update policy $\pi$ and value model + +# end + +// Environment interaction + +for time step $t = 0..T - 1$ do + +$$ +z _ {t} \sim p _ {\phi} \left(z _ {t} \mid z _ {t - 1}, a _ {t - 1}, o _ {t}\right); a _ {t} \sim \pi \left(a _ {t} \mid z _ {t}\right) +$$ + +$$ +r _ {t}, o _ {t + 1} \leftarrow \text {e n v . s t e p} \left(a _ {t}\right). +$$ + +# end + +Add data $\mathcal{D}\gets \mathcal{D}\cup \{(o_t,a_t,r_t)_{t = 1}^T\}$ + +# end + +information. We denote a lower bound to MI by $\underline{I}(o_t, z_t)$ . We empirically find the NWJ-bound to perform slightly better than the NCE-bound for our approach, explained in section 4.5. + +# 3.3 OVERALL OBJECTIVE + +We now motivate the overall objective, which consists of maximizing mutual information while prioritizing the learning of controllable representations through empowerment in a latent state-space model. Based on the discussions in Sections 3.1 and 3.2, we define the overall objective for representation learning as + +$$ +\max _ {Z _ {0: H - 1}} \sum_ {t = 0} ^ {H - 1} I (\mathcal {O} _ {t}; Z _ {t}) \text {s . t .} \sum_ {t = 0} ^ {H - 1} \overbrace {\left(- I \left(i _ {t} ; Z _ {t} | Z _ {t - 1} , A _ {t - 1}\right) + I \left(A _ {t - 1} ; Z _ {t} | Z _ {t - 1}\right) + I \left(R _ {t} ; Z _ {t}\right)\right)} ^ {\mathcal {C} _ {t}} \geq c _ {0}. +$$ + +The objective is to maximize a MI term $I(\mathcal{O}_t;Z_t)$ through contrastive learning such that a constraint on $\mathcal{C}_t$ holds for prioritizing the encoding of forward-predictive, reward-predictive and controllable representations. We define the overall planning objective as + +$$ +\max _ {A _ {0: H - 1}} \sum_ {t = 0} ^ {H - 1} I (A _ {t - 1}; Z _ {t} | Z _ {t - 1}) + V (Z _ {t}) \quad ; A _ {t} = \pi (Z _ {t}) \quad ; V (Z _ {t}) \approx \sum_ {t} R _ {t}. +$$ + +The planning objective is to learn a policy as a function of the latent state $Z$ such that the empowerment term and a reward-based value term are maximized over the horizon $H$ . + +We can perform the constrained optimization for representation learning through the method of Lagrange Multipliers, by the primal and dual updates shown in Section A.2. In order to analyze this objective, let $|\mathcal{O}| = n$ and $|Z| = d$ . Since, $\mathcal{O}$ corresponds to images and $Z$ is a bottlenecked latent representation, $d \ll n$ . + +$I(\mathcal{O},Z)$ is maximized when $Z$ contains all the information present in $\mathcal{O}$ such that $Z$ is a sufficient statistic of $\mathcal{O}$ . However, in practice, this is not possible because $|Z|\ll |\mathcal{O}|$ . When $c_{0}$ is sufficiently large, and the constraint $\sum_{t}\mathcal{C}_{t}\geq c_{0}$ is satisfied, $Z = [S^{+},\tilde{S}^{-}]$ . Hence, the objective $\max \sum_{t}I(\mathcal{O}_{t},Z_{t})$ s.t. $\sum_{t}\mathcal{C}_{t}\geq c_{0}$ cannot encode anything else in $Z$ , in particular it cannot encode distractors $DS^{-}$ . + +To understand the importance of prioritization through $\mathcal{C}_t\geq c_0$ , consider $\max \sum_{t}I(\mathcal{O}_{t},Z_{t})$ without the constraint. This objective would try to make $Z$ a sufficient statistic of $\mathcal{O}$ , but since $|Z|\ll |\mathcal{O}|$ , there are no guarantees about which parts of $\mathcal{O}$ are getting encoded in $Z$ . This is because both distractors $S^{-}$ and non-distractors $S^{+}$ , $D\tilde{S}^{-}$ are equally important with respect to $I(\mathcal{O},Z)$ . Hence, the constraint helps in prioritizing the type of information to be encoded in $Z$ . + +# 3.4 PRACTICAL ALGORITHM AND IMPLEMENTATION DETAILS + +To arrive at a practical algorithm, we optimize the overall objective in section 3.3 through lower bounds on each of the MI terms. For $I(\mathcal{O}, Z)$ we consider two variants, corresponding to the NCE and NWJ lower bounds described in Section 3.2. We can obtain a variational lower bound on each of the terms in $\mathcal{C}_t$ as follows, with detailed derivations in Appendix A.3: + +$$ +\begin{array}{l} - I \left(i _ {t}; z _ {t} \mid a _ {t - 1}\right) \geq - \sum_ {t} \mathbb {E} \left[ D _ {\mathrm {K L}} \left(p \left(z _ {t} \mid z _ {t - 1}, a _ {t - 1}, o _ {t}\right) \mid \mid q _ {\chi} \left(z _ {t} \mid z _ {t - 1}, a _ {t - 1}\right)\right) \right] \\ I \left(r _ {t}; z _ {t}\right) \geq \mathbb {E} _ {p \left(r _ {t} \mid o _ {t}\right)} \left[ \log q _ {\eta} \left(r _ {t} \mid z _ {t}\right) \right] + \mathcal {H} \left(p \left(r _ {t}\right)\right) \\ I \left(a _ {t - 1}; z _ {t} \mid z _ {t - 1}\right) \geq \mathbb {E} _ {p \left(o _ {t} \mid z _ {t - 1}, a _ {t - 1}\right) q _ {\phi} \left(z _ {t} \mid o _ {t}\right)} \left[ \log q _ {\psi} \left(a _ {t - 1} \mid z _ {t}, z _ {t - 1}\right) \right] + \mathbb {E} [ \mathcal {H} (\pi \left(a _ {t - 1} \mid z _ {t - 1}\right)) ] \\ \end{array} +$$ + +Here, $q_{\phi}(z_t|o_t)$ is the observation encoder, $q_{\psi}(a_{t-1}|z_t,z_{t-1})$ is the inverse dynamics model, $q_{\eta}(r_t|z_t)$ is the reward decoder, and $q_{\chi}(z_t|z_{t-1},a_{t-1})$ is the forward dynamics model. The inverse model helps in learning representations such that the chosen action is predictable from successive latent states. The forward dynamics model helps in predicting the next latent state given the current latent state and the current action, without having the next observation. The reward decoder predicts the reward (a scalar) at a time-step given the corresponding latent state. We use dense networks for all the models, with details in Appendix A.7. We denote by $\underline{C}_t$ , the lower bound to $C_t$ based on the sum of the terms above. We construct a Lagrangian $\mathcal{L} = \sum_{t}\underline{I}(o_t;z_t) + \lambda (\underline{C}_t - c_0)$ and optimize it by primal-dual gradient descent. An outline of this is shown in Algorithm 1. + +Planning Objective. For planning to choose actions at every time-step, we learn a policy $\pi (a|z)$ through value estimates of task reward and the empowerment objective. We learn value estimates with $V(z_{t})\approx \mathbb{E}_{\pi}[\ln q_{\eta}(r_{t}|z_{t}) + \ln q_{\psi}(a_{t - 1}|z_{t},z_{t - 1})]$ . We estimate $V(z_{t})$ similar to Equation 6 of (Hafner et al., 2019a). The empowerment term $q_{\psi}(a_{t - 1}|z_t,z_{t - 1})$ in policy learning incentivizes choosing actions $a_{t - 1}$ such that they can be predicted from consecutive latent states $z_{t - 1},z_{t}$ . This biases the policy to explore controllable regions of the state-space. The policy is trained to maximize the estimate of the value, while the value model is trained to fit the estimate of the value that changes as the policy is updated. + +Finally, we note that the difference in value function of the underlying MDP $Q^{\pi}(o,a)$ and the latent MDP $\hat{Q}^{\pi}(z,a)$ , where $z\sim q_{\phi}(z|o)$ is bounded, under some regularity assumptions. We provide this result in Theorem 3 of the Appendix Section A.4. The overall procedure for model learning, planning, and interacting with the environment is outlined in Algorithm 1. + +# 4 EXPERIMENTS + +Through our experiments, we aim to understand the following research questions: + +1. How does InfoPower compare with the baselines in terms of episodic returns in environments with explicit background video distractors? +2. How sample efficient is InfoPower when the reward signal is weak ( $< 100k$ env steps when the learned policy typically doesn't achieve very high rewards)? +3. How does InfoPower compare with baselines in terms of behavioral similarity of latent states? + +Please refer to the website for a summary and qualitative visualization results https://sites.google.com/view/information-empowerment + +# 4.1 SETUP + +We perform experiments with modified DeepMind Control Suite environments (Tassa et al., 2018), with natural video distractors from ILSVRC dataset (Russakovsky et al., 2015) in the background. The agent receives only image observations at each time-step and does not receive the ground-truth simulator state. This is a very challenging setting, because the agents must learn to ignore the distractors and abstract out representations necessary for control. While natural videos that are unrelated to the task might be easy to ignore, realistic scenes might have other elements that resemble the controllable elements, but are not actually controllable (e.g., other cars in a driving scenario). To emulate this, we also add distractors that resemble other potentially controllable robots, as shown for example in Fig. 3 (1st and 6th), but are not actually influenced by actions. + +In addition to this setting, we also perform experiments with gray-scale distractors based on videos from the Kinetics dataset (Kay et al., 2017). This setting is adapted exactly based on prior works (Fu et al., 2021; Zhang et al., 2020) and we compare directly to the published results. + +We compare InfoPower with state-of-the-art baselines that also learn world models for control: Dreamer (Hafner et al., 2019a), C-Dreamer that is a contrastive version of Dreamer similar to Ma et al. (2020), TIA (Fu et al., 2021) that learns explicit reconstructions for both the distracting background and agent separately, DBC (Zhang et al., 2020), and DeepMDP (Gelada et al., 2019). We also compare variants of InfoPower with different MI bounds (NCE and NWJ), and ablations of it that remove the empowerment objective from policy learning. + +![](images/5a8f45a700831c2d67581b4c17249705e3700ee8afa7babefec8269aafa4f92e.jpg) + +![](images/a025c1f4591c9d2b8195f77e0011fa77874488869e719e24ccea05362605b4cf.jpg) + +![](images/0856bc80532ce84446dd65fbf12013459142a7b26dafb1d27cfa8b7115807179.jpg) + +![](images/426b5c8b25c94fcea448644080584ec978e52333d7fd6c919c3f4e6a87c246d0.jpg) +Figure 3: Some of the natural video background distractors in our experiments. The videos change every 50 time-steps. Some backgrounds (for e.g. the top left and the bottom right) have more complex distractors in the form of agent-behind-agent i.e. the background has pre-recorded motion of a similar agent that is being controlled. + +![](images/3fdfa4ad3c6f624b88032febc47153214db112d06f1222f086dccac85448f72c.jpg) + +![](images/c01ea0fedd0de3d578fa9c032de2003de56e2aca95e8264bafb485e31b20019f.jpg) + +# 4.2 A BEHAVIORAL SIMILARITY METRIC BASED ON GRAPH KERNELS + +In order to measure how good the learned latent representations are at capturing the functionally relevant elements in the scene, we introduce a behavioral similarity metric with details in A.5. Given + +![](images/dd58329efe83620ed0a5972516319ef7e540f894efe7e4bfaa6d9fba43fd88d4.jpg) + +![](images/cd17b4aa89c9b48a15741c4fd16f6d9b896c69080d0d402c4348fdc8906e1b21.jpg) + +![](images/5beff254eb8b996e37606220ac5eaaf58a34515f72873030ff83817a2b147a70.jpg) + +![](images/1394ad68af65c5afe8d9b5162c3e065aaf798231d71a475fc85679b3f7f5e64f.jpg) + +Figure 4: Evaluation of InfoPower and baselines in a suite of DeepMind Control tasks with natural video distractors in the background. The x-axis denotes the number of environment interactions and the y-axis shows the episodic returns. The S.D is over 4 random seeds. Higher is better. +![](images/7e9dca1593e635563daaa496d48a262f5ffbf10e81c66ba68b8832048a221c6c.jpg) +InfoPower dreamer cdreamer tia dbc deepmpdp + +![](images/52867dcb113a5012f62bd6357b48549ff88ae9d5fee434ab606165f1c78a9479.jpg) + +![](images/64cd26384a88e6979419088e2be9b24b2452db17c6bb018a258ec87e26db29a5.jpg) + +![](images/5f6695ddd06657678a498c0974502083ff6835041f53d88d07f05b8cddbcd5a9.jpg) + +the sets $S_{z} = \{z^{i}\}_{i=1}^{n}$ and $S_{z_{\mathrm{gt}}} = \{z_{\mathrm{gt}}^{i}\}_{i=1}^{n}$ , we construct complete graphs by connecting every vertex with every other vertex through an edge. The weight of an edge is the Euclidean distance between the respective pairs of vertices. The label of each vertex is an unique integer and corresponding vertices in the two graphs are labelled similarly. + +Let the resulting graphs be denoted as $G_{z} = (V_{z},E_{z})$ and $G_{z_{\mathrm{gt}}} = (V_{z_{\mathrm{gt}}},E_{z_{\mathrm{gt}}})$ respectively. Note that both these graphs are shortest path graphs, by construction. Let, $e_i = \{u_i,v_i\}$ and $e_j = \{u_j,v_j\}$ . We define a kernel $\hat{k}$ that measures similarity between the edges $e_i,e_j$ and the labels on respective vertices. $\hat{k} (e_i,e_j) =$ + +$$ +k _ {v} (l (u _ {i}), l (u _ {j})) k _ {e} (l (e _ {i}), l (e _ {j})) k _ {v} (l (v _ {i}), l (v _ {j})) + k _ {v} (l (u _ {i}), l (v _ {j})) k _ {e} (l (e _ {i}), l (e _ {j})) k _ {v} (l (v _ {i}), l (u _ {j})) +$$ + +Here, the function $l(\cdot)$ denotes the labels of vertices and the weights of edges. $k_{v}$ is a Dirac delta kernel i.e. $k_{e}(x,y) = 1 - \delta (x,y)$ (Note that $\delta (x,y) = 1$ iff $x = y$ , else $\delta (x,y) = 0$ ) and $k_{e}$ is a Brownian ridge kernel, $k_{e}(x,y) = \frac{1}{c}\max (0,c - |x - y|)$ , where $c$ is a large number. We define the shortest path kernel to measure similarity between the two graphs, as, $k(G_{z},G_{z_{\mathrm{gt}}}) = \frac{1}{|E_z|}\sum_{e_i\in E_z}\sum_{e_j\in E_{z_{\mathrm{gt}}}}\hat{k} (e_i,e_j)$ . The value of $k(G_{z},G_{z_{\mathrm{gt}}})$ is low when a large number of pairs of corresponding vertices in both the graphs have the same edge length. We expect methods that recover latent state representations which better reflect the true underlying simulator state (i.e., the positions of the joints) to have higher values according to this metric. + +# 4.3 SAMPLE EFFICIENCY ANALYSIS + +In Fig. 4, we compare InfoPower and the baselines in terms of episodic returns. This version of InfoPower corresponds to an NWJ bound on MI which we find works slightly better than the NCE bound variant analyzed in section 4.5. It is evident that InfoPower achieves higher returns before 1M steps of training quickly compared to the baselines, indicating higher sample efficiency. This suggests the effectiveness of the empowerment model in helping capture controllable representations early on during training, when the agent doesn't take on actions that yield very high rewards. + +# 4.4 BEHAVIORAL SIMILARITY OF LATENT STATES + +In this section, we analyze how similar are the learned latent representations with respect to the underlying simulator states. The intuition for this comparison is that the proprioceptive features in the simulator state abstract out distractors in the image, and so we want the latent states to be behaviorally similar to the simulator states. + +Quantitative results with the defined metric. In Table 1, we show results for behavioral similarity of latent states (Sim), based on the metric in section 4.2. We see that the value of Sim for InfoPower is around $20\%$ higher than the most competitive baseline, indicating high behavioral similarity of the latent states with respect to the corresponding ground-truth simulator states. + +Qualitative visualizations with t-sne. Fig. 5 shows a t-SNE plot of latent states $z \sim q_{\phi}(z|o)$ for InfoPower and the baselines with visualizations of 3 nearest neighbors for two randomly chosen latent states. We see that the state of the agent is similar in each group for InfoPower, although the + +![](images/a1512658a6efb1ea8e31be94c54bfc960fc23a87673d26e19b3722f6ae3d9415.jpg) +Figure 5: t-SNE plot of latent states $z \sim q_{\phi}(z|o)$ with visualizations of three nearest neighbors for two randomly sampled points (in red frame). We see that the state of the agent is similar in each set for InfoPower, whereas for Dreamer, and the most competitive baseline C-Dreamer, the nearest neighbor frames have significantly different agent configurations. + +![](images/ddb966c78e28053068585a1d5e6d0dc1d2db9ab7a6cae55f9ed1c55ed47d777f.jpg) + +![](images/ff0e4e5ac64da3ca201f95ef2a763fe8b684b2c663f6b32412091357dfcaf77b.jpg) + +![](images/d93d7c3c48f36144263bcc85207e4dfdf35ac20b39e177755bb0d7f60d8afecf.jpg) + +![](images/89e3ef090dcb8b779e912ac5629afb45a7cc8377e7e85b54962b328bf3ad375e.jpg) + +Figure 6: Evaluation of InfoPower and ablated variants in a suite of DeepMind Control tasks with natural video distractors in the background. The x-axis denotes the number of environment interactions and the y-axis shows the episodic returns. InfoPower-NWJ and InfoPower-NCE are full versions of our method differing only in the MI lower bound. The versions with - Policy do not include the empowerment objective in policy learning, but only use it from representation learning. The S.D is over 4 random seeds. Higher is better. +![](images/2fe927f788cefb6e644f1969e0ab27115b0da097e3bf1ec12fd09fbcc45f204d.jpg) +InfoPower NWJ InfoPower NCE InfoPower NWJ - Policy InfoPower NCE - Policy + +![](images/52df03954942b7826829d6ced844e1a4990394eecf5437e8e43a730862b5e924.jpg) + +![](images/fae4ea36de116ee1bbcc704c002cd1b5a2bf7ef84d014bc39159dea26c60a487.jpg) + +![](images/3ff72f94341bb03bb7212c55392b127cb8b134fde376814ab257ec57554aec63.jpg) + +background scenes are significantly different. However, for the baselines, the nearest neighbor states are significantly different in terms of the pose of the agent, indicating that the latent representations encode significant background information. + +# 4.5 ABLATION STUDIES + +In Fig. 6, we compare different ablations of InfoPower. Keeping everything else the same, and changing only the MI lower bound to NCE, we see that the performance is almost similar or slightly worse. However, when we remove the empowerment objective from policy optimization (the versions with '-Policy' in the plot), we see that performance drops. The drop is significant in the regions $< 200k$ environment interactions, particularly in the sparse reward environments - cartpole balance and ball in a cup, indicating the necessity of the empowerment objective in exploration for learning controllable representations, when the reward signal is weak. + +# 5 RELATED WORKS + +Visual model-based RL. Recent developments in video prediction and contrastive learning have enabled learning of world-models from images (Watter et al., 2015; Babaeizadeh et al., 2017; Finn & Levine, 2017; Hafner et al., 2019a; Ha & Schmidhuber, 2018; Hafner et al., 2019b; Xie et al., 2020). All of these approaches learn latent representations through reconstruction objectives that are amenable for planning. Other approaches have used similar reconstruction based objectives for control, but not for MBRL (Lee et al., 2019; Gregor et al., 2019). + +MI for representation learning. Mutual Information measures the dependence between two random variables. The task of learning latent representations $Z$ from images $\mathcal{O}$ for downstream applications, has been very successful with MI objectives of the form $\max_{f_1,f_2} I(f_1(\mathcal{O}), f_2(Z))$ (Hjelm & Bachman, 2020; Tian et al., 2020; Oord et al., 2018; Tschannen et al., 2019; Nachum & Yang, 2021). Since calculating MI exactly is intractable optimizing MI based objectives, it is important to construct appropriate MI estimators that lower-bound the true MI objective (Hjelm et al., 2018; Nguyen et al., 2010; Belghazi et al., 2018; Agakov, 2004). The choice of the estimator is crucial, as shown by recent works (Poole et al., 2019), and different estimators yield very different behaviors of the algorithm. We incorporate MI maximization through the NCE (Hjelm et al., 2018) and NWJ (Nguyen et al., 2010) lower bounds, such that typical reconstruction objectives for representation learning which do not perform well with visual distractors, can be avoided. + +Inverse models and empowerment. Prior approaches have used inverse dynamics models for regularization in representation learning (Agrawal et al., 2016; Zhang et al., 2018) and as bonuses for improving policy gradient updates in RL (Shelhamer et al., 2016; Pathak et al., 2017). The importance of information theoretic approaches for learning representations that maximize predictive power has been discussed in prior work (Still, 2009) and more recently in Lee et al. (2020). Empowerment (Mohamed & Rezende, 2015) has been used as exploration bonuses for policy learning (Leibfried et al., 2019; Klyubin et al., 2008), and for learning skills in RL (Gregor et al., 2016; Sharma et al., 2019; Eysenbach et al., 2018). In contrast to prior work, we incorporate empowerment both for state space representation learning and policy learning, in a visual model-based RL framework, with the aim of prioritizing the most functionally relevant information in the scene. + +RL with environment distractors. Some recent RL frameworks have studied the problem of abstracting out only the task relevant information from the environment when there are explicit distractors (Hansen & Wang, 2020; Zhang et al., 2020; Fu et al., 2021; Ma et al., 2020). Zhang et al. (2020) constrain the latent states by enforcing a bisimulation metric, without a reconstruction objective. Our approach is different from this primarily because of the empowerment objective that provides useful signal for dealiasing controllable vs. uncontrollable representations independent of how strong is the observed reward signal. Fu et al. (2021) model both the relevant and irrelevant aspects of the environment separately, and differ from our approach that prioritizes learning only the relevant aspects. (Shu et al., 2020) was and earlier approach that used contrastive representations for control. More recently, (Nguyen et al., 2021) used temporal predictive coding and (Ma et al., 2020) used InfoNCE based contrastive loss for learning representations while ignoring distractors in visual MBRL. Incorporating data augmentations for improving robustness with respect to environment variations is an orthogonal line of work (Laskin et al., 2020; Hansen & Wang, 2020; Raileanu et al., 2020; Srinivas et al., 2020; Kostrikov et al., 2020), complementary to our approach. + +# 6 CONCLUSION + +In this paper we derived an approach for visual model-based RL such that an agent can learn a latent state-space model and a policy by explicitly prioritizing the encoding of functionally relevant factors. Our prioritized information objective integrates a term inspired by variational empowerment into a non-reconstructive objective for learning state space models. We evaluate our approach on a suite of vision-based robot control tasks with two sets of challenging video distractor backgrounds. In comparison to state-of-the-art visual model-based RL methods, we observe higher sample efficiency and episodic returns across different environments and distractor settings. + +# REFERENCES + +David Barber Felix Agakov. The im algorithm: a variational approach to information maximization. Advances in neural information processing systems, 16(320):201, 2004. +Pulkit Agrawal, Ashvin Nair, Pieter Abbeel, Jitendra Malik, and Sergey Levine. Learning to poke by poking: Experiential learning of intuitive physics. arXiv preprint arXiv:1606.07419, 2016. +Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. arXiv preprint arXiv:1710.11252, 2017. +Mohamed Ishmael Belghazi, Aristide Baratin, Sai Rajeshwar, Sherjil Ozair, Yoshua Bengio, Aaron Courville, and Devon Hjelm. Mutual information neural estimation. In International Conference on Machine Learning, pp. 531-540. PMLR, 2018. +Richard Blahut. Computation of channel capacity and rate-distortion functions. IEEE transactions on Information Theory, 18(4):460-473, 1972. +Thomas M. Cover and Joy A. Thomas. Elements of Information Theory 2nd Edition (Wiley Series in Telecommunications and Signal Processing). Wiley-Interscience, July 2006. ISBN 0471241954. +Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. arXiv preprint arXiv:1802.06070, 2018. +Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 2786-2793. IEEE, 2017. +Xiang Fu, Ge Yang, Pulkit Agrawal, and Tommi Jaakkola. Learning task informed abstractions. In International Conference on Machine Learning, pp. 3480-3491. PMLR, 2021. +Carles Gelada, Saurabh Kumar, Jacob Buckman, Ofir Nachum, and Marc G Bellemare. Deepmdp: Learning continuous latent space models for representation learning. In International Conference on Machine Learning, pp. 2170-2179. PMLR, 2019. +Karol Gregor, Danilo Jimenez Rezende, and Daan Wierstra. Variational intrinsic control. arXiv preprint arXiv:1611.07507, 2016. +Karol Gregor, Danilo Jimenez Rezende, Frederic Besse, Yan Wu, Hamza Merzic, and Aaron van den Oord. Shaping belief states with generative environment models for rl. arXiv preprint arXiv:1906.09237, 2019. +David Ha and Jürgen Schmidhuber. World models. arXiv preprint arXiv:1803.10122, 2018. +Danijar Hafner, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. arXiv preprint arXiv:1912.01603, 2019a. +Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In International Conference on Machine Learning, pp. 2555-2565. PMLR, 2019b. +Nicklas Hansen and Xiaolong Wang. Generalization in reinforcement learning by soft data augmentation. arXiv preprint arXiv:2011.13389, 2020. +R Devon Hjelm and Philip Bachman. Representation learning with video deep infomax. arXiv preprint arXiv:2007.13278, 2020. +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. +Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017. + +Alexander S Klyubin, Daniel Polani, and Chrystopher L Nehaniv. Keep your options open: an information-based driving principle for sensorimotor systems. *PloS one*, 3(12):e4018, 2008. +Ilya Kostrikov, Denis Yarats, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. arXiv preprint arXiv:2004.13649, 2020. +Michael Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. arXiv preprint arXiv:2004.14990, 2020. +Alex X Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. arXiv preprint arXiv:1907.00953, 2019. +Kuang-Huei Lee, Ian Fischer, Anthony Liu, Yijie Guo, Honglak Lee, John Canny, and Sergio Guadarrama. Predictive information accelerates learning in rl. arXiv preprint arXiv:2007.12401, 2020. +Felix Leibfried, Sergio Pascual-Diaz, and Jordi Grau-Moya. A unified bellman optimality principle combining reward maximization and empowerment. arXiv preprint arXiv:1907.12392, 2019. +Xiao Ma, Siwei Chen, David Hsu, and Wee Sun Lee. Contrastive variational model-based reinforcement learning for complex observations. arXiv e-prints, pp. arXiv-2008, 2020. +Shakir Mohamed and Danilo Jimenez Rezende. Variational information maximisation for intrinsically motivated reinforcement learning. arXiv preprint arXiv:1509.08731, 2015. +Ofir Nachum and Mengjiao Yang. Provable representation learning for imitation with contrastive fourier features. arXiv preprint arXiv:2105.12272, 2021. +Kenji Nakagawa, Yoshinori Takei, Shin-ichiro Hara, and Kohei Watabe. Analysis of the convergence speed of the arimoto-blahut algorithm by the second-order recurrence formula. IEEE Transactions on Information Theory, 2021. +Tung Nguyen, Rui Shu, Tuan Pham, Hung Bui, and Stefano Ermon. Temporal predictive coding for model-based planning in latent space. arXiv preprint arXiv:2106.07156, 2021. +XuanLong Nguyen, Martin J Wainwright, and Michael I Jordan. Estimating divergence functionals and the likelihood ratio by convex risk minimization. IEEE Transactions on Information Theory, 56(11):5847-5861, 2010. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. +Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International conference on machine learning, pp. 2778-2787. PMLR, 2017. +Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In International Conference on Machine Learning, pp. 5171-5180. PMLR, 2019. +Roberta Raileanu, Maxwell Goldstein, Denis Yarats, Ilya Kostrikov, and Rob Fergus. Automatic data augmentation for generalization in reinforcement learning. 2020. +Kate Rakelly, Abhishek Gupta, Carlos Florensa, and Sergey Levine. Which mutual-information representation learning objectives are sufficient for control? arXiv preprint arXiv:2106.07278, 2021. +Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. +Archit Sharma, Shixiang Gu, Sergey Levine, Vikash Kumar, and Karol Hausman. Dynamics-aware unsupervised discovery of skills. arXiv preprint arXiv:1907.01657, 2019. + +Evan Shelhamer, Parsa Mahmoudieh, Max Argus, and Trevor Darrell. Loss is its own reward: Self-supervision for reinforcement learning. arXiv preprint arXiv:1612.07307, 2016. +Rui Shu, Tung Nguyen, Yinlam Chow, Tuan Pham, Khoat Than, Mohammad Ghavamzadeh, Stefano Ermon, and Hung Bui. Predictive coding for locally-linear control. In International Conference on Machine Learning, pp. 8862-8871. PMLR, 2020. +Aravind Srinivas, Michael Laskin, and Pieter Abbeel. Curl: Contrastive unsupervised representations for reinforcement learning. arXiv preprint arXiv:2004.04136, 2020. +Susanne Still. Information-theoretic approach to interactive learning. EPL (Europhysics Letters), 85(2):28005, 2009. +Richard S Sutton. Dyna, an integrated architecture for learning, planning, and reacting. ACM Sigart Bulletin, 2(4):160-163, 1991. +Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018. +Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XI 16, pp. 776-794. Springer, 2020. +Michael Tschannen, Josip Djolonga, Paul K Rubenstein, Sylvain Gelly, and Mario Lucic. On mutual information maximization for representation learning. arXiv preprint arXiv:1907.13625, 2019. +Manuel Watter, Jost Tobias Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. arXiv preprint arXiv:1506.07365, 2015. +Kevin Xie, Homanga Bharadhwaj, Danijar Hafner, Animesh Garg, and Florian Shkurti. Latent skill planning for exploration and transfer. In International Conference on Learning Representations, 2020. +Amy Zhang, Harsh Satija, and Joelle Pineau. Decoupling dynamics and reward for transfer learning. arXiv preprint arXiv:1804.10689, 2018. +Amy Zhang, Rowan McAllister, Roberto Calandra, Yarin Gal, and Sergey Levine. Learning invariant representations for reinforcement learning without reconstruction. arXiv preprint arXiv:2006.10742, 2020. + +# A APPENDIX + +# A.1 THEORETICAL RESULTS ON CONTROLLABLE REPRESENTATIONS + +Let $\Phi(\cdot)$ denote the encoder such that $Z = \Phi(\mathcal{O})$ . $\mathcal{O}$ is the observation seen by the agent and $S$ is the underlying state. $S^{+}$ is defined as that part of underlying state $S$ which is directly influenced by actions $A$ i.e. $S^{+} \leq S$ s.t. $I(A_{t-1}; S_t | S_t^{+}) = 0$ . + +We next describe two theorems regarding learning controllable representations, with proofs in the Appendix. We observe that the max $\sum_{t}I(A_{t - 1};\bar{Z}_t|Z_{t - 1})$ objective alone for learning latent representations $Z$ , along with the planning objective provably recovers controllable parts of the observation $\mathcal{O}$ , namely $S^{+}$ . + +Theorem 1. The objective max $\sum_{t}I(A_{t - 1};Z_{t}|Z_{t - 1})$ provably recovers controllable parts $S^{+}$ of the observation $\mathcal{O}$ . $S^{+}$ is defined as that part of underlying state $S$ which is directly influenced by actions $A$ i.e. $S^{+}\subset S$ s.t. $I(S_{t};A_{t - 1}|S_{t}^{+}) = 0$ . + +Proof. Based on Fig. 2 and Fig. 7, we have the following + +$$ +\begin{array}{l} \max I \left(A _ {t - 1}; Z _ {t}\right) \leq \max I \left(A _ {t - 1}; \mathcal {O} _ {t}\right) \quad \text {D a t a - P r o c e s s i n g I n e q u a l i t y} \\ \leq I \left(A _ {t - 1}; S _ {t}\right) \quad \text {D a t a - P r o c e s s i n g I n e q u a l i t y} \\ \leq I \left(A _ {t - 1}; S _ {t}, S _ {t} ^ {+}\right) \\ \leq I \left(A _ {t - 1}; S _ {t} \mid S _ {t} ^ {+}\right) + I \left(A _ {t - 1}; S _ {t} ^ {+}\right) \quad \text {C h a i n R u l e o f M I} \\ \leq I \left(A _ {t - 1}; S _ {t} ^ {+}\right) \quad \text {C o n d i t i o n a l} \\ \end{array} +$$ + +So, the maximum above can be obtained when the encoder $\Phi$ is an identity function over $S^{+}$ and a zero function over $[\tilde{S}^{-}, S^{-}]$ . So, $Z_{t} = S_{t}^{+}$ . Hence, given $Z_{t-1}$ , $I(A_{t-1}; Z_{t}|Z_{t-1})$ is maximized when $\Phi$ is an identity function over $S^{+}$ . So, $\max \sum_{t} I(A_{t-1}; Z_{t}|Z_{t-1})$ learns the encoder $\Phi$ such that controllable representations are recovered. + +![](images/ac331eca0a7d3a7464f3021d01bbfc8892bfa203d45d35b66e9e8e202099fd75.jpg) + +This result is important because in practice, we may not be able to represent every possible factor of variation in a complex environment. In this situation, we would expect that when $|Z| \ll |\mathcal{O}|$ , learning $Z$ under the objective $\max \sum_{t} I(A_{t-1}; Z_t | Z_{t-1})$ would encode $S^+$ . We next show that the inverse information objective alone can be used to train a latent-state space model and a policy through an alternating optimization algorithm that converges to a local minimum of the objective $\max \sum_{t} I(A_{t-1}; Z_t | Z_{t-1})$ at a rate inversely proportional to the number of iterations. + +Theorem 2. $\max_{\pi, \psi} \sum_t I(A_{t-1}; Z_t | Z_{t-1}) = \sum_t \mathbb{E}_{\pi(a_{t-1} | z_{t-1}) p(z_t | z_{t-1}, a_{t-1}, o_t)} \log \frac{q_{\psi}(a_{t-1} | z_t, z_{t-1})}{\pi(a_{t-1} | z_{t-1})}$ can be optimized through an alternating optimization scheme that has a convergence rate of $\mathcal{O}(1/N)$ to a local minima of the objective, where $N$ is the number of iterations. + +Proof. Let $z \sim q_{\phi}(z|o)$ denote a latent state sampled from the encoder distribution. Learning a world model such that reward prediction and inverse information are maximized can be summarized as: + +$$ +\max _ {\phi , \psi , \eta} \sum_ {t} \mathbb {E} _ {\pi \left(a _ {t} \mid z _ {t}\right), q _ {\phi} \left(z _ {t} \mid o _ {t}\right)} \left[ \mathbb {E} _ {p \left(r _ {t} \mid z _ {t}, a _ {t}\right)} \log q _ {\eta} \left(r _ {t} \mid z _ {t}, a _ {t}\right) + \mathbb {E} _ {p \left(z _ {t + 1} \mid z _ {t}, a _ {t}\right)} \log \frac {q _ {\psi} \left(a _ {t} \mid z _ {t + 1} , z _ {t}\right)}{\pi \left(a _ {t} \mid z _ {t}\right)} \right] +$$ + +The policy $\pi (a_t|z_t)$ is learned by + +$$ +\max _ {\pi} \sum_ {t} \mathbb {E} _ {\pi (a _ {t} | z _ {t}), q _ {\phi} (z _ {t} | o _ {t})} \left[ \mathbb {E} _ {p (r _ {t} | z _ {t}, a _ {t})} \log q _ {\eta} (r _ {t} | z _ {t}, a _ {t}) + \mathbb {E} _ {p (z _ {t + 1} | z _ {t}, a _ {t})} \log \frac {q _ {\psi} (a _ {t} | z _ {t + 1} , z _ {t})}{\pi (a _ {t} | z _ {t})} \right] +$$ + +Model-based RL in this case involves alternating optimization between policy learning and learning the world model. In the case where there is no reward signal from the environment, i.e. $p(r_t|z_t)$ , we have the following objective + +$$ +\max _ {\pi} \max _ {\phi , \psi} \sum_ {t} \mathbb {E} _ {\pi \left(a _ {t} \mid z _ {t}\right), q _ {\phi} \left(z _ {t} \mid s _ {t}\right) p \left(z _ {t + 1} \mid z _ {t}, a _ {t}\right)} \log \frac {q _ {\psi} \left(a _ {t} \mid z _ {t + 1} , z _ {t}\right)}{\pi \left(a _ {t} \mid z _ {t}\right)} +$$ + +![](images/484a8b287e82fe4a01bbc0e13905f21b9974a5066add738ad2da70dec9eceb7d.jpg) +Figure 7: PGM of the MDP with distractor states. The state observed by the agent $\mathcal{O}$ consists of three parts $S^{+}$ , $\tilde{S}^{-}$ and $DS^{-}$ . $S^{+}$ is the controllable part of the state i.e. it is affected by the actions of the agent, and in turn affects the reward $R$ ; $\tilde{S}^{-}$ is not controllable by the agent but affects the reward $R$ and future $S^{+}$ ; $DS^{-}$ is not controllable by the agent and doesn't affect the reward $R$ and future $S^{+}$ . + +The optimal $q_{\psi}^{*}$ give a fixed $\pi$ and $\phi$ can be derived as in page 335 of Cover & Thomas (2006). + +$$ +q _ {\psi} ^ {*} (a _ {t} | z _ {t + 1}, z _ {t}) = \frac {q _ {\phi} (z _ {t} | s _ {t}) p (z _ {t + 1} | z _ {t} , a _ {t}) \pi (a _ {t} | z _ {t})}{\int_ {a} q _ {\phi} (z _ {t} | s _ {t}) p (z _ {t + 1} | z _ {t} , a _ {t}) \pi (a _ {t} | z _ {t})} +$$ + +The optimal $\pi *$ given a fixed $\psi$ and $\phi$ can be derived as + +$$ +\pi^ {*} (a _ {t} | z _ {t}) = \frac {\exp \left(\mathbb {E} _ {q _ {\phi} (z _ {t} | s _ {t}) p (z _ {t + 1} | z _ {t} , a _ {t})} [ \log q _ {\psi} (a _ {t} | z _ {t + 1} , z _ {t}) ]\right)}{\int_ {a} \exp \left(\mathbb {E} _ {q _ {\phi} (z _ {t} | s _ {t}) p (z _ {t + 1} | z _ {t} , a _ {t}) q} [ \log q _ {\psi} (a _ {t} | z _ {t + 1} , z _ {t}) ]\right)} +$$ + +We note that these alternating iterations correspond to an instantiation of the Blahut-Arimoto algorithm (Blahut, 1972) for determining the information theoretic capacity of a channel. Based on (Nakagawa et al., 2021) we see that this iterative optimization procedure between $q_{\psi}^{*}$ and $\pi^{*}$ converges, and the worst-case rate of convergence is $\mathcal{O}(1 / N)$ where $N$ is the number of iterations. + +![](images/97518134861d17a0cb307188149fe16121e44a0392f14144044418ca5c64a194.jpg) + +This result is useful because it shows that even in the absence of rewards from the environment $(r_t = 0\forall t)$ , when planning to minimize regret is not possible, the inverse information objective can be used to train a policy that explores to seek out controllable parts of the state-space. When rewards from the environment are present, we can train the policy with this objective and the value estimates obtained from the cumulative rewards during planning. In Section 4.3 we empirically show how this objective helps achieve higher sample efficiency compared to pure value-based policy learning. + +# A.2 PRIMAL DUAL UPDATES + +$$ +Z _ {0: H - 1} = Z _ {0: H - 1} + \frac {\partial \sum_ {t = 0} ^ {H - 1} I (\mathcal {O} _ {t} ; Z _ {t}) + \lambda (- I (i _ {t} ; Z _ {t} | Z _ {t - 1} , A _ {t - 1}) + I (A _ {t - 1} ; Z _ {t} | Z _ {t - 1}) + I (R _ {t} ; Z _ {t}) - c _ {0})}{\partial Z _ {0 : H - 1}} +$$ + +$$ +\lambda = \lambda - \left(\underbrace {- I \left(i _ {t} ; Z _ {t} \mid Z _ {t - 1} , A _ {t - 1}\right)} _ {\text {f w d d y n a m i c s m o d e l}} + \underbrace {I \left(A _ {t - 1} ; Z _ {t} \mid Z _ {t - 1}\right)} _ {\text {i n v d y n a m i c s m o d e l}} + \underbrace {I \left(R _ {t} ; Z _ {t}\right)} _ {\text {r e w m o d e l}} - c _ {0}\right) +$$ + +# A.3 FORWARD, INVERSE, AND REWARD MODELS + +$$ +\begin{array}{l} - I \left(i _ {t}; Z _ {t} \mid Z _ {t - 1}, A _ {t - 1}\right) = - \int p \left(z _ {t}, z _ {t - 1}, a _ {t - 1}, i _ {t}, o _ {t}\right) \log \frac {p \left(z _ {t} \mid z _ {t - 1} , a _ {t - 1} , o _ {t}\right)}{p \left(z _ {t} \mid z _ {t - 1} , a _ {t - 1}\right)} \\ = - \int p (z _ {t}, z _ {t - 1}, a _ {t - 1}, o _ {t}) \left(\log \frac {p (z _ {t} | z _ {t - 1} , a _ {t - 1} , o _ {t})}{q _ {\chi} (z _ {t} | z _ {t - 1} , a _ {t - 1})} + \log \frac {q _ {\chi} (z _ {t} | z _ {t - 1} , a _ {t - 1})}{p (z _ {t} | z _ {t - 1} , a _ {t - 1})}\right) \\ \geq - \int p (z _ {t}, z _ {t - 1}, a _ {t - 1}, o _ {t}) \log \frac {p (z _ {t} | z _ {t - 1} , a _ {t - 1} , o _ {t})}{q _ {\chi} (z _ {t} | z _ {t - 1} , a _ {t - 1})} \\ = - D _ {\mathrm {K L}} \left(p \left(z _ {t} \mid z _ {t - 1}, a _ {t - 1}, o _ {t}\right) \mid \mid q _ {\chi} \left(z _ {t} \mid z _ {t - 1}, a _ {t - 1}\right)\right) \\ \end{array} +$$ + +We can obtain a variational lower bound on the empowerment + +$$ +\begin{array}{l} I \left(a _ {t}; z _ {t + k} \mid z _ {t}\right) = \int p \left(a _ {t}, z _ {t + k}, z _ {t}\right) \log \frac {p \left(a _ {t} \mid z _ {t + k} , z _ {t}\right)}{p \left(a _ {t} \mid z _ {t}\right)} \\ = \int p \left(a _ {t}, z _ {t + k}, z _ {t}\right) \left(\log \frac {q \left(a _ {t} \mid z _ {t + k} , z _ {t}\right)}{p \left(a _ {t} \mid z _ {t}\right)} + \log \frac {p \left(a _ {t} \mid z _ {t + k} , z _ {t}\right)}{q \left(a _ {t} \mid z _ {t + k} , z _ {t}\right)}\right) \\ \geq \int p (a _ {t}, z _ {t + k}, z _ {t}) \log \frac {q (a _ {t} | z _ {t + k} , z _ {t})}{p (a _ {t} | z _ {t})} \\ = \int p \left(a _ {t}, z _ {t + k}, z _ {t}\right) \log q \left(a _ {t} \mid z _ {t + k}, z _ {t}\right) - \int p \left(z _ {t}\right) p \left(z _ {t + k} \mid a _ {t}, z _ {t}\right) p \left(a _ {t} \mid z _ {t}\right) \log p \left(a _ {t} \mid z _ {t}\right) \\ = \mathbb {E} _ {p (a _ {t}, z _ {t + k}, z _ {t})} [ \log q (a _ {t} | z _ {t + k}, z _ {t}) ] + \mathbb {E} _ {p (z _ {t}) p (z _ {t + k} | a _ {t}, z _ {t})} [ \mathcal {H} (p (a _ {t} | z _ {t})) ] \\ \end{array} +$$ + +Here, $q(a_{t}|z_{t + k},z_{t})$ is the inverse dynamics model, and $\mathcal{H}(p(a_t|z_t))$ is the entropy of the policy. + +We can obtain a variational lower bound on the reward model as + +$$ +\begin{array}{l} I (r _ {t}; z _ {t}) = \int p (r _ {t}, z _ {t}) \log \frac {p (r _ {t} | z _ {t})}{p (r _ {t})} \\ = \int p \left(r _ {t}, z _ {t}\right) \left(\log \frac {q \left(r _ {t} \mid z _ {t}\right)}{p \left(r _ {t}\right)} + \log \frac {p \left(r _ {t} \mid z _ {t}\right)}{q \left(r _ {t} \mid z _ {t}\right)}\right) \\ = \int p \left(r _ {t}, z _ {t}\right) \log \frac {q \left(r _ {t} \mid z _ {t}\right)}{p \left(r _ {t}\right)} + K L [ p \left(r _ {t}, z _ {t}\right) | | q \left(r _ {t}, z _ {t}\right) ] \\ \geq \int p (r _ {t}, z _ {t}) \log \frac {q (r _ {t} | z _ {t})}{p (r _ {t})} \\ = \int p \left(r _ {t}, z _ {t}\right) \log q \left(r _ {t} \mid z _ {t}\right) - \int p \left(r _ {t}, z _ {t}\right) \log p \left(r _ {t}\right) \\ = \mathbb {E} _ {p (r _ {t}, z _ {t})} [ \log q (r _ {t} | z _ {t}) ] + C o n s t a n t \\ \end{array} +$$ + +Here, $q(r_t|z_t)$ is the reward decoder. Since the reward is a scalar, reconstructing it is computationally simpler compared to reconstructing high dimensional observations as in the BA bound for the observation model. + +# A.4 VALUE DIFFERENCE RESULT + +We show that the difference in value function of the underlying MDP $Q^{\pi}(o,a)$ and the latent MDP $\hat{Q}^{\pi}(z,a)$ , where $z\sim q_{\phi}(z|o)$ is bounded, under some regularity assumptions. Similar to the assumption in (Gelada et al., 2019), let the policy $\pi$ have bounded semi-norm value functions under the total variation distance $D_{\mathrm{TV}}$ i.e. $|\hat{V}^{\pi}(z)|_{D_{\mathrm{TV}}}\leq K$ and $|\mathbb{E}_{z_1\sim P}V(z_1) - \mathbb{E}_{z_2\sim Q}V(z_2)|\leq KD_{\mathrm{TV}}(P,Q)$ . + +Define the forward dynamics learning objective as $\min_{\chi}L_{T} = \min_{\chi}D_{\mathrm{KL}}(p(o'|o,a)||q_{\chi}(z'|z,a))$ and the reward model objective as $\min_{\eta}L_R = \min_{\eta}D_{\mathrm{KL}}(p(r|o)||q_{\eta}(r|z))$ + +Theorem 3. The difference between the $Q$ -function in the latent MDP and that in the original MDP is bounded by the loss in reward predictor and forward dynamics model. + +$$ +\mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} [ Q ^ {\pi} (o, a) - \hat {Q} ^ {\pi} (z, a) ] \leq \frac {\sqrt {L _ {R}} + \gamma K \sqrt {L _ {T}}}{1 - \gamma} +$$ + +Proof. + +$$ +\begin{array}{l} \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} [ Q ^ {\pi} (o, a) - \hat {Q} ^ {\pi} (z, a) ] \\ \leq \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} \bigl (\left| r (o, a) - \hat {r} (z, a) \right| + \gamma \left| \mathbb {E} _ {o ^ {\prime} \sim p (o ^ {\prime} | o, a)} V (o ^ {\prime}) - \mathbb {E} _ {z ^ {\prime} \sim q _ {\chi} (z ^ {\prime} | z, a)} \hat {V} (z ^ {\prime}) \right| \bigr) \\ \leq \sqrt {D _ {\mathrm {K L}} (p (r | o) | | q _ {\eta} (r | z))} + \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} (\gamma | \mathbb {E} _ {o ^ {\prime} \sim p (o ^ {\prime} | o, a), z ^ {\prime} \sim q _ {\phi} (z ^ {\prime} | o ^ {\prime})} [ V (o ^ {\prime}) - \hat {V} (z ^ {\prime}) ] | \\ + \gamma | \mathbb {E} _ {o ^ {\prime} \sim p (o ^ {\prime} | o, a), z ^ {\prime} \sim q _ {X} (z ^ {\prime} | z, a)} [ V (o ^ {\prime}) - \hat {V} (z ^ {\prime}) ] |) \\ \leq \sqrt {L _ {R}} + \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} (\gamma | \mathbb {E} _ {o ^ {\prime} \sim p (o ^ {\prime} | o, a), z ^ {\prime} \sim q _ {\phi} (z ^ {\prime} | o ^ {\prime})} [ V (o ^ {\prime}) - \hat {V} (z ^ {\prime}) ] |) \\ + \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} (\gamma K D _ {\mathrm {T V}} (p (o ^ {\prime} | o, a) | | q _ {\chi} (z ^ {\prime} | z, a))) \\ \leq \sqrt {L _ {R}} + \gamma \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} \mathbb {E} _ {o ^ {\prime} \sim p (o ^ {\prime} | o, a), z ^ {\prime} \sim q _ {\phi} (z ^ {\prime} | o ^ {\prime})} [ V (o ^ {\prime}) - \hat {V} (z ^ {\prime}) ]) \\ + \gamma K \sqrt {D _ {\mathrm {K L}} (p (o ^ {\prime} | o , a) | | q _ {\chi} (z ^ {\prime} | z , a))} \\ \leq \sqrt {L _ {R}} + \gamma \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} [ V (o) - \hat {V} (z) ]) + \gamma K \sqrt {L _ {T}} \\ \leq \sqrt {L _ {R}} + \gamma \mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} [ Q (o, a) - \hat {Q} (z, a) ]) + \gamma K \sqrt {L _ {T}} \\ \end{array} +$$ + +So, we have shown that + +$$ +\mathbb {E} _ {(o, a) \sim d ^ {\pi} (o, a), z \sim q _ {\phi} (z | o)} [ Q ^ {\pi} (o, a) - \hat {Q} ^ {\pi} (z, a) ] \leq \frac {\sqrt {L _ {R}} + \gamma K \sqrt {L _ {T}}}{1 - \gamma} +$$ + +![](images/5075625daaf4b427692506eac396f0616819f0c84bc0fb7962781d20f291134b.jpg) + +We can see that, as $L_{R}, L_{T} \to 0$ , the Q-function in the representation space of the MDP, $\hat{Q}$ , becomes increasingly closer to that of the original MDP, $Q$ . Since this result holds for all Q-functions, it also holds for the optimal $Q^{*}$ and $\hat{Q}^{*}$ . This result extends sufficiency results in prior works Rakelly et al. (2021) to a setting with stochastic encoders and KL-divergence losses on forward dynamics and reward, as opposed to Wasserstein metrics (Gelada et al., 2019), and bisimulation metrics (Zhang et al., 2020). + +# A.5 BEHAVIORAL SIMILARITY METRIC DETAILS + +Given the sets $S_{z} = \{z^{i}\}_{i=1}^{n}$ and $S_{z_{\mathrm{gt}}} = \{z_{\mathrm{gt}}^{i}\}_{i=1}^{n}$ , we construct complete graphs by connecting every vertex with every other vertex through an edge. The weight of an edge is the Euclidean distance between the respective pairs of vertices. The label of each vertex is an unique integer and corresponding vertices in the two graphs are labelled similarly. Let the resulting graphs be denoted as $G_{z} = (V_{z}, E_{z})$ and $G_{z_{\mathrm{gt}}} = (V_{z_{\mathrm{gt}}}, E_{z_{\mathrm{gt}}})$ respectively. Note that both these graphs are shortest path graphs, by construction. + +Since the Euclidean distances in both the graphs cannot be directly compared, we scale the distances such that the shortest edge weight among all edge weights are equal in both the graphs. Scaling every edge weight by the same number doesn't change the structure of the graph. Now, we define the shortest path kernel to measure similarity between the two graphs, as follows + +$$ +k (G _ {z}, G _ {z _ {\mathrm {g t}}}) = \frac {1}{| E _ {z} |} \sum_ {e _ {i} \in E _ {z}} \sum_ {e _ {j} \in E _ {z _ {\mathrm {g t}}}} \hat {k} (e _ {i}, e _ {j}) +$$ + +Let, $e_i = \{u_i, v_i\}$ and $e_j = \{u_j, v_j\}$ . Here, the kernel $\hat{k}$ measures similarity between the edges $e_i, e_j$ and the labels on respective vertices. Let the function $l(\cdot)$ denote the labels of vertices and the weights of edges. + +$$ +\hat {k} (e _ {i}, e _ {j}) = k _ {v} (l (u _ {i}), l (u _ {j})) k _ {e} (l (e _ {i}), l (e _ {j})) k _ {v} (l (v _ {i}), l (v _ {j})) + k _ {v} (l (u _ {i}), l (v _ {j})) k _ {e} (l (e _ {i}), l (e _ {j})) k _ {v} (l (v _ {i}), l (u _ {j})) +$$ + +Here, $k_{v}$ is a Dirac delta kernel i.e. $k_{e}(x,y) = 1 - \delta (x,y)$ (Note that $\delta (x,y) = 1$ iff $x = y$ , else $\delta (x,y) = 0$ ) and $k_{e}$ is a Brownian ridge kernel, $k_{e}(x,y) = \frac{1}{c}\max (0,c - |x - y|)$ , where $c$ is a large number. + +So, in summary, the value of $\hat{k}(e_i,e_j)$ is low when the edge lengths between corresponding pairs of vertices in both the graphs are close. Hence, the value of $k(G_z,G_{z_{\mathrm{gt}}})$ is low when a large number of pairs of corresponding vertices in both the graphs have the same edge length. + +We expect methods that recover latent state representations which better reflect the true underlying simulator state (i.e., the positions of the joints) to have higher values according to this metric. + +# A.6 DESCRIPTION OF THE DISTRACTORS + +ILSVRC dataset (Russakovsky et al., 2015) The distractors used for the main experiments are natural video backgrounds with RGB images from the ILSVRC dataset. We use 200 videos during training, and reserve 50 videos for testing. An illustration of this for different environments are shown in Fig. 8. These images are snapshots of what is received by the algorithm (64x64x3 images) and no information about proprioceptive features is provided. While natural videos that are unrelated to the task might be easy to ignore, realistic scenes might have other elements that resemble the controllable elements, but are not actually controllable (e.g., other cars in a driving scenario). + +To emulate this, we also add distractors that resemble other potentially controllable robots, as shown for example in Fig. 8 (top left and bottom right frames), but are not actually influenced by the actions of the algorithm. These are particularly challenging because the background video has a prerecorded motion of the same (or similar) agent that is being controlled. We include such challenging agent-behind-agent background videos with a frequency of 1 in very 3 videos. + +For the experiments in Table 1, examples of different levels of distractors are shown in Fig. 9. The three different levels have distractor windows of size $32 \times 32$ , $40 \times 40$ , and $64 \times 64$ respectively. + +Kinetics dataset (Kay et al., 2017) For comparing directly with results in prior works DBC (Zhang et al., 2020), and TIA (Fu et al., 2021), we evaluate on the setting where the random videos are grayscale images from the Kinetics dataset driving car class. The settings are same as in the prior works and we compare directly to the results in the respective papers. + +# A.7 TRAINING AND NETWORK DETAILS + +The agent observations have shape $64 \times 64 \times 3$ , action dimensions range from 1 to 12, rewards per time-step are scalars between 0 and 1. All episodes have randomized initial states, and the initial distractor video background is chosen randomly. + +We implement our approach with TensorFlow 2 and use a single Nvidia V100 GPU and 10 CPU cores for each training run. The training time for 1e6 environment steps is 4 hours on average. In comparison, the average training time for 1e6 steps for Dreamer is 3 hours, for CDreamer is 4 hours, for TIA is 4 hours, for DBC is 4.5 hours, and for DeepMDP is 5 hours. + +The encoder consists of 4 convolutional layers with kernel size 4 and channel numbers 32, 65, 128, 256. The forward model consists of deterministic and stochastic parts, as in standard in visual model-based RL (Hafner et al., 2019b;a). The stochastic states have size 30 and deterministic state has size 200. The compatibility function $f_{\theta}(z_t, o_{t'}) = \exp(z_t^T W_{\theta} z_{t'})$ for contrastive learning is learned with a $200 \times 200 W_{\theta}$ matrix. Here, $z_{t'}$ is the encoding of $o_{t'}$ . All other models are implemented as three dense layers of size 300 with ELU activations. + +We use ADAM optimizer, with learning rate of 6e-4 for the latent-state space model, and 8e-5 for the value function and policy optimization. The hyper-parameter $c_{0}$ for the prioritized information constraint is set to 1000, after doing a grid-search over the range [100, 10000] and observing similar performance for 1000 and 10000. 100 training steps are followed by 1 episode of interacting with the environment with the currently trained policy, for observing real transitions. The dataset is initialized with 7 episodes collected with random actions in the environment. We kept the hyper-parameters of InfoPower same across all environments and distractor types. + +For fair comparisons, we kept all the common hyper-parameter values same as Dreamer (Hafner et al., 2019a). This was the protocol followed in prior works TIA (Fu et al., 2021) and Ma et al. + +![](images/b26606aa4fbbeec57820845fcda54a811b8c209a02d1a81bb2f1113d268c4d2c.jpg) + +![](images/e290ba43b19dca6c6acd29bc3f678c4098ed119a5614f7a3695d2e3bfccab00d.jpg) + +![](images/5bad1f36d0d6722e6b5791dd9083a3927cb490ddcb86e09de5da3f609ec7e32d.jpg) + +![](images/c0bafdd533c235d4a75387256701bfec2505bca016b3c2c5617981dbb4ce1bad.jpg) +Figure 8: Illustration of the natural video background distractors used in our experiments. The videos change after every 50 time-steps. Some video backgrounds (for example the top left and the bottom right) have more complex distractors in the form of agent-behind-agent i.e. an agent of similar morphology moves in the background of the agent being controlled. + +![](images/5c8fbe6093ed387f5cdcdcb47f957f5c3f88f9983a102a5f6a520f288e2064dc.jpg) + +![](images/da4306e5cdec3cca389069094e76e30f776218e503bace1621bd88712ba64099.jpg) + +![](images/c0ccdda148f563974b1eabcd126bae04f961a893ca00ba014795e4e19d790d77.jpg) +L1 + +![](images/c6ca88a7cd1306bdca688b35eb99513a328c5e599c6704a4dbe66114b7e80d4d.jpg) +L2 + +![](images/edbf65a7f6b7af332250c9b34ff6370be98f0a173efde88761ec212398d12aaa.jpg) +L3 +Figure 9: Illustration of the different levels of distractors. L1, L2, and L3 respectively have distractor windows of size $32 \times 32$ , $40 \times 40$ , and $64 \times 64$ . + +(2020). For the baseline TIA, we tuned the environment-specific parameters $\lambda_{R_{adv}}$ and $\lambda_{O_s}$ as mentioned in Table 2 of (Fu et al., 2021). For $\lambda_{R_{adv}}$ , we performed a gridsearch over the range $10k - 50k$ and for $\lambda_{O_s}$ we performed a gridsearch over the range $1 - 3$ to obtain the parameters for best performance, which we used for the plots in Fig. 4 and Fig. 11. Respectively for walker-walk, cheetah-run, finger-spin, quadruped-walk, hopper-stand, ball-in-a-cup-catch, cartpole-balance-sparse, quadruped-run, the values of $\lambda_{R_{adv}}$ are $30k,30k,20k,40k,30k,40k,20k,30k$ . The values of $\lambda_{O_s}$ are $2,2,1.5,2.5,2.5,2.2,2$ . + +For baseline DBC (Zhang et al., 2020), we kept all the parameters same as in Table 2 of the paper, because DBC does not have any environment-specific parameters and the same values were used for all environments in the DBC paper. The DeepMDP agent and its hyperparameters are adapted from the implementation provided in the github repo of DBC (Zhang et al., 2020). + +# A.8 CONTRASTIVE LEARNING + +Since the distracting backgrounds are changing videos of a certain duration, for contrastive learning, we contrast both across time and across batches. Contrasting across time helps model invariance against temporally contiguous distractors (for example in the same video) while contrasting across batches helps in learning invariance across different videos. Concretely, we sample batches from the dataset $\left(^{(i)}\right)\{(a_{t},o_{t},r_{t})\}_{t = 1}^{H}$ , where $i$ denotes a batch index, and for each observation $o_t$ in batch $i$ , all observations $o_{t'}$ both in batch $i$ and in other batches $j\neq i$ are considered negative samples. + +# A.9 RESULT ON VARYING DISTRACTOR LEVELS + +We consider different levels of distractors by varying the size of the window where distractors in the background are active. Fig. 9 in the Appendix illustrates this visually. Table 1 shows results for + +Table 1: DM Control Walker Stand with natural video distractors at different levels. We tabulate the rewards (Rew) and behavioral similarity (Sim) at ${500}\mathrm{k}$ and $1\mathrm{M}$ steps of training. Higher is better for both Rew and Sim. + +
NameLevelsRew@500kRew@1MSim@500kSim@1M
DreamerL1197 ± 31240 ± 270.73±0.020.74±0.01
DBCL1261 ± 25390 ± 340.75±0.030.74±0.02
C-DreamerL1291 ± 34590 ± 260.73±0.020.79±0.01
DeepMDPL1263 ± 31340 ± 220.74±0.020.75±0.03
InfoPowerL1397 ± 22650 ± 1000.82 ± 0.010.84 ± 0.03
DreamerL2180 ± 36197 ± 200.56±0.030.59±0.02
DBCL2221 ± 28320 ± 330.65±0.020.66±0.02
C-DreamerL2282 ± 30550 ± 660.63±0.010.71±0.02
DeepMDPL2213 ± 34300 ± 250.59±0.020.61±0.04
InfoPowerL2394 ± 30644 ± 1010.77 ± 0.030.77 ± 0.03
DreamerL3140 ± 52157 ± 100.32±0.020.33±0.03
DBCL3165 ± 20221 ± 240.45±0.010.48±0.01
C-DreamerL3231 ± 39485 ± 860.58±0.020.64±0.01
DeepMDPL3153 ± 23212 ± 280.44±0.020.49±0.01
InfoPowerL3389 ± 20624 ± 800.71 ± 0.010.74 ± 0.03
+ +Table 2: Comparison of baselines TIA and DBC with InfoPower on environments with video distractors from the Kinetics dataset Driving Car class. The results for TIA and DBC are from the respective papers. + +
TIADBCInfoPower
500k800k500k800k500k800k
Walker-Run389±45602±40165±92210±32417±22630±33
Cheetah-Run384±149579±172261±64277±81425±97572±158
Hopper-Stand338±221581±214110±92207±120395±140615±176
Ball-in-a-Cup201±197115±110--255±104263±116
Walker-Walk878±37948±28545±57630±68925±18972±26
Finger-Spin371±96487±107801±10832±4795±34787±58
Hopper-Hop47±4472±685±120±085±2677±74
+ +the different approaches on varying distractor levels. The size of the frame for distractors at levels L1, L2, and L3 respectively are 32x32, 40x40, and 64x64. We observe that the baselines perform worse as the distractor window size increases. While, for InfoPower, the performance decreases with increasing level is minimal. This indicates the effectiveness of InfoPower in filtering out background distractors from the observations while learning latent representations. Note that the distractors in Figs. 4 and 6 are of level 3 i.e. same size as the observations 64x64. + +# A.10 RESULTS ON DISTRACTORS FROM THE KINETICS DATASET + +In this section, we evaluate InfoPower on the same distractors used in prior works, DBC and TIA. The distractor videos are from the Kinetics dataset (Kay et al., 2017) Driving Car class, and converted to grayscale. From Table 2 we see that InfoPower slightly outperforms the baselines. We believe the performance gap is not as significant as Fig. 4 because the distractors being grayscale images, and not RGB might be easier to ignore by the baselines as well as InfoPower. + +# A.11 SETTING WITH ONLY SHIFTED AGENT BEHIND AGENT DISTRACTORS + +In this section we evaluate InfoPower with the baselines only for the challenging setting of agent-behind-agent distrators where the background contains the same agent being controlled (a walker or a cheetah). An illustration of this is shown in Fig. 10. From the results in Table 3, we see that InfoPower significantly out + +![](images/1ac9ef0cc09220893ef07d8cb6c654cd2266534d9c7d9ed65e333d42d9d65dd5.jpg) +Figure 10: Illustration of the distractor setting for results in Table 3. + +![](images/2b31a52ae74ecd74fe72fea5c986136983d072f2578565169749c3d6be459b4e.jpg) + +performs the competitive baselines both at 500k and 1M environment interactions. This suggests the utility of InfoPower in separating out informative elements of the observation from uninformative ones even in challenging settings. + +Table 3: Evaluation of InfoPower and the most competitive baselines in a suite of challenging distractors where the background contains a shifted version of the agent being controlled. Results are averaged over 4 random seeds. Fig. 10 shows a visualization of the distractors for this setting. + +
Walker-Walk-shiftedCheetah-Run-shifted
500k1M500k1M
DBC35±15104±2841±1078±38
CDreamer108±36164±4573±44110±52
TIA79±42152±3365±24115±28
InfoPower168±48278±42130±46207±35
+ +![](images/f270e6992273fb17037be8fbca3945970a906bcfc8c79157ec31cbbddccfdefa.jpg) + +![](images/c3ae08e690f3a266d1f8e6d9a289f93b8433d2199fc34a634ae4ababdbfa393a.jpg) + +![](images/4e16b52547f684c1e1d03f08fed2f45f72596a92807e281ceb30d578b4771f51.jpg) + +![](images/acf1ae2c55710c1d03250cd4f649c502b33e0d9512d8302ef7541706fed8b9af.jpg) + +![](images/c40d058f1fc974275a4f80f945605fdc1fcb966a46433263e34125ba613b9b50.jpg) +Figure 11: Evaluation of InfoPower and baselines with empowerment in policy learning. The setting corresponds to DeepMind Control tasks with RGB natural video distractors in the background (same as that in Figure 5 of the main paper). The x-axis denotes the number of environment interactions and the y-axis shows the episodic returns. + +![](images/255c4c70725c4c33bd76fd486a6f644bd1427c73f69b893b8153e7d0b5ca6c03.jpg) + +![](images/e57d2c105ea3b2eda5c5839bfa695fb57b28d2afec0628199add02d53fb282f2.jpg) + +![](images/0bacfb4044d04b0a1ed25d514216a2a6bd0a0b4c040358b4f311c41a80242c5e.jpg) + +# A.12 COMPARISON OF BASELINES WITH EMPOWERMENT IN POLICY LEARNING + +In this section, we compare against modified versions of the baselines, such that we include empowerment in the policy learning of the baselines. This is the only modification we make to the baselines, and keep everything else unchanged. We described in section 3.3 that inclusion of empowerment in the objective for visual model-based RL (by modifying both the representation learning objective and the policy learning objective) is an important contribution of our paper. The aim of this experiment is to disentangle the benefits of empowerment in representation learning, for InfoPower with that in policy learning. + +We have plotted the results in Fig. 11. We can see that the performance of the baselines is slightly better than Fig. 4 because of the inclusion of empowerment in the policy learning objective which as we motivated previously in section 3.4 helps with exploring controllable regions of the state-space. Note that by adding empowerment, we have effectively modified the baselines. + +# A.13 COMPARISON ON ENVIRONMENTS WITHOUT DISTRACTORS + +We compare the performance of InfoPower with a state-of-the-art visual model-based RL method, Dreamer in the default DM Control environments without distractors. We see from Table 4 that InfoPower performs slightly better or similar to Dreamer in all the environments consistently. This result complements our main paper result on environments with distractors and confirms that the benefit of InfoPower in challenging distracting environments does not come at a cost of performance in simpler non-distracting environments. + +Table 4: Comparison of InfoPower with state-of-the-art visual model-based RL method, Dreamer in the default DM Control environments without distractors. We tabulate reward at $500\mathrm{k}$ and 1M environment interactions. Results are averaged over 4 random seeds. Higher is better. + +
DreamerInfoPower
Rew @ 500kRew @ 1MRew @ 500k1M
Walker Walk890±52985±10910±41980±17
Cheetah Run580±190811±95586±142810±102
Finger Spin570±187573±96590±172598±85
Quadruped Walk592±45646±50623±65666±47
Hopper Stand701±68906±33715±60930±39
Ball in a Cup871±102910±48913±67939±52
Cart-Pole Sparse742±58849±88776±40866±80
Quadruped Run450±47515±65468±42510±61
+ +# A.14 ADDITIONAL ABLATIONS + +In this section, we consider additional ablations, namely a version of of InfoPower that does not have the empowerment objective, a version of InfoPower that does not have the MI maximization objective. We see from Table 5 that removing either of these terms drops performance. + +Table 5: DM Walker Stand with natural video distractors + +
NameObs boundRew@500kRew@1MSim@500kSim@1M
DreamerBA140 ± 52157 ± 100.32±0.020.33±0.03
Contrastive-DreamerNCE231 ± 39485 ± 860.58±0.020.64±0.01
NonGenerative-DreamerNWJ280 ± 25480 ± 930.59±0.010.62±0.05
InfoPowerNCE254 ± 27481 ± 300.69±0.030.72±0.02
InfoPowerNWJ389 ± 20624 ± 800.71±0.010.74±0.03
Inverse onlyNone282 ± 70367 ± 240.63±0.040.66±0.03
\ No newline at end of file diff --git a/informationprioritizationthroughempowermentinvisualmodelbasedrl/images.zip b/informationprioritizationthroughempowermentinvisualmodelbasedrl/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f85105dba91d83ac64111f1dab1844b39fa93873 --- /dev/null +++ b/informationprioritizationthroughempowermentinvisualmodelbasedrl/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fd3793597d02f444d721bc11c239dc9388b3030b96c0cd2215de54a10e3f512 +size 1254239 diff --git a/informationprioritizationthroughempowermentinvisualmodelbasedrl/layout.json b/informationprioritizationthroughempowermentinvisualmodelbasedrl/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1fb06aebcbe002a03a2a5e2c9226f450ca7af7cf --- /dev/null +++ b/informationprioritizationthroughempowermentinvisualmodelbasedrl/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:813ac662bfcba9fbe1d6addd857eb48e17ad17580e889da5e7268b39df1f723c +size 838447 diff --git a/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_content_list.json b/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..baea18668b2295ecc699e14c7219418469ceb26f --- /dev/null +++ b/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdc5c77d1539cc10774369afad57dd1a04d1ca3790337e958994d6a33de7b5bc +size 159024 diff --git a/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_model.json b/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4f36079b9a30217c694a557a5cc9be81360a6032 --- /dev/null +++ b/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9a2ee6f7552e8d286bde0ca89a5500479246da45ac7ed2dd784c84d46a8c9ee +size 183427 diff --git a/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_origin.pdf b/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..60e25f4061fc505d55dfa72c3890443f1dc38f6f --- /dev/null +++ b/informationtheoreticonlinememoryselectionforcontinuallearning/a7dcfa61-6007-4e08-973d-f202a58277db_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f925f217e3717f6007151ca9429ad757076fbda0b410392d881d2dd4c17db81 +size 6512282 diff --git a/informationtheoreticonlinememoryselectionforcontinuallearning/full.md b/informationtheoreticonlinememoryselectionforcontinuallearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a5052cc1be923ec8f5766a88a5e4d5a9ddd1f0c7 --- /dev/null +++ b/informationtheoreticonlinememoryselectionforcontinuallearning/full.md @@ -0,0 +1,618 @@ +# INFORMATION-THEORETIC ONLINE MEMORY SELECTION FOR CONTINUAL LEARNING + +Shengyang Sun\*1, Daniele Calandriello4, Huiyi Hu\*2, Ang Li\*3, Michalis K. Titsias4 + +1University of Toronto, 1Vector Institute, 2Google Brain, 3Baidu Apollo, 4DeepMind ssy@cs.toronto.edu, angli01@baidu.com, {dcalandriello, clarahu, mtitsias}@google.com + +# ABSTRACT + +A challenging problem in task-free continual learning is the online selection of a representative replay memory from data streams. In this work, we investigate the online memory selection problem from an information-theoretic perspective. To gather the most information, we propose the surprise and the learnability criteria to pick informative points and to avoid outliers. We present a Bayesian model to compute the criteria efficiently by exploiting rank-one matrix structures. We demonstrate that these criteria encourage selecting informative points in a greedy algorithm for online memory selection. Furthermore, by identifying the importance of the timing to update the memory, we introduce a stochastic information-theoretic reservoir sampler (InfoRS), which conducts sampling among selective points with high information. Compared to reservoir sampling, InfoRS demonstrates improved robustness against data imbalance. Finally, empirical performances over continual learning benchmarks manifest its efficiency and efficacy. + +# 1 INTRODUCTION + +Continual learning (Robins, 1995; Goodfellow et al., 2013; Kirkpatrick et al., 2017) aims at training models through a non-stationary data stream without catastrophic forgetting of past experiences. Specifically, replay-based methods (Lopez-Paz & Ranzato, 2017; Rebuffi et al., 2017; Rolnick et al., 2019) tackle the continual learning problem by keeping a replay memory for rehearsals over the past data. Given the limited memory budget, selecting a representative memory becomes critical. The majority of existing approaches focus on task-based continual learning and update the memory based on the given task boundaries. Since the requirement for task boundaries is usually not realistic, general continual learning (GCL) (Aljundi et al., 2019a; Delange et al., 2021; Buzzega et al., 2020) has received increasing attention, which assumes that the agent observes the streaming data in an online fashion without knowing task boundaries. GCL makes the online memory selection more challenging since one needs to update the memory in each iteration based only on instant observations. So, successful memory management for GCL needs to be both efficient and effective. + +Due to the online constraint, only a few memory selection methods are applicable to GCL. A selection method compatible with GCL is reservoir sampling (RS) (Vitter, 1985). In particular, RS can be used to randomly extract a uniform subset from a data stream in a single pass, and it showed competitive performances for GCL for balanced streams (Chaudhry et al., 2019b; Buzzega et al., 2020). However, when the data stream is imbalanced, RS tends to miss underrepresented (but essential) modes of the data distribution. To improve the robustness against data imbalance, gradient-based sample selection (GSS) (Aljundi et al., 2019b) proposes to minimize the gradient similarities in the memory, but evaluating many memory gradients in each iteration incurs high computational costs. + +We investigate online memory selection from an information-theoretic perspective, where the memory attempts to maintain the most information for the underlying problem. Precisely, we evaluate each data point based on the proposed surprise and learnability criteria. Surprise captures how unexpected a new point is given the memory, and allows us to include new information in the memory. In contrast, learnability captures how much of this new information can be absorbed without inter + +ference, allowing us to avoid outliers. Then we present a scalable Bayesian model that can compute surprise and learnability with a small computational footprint by exploiting rank-one matrix structures. Finally, we demonstrate the effectiveness of the proposed criteria using a greedy algorithm. + +While keeping a representative memory is essential, we show that the timing of the memory updates can also be crucial for continual learning performance. Concretely, we highlight that the agent should not update the memory as soon as it sees new data, otherwise it might prematurely remove historical data from the memory and weaken the replay regularization in the GCL process. This phenomenon affects the greedy algorithm much more than RS, since the memory updates in RS appear randomly over the whole data stream. To combine the merits of information-theoretic criteria and RS, we modify reservoir sampling to select informative points only. This filters out uninformative points, and thus encourages a diverse memory and improves the robustness against data imbalance. + +Empirically, we demonstrate that the proposed information-theoretic criteria encourage to select representative memories for learning the underlying function. We also conduct standard continual learning benchmarks and demonstrate the advantage of our proposed reservoir sampler over strong GCL baselines at various levels of data imbalance. Finally, we illustrate the efficiency of the proposed algorithms by showing their small computational overheads over the standard RS. + +# 2 MEMORABLE INFORMATION CRITERION + +Firstly we formalize the online memory selection problem and propose our information-theoretic criteria to detect informative points. Then we introduce a Bayesian model to compute the proposed criteria efficiently. Finally, we demonstrate the usefulness of the criteria in a greedy algorithm. + +# 2.1 ONLINE MEMORY SELECTION + +We consider a supervised learning problem, where the agent evolves a predictor $f$ to learn the underlying mapping from inputs to targets. We assume that the predictor is in the following form, + +$$ +f _ {\boldsymbol {\theta}} (\cdot) = g _ {\boldsymbol {\theta} _ {g}} \left(h _ {\boldsymbol {\theta} _ {h}} (\cdot)\right), \tag {1} +$$ + +where $\pmb{\theta} \coloneqq (\pmb{\theta}_g, \pmb{\theta}_h)$ . The base network $h_{\pmb{\theta}_h}(\mathbf{x})$ extracts the feature representation of the input $\mathbf{x}$ , and $g_{\pmb{\theta}_g}$ maps the representation to predictions. The function $g_{\pmb{\theta}_g}$ is usually a simple module, such as a linear layer (Krizhevsky et al., 2012) or mean-of-neighbours (Snell et al., 2017) mapping to the softmax logits. We assume the memory buffer contains the inputs, features, predictions, and targets, + +$$ +\mathcal {M} = \left\{\left(\mathbf {x} _ {m}, \mathbf {h} _ {m}, \mathbf {g} _ {m}, y _ {m}\right) \right\} _ {m = 1} ^ {M}. \tag {2} +$$ + +In the online memory selection problem, the agent iteratively receives observations from an online stream, and updates the predictor and the memory buffer. Let $\mathcal{B} = \{(\mathbf{x}_b,y_b)\}_{b = 1}^B$ be the observed batch in one iteration, a general update formula can be expressed as, + +$$ +(\boldsymbol {\theta}, \mathcal {M}) \leftarrow (\boldsymbol {\theta}, \mathcal {M}, \mathcal {B}). \tag {3} +$$ + +We emphasize that updating the predictor parameters $\theta$ and updating the memory $\mathcal{M}$ are essential but orthogonal components. For example, the agent can update the memory using RS (Buzzega et al., 2020) or GSS (Aljundi et al., 2019b), and update $\theta$ using GEM (Lopez-Paz & Ranzato, 2017) or experience replay (Chaudhry et al., 2019b). This section focuses on how to maintain a representative memory $\mathcal{M}$ online, while how to update the predictor $f_{\theta}$ is not our focus. Furthermore, unlike task-based continual learning (Kirkpatrick et al., 2017), we assume the agent receives only the data stream without observing task boundaries. This scenario is more difficult for memory selection. For instance, it must deal with data imbalances, e.g., if discrete tasks of varying lengths exist, we may want the selection to identify a more balanced memory and avoid catastrophic forgetting. + +# 2.2 MEMORABLE INFORMATION CRITERION + +Intuitively, the online memory should maintain points that carry useful information. We consider a Bayesian model for this problem since the Bayesian framework provides a principled way to quantify the informativeness of data points. Specifically, we let $p(y|\mathbf{w};\mathbf{x})$ be the likelihood of the observation $y$ given the deterministic input $\mathbf{x}$ dependent on the random model parameter $\mathbf{w}$ ,1 and we + +denote by $p(\mathbf{w})$ the prior distribution. Then the posterior of $\mathbf{w}$ and the predictive distribution of new data points can be inferred according to Bayes's rule. Also worth mentioning, the Bayesian model is introduced merely for memory selection, which is different from the predictor $f_{\theta}$ . + +In each iteration of online memory selection, the agent decides whether to include the new data point $(\mathbf{x}_{\star},y_{\star})$ into the memory $\mathcal{M}$ . To this end, we present information-theoretic criteria based on the Bayesian model to evaluate the usefulness of the new data point. For notational simplicity, we denote by $\mathbf{X}_{\mathcal{M}}$ and $\mathbf{y}_{\mathcal{M}}$ the inputs and the targets in the memory, respectively. + +Surprise. As Claude Shannon says: "Information is the resolution of uncertainty". If the memory $\mathcal{M}$ is certain of the target $y_{\star}$ of $\mathbf{x}_{\star}$ beforehand, incorporating the data point $(\mathbf{x}_{\star}, y_{\star})$ brings little information into $\mathcal{M}$ . Thus we propose to measure the "surprise" of the new point given the memory. We define the surprise criterion of $(\mathbf{x}_{\star}, y_{\star})$ given $\mathcal{M}$ as the negative log conditional probability, + +$$ +s _ {\text {s u r p}} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = - \log p \left(y _ {\star} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right), \tag {4} +$$ + +where $p(y_{\star}|\mathbf{y}_{\mathcal{M}};\mathbf{X}_{\mathcal{M}},\mathbf{x}_{\star}) = \int p(y_{\star}|\mathbf{w};\mathbf{x}_{\star})p(\mathbf{w}|\mathbf{y}_{\mathcal{M}};\mathbf{X}_{\mathcal{M}})\mathrm{d}\mathbf{w}$ . Intuitively, if $(\mathbf{x}_{\star},y_{\star})$ comes from a new task, it will likely be less predictable according to the memory and the surprise will be large. In this way, the surprise criterion detects informative points and ensures diversity within the buffer. + +Learnability. The surprise detects unpredictable points in the data stream, but it is not capable of distinguishing "helpful" unfamiliar points and "harmful" outliers. To avoid the outliers, we propose the learnability criterion, which measures how much our Bayesian model can explain the new point once it has absorbed its information in the memory. Formally, we define the learnability as follows, + +$$ +s _ {\text {l e a r}} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \log p \left(y _ {\star} ^ {\prime} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right) | _ {y _ {\star} ^ {\prime} = y _ {\star}}, \tag {5} +$$ + +where we use $y_{\star}^{\prime}$ and $y_{\star}$ to represent two realizations of the same random variable. Intuitively, the learnability measures the consensus between the new point and the memory. We illustrate the utility of learnability through a toy example in Figure 1. We use a Gaussian process with the RBF kernel to fit memory points (shown as black dots). We visualize its pre + +![](images/58f76d133842db7a3db1a8e14c14c562f91887298f8057dc8f068ae10c7df63a.jpg) +Figure 1: Visualization of the toy problem. + +dictive mean and $95\%$ confidence interval as the green line and the shadow region. For two new points (shown as red stars $\star$ ) separately in the left and right figure, we also visualize the predictive distribution given the memory and the new point, shown as the blue line and the shadow region. We observe that both points are surprising to the memory since they lie outside (or just outside) of the green confidence regions. However, after conditioning on the new point itself, the left point still lies outside of the confidence region while the prediction on the right adjusts to include the new point. Thus the left point has low learnability, and the right point has high learnability, though both have high surprises. Thus the learnability can be used to detect outliers when combined with the surprise. + +Memorable Information Criterion (MIC). Given $\eta \geq 0$ , we propose the Memorable Information Criterion (MIC) as a combination of the surprise and learnability of the new point, + +$$ +\operatorname {M I C} _ {\eta} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \eta s _ {\text {l e a r n}} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) + s _ {\text {s u r p}} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right). \tag {6} +$$ + +Notably, the MIC is related to the information gain (IG) (Cover, 1999): $\mathrm{IG}((\mathbf{x}_{\star},y_{\star});\mathcal{M}) = \mathrm{KL}(p(\mathbf{w}|y_{\star},\mathbf{y}_{\mathcal{M}};\mathbf{X}_{\mathcal{M}},\mathbf{x}_{\star})||p(\mathbf{w}|\mathbf{y}_{\mathcal{M}};\mathbf{X}_{\mathcal{M}}))$ . By Appendix E, IG can be rewritten as, + +$$ +\operatorname {I G} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \mathbb {E} _ {p \left(\mathbf {w} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {x} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right)} \left[ \log p \left(y _ {\star} \mid \mathbf {w}; \mathbf {x} _ {\star}\right) \right] - \log p \left(y _ {\star} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}\right), \tag {7} +$$ + +where the second term is the surprise, and the first term is upper bounded by the learnability based on Jensen's inequality. Thus we have that $\mathrm{MIC}_1((\mathbf{x}_{\star},y_{\star});\mathcal{M})\geq \mathrm{IG}((\mathbf{x}_{\star},y_{\star});\mathcal{M})\geq 0$ . Given the connection, we generalize IG to be a weighted combination of learnability and surprise as well in the Appendix. We also compare with an entropy reduction criterion. More discussions are in Sec C. + +# 2.3 AN EFFICIENT BAYESIAN MODEL + +Computing the MIC requires inferring Bayesian posteriors, which can be computationally unfeasible for complicated Bayesian models. Now we combine deep networks and Bayesian linear models to make computing the MIC efficient. Deep networks are well-known for learning meaningful + +representations based on which the predictions are made by simple modules such as linear layers (Krizhevsky et al., 2012; Dubois et al., 2021). Thus we treat our base network $h_{\theta_h}$ as a feature extractor and establish the Bayesian model from the feature space to the target space. Precisely, let $d_0$ be the feature dimension and $\mathbf{h}_0 = h_{\theta_h}(\mathbf{x}) \in \mathbb{R}^{d_0}$ be the feature of the input $\mathbf{x}$ , we compute the normalized feature $\mathbf{h} := [\mathbf{h}_0^\top, 1]^\top / \sqrt{d}$ for $d := d_0 + 1$ . Then we consider a Bayesian linear model, + +$$ +y = \mathbf {w} ^ {\top} \mathbf {h} + \epsilon , \epsilon \sim \mathcal {N} (0, \sigma^ {2}). \tag {8} +$$ + +We consider an isotropic Gaussian prior $\mathbf{w} \sim \mathcal{N}(0, \sigma_w^2\mathbf{I})$ . Denoting the features and the targets in the buffer as $\mathbf{H}_{\mathcal{M}} \in \mathbb{R}^{M \times d}$ and $\mathbf{y}_{\mathcal{M}} \in \mathbb{R}^{M}$ respectively, the weight posterior can be computed as, + +$$ +p \left(\mathbf {w} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {H} _ {\mathcal {M}}\right) = \mathcal {N} \left(\mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {b} _ {\mathcal {M}}, \sigma^ {2} \mathbf {A} _ {\mathcal {M}} ^ {- 1}\right), \tag {9} +$$ + +where we define $\mathbf{A}_{\mathcal{M}}^{-1} = \left(\mathbf{H}_{\mathcal{M}}^{\top}\mathbf{H}_{\mathcal{M}} + c\mathbf{I}_d\right)^{-1}$ for $c = \frac{\sigma^2}{\sigma_w^2}$ and $\mathbf{b}_{\mathcal{M}} = \mathbf{H}_{\mathcal{M}}^{\top}\mathbf{y}_{\mathcal{M}}$ . Given a new point $(\mathbf{x}_{\star}, y_{\star})$ , let $\mathbf{h}_{\star}$ be the corresponding feature, then the MIC can be computed explicitly as, + +$$ +\begin{array}{l} \operatorname {M I C} _ {\eta} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \eta \log \mathcal {N} \left(y _ {\star} \mid \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {b} _ {\mathcal {M} ^ {+}}, \sigma^ {2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {h} _ {\star} + \sigma^ {2}\right) \\ - \log \mathcal {N} \left(y _ {\star} \mid \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {b} _ {\mathcal {M}}, \sigma^ {2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {h} _ {\star} + \sigma^ {2}\right), \\ \end{array} +$$ + +where $\mathbf{A}_{\mathcal{M}^+} = \mathbf{A}_{\mathcal{M}} + \mathbf{h}_{\star}\mathbf{h}_{\star}^\top$ and $\mathbf{b}_{\mathcal{M}^+} = \mathbf{b}_{\mathcal{M}} + \mathbf{h}_{\star}y_{\star}$ . A derivation is provided in Appendix E. + +Efficient computation. Computing the MIC still involves the matrix inversions $\mathbf{A}_{\mathcal{M}^+}^{-1}$ and $\mathbf{A}_{\mathcal{M}}^{-1}$ . Fortunately, since $\mathbf{A}_{\mathcal{M}^+}$ differ with $\mathbf{A}_{\mathcal{M}}$ by a rank-one matrix, its inverse can be computed efficiently given $\mathbf{A}_{\mathcal{M}}^{-1}$ according to the Sherman-Morrison Formula (Sherman & Morrison, 1950), + +$$ +\mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} = \mathbf {A} _ {\mathcal {M}} ^ {- 1} - \frac {\mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {h} _ {\star} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1}}{1 + \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {h} _ {\star}}. \tag {11} +$$ + +Moreover, $\mathbf{A}_{\mathcal{M}^+}^{-1}$ needs not to be computed explicitly either since the MIC expression involves only the matrix vector product $\mathbf{A}_{\mathcal{M}^+}^{-1}\mathbf{h}_\star$ . As a result, given $\mathbf{A}_{\mathcal{M}}^{-1}$ and $\mathbf{b}_{\mathcal{M}}$ , the computational cost of the MIC is merely $\mathcal{O}(d^2)$ . One can store $\mathbf{A}_{\mathcal{M}}^{-1}$ and $\mathbf{b}_{\mathcal{M}}$ along with the memory, so that the MIC can be computed efficiently. Finally, since the buffer adds or removes at most one point in each iteration, $\mathbf{A}_{\mathcal{M}}^{-1}$ and $\mathbf{b}_{\mathcal{M}}$ can be updated efficiently in $\mathcal{O}(d^2)$ as well using the Sherman-Morrison formula. + +Feature update. Since the predictor evolves along with memory selection, the feature of each input also changes. The feature $h_{\theta}(\mathbf{x}_{\star})$ is usually available since the agent needs to forward $\mathbf{x}_{\star}$ for learning the predictor. However, the stored features $\mathbf{H}_{\mathcal{M}}$ in the buffer are usually outdated due to representation shifting in the online process. Forwarding the whole memory through the network in each iteration is also computationally infeasible. Alternatively, we notice that the memory is usually used to aid learning in the online process, such as memory replay in continual learning (Rebuffi et al., 2017) or experience replay in deep Q learning (Mnih et al., 2015). Therefore, we update the memory features whenever the agent forwards the memories through the network, which is free of computational overheads. Finally, we note that the matrix $\mathbf{A}_{\mathcal{M}}^{-1}$ needs to be recomputed when the memory features are updated, which takes $\mathcal{O}(d^3)$ computations using a Cholesky decomposition. + +Classification. For classification problems, the exact Bayesian posterior is no longer tractable, preventing explicit expressions of the MIC. To alleviate this problem, we propose to approximate the classification problem as a multi-output regression problem. Specifically, let $1 \leq y \leq K$ be the label among $K$ classes, we use the Bayesian model to regress the one-hot vector $\hat{y} \in \mathbb{R}^K$ , where $\hat{y}_i = \delta_{iy}$ , $i = 1, \dots, K$ . Further, we let our Gaussian prior to be independent across output dimensions. Then, the MIC can be computed as the summation of MICs across each output dimension. + +# 2.4 DEMONSTRATING THE CRITERIA BY A GREEDY ALGORITHM + +Using a greedy algorithm for online memory selection, we show that the proposed information-theoretic criteria encourage informative points. Intuitively, in each iteration, the algorithm adds the most informative new point and removes the least informative existing point in the buffer. + +Information criterion for memories. Consider the new data $(\mathbf{x}_{\star},y_{\star})$ , the buffer $\mathcal{M}$ , and a data point $(\mathbf{x}_m,y_m)\in \mathcal{M}$ . Let $\mathcal{M}_{*, - m} := \mathcal{M}\cup (\mathbf{x}_{\star},y_{\star})\backslash (\mathbf{x}_m,y_m)$ . We measure the informativeness + +![](images/bead714636c601eda2f73cbe0071d86ce9f6667dc0e91670bdb2647089805e23.jpg) +Figure 2: left: Relearning performance of the memory. We compare InfoGS with RS and InfoGS without using learnability, for various budgets. middle, right: TSNE visualizations of the training data (colored dots, where the color represents the label of the data point) and 200 memory points (black digits, where the digit represents the label of the point) for InfoGS without and with learnability, respectively. We observe that InfoGS without learnability selects many memories that differ from the training majority, i.e., it selects outliers. In comparison, incorporating learnability avoids the outliers and selects memories that spread the training region and help to learn the decision boundary. Further, InfoGS performances also improve over RS when the budget is very low. + +of $(\mathbf{x}_m,y_m)$ according to its MIC for the pseudo buffer $\mathcal{M}_{\star, -m}$ , i.e., $\mathrm{MIC}_{\eta}((\mathbf{x}_m,y_m); \mathcal{M}_{\star, -m})$ . Notably, the criterion for memories is comparable to the criterion for the new point, since $\mathrm{MIC}_{\eta}((\mathbf{x}_{\star},y_{\star});\mathcal{M}) = \mathrm{MIC}_{\eta}((\mathbf{x}_{\star},y_{\star});\mathcal{M}_{\star, -\star})$ can be expressed similarly. + +Let $(\mathbf{x}_{b^{\star}},y_{b^{\star}})\in \mathcal{M}$ be the memory point with the smallest MIC. We decide whether to replace it with the new point $(\mathbf{x}_{\star},y_{\star})$ . Specifically, we present information improvement thresholding to determine whether the new point improves the information by at least a certain amount. We present learnability thresholding to only add points with high learnability. The overall algorithm, Information-theoretic Greedy Selection (InfoGS), replaces $(\mathbf{x}_{b^{\star}},y_{b^{\star}})$ with $(\mathbf{x}_{\star},y_{\star})$ , if the new point passes both thresholding. A detailed description and the pseudocode are shown in Alg 2 in the Appendix. + +A toy experiment. Using InfoGS, we illustrate the proposed criteria by a toy experiment. We generate the toy dataset by training a ResNet-18 (He et al., 2016) for CIFAR-10 classification and storing the network features and the targets of the whole dataset. We use pre-trained features for InfoGS, to focus on the online memory selection without the interference of feature learning. The agent observes the dataset stream for one epoch with the batch size 32, sequentially by the order of classes: $\{0,1\}, \{2,3\}, \{4,5\}, \{6,7\}, \{8,9\}$ . We evaluate the final memory by the "relearn" performance, where we fit a linear classifier on merely the memory points and report the test accuracy. In this way, the relearning performance directly represents the quality of the memory. We compare InfoGS with RS. To investigate the impact of learnability, we also include a modified InfoGS by removing the learnability. We run all methods across various memory budgets. We also plot the memories using the TSNE visualization (Hinton & Roweis, 2002). The results are shown in Figure 2. + +# 3 INFORMATION-THEORETIC RESERVOIR SAMPLING + +In this section we incorporate the MIC into continual learning. For training the prediction network, we pick the dark experience replay (DER++) (Buzzega et al., 2020), which is fully compatible to GCL and achieves state-of-art performances on continual learning benchmarks. DER++ prevents the network from forgetting by regularizing both the targets and the logits. Specifically, for each new batch $\mathcal{B}$ , $\mathrm{DER}++$ optimizes the network parameter $\theta$ by minimizing the following objective, + +$$ +\mathcal {L} (\boldsymbol {\theta}; \mathcal {M}) = \frac {1}{| \mathcal {B} |} l (\mathcal {B}; \boldsymbol {\theta}) + \frac {\alpha}{M} \sum_ {m = 1} ^ {M} \| f _ {\boldsymbol {\theta}} (\mathbf {x} _ {m}) - \mathbf {g} _ {m} \| _ {2} ^ {2} + \frac {\beta}{M} \sum_ {m = 1} ^ {M} l ((\mathbf {x} _ {m}, y _ {m}); \boldsymbol {\theta}), +$$ + +where the objective is composed of (1) the fitting loss of the current batch, such as the cross entropy; (2) the mean squared loss between the predictive logits $f_{\theta}(\mathbf{x}_m)$ of the memory input $\mathbf{x}_m$ and its memory logits $\mathbf{g}_m$ ; (3) the fitting loss of the memory. $\alpha$ and $\beta$ are hyper-parameters. + +While straightforward, naively employing InfoGS to curate the buffer suffers the timing issue we identify for continual learning. We present a new algorithm, the information-theoretic reservoir sampling, which integrates the MIC into RS and achieves improved robustness against data imbalance. + +Algorithm 1 Information-theoretic Reservoir Sampling (InfoRS) +1: Input: Memory $\mathcal{M}$ and matrices $\mathbf{A}_{\mathcal{M}}^{-1}, \mathbf{b}_{\mathcal{M}}$ , the batch $\mathcal{B}$ , the predictor parameter $\theta$ . +2: Input: The reservoir count $n$ and the budget $M$ . +3: Input: Running mean and stddev for the MIC: $\hat{\mu}_i, \hat{\sigma}_i$ . The thresholding ratio $\gamma_i$ . +4: Update the predictor parameter $\theta$ based on $\mathcal{M}$ and $\mathcal{B}$ . +5: Update the features for the memory points used in replay, and update $\mathbf{A}_{\mathcal{M}}^{-1}, \mathbf{b}_{\mathcal{M}}$ accordingly. +6: for $(\mathbf{x}_{\star}, y_{\star})$ in $\mathcal{B}$ do +7: if $|\mathcal{M}| < M$ or $\mathrm{MIC}_{\eta}((\mathbf{x}_{\star}, y_{\star}); \mathcal{M}) \geq \hat{\mu}_i + \hat{\sigma}_i * \gamma_i$ // Information Thresholding +8: Update $\mathcal{M}, n \leftarrow$ ReservoirSampling( $\mathcal{M}, M, n, (\mathbf{x}_{\star}, y_{\star})$ ). // Memory Update +9: Update $\mathbf{A}_{\mathcal{M}}^{-1}, \mathbf{b}_{\mathcal{M}}$ based on the Sherman-Morrison formula if $\mathcal{M}$ is updated. +10: Update $\hat{\mu}_i, \hat{\sigma}_i$ using the criterion $\mathrm{MIC}_{\eta}((\mathbf{x}_{\star}, y_{\star}); \mathcal{M})$ . // Running Moments Update +11: return Buffer $\mathcal{M}$ and $\mathbf{A}_{\mathcal{M}}^{-1}, \mathbf{b}_{\mathcal{M}}$ . The reservoir count $n$ and statistics $\hat{\mu}_i, \hat{\sigma}_i$ . The updated $\theta$ . + +# 3.1 THE IMPORTANCE OF THE TIMING TO UPDATE THE MEMORY + +While maintaining a representative memory is critical to properly regularize an online CL process, we will now discuss and empirically show that when the memory is updated (i.e., the update timing) is also influential. We begin by giving an intuition of this issue with a mind experiment, where the agent sequentially observes the data from two tasks $\mathcal{T}_1$ and $\mathcal{T}_2$ . At the time $t$ of task switching, the agent has a memory with $M$ examples from $\mathcal{T}_1$ . Assume that the agent will update the memory by removing $\frac{M}{2}$ examples from $\mathcal{T}_1$ and adding $\frac{M}{2}$ examples from $\mathcal{T}_2$ at the time $t + \Delta t$ . Since the $\mathcal{T}_2$ examples are repeatedly visited after time $t$ , it is favorable to use a large $\Delta t$ . In contrast, updating the memory at the beginning of $\mathcal{T}_2$ with $\Delta t = 0$ , leads to degrading $\mathcal{T}_1$ regularizations too early. + +We further demonstrate this by a Split CI-FAR10 experiment with 5 tasks. After $\Delta t$ iterations of each task $\mathcal{T}_i$ for $i = 1,\dots,5$ , we randomly replace $\frac{200}{i}$ memories with the examples from $\mathcal{T}_i$ . In Figure 3, we report the final accuracies with varying $\Delta t$ to change the timing of memory updates, for both $\alpha = 0,\beta = 1$ and $\alpha = 0.3,\beta = 1$ in dark experience replay. We observe that updating the memory early in each task leads to worse performances. The phenomenon is more distinct for $\alpha = 0.3$ , where storing premature logits $\mathbf{g}_m$ early in each task actually hurts the network learning. + +![](images/05f3a51780aee055e0972ce980f5e8c032029f75a25829d049f5753760792df5.jpg) +Figure 3: The effect of update timing $\Delta t$ . + +Reservoir sampling acts randomly to maintain a uniform sample from the past stream, thus it tends not to update the buffer immediately at a new task. However, InfoGS accumulates surprising examples greedily, thus its memory updates tend to happen early in each task. Therefore, the greediness of InfoGS is a disadvantage to RS in terms of the timing to update the memory. Moreover, the importance of timing persists not only in the task-based continual learning, but also in the general continual learning regime where the data distribution shifts continuously. + +# 3.2 INFORMATION-THEORETIC RESERVOIR SAMPLING + +To alleviate the timing problem of InfoGS, we present the information-theoretic reservoir sampling (InfoRS) algorithm, which attempts to bring together the merits of both the information-theoretic criteria and the reservoir sampling. The MIC facilitates a representative memory, but the greedy selection should be circumvented for the sake of timing. To this end, we propose InfoRS, which conducts reservoir sampling over those points with high MICs. Similarly to InfoGS, we let $\hat{\mu}_i,\hat{\sigma}_i$ be the running mean and standard deviation of the MICs for all historical observations, and let $\gamma_{i}$ be a hyper-parameter. InfoRS selects the point $(\mathbf{x}_{\star},y_{\star})$ for reservoir sampling if its MIC passes the information threshold: $\mathrm{MIC}_{\eta}((\mathbf{x}_{\star},y_{\star});\mathcal{M})\geq \hat{\mu}_i + \hat{\sigma}_i*\gamma_i$ . The overall algorithm of InfoRS is shown in Alg 1 and we also provide the algorithm of ReservoirSampling in Alg 3 in the Appendix. + +Worth mentioning, a point $(\mathbf{x}_{\star},y_{\star})$ passing the information threshold results in itself being considered in the reservoir sampling procedure. However, due to the stochasticity in RS, the point might not be added to the memory. Consequently, InfoRS overcomes the timing issue for the greedy InfoGS. In addition, standard RS draws uniform samples over the stream, making it vulnerable to imbalanced data. For example, the memory can be dominated by a specific task if it has lots of observations, while examples from other tasks might be missed and their regularizations be degraded. In comparison, for InfoRS, if a specific task occupies more space in the memory, similar points in the task will have a smaller information criterion and thus a lower chance to pass the information threshold. Thus the memory selected by InfoRS will not be dominated by specific tasks and tend to be more balanced. In this way, InfoRS could be more robust to data imbalance compared to RS. + +# 4 RELATED WORKS + +Experience replay for continual learning. Experience replay is widely adopted in continual learning to prevent catastrophic forgetting (Robins, 1995; Lopez-Paz & Ranzato, 2017; Rebuffi et al., 2017; Rolnick et al., 2019). However, the majority of approaches focus on task-based continual learning and update the memory relying on task boundaries (Rebuffi et al., 2017; Nguyen et al., 2018; Titsias et al., 2020; Pan et al., 2020; Bang et al., 2021; Yoon et al., 2021). In contrast, reservoir sampling (Vitter, 1985) is used (Rolnick et al., 2019; Chaudhry et al., 2019b; Buzzega et al., 2020; Isele & Cosgun, 2018; Balaji et al., 2020) to update the memory online and maintain uniform samples from the stream. RS is generalized to class-balanced RS (CBRS) that selects uniform samples over each class (Chrysakis & Moens, 2020; Wiewel & Yang, 2021; Kim et al., 2020), but CBRS cannot resolve other forms of data imbalance. To counter the vulnerabilities to data imbalance, GSS (Aljundi et al., 2019b) proposes to minimize gradient similarities to ensure the memory diversity, but incurs large computational costs for gradient computations. For continual reinforcement learning, Isele & Cosgun (2018) propose selection strategies based on prediction errors or rewards, but these do not promote diversities within the memory. They further attempt to maximize the coverage of the input space for the memory, while selecting an appropriate distance metric between high-dimensional inputs is crucial. Borsos et al. (2020) present the weighted coreset selection and extend it to GCL. However, the method incurs large computational costs and is limited to a small memory. + +More applications with online data selection. Apart from preventing catastrophic forgetting, online selecting data is also useful for improving the computational and memory efficiencies of learning systems. Deep Q-learning (Mnih et al., 2015) adopts past experiences to train the Q-networks, and selective experiences can improve the learning efficiency of agents (Schulman et al., 2015). Moreover, online selection forms the key component in curriculum learning (Bengio et al., 2009) to pick the next curriculum for efficient learning. Specifically, prediction gain (PG) (Bellemare et al., 2016; Graves et al., 2017) picks the curriculum according to $\mathcal{L}((\mathbf{x}_{\star},y_{\star});\pmb {\theta}) - \mathcal{L}((\mathbf{x}_{\star},y_{\star});\pmb{\theta}^{\prime})$ , where $\pmb{\theta}^{\prime}$ is the parameter after the network updates $\pmb{\theta}$ for one step using $(\mathbf{x}_{\star},y_{\star})$ . Thus PG can be seen as the combination of surprises and learnability as well. However, PG does not use a memory buffer and the $\theta^\prime$ is obtained by one-step gradient updates unlike our exact inference. Bayesian optimization (Mockus et al., 1978) and active learning (MacKay, 1992) learn the problem with querying the training data interactively to maximize some unknown objective or data efficiency. However, the labels of the queried data are not available before the query, which is different to our setting where both the input and target are available. Online submodular maximization (Buchbinder et al., 2014; Lavania et al., 2021) selects a memory buffer online to maximize a submodular criterion. They propose greedy algorithms based on an improvement thresholding procedure, which is similar to our InfoGS. However, as discussed in Sec. 3, greedy algorithms can suffer from the issue of timing in continual learning. Also, while we provide MIC as a general criterion to evaluate forthcoming points, submodular maximization relies on meaningful submodular criterions. + +Offline data selection. Offline selections assume the whole dataset is available and a representative small set is targeted, which helps to lift the memory burden of dataset storage and improve learning efficiency. Coreset selection (Campbell & Broderick, 2019) aims to find a weighted set whose maximum likelihood estimator approximates that of the whole dataset. Dataset distillation (Zhao et al., 2020; Nguyen et al., 2021) aims at a small set training on which achieves similar performances to training on the original dataset. Sparse Gaussian processes also consider the selection of inducing points (Seeger et al., 2003; Csato & Opper, 2002; Bui et al., 2017). For instance, Seeger et al. (2003) adopt the information gain to select inducing points for a scalable Gaussian process method. + +![](images/fb53d76bf8d64d04ecb03937fe636f667d009147eeff7370ed4f7f0f2a2890f0.jpg) +Figure 4: Test performances against data imbalance over continual learning benchmarks. left three: We compare RS, weighted RS (WRS) using the output-space Hessian, InfoGS and InfoRS. For each experiment, we plot the mean and the $95\%$ confidence interval across 10 random seeds. right: We compare InfoRS and RS for different memory budgets over Split CIFAR10. For all figures, we observe that InfoRS is more robust to data imbalance compared to RS. + +![](images/a3882e6dcb145762d7a2c4ebab2f5460241c20549307e66b4ee4937ec8fc4933.jpg) + +![](images/12308507542a9fef4608e01fea2668ba646cf62a7f5202439bfc051a9fc98551.jpg) + +![](images/fe4bd589dde81fa4ed548ed2d5ae509e4c5b08a79e6bdec2b41c3d7aa279fc09.jpg) + +# 5 EXPERIMENTS + +We investigate how InfoRS performs empirically. We assume the general continual learning regime, where the agent is agnostic of task boundaries. We use DER++ (Buzzega et al., 2020) for learning the predictor along with the online memory selection instead of using pretrained features. To introduce experimental details, we first describe useful notations following Buzzega et al. (2020). We denote the batch size as $bs$ , and the memory batch size as $mbs$ . Specifically, we randomly sample $mbs$ points from the memory buffer in each iteration. We denote the memory budget as $M$ . For all experiments, we adopt the stochastic gradient descent optimizer and we denote the learning rate as $lr$ . + +**Benchmarks.** The benchmarks involve Permuted MNIST, Split MNIST, Split CIFAR10, and Split MiniImageNet. Permuted MNIST involves 20 tasks, and transforms the images by task-dependent permutations. The agent attempts to classify the digits without task identities. The other benchmarks split the dataset into disjoint tasks based on labels. For Split MNIST and Split CIFAR10, 10 classes are split into 5 tasks evenly; for Split MiniImageNet, 100 classes are split into 10 tasks evenly. We use a fixed split across all random seeds. The agent attempts to classify the images without task identities either. For the sake of space, we present the results for Permuted MNIST in the Appendix. + +Methods. The online fashion in GCL causes that only a few existing methods are compatible. In addition to RS, weighted reservoir sampling (WRS) (Chao, 1982; Efraimidis & Spirakis, 2006) generalizes RS to non-uniform sampling in proportional to data-dependent weights. Consequently, one can adopt WRS to favor specific points according to the chosen importance weight. We include a WRS baseline with the total output-space Hessian (Pan et al., 2020) as importance weights. Specifically, if $p_{1:K}$ are the predictive probabilities for $K$ classes of a point, its total output-space Hessian is computed as $1 - \sum_{k=1}^{K} p_i^2$ . Intuitively, the total Hessian of a point is small if it has a confident prediction. We compare InfoRS, InfoGS, RS and WRS over the experiments. Additionally, class-balanced reservoir sampling (CBRS) (Chrysakis & Moens, 2020) maintains uniform samples separately for each class, and GSS (Aljundi et al., 2019b) minimizes the gradient similarities in the memory. We present the comparisons with CBRS and GSS in Figure 8 in the Appendix for clarity. + +Experimental details. For Permuted MNIST and Split MNIST, we adopt a fully connected network with two hidden layers of 100 units each, and we set $M = 100$ , $bs = 128$ , $mbs = 128$ . For Split CIFAR10 and Split MiniImageNet, we adopt a standard ResNet-18 (He et al., 2016) and set $bs = 32$ , $mbs = 32$ .4 We set $M = 200$ and $M = 1000$ for Split CIFAR10 and Split MiniImageNet, respectively. To tune the hyper-parameters, we pick $10\%$ of training data as the validation set, then we pick the best hyper-parameter based on the averaged validation accuracy over 5 random seeds. The final test performance is reported by relearning the model using the whole training set with the best hyperparameter, averaged over 10 seeds. The tuning hyper-parameters include the learning rate $lr$ , the logit regularization coefficient $\alpha$ , the target regularization coefficient $\beta$ , the learnability ratio $\eta$ , and the information thresholding ratio $\gamma_{i}$ , if needed. We present the detailed hyper-parameters in Table 1. + +![](images/47a1da3af4f5235340acfa7a2a386dbbc111b7b950a3382abc210163ade00b9e.jpg) +Figure 5: left: The reservoir count along with training. The line $i = 1,3,5,7,9$ , corresponds to the problem where the $i$ -th task has 10 times epochs than the other tasks. We also plot the black dashed line for the count of standard RS. We observe that the reservoir count of InfoRS grows at a similar speed as RS for most tasks. However, it grows slower at iterations corresponding to task $i$ for each line $i$ . In this way, InfoRS counters the imbalanced data stream, maintains a diverse buffer, and behaves more robustly. right: The class variance of the memory. We observe that the memory of RS becomes the most imbalanced with the data imbalance increasing. + +![](images/099da84b589da461b851d67394924d9c696d98b86033a85f64cbe7670f9ff76c.jpg) + +Robustness against data imbalance. To simulate data imbalance, we vary training epochs across different tasks. Specifically, given the base epoch $n_e > 0$ and data imbalance $r \geq 1$ , we randomly pick one task $\mathcal{T}_{\star}$ and train it for $n_e * r$ epochs, while we train the other tasks for $n_e$ epochs. Thus $\mathcal{T}_{\star}$ is observed $r$ times more frequently and the data imbalance increases when $r$ grows. Given the imbalanced training data, the agent is still expected to learn all tasks well. Therefore, we evaluate all tasks equally and report the averaged test performance. For all the benchmarks, we conduct experiments with $r = 1, 3, 10, 30$ . We set $n_e = 1$ for Permuted MNIST and Split MNIST, $n_e = 50$ for Split CIFAR10, and $n_e = 100$ for Split MiniImageNet. The results are shown in Figure 4. Moreover, Figure 4 also compares InfoRS and RS across varying budgets over Split CIFAR10. + +We observe that RS and InfoRS outperform other approaches when the data is balanced, while InfoRS demonstrates improved robustness compared to RS as data imbalance increases. Compared to InfoRS and RS, InfoGS is less affected by data imbalance since InfoGS acts greedily to gather the memories. Also, WRS with the total Hessian is more robust than RS, since frequently observed points tend to have confident predictions and thus small weights to be sampled. Overall, we observe that InfoRS improves the robustness from RS without sacrificing the performance for balanced data. + +We manifest the robustness of InfoRS by visualizing its reservoir count along with training, which is the total number of points considered in the reservoir sampling. Thus the count increases linearly for the standard RS, but is affected by the information thresholding in InfoRS. We track the reservoir count of InfoRS for Split MiniImageNet with data imbalance $r = 10$ . The results are visualized in Figure 5. Furthermore, a good memory should contain similar example amounts for all classes. Let $M_{1:K}$ be the example numbers in the memory for all $K$ classes. For each method, we compute the variance $\frac{1}{K}\sum_kM_k^2 -\left(\frac{1}{K}\sum_kM_k\right)^2$ . Figure 5 also visualizes the variances for Split MiniImageNet. + +Running time. To demonstrate the computational efficiency of the proposed approaches, we compare the running time of RS, WRS, InfoGS, InfoRS. Specifically, we plot the total running time over Split MiniImageNet with the data imbalance $r = 30$ . As shown in Figure 6, InfoGS and InfoRS incur small computational overheads compared to RS. This result demonstrates the efficiency of the proprosed algorithms. + +# 6 CONCLUSION + +![](images/3992045b7d9c0772b76a8cf1a7410f2b85c544ba23d022ead79a9074ec72d821.jpg) +Figure 6: The total running time. + +We presented information-theoretic approaches for online memory selection. Specifically, we proposed to maintain the most information in the memory by evaluating new points along two dimensions: the surprise and the learnability, which are shown to select informative points and avoid outliers. Besides the InfoGS which updates the buffer whenever seeing new examples, we presented the InfoRS that counters the timing issue of the greedy algorithm. Adding the information threshold in InfoRS avoids duplicate points in the memory, improving robustness against imbalanced data streams. Moreover, our proposed algorithms run efficiently, thanks to the proposed Bayesian model. + +# ACKNOWLEDGMENTS + +We thank Yutian Chen, Razvan Pascanu and Yee Whye Teh for their constructive feedback. + +# ETHICS STATEMENT + +This paper introduces a novel and efficient mechanism for selecting examples into an online memory. The proposed memory selection approach is applied to continual learning. An important benefit of this approach is that it allows a neural network to be trained from a stream of data, in which case it is not required to store all the data into a storage. The overall machine learning efficiency could be significantly improved in terms of both space storage and computation. However, potential risk comes with the fact that a small amount of information is selected into an online memory. Special care should be taken to ensure the user's privacy is not violated in certain situations. + +# REPRODUCIIBILITY STATEMENT + +Here we discuss our efforts to facilitate the reproducibility of the paper. Firstly, we present detailed pseudocodes for the proposed InfoRS (Alg 1) and InfoGS (Alg 2). We also present pseudocodes for the baselines used in the experiments, including reservoir sampling (Alg 3), weighted reservoir sampling (Alg 4), and class-balanced reservoir sampling (Alg 5). Moreover, we introduce the process to tune the hyper-parameters in the experimental section, and we present in Table 1 the detailed hyper-parameters we tuned for the involved approaches. In addition, we show detailed derivations and proofs in Sec E. Finally, besides the visualization figures, we present the precise means and standard errors of the experiments in Table 2. + +# REFERENCES + +Rahaf Aljundi, Klaas Kelchtermans, and Tinne Tuytelaars. Task-free continual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11254-11263, 2019a. +Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. Advances in Neural Information Processing Systems, 32:11816-11825, 2019b. +Yogesh Balaji, Mehrdad Farajtabar, Dong Yin, Alex Mott, and Ang Li. The effectiveness of memory replay in large scale continual learning, 2020. +Jihwan Bang, Heesu Kim, YoungJoon Yoo, Jung-Woo Ha, and Jonghyun Choi. Rainbow memory: Continual learning with a memory of diverse samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8218-8227, 2021. +Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. Advances in neural information processing systems, 29:1471-1479, 2016. +Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pp. 41-48, 2009. +Zalán Borsos, Mojmir Mutny, and Andreas Krause. Coresets via bilevel optimization for continual learning and streaming. Advances in Neural Information Processing Systems, 33, 2020. +Niv Buchbinder, Moran Feldman, and Roy Schwartz. Online submodular maximization with preemption. In Proceedings of the twenty-sixth annual ACM-SIAM symposium on Discrete algorithms, pp. 1202-1216. SIAM, 2014. +Thang D Bui, Cuong Nguyen, and Richard E Turner. Streaming Sparse Gaussian Process Approximations. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 3299-3307. Curran Associates, Inc., 2017. + +Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark experience for general continual learning: a strong, simple baseline. In 34th Conference on Neural Information Processing Systems (NeurIPS 2020), 2020. +Trevor Campbell and Tamara Broderick. Automated scalable bayesian inference via hilbert coresets. The Journal of Machine Learning Research, 20(1):551-588, 2019. +Min-Te Chao. A general purpose unequal probability sampling plan. Biometrika, 69(3):653-656, 1982. +Arslan Chaudhry, Marc'Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-GEM. In International Conference on Learning Representations, 2019a. URL https://openreview.net/forum?id=Hkf2_sC5FX. +Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhoseiny, Thalaiyasingam Ajanthan, Puneet K Dokania, Philip HS Torr, and Marc'Aurelio Ranzato. On tiny episodic memories in continual learning. arXiv preprint arXiv:1902.10486, 2019b. +Aristotelis Chrysakis and Marie-Francine Moens. Online continual learning from imbalanced data. In International Conference on Machine Learning, pp. 1952-1961. PMLR, 2020. +Thomas M Cover. Elements of information theory. John Wiley & Sons, 1999. +L. Csato and M. Opper. Sparse online Gaussian processes. Neural Computation, 14:641-668, 2002. +Matthias Delange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Ales Leonardis, Greg Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021. +Yann Dubois, Benjamin Bloem-Reddy, Karen Ullrich, and Chris J Maddison. Lossy compression for lossless prediction. arXiv preprint arXiv:2106.10800, 2021. +Pavlos S Efraimidis and Paul G Spirakis. Weighted random sampling with a reservoir. Information Processing Letters, 97(5):181-185, 2006. +Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013. +Alex Graves, Marc G Bellemare, Jacob Menick, Remi Munos, and Koray Kavukcuoglu. Automated curriculum learning for neural networks. In international conference on machine learning, pp. 1311-1320. PMLR, 2017. +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. +Geoffrey Hinton and Sam T Roweis. Stochastic neighbor embedding. In NIPS, volume 15, pp. 833-840. CiteSeer, 2002. +David Isele and Akansel Cosgun. Selective experience replay for lifelong learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +Chris Dongjoo Kim, Jinseo Jeong, and Gunhee Kim. Imbalanced continual learning with partitioning reservoir sampling. In European Conference on Computer Vision, pp. 411-428. Springer, 2020. +James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, pp. 201611835, 2017. +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. + +Chandrashekhar Lavania, Kai Wei, Rishabh Iyer, and Jeff Bilmes. A practical online framework for extracting running video summaries under a fixed memory budget. In Proceedings of the 2021 SIAM International Conference on Data Mining (SDM), pp. 226-234. SIAM, 2021. +David Lopez-Paz and Marc'Aurelio Ranzato. Gradient episodic memory for continual learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 6470-6479, 2017. +David JC MacKay. Information-based objective functions for active data selection. Neural computation, 4(4):590-604, 1992. +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. +Jonas Mockus, Vytautas Tiesis, and Antanas Zilinskas. The application of bayesian methods for seeking the extremum. Towards global optimization, 2(117-129):2, 1978. +Cuong V Nguyen, Yingzhen Li, Thang D Bui, and Richard E Turner. Variational continual learning. In International Conference on Learning Representations, 2018. +Timothy Nguyen, Roman Novak, Lechao Xiao, and Jaehoon Lee. Dataset distillation with infinitely wide convolutional networks. arXiv preprint arXiv:2107.13034, 2021. +Pingbo Pan, Siddharth Swaroop, Alexander Immer, Runa Eschenhagen, Richard Turner, and Mohammad Emtiyaz E Khan. Continual deep learning by functional regularisation of memorable past. In Advances in Neural Information Processing Systems, volume 33, pp. 4453-4464. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/2f3bbb9730639e9ea48f309d9a79ff01-Paper.pdf. +Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 2001-2010, 2017. +Anthony Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. _Connection Science_, 7(2): 123-146, 1995. +David Rolnick, Arun Ahuja, Jonathan Schwarz, Timothy P Lillicrap, and Greg Wayne. Experience replay for continual learning. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pp. 350-360, 2019. +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, 2015. +M. Seeger, C. K. I. Williams, and N. D. Lawrence. Fast forward selection to speed up sparse Gaussian process regression. In Ninth International Workshop on Artificial Intelligence. MIT Press, 2003. +Jack Sherman and Winifred J Morrison. Adjustment of an inverse matrix corresponding to a change in one element of a given matrix. The Annals of Mathematical Statistics, 21(1):124-127, 1950. +Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 4080-4090, 2017. +Michalis K. Titsias, Jonathan Schwarz, Alexander G. de G. Matthews, Razvan Pascanu, and Yee Whye Teh. Functional regularisation for continual learning with gaussian processes. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=HkxCzeHFDB. +Jeffrey S Vitter. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1):37-57, 1985. + +Felix Wiewel and Bin Yang. Entropy-based sample selection for online continual learning. In 2020 28th European Signal Processing Conference (EUSIPCO), pp. 1477-1481. IEEE, 2021. +Jaehong Yoon, Divyam Madaan, Eunho Yang, and Sung Ju Hwang. Online coreset selection for rehearsal-based continual learning. arXiv preprint arXiv:2106.01085, 2021. +Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. In International Conference on Learning Representations, 2020. + +# A ALGORITHMS AND PSEUDOCODES + +In this section we present more algorithms details and pseudocodes for the proposed InfoGS and the reservoir sampling. + +# A.1 INFOGS + +Information improvement thresholding. Let $(\mathbf{x}_{b^{\star}},y_{b^{\star}})\in \mathcal{M}$ be the memory point with the smallest MIC. We decide whether to replace it with the new point $(\mathbf{x}_{\star},y_{\star})$ by the information improvement thresholding. Specifically, let $\hat{\mu}_i,\hat{\sigma}_i$ be the running mean and standard deviation of the MIC for all historical observations, and let $\gamma_{i}$ be a hyper-parameter. The information improvement thresholding determines whether the new point improves the information by at least a certain amount, + +$$ +\text {i f :} \quad \operatorname {M I C} _ {\eta} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) \geq \operatorname {M I C} _ {\eta} \left(\left(\mathbf {x} _ {b ^ {*}}, y _ {b ^ {*}}\right); \mathcal {M} _ {* - b ^ {*}}\right) + \hat {\mu} _ {i} + \gamma_ {i} * \hat {\sigma} _ {i}. \tag {12} +$$ + +Learnability thresholding. Outliers usually come with a large surprise. To further exclude outliers, we propose the learnability thresholding. Specifically, let $\hat{\mu}_l, \hat{\sigma}_l$ be the running mean and standard deviation of the learnability for all historical observations, and let $\gamma_l$ be a hyper-parameter. Then the learnability thresholding determines whether $s_{\mathrm{learn}}((\mathbf{x}_{\star}, y_{\star}); \mathcal{M}) \geq \hat{\mu}_l + \gamma_l * \hat{\sigma}_l$ . In this way, we deliberately take a certain percentage of data with low learnability out of consideration. + +The overall algorithm, the Information-theoretic Greedy Selection (InfoGS), replaces the memory point $(\mathbf{x}_{b^{\star}},y_{b^{\star}})$ with $(\mathbf{x}_{\star},y_{\star})$ , if the new point passes both the information improvement thresholding and learnability thresholding. A pseudocode is shown in Alg 2. + +Algorithm 2 Information-theoretic Greedy Selection (InfoGS) +1: Input: Memory $\mathcal{M}$ , the batch $\mathcal{B}^t$ , the budget $M$ , the predictor $f_{\theta}$ . +2: Input: Running mean and stddev for the information criterion: $\hat{\mu}_i, \hat{\sigma}_i$ . The thresholding ratio $\gamma_i$ . +3: Input: Running mean and stddev for the learnability: $\hat{\mu}_l, \hat{\sigma}_l$ . The thresholding ratio $\gamma_l$ . +4: Update $f_{\theta}$ based on $\mathcal{M}$ and $(\mathbf{x}_{\star}, y_{\star})$ , with a network learning algorithm. +5: Compute $\mathbf{A}_{\mathcal{M}}^{-1}$ and $\mathbf{b}_{\mathcal{M}}$ using the features and targets in the memory. +6: for $-1, \dots, |\mathcal{B}^t|$ do +7: if $|\mathcal{M}| < M$ +8: Update the buffer: $\mathcal{M} \longleftarrow \mathcal{M} \cup (\mathbf{x}_{b^{\star}}, y_{b^{\star}})$ . +9: Update $\mathbf{A}_{\mathcal{M}}^{-1}$ and $\mathbf{b}_{\mathcal{M}}$ based on the Sherman-Morrison formula. +10: continue +11: Get the batch index with the largest information criterion among those with large learnability: +\[ b^{\star} = \operatorname*{argmax}_{b: s_{learn}((\mathbf{x}_b, y_b); \mathcal{M}) \geq \hat{\mu}_l + \hat{\sigma}_l * \gamma_l} \mathrm{MIC}_\eta((\mathbf{x}_b, y_b); \mathcal{M}). \tag{13} + +12: Get the memory index with the smallest information criterion: + +$$ +m ^ {\star} = \underset {m} {\arg \min } \operatorname {M I C} _ {\eta} ((\mathbf {x} _ {m}, y _ {m}); \mathcal {M} \cup (\mathbf {x} _ {b ^ {\star}}, y _ {b ^ {\star}}) \backslash (\mathbf {x} _ {m}, y _ {m})). +$$ + +13: if $\mathrm{MIC}_{\eta}((\mathbf{x}_b,y_b);\mathcal{M})\geq \mathrm{MIC}_{\eta}((\mathbf{x}_{m^{\star}},y_{m^{\star}});\mathcal{M}\cup (\mathbf{x}_{b^{\star}},y_{b^{\star}})\backslash (\mathbf{x}_m,y_m)) + (\hat{\mu}_i + \hat{\sigma}_i*\gamma_i)$ +14: Update the buffer: $\mathcal{M}\longleftarrow \mathcal{M}\cup (\mathbf{x}_{b^{\star}},y_{b^{\star}})\backslash (\mathbf{x}_m,y_m)$ +15: Update $\mathbf{A}_{\mathcal{M}}^{-1}$ and $\mathbf{b}_{\mathcal{M}}$ using $x_{b^{\star}}$ and $x_{m^{\star}}$ based on the Shermann-Morrison formula. +16: else +17: Update $\hat{\mu}_i, \hat{\sigma}_i, \hat{\mu}_l, \hat{\sigma}_l$ using $\mathcal{B}^t$ . +18: return Buffer $\mathcal{M}$ and predictor $f_{\theta}$ , the statistics $\hat{\mu}_i, \hat{\sigma}_i, \hat{\mu}_l, \hat{\sigma}_l$ . +19: Update $\hat{\mu}_i, \hat{\sigma}_i, \hat{\mu}_l, \hat{\sigma}_l$ using $\mathcal{B}^t$ . +20: return Buffer $\mathcal{M}$ and predictor $f_{\theta}$ , the statistics $\hat{\mu}_i, \hat{\sigma}_i, \hat{\mu}_l, \hat{\sigma}_l$ . + +# A.2 RESERVOIR SAMPLING + +We present the pseudocodes for reservoir sampling (Vitter, 1985), the weighted reservoir sampling (Chao, 1982; Efraimidis & Spirakis, 2006), and the class-balanced reservoir sampling (Chrysakis & Moens, 2020). Worth mentioning, the weighted reservoir sampling becomes equivalent to reservoir sampling if the score function is a constant function. The class-balanced reservoir sampling becomes equivalent to reservoir sampling if only one class is observed. + +Algorithm 3 Reservoir Sampling (Vitter, 1985) +1: Input: Buffer $\mathcal{M}$ , the budget $M$ , the count $n$ , the new data point $(\mathbf{x}_{\star},y_{\star})$ . +2: if $|\mathcal{M}| < M$ +3: $\mathcal{M} \leftarrow \mathcal{M} \cup (\mathbf{x}_{\star},y_{\star})$ . +4: else +5: Generate a random integer $i$ within $1, \ldots, n + 1$ . +6: if $i \leq M$ +7: $\mathcal{M} \leftarrow \mathcal{M} \cup (\mathbf{x}_{\star},y_{\star}) \backslash \mathcal{M}_i$ . +8: return $\mathcal{M}, n + 1$ . + +Algorithm 4 Weighted Reservoir Sampling (Chao, 1982; Efraimidis & Spirakis, 2006) +1: Input: Buffer $\mathcal{M}$ budget $M$ , the new data point $(\mathbf{x}_{\star},y_{\star})$ +2: Input: The score function $w$ and the accumulative score $\bar{w}$ +3: Compute the score $w_{\star} = w(\mathbf{x}_{\star},y_{\star})$ +4: Update the accumulative score $\bar{w} = \bar{w} +w_{\star}$ +5: if $|\mathcal{M}| < M$ +6: $\mathcal{M}\longleftarrow \mathcal{M}\cup (\mathbf{x}_{\star},y_{\star})$ +7: else +8: Compute normalized score $\hat{w}_{\star} = \min (\frac{w_{\star}}{\bar{w}},\frac{1}{M})$ +9: Generate a random integer $i$ within 1,..., $M + 1$ , based on the probability, + $\overbrace{[\hat{w}_{\star},\dots,\hat{w}_{\star},1 - M*\hat{w}_{\star}]}$ +10: if $i\leq M$ +11: $\mathcal{M}\longleftarrow \mathcal{M}\cup (\mathbf{x}_{\star},y_{\star})\backslash \mathcal{M}_{i}$ +12: return $\mathcal{M},\bar{w}$ + +Algorithm 5 Class-Balanced Reservoir Sampling (Chrysakis & Moens, 2020) +14: return $\mathcal{M}$ , n. +1: Input: Buffer $\mathcal{M}$ , the budget $M$ , the new data point $(\mathbf{x}_{\star}, y_{\star})$ . +2: Input: The counts $\mathbf{n} \in \mathbb{R}^{K}$ for all $K$ classes. +3: if $|\mathcal{M}| < M$ +4: $\mathcal{M} \leftarrow \mathcal{M} \cup (\mathbf{x}_{\star}, y_{\star})$ . +5: else +6: Get the class index $k$ with the largest count. +7: if $\mathbf{n}_k > \mathbf{n}_{y_\star}$ +8: Generate a random integer $i$ within $1, \ldots, \mathbf{n}_k$ . +9: Replace the $i$ -th class- $k$ point in the memory with $(\mathbf{x}_{\star}, y_{\star})$ . +10: Update the counter: $\mathbf{n}_{y_\star} = \mathbf{n}_{y_\star} + 1$ . +11: else +12: Let $\mathcal{M}_{y_\star}$ be the sub-buffer for class- $y_\star$ . +13: Update $\mathcal{M}_{y_\star}$ using reservoir sampling, +\[ +\mathcal{M}_{y_\star}, \mathbf{n}_{y_\star} \leftarrow \text{ReservoirSampling}(\mathcal{M}_{y_\star}, |\mathcal{M}_{y_\star}|, \mathbf{n}_{y_\star}, (\mathbf{x}_{\star}, y_\star)). +\] + +# B EXPERIMENTAL DETAILS + +Methods. Our experiments involve Reserovir sampling (RS) (Vitter, 1985), weighted reservoir sampling with the output-space Hessian (WRS), class-balanced reservoir sampling (CBRS) (Chrysakis & Moens, 2020), greedy gradient sample selection (GSS) (Aljundi et al., 2019b), feature-space clustering (FSS-Clust) (Aljundi et al., 2019b), coreset (Borsos et al., 2020), InfoGS, and InfoRS. + +The toy Gaussian process regression. We present here the experimental details of the toy GP regression in Figure 1. We consider a GP with the one-dimensional RBF kernel: $k(x, x') = \exp(-2(x - x'))^2$ . We fix the variance of the observation noise as 0.04. For the memory points, we generate the inputs using np.linspace(-1, 1, 10). We randomly sample noisy function values from the Gaussian process. For two new points, we fix them as (0, 1) in the left and (1.5, 1) in the right. + +Continual learning benchmarks. To create data imbalance, we deliberately tie the task-ID that receives more epochs with the random seed, so that the imbalance appears for all tasks across the random runs. For example, in Split-CIFAR10, we make sure each of the five tasks is chosen twice within 10 random runs. We present the hyper-parameters and the configurations for the continual learning experiments in Table 1. We denote the batch size as $bs$ , and the memory batch size as mbs. Specifically, we randomly sample mbs points from the memory buffer in each iteration to regularize the network. We denote the memory budget as $M$ . For all the experiments, we adopt the stochastic gradient descent optimizer and we denote the learning rate as $lr$ . Furthermore, $\alpha$ and $\beta$ are the regularization coefficients in the dark experience replay objective; $\eta$ is the coefficient of the learnability in the MIC; $\gamma_{i}$ is the coefficient of the standard deviation for the information improvement thresholding (InfoGS) or the information thresholding (InfoRS); $\gamma_{l}$ is the coefficient of the standard deviation for the learnability thresholding (InfoGS). + +Table 1: Hyperparameters and Configurations of the Continual Learning Experiments. + +
Permuted MNIST and Split MNIST
ConfigurationNetwork: FC-[100,100], base epoch ne=1, bs: 128, mbs: 128, M=100, sgd
MethodsHyper-parameters
RS, WRS(var), CBRSlr: [0.03, 0.1, 0.3], α: [0.3, 1.], β: [0.3, 1.]
GSS, FSS-Clustlr: [0.03, 0.1, 0.3], α: [0.3, 1.], β: [0.3, 1.], Memory batch size for gss: 10
Coresetlr: [0.001, 0.003, 0.01, 0.03], α: [0.1, 0.3, 1.], β: [0.3], nrSlots: 10
InfoGSlr: [0.03, 0.1, 0.3], α: [0.3, 1.], β: [1.], +η: [0., 1., 3.], γi: [-0.3, 0, 0.3], γl: [0., 1.], +noise sigma: σ = 0.3, jitter c = σ2w = 0.1
InfoRSlr: [0.03, 0.1, 0.3], α: [0.3, 1.], β: [1.], η: [0., 1., 3.], γi: [-0.3, 0, 0.3] +noise sigma: σ = 0.3, jitter c = σ2w = 0.1
Split CIFAR10 and Split MiniImageNet
ConfigurationNetwork: ResNet-18, bs: 32, mbs: 32, optimizer: sgd +base epoch ne=50 (CIFAR10) and ne=100 (MiniImageNet) +M=200 (CIFAR10) and M=1000 (MiniImageNet), +data aug: [pad(4), randomCrop, random-horizontalFlip]
MethodsHyper-parameters
RS, WRS(var), CBRSlr: [0.01, 0.03], α: [0.3, 1.], β: [1., 3.]
InfoGSlr: [0.01, 0.03], α: [0.3, 1.], β: [1., 3.], η: [1.], γi: [-0.5, 0, 0.5], γl: [0.], +noise sigma: σ = 0.3, jitter c = σ2w = 0.1
InfoRSlr: [0.01, 0.03], α: [0.3, 1.], β: [1., 3.], η: [0., 1., 3.], γi: [-0.3, 0, 0.3] +noise sigma: σ = 0.3, jitter c = σ2w = 0.1
+ +# C INFORMATION-THEORETIC CRITERIA + +In this section we present other information-theoretic criteria for online memory selection. Firstly, we have introduced the memorable information criterion composed of the learnability and the surprise, + +$$ +\operatorname {M I C} _ {\eta} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \eta \log p \left(y _ {\star} ^ {\prime} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right) \mid_ {y _ {\star} ^ {\prime} = y _ {\star}} - \log p \left(y _ {\star} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}\right). \tag {14} +$$ + +Weighted Information Gain. The standard information gain (Cover, 1999) is the KL divergence between the updated posterior and the memory posterior, which is further rewritten in Eq 7. Based on the rewritten form in Eq 7, we generalize the information gain as a weighted combination, + +$$ +\operatorname {I G} _ {\eta} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \eta \mathbb {E} _ {p \left(\mathbf {w} \mid y _ {\star}; \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right)} \left[ \log p \left(y _ {\star} \mid \mathbf {w}; \mathbf {x} _ {\star}\right) \right] - \log p \left(y _ {\star} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}\right), \tag {15} +$$ + +where we include a coefficient $\eta$ to the first term similarly to MIC. We note that $\mathrm{IG}_1 = \mathrm{IG}$ . Comparing $\mathrm{IG}_{\eta}$ and $\mathrm{MIC}_{\eta}$ , we observe they share the same second surprise term, but differ in the first term. Nevertheless, observing that the first term in $\mathrm{IG}_{\eta}$ is the expected log probability of the new data point under the updated posterior $p(\mathbf{w}|y_{\star},\mathbf{y}_{\mathcal{M}};\mathbf{X}_{\mathcal{M}},\mathbf{x}_{\star})$ , thus it quantifies the "learnability" as well but in a different form as in $\mathrm{MIC}_{\eta}$ . Therefore, both $\mathrm{MIC}_{\eta}$ and $\mathrm{IG}_{\eta}$ are weighted combinations of "learnability" and "surprise". + +Additionally, under the proposed Bayesian model in Subsec 2.3, the weighted IG can be computed in explicit forms as well, + +$$ +\begin{array}{l} \operatorname {I G} _ {\eta} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \eta \log \mathcal {N} \left(y _ {\star} \mid \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {b} _ {\mathcal {M} ^ {+}}, \sigma^ {2}\right) - \frac {\eta}{2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {h} _ {\star} \tag {16} \\ - \log \mathcal {N} (y _ {\star} | \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {b} _ {\mathcal {M}}, \sigma^ {2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {h} _ {\star} + \sigma^ {2}), \\ \end{array} +$$ + +where $\mathbf{h}_{\star}$ is the feature of $\mathbf{x}_{\star}$ . + +Entropy Reduction. The entropy reflects the amount of information carried in a distribution. Thus another information-theoretic criterion would be how much the entropy can be reduced by adding the new point into the buffer. We propose the entropy reduction criterion as the following, + +$$ +\operatorname {E R} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) := \mathbb {H} [ p (\mathbf {w} | \mathcal {M}) ] - \mathbb {H} [ p (\mathbf {w} | \mathcal {M}, (x, y)) ], \tag {17} +$$ + +where $\mathbb{H}$ represents the entropy of the distribution. The weight posterior is a Gaussian distribution under the Bayesian model in Subsec 2.3, thus the entropy can be computed explicitly as well, + +$$ +\begin{array}{l} \operatorname {E R} ((\mathbf {x} _ {\star}, y _ {\star}); \mathcal {M}) = \frac {1}{2} \log | \mathbf {A} _ {\mathcal {M}} ^ {- 1} | - \frac {1}{2} \log | \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} | = \frac {1}{2} \log | (\mathbf {A} _ {\mathcal {M}} + \mathbf {x} _ {\star} \mathbf {x} _ {\star} ^ {\top}) \mathbf {A} _ {\mathcal {M}} ^ {- 1} | \\ = \frac {1}{2} \log | \mathbf {I} + \mathbf {x} _ {\star} \mathbf {x} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} | = \frac {1}{2} \log \left(1 + \mathbf {x} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {x} _ {\star}\right). \tag {18} \\ \end{array} +$$ + +We note that this entropy reduction is independent of the target $y_{\star}$ of the new point. + +Comparing the information-theoretic criteria. Intuitively, we propose the "surprise" to detect unexpected points for gathering the most information in the memory, and we propose the "learnability" to encourage the consensus between the new point and the memory. As demonstrated by $\mathrm{MIC}_{\eta}$ and $\mathrm{IG}_{\eta}$ , the "learnability" can be quantified by different explicit expressions. Similarly, the "surprise" criterion might have different expressions as well. This is also illustrated by the prediction gain (Graves et al., 2017), where the losses before and after one step of gradient updates can be understood as the "surprise" and "learnability", respectively. Therefore, we do not think that $\mathrm{MIC}_{\eta}$ strictly outperforms $\mathrm{IG}_{\eta}$ , since both combine the "surprise" and "learnability". In this paper we pick the $\mathrm{MIC}_{\eta}$ since its learnability and surprise expressions are in a more comparable form, given that both are log predictive densities. + +The entropy reduction criterion does not depend on the target $y_{\star}$ under the Gaussian weight posterior. Unlike the "surprise" criterion, ER encourages the diversity of inputs. Therefore it can behave more like an unsuperised information criterion where output/label information is not captured. For example, if the underlying distribution is composed of two input modes (where each mode has different target labels), while one mode is larger in the input space but the other mode is smaller. Then ER might focus more on the larger mode but neglects the smaller mode, yet this problem could be fixed by considering the target observations. + +![](images/cc70ae16936612509142f48783c04f8ad6084452013271ae2cf1fbd2d62ced6a.jpg) +Figure 7: The performances of InfoRS with varying criteria for Split CIFAR10 (left) and Split MiniImageNet (right). We compare ER, $\mathrm{MIC}_1$ , $\mathrm{MIC}_3$ , $\mathrm{IG}_1$ , $\mathrm{IG}_3$ . + +![](images/8bc56d403502f8a61c93c72abd641b581d3945e6584545d1a6fe1abe3be232c4.jpg) + +We further conduct Split CIFAR10 and Split MiniImageNet experiments to compare ER, $\mathrm{IG}_1$ , $\mathrm{IG}_3$ , $\mathrm{MIC}_1$ , $\mathrm{MIC}_3$ . The results are shown in Figure 7. We observe $\mathrm{IG}_{\eta}$ and $\mathrm{MIC}_{\eta}$ perform similarly in this experiment. Furthermore, we observe that using $\eta = 3$ improves over $\eta = 1$ for the Split CIFAR10 experiment, while using $\eta = 1$ improves over $\eta = 3$ for the Split MiniImageNet experiment. This indicates the importance to balance the surprise and learnability in the information-theoretic criteria. We also observe that the entropy reduction achieves competitive results as well, although it does not rely on the targets of new points. + +# D MORE EXPERIMENTS + +In this section we present more experimental results. Firstly, in Table 2 we present the test performances of the continual learning benchmarks, accompanying Figure 4. + +More baselines. We compare the proposed approaches with the gradient sample selection (GSS) (Aljundi et al., 2019b) and class-balanced reservoir sampling (CBRS) (Chaudhry et al., 2019a) as well. We choose the GSS-Greedy algorithm in Aljundi et al. (2019b), which proposes a greedy algorithm to minimize gradient similarities in the memory. However, since evaluating the per-example gradients in each iteration causes large computational costs, we only managed to run it for Permuted MNIST and Split MNIST. As argued in the paper, RS is vulnerable to imbalanced data streams. Specifically for classifications, RS tends to select the classes with more appearances and leads to an imbalanced buffer. Class-balanced reservoir sampling (Chaudhry et al., 2019a) proposes to force a balanced buffer across classes by conducting reservoir sampling separately for each class. Consequently, when $K$ classes are observed, each class will occupy $M / K$ points in the memory. A pseudocode for CBRS is shown in Alg 5. However, CBRS is only applicable to fix the class-imbalance problem for classifications. In comparison, InfoRS is generally applicable to all forms of data imbalance in the problems. + +We include GSS and CBRS in Figure 8. We observe that GSS performs worse than other approaches. For the CBRS, we first observe that it sees a performance degradation similar to RS over Permuted MNIST, since CBRS can only fix the class-imbalance problem, but the classes in Permuted MNIST are always balanced. For the other three benchmarks where class-imbalance appears, CBRS demonstrates the best robustness compared to all approaches. However, as observed in Split CIFAR10 and Split MiniImageNet, CBRS underperforms RS and InfoRS when the data is balanced. We argue that the timing of the memory updates influences CBRS here. Because CBRS attempts to maintain a class-balanced buffer, it will immediately include new points into the buffer when these points are from previously unseen classes. In consequence, CBRS tends to update the buffer at the beginning of each task for the three Split benchmarks. Then the historical points will be removed earlier. In particular, for the dark experience replay, the stored logits at the beginning of each task will be harmful to network learning as well, which also affects the performance of CBRS. + +![](images/02bb59420ecce2f5ba1b9014def0d622893528a143c2d3afc417c06b39a13f84.jpg) +Figure 8: Test performances against data imbalances over continual learning benchmarks. We compare RS, weighted RS (WRS) using the output-space Hessian, InfoGS, InfoRS, GSS, and CBRS. For each experiment, we plot the mean and the $95\%$ confidence interval across 10 random seeds. + +![](images/b50619c468c288f3f2c2e1b3d3f7c3e5bdca5dd4e9c2001438467fedbabec5ee.jpg) + +![](images/226b04b824cf01189bb9d62235e55ae303a76edf533bf2d24f972e14380ce1bb.jpg) + +![](images/622a7094309217db5041a9636ba7714571fc2f18030c96c9e2b546fb2029ebdf.jpg) + +We also include the feature-space clustering method (FSS-Clust) (Aljundi et al., 2019b) for Permuted MNIST and Split MNIST. The results are shown in Table 2. We observe that FSS-Clust also underperforms RS and InfoRS. + +Ablation studies for InfoGS and InfoRS. InfoRS is motivated by trying to resolve the timing issue of InfoGS. However, besides the difference of "when to update the memory" between InfoRS and InfoGS, "how to update the memory" is still different since InfoRS removes a random memory point while InfoGS removes the least informative memory point. Therefore, we further present an ablation algorithm to separate the effect of "when to update the memory" and "how to update the memory". In InfoGS, the new point is added to the memory as long as it passes the information improvement thresholding and the learnability thresholding, thus InfoGS tends to update the memory urgently. To bridge the gap between InfoGS and InfoRS, we propose to decide "when to update the memory" by reservoir sampling as well. Specifically, if the new point passes both thresholding in InfoGS, we decide whether to include it in the memory by reservoir sampling. If the point also passes the reservoir sampling, we put the new point into the memory and remove the least informative existing point. The resulting algorithm is represented InfoGS-RS. + +![](images/7db8e1dec69deff9e7270e91f5b33bb3a6139ccb55550e58802b94b4c116e5c7.jpg) +Figure 9: Test performances against data imbalances over continual learning benchmarks. We compare InfoGS, InfoRS, and the InfoGS with reservoir sampling (InfoGS-RS). + +![](images/fbf89df22a5556dad21f775fd8169877e08a6d53208f8a552a701ae63619eeb1.jpg) + +![](images/c0565576e295333635a5c5d45043bab3dfe8f46a5b857956622dd80318716338.jpg) + +![](images/0eceb16a5464543076693221492d39a6f676743324a265941a40584c2dd17ad8.jpg) + +We compare InfoGS, InfoRS and InfoGS-RS in Figure 9. From the figure we observe that although InfoGS-RS incorporates reservoir sampling to remedy the timing issue, it still underperforms InfoRS when the tasks are balanced. We hypothesize that feature learning might be accounted for the difference. For example, due to the effect of regularizations, the features for the memory points tend to be stable in the learning process, while the features for new points will adapt to learn the underlying mapping. Due to the evolving features, new points might have a larger chance to be surprising and existing memories could be deleted as a result. + +Forward transfer and backward transfer. We also present the forward transfer and backward transfer for the continual learning benchmarks in Table 3 and Table 4, respectively. The forward and backward transfer is introduced in Lopez-Paz & Ranzato (2017). Specifically, let $R_{i,j}$ be the + +Table 2: The means and standard errors of the continual learning benchmarks. + +
Methodimbalance=1imbalance=3imbalance=10imbalance=30
Permuted MNIST (M=100)
RS (Buzzega et al., 2020)75.41 ± 0.3274.90 ± 0.4272.90 ± 0.4766.35 ± 0.41
WRS73.76 ± 0.4173.97 ± 0.4371.92 ± 0.5069.44 ± 0.77
CBRS (Chrysakis & Moens, 2020)76.86 ± 0.3175.07 ± 0.4271.02 ± 0.4465.73 ± 0.72
GSS (Aljundi et al., 2019b)64.46 ± 0.4863.45 ± 0.6461.74 ± 1.1159.36 ± 1.59
FSS-Clust (Aljundi et al., 2019b)70.53 ± 0.3370.12 ± 0.5768.35 ± 0.8265.82 ± 0.90
InfoGS79.10 ± 0.3679.03 ± 0.2976.51 ± 0.3972.59 ± 0.69
InfoRS77.50 ± 0.1977.07 ± 0.3273.97 ± 0.4867.67 ± 0.62
Split MNIST (M=100)
RS (Buzzega et al., 2020)81.49 ± 0.7278.74 ± 1.1771.94 ± 1.8752.76 ± 1.41
WRS75.75 ± 1.2473.90 ± 0.9768.82 ± 2.3965.87 ± 2.92
CBRS(Chrysakis & Moens, 2020)80.96 ± 1.4379.71 ± 0.5579.43 ± 2.2875.08 ± 2.73
GSS (Aljundi et al., 2019b)45.36 ± 0.9545.10 ± 0.9644.16 ± 1.1549.54 ± 2.57
FSS-Clust (Aljundi et al., 2019b)52.85 ± 1.1354.59 ± 1.6954.36 ± 2.1155.33 ± 2.89
Coreset (Borsos et al., 2020)69.77 ± 0.7563.47 ± 2.2150.30 ± 2.9742.05 ± 2.19
InfoGS78.55 ± 1.3778.35 ± 1.5669.90 ± 2.1867.19 ± 3.52
InfoRS80.02 ± 1.5381.48 ± 0.9873.81 ± 2.4363.70 ± 2.63
Split CIFAR10 (M=200)
RS(Buzzega et al., 2020)50.32 ± 0.3048.31 ± 0.5440.59 ± 0.6732.88 ± 1.43
WRS34.14 ± 0.5937.66 ± 0.3037.64 ± 0.6836.65 ± 0.76
CBRS(Chrysakis & Moens, 2020)48.35 ± 0.5548.64 ± 0.3947.65 ± 0.3148.90 ± 0.56
InfoGS44.99 ± 1.3748.02 ± 0.6544.59 ± 0.7746.18 ± 0.82
InfoRS52.61 ± 0.3651.11 ± 0.3546.66 ± 0.7642.10 ± 0.71
Split MiniImageNet (M=1000)
RS(Buzzega et al., 2020)23.48 ± 0.2423.19 ± 0.3020.93 ± 0.5116.89 ± 0.67
WRS17.24 ± 0.2717.04 ± 0.2116.93 ± 0.3915.87 ± 0.25
CBRS(Chrysakis & Moens, 2020)21.74 ± 0.0721.41 ± 0.1121.10 ± 0.1620.52 ± 0.26
InfoGS20.05 ± 0.1519.89 ± 0.1719.51 ± 0.2619.16 ± 0.33
InfoRS23.83 ± 0.1423.35 ± 0.2222.03 ± 0.3919.69 ± 0.44
+ +performance of task $j$ after training task $i$ , and let $b_{i}$ be the performance of task $i$ at initialization, then they are defined in the following expression, + +$$ +\text {b a c k w a r d} = \frac {1}{T - 1} \sum_ {i = 1} ^ {T - 1} \left(R _ {T, i} - R _ {i, i}\right) +$$ + +$$ +\text {f o r w a r d} = \frac {1}{T - 1} \sum_ {i = 1} ^ {T - 1} \left(R _ {i, i + 1} - b _ {i + 1}\right). +$$ + +Intuitively, backward transfer measures how training new tasks can improve previous performances. Forward transfer measures how much performance improvement over a random network can be achieved by training previous tasks. New classes appear in news tasks in Split benchmarks, making the forward transfer is almost impossible. In contrast, it is possible for the network to explore the relationship between data points in the Permuted MNIST to achieve forward transfer. Therefore, we only report forward transfer for Permuted MNIST and Split MNIST for comparison, while we report backward transfer for all benchmarks. + +Table 3: The means and standard errors of forward transfers in continual learning benchmarks. + +
Methodimbalance=1imbalance=3imbalance=10imbalance=30
Permuted MNIST (M=100)
RS(Buzzega et al., 2020)0.88 ± 0.270.73 ± 0.240.74 ± 0.240.75 ± 0.27
WRS0.86 ± 0.280.65 ± 0.220.84 ± 0.250.80 ± 0.25
CBRS(Chrysakis & Moens, 2020)0.90 ± 0.220.84 ± 0.300.72 ± 0.330.81 ± 0.22
GSS (Aljundi et al., 2019b)0.74 ± 0.260.64 ± 0.290.77 ± 0.250.55 ± 0.25
FSS-Clust (Aljundi et al., 2019b)1.91 ± 0.231.89 ± 0.281.74 ± 0.281.74 ± 0.34
InfoGS0.75 ± 0.260.67 ± 0.320.78 ± 0.290.58 ± 0.28
InfoRS0.64 ± 0.300.92 ± 0.250.82 ± 0.250.58 ± 0.23
Split MNIST (M=100)
RS(Buzzega et al., 2020)-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89
WRS-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89
CBRS(Chrysakis & Moens, 2020)-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89
GSS (Aljundi et al., 2019b)-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89
FSS-Clust (Aljundi et al., 2019b)-10.09 ± 1.58-10.09 ± 1.58-10.09 ± 1.58-10.09 ± 1.58
Coreset (Borsos et al., 2020)-10.09 ± 1.58-10.09 ± 1.58-10.09 ± 1.58-10.09 ± 1.58
InfoGS-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89
InfoRS-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89-9.68 ± 0.89
+ +Table 4: The means and standard errors of backward transfers in the continual learning benchmarks. + +
Methodimbalance=1imbalance=3imbalance=10imbalance=30
Permuted MNIST (M=100)
RS(Buzzega et al., 2020)-19.27 ± 0.26-21.30 ± 0.31-23.34 ± 0.30-31.48 ± 0.43
WRS-21.69 ± 0.30-21.98 ± 0.58-24.60 ± 0.72-28.07 ± 0.76
CBRS(Chrysakis & Moens, 2020)-19.98 ± 0.43-21.30 ± 0.39-24.72 ± 0.31-30.43 ± 0.65
GSS (Aljundi et al., 2019b)-32.58 ± 0.57-33.53 ± 0.74-34.55 ± 0.96-36.23 ± 1.22
FSS-Clust (Aljundi et al., 2019b)-24.72 ± 0.34-25.42 ± 0.59-27.38 ± 0.82-30.14 ± 0.90
InfoGS-15.68 ± 0.30-17.20 ± 0.26-19.58 ± 0.28-22.74 ± 0.62
InfoRS-18.16 ± 0.22-20.20 ± 0.52-22.44 ± 0.51-28.95 ± 0.57
Split MNIST (M=100)
RS(Buzzega et al., 2020)-21.90 ± 1.53-25.58 ± 1.36-36.75 ± 1.88-53.51 ± 1.32
WRS-24.33 ± 1.99-26.03 ± 1.36-37.78 ± 3.19-39.65 ± 4.42
CBRS(Chrysakis & Moens, 2020)-22.62 ± 1.29-23.75 ± 1.02-25.33 ± 2.67-25.88 ± 3.62
GSS (Aljundi et al., 2019b)-65.27 ± 1.25-65.58 ± 1.43-65.59 ± 1.33-62.55 ± 2.17
FSS-Clust (Aljundi et al., 2019b)-56.49 ± 1.45-54.52 ± 2.14-53.10 ± 3.27-54.19 ± 3.67
Coreset (Borsos et al., 2020)-18.72 ± 0.79-34.04 ± 2.88-50.00 ± 4.29-59.13 ± 3.74
InfoGS-21.62 ± 1.93-28.59 ± 1.99-33.11 ± 3.25-34.81 ± 5.12
InfoRS-18.52 ± 1.06-23.81 ± 1.83-31.74 ± 3.83-43.37 ± 2.71
Split CIFAR10 (M=200)
RS(Buzzega et al., 2020)-44.09 ± 0.75-50.74 ± 1.53-53.00 ± 2.26-52.66 ± 4.51
WRS-61.35 ± 1.03-58.45 ± 0.96-55.91 ± 0.95-56.33 ± 1.51
CBRS(Chrysakis & Moens, 2020)-53.92 ± 0.50-55.62 ± 0.54-53.56 ± 0.49-55.32 ± 0.83
InfoGS-51.92 ± 2.42-43.14 ± 1.26-42.80 ± 1.19-49.30 ± 1.78
InfoRS-43.46 ± 0.66-46.72 ± 1.06-47.02 ± 1.75-51.63 ± 2.62
Split MiniImageNet (M=1000)
RS(Buzzega et al., 2020)-52.52 ± 0.27-52.68 ± 0.59-53.62 ± 1.58-52.67 ± 3.09
WRS-61.11 ± 0.37-60.59 ± 0.47-59.63 ± 0.44-61.28 ± 0.31
CBRS(Chrysakis & Moens, 2020)-58.33 ± 0.15-57.91 ± 0.17-58.91 ± 0.29-59.34 ± 0.23
InfoGS-58.80 ± 0.13-59.14 ± 0.32-59.87 ± 0.34-60.91 ± 0.31
InfoRS-53.04 ± 0.23-53.41 ± 0.62-53.89 ± 1.27-57.28 ± 1.06
+ +Ablation studies for $\eta$ and $\gamma_{i}$ . The learnability ratio $\eta$ controls the weighting between surprise and learnability. We present an ablation study to investigate the impact of $\eta$ in InfoRS. In addition, the information thresholding parameter $\gamma_{i}$ determines the degree of InfoRS from acting purely randomly to greedily. We also present an ablation study to investigate its impact. The results are shown in Figure 10. + +![](images/312e1d614f33c566e9731b7b758e9fc8e7946f8b205a688c1e5ddd92633f502e.jpg) +Figure 10: Validation performances against the learnability ratio $(\eta)$ and the information thresholding ratio $(\gamma_{i})$ , over Split CIFAR10. We compare InfoRS under various data imbalances $(R)$ and plot the means and $95\%$ confidence intervals. Firstly, for all data imbalance, the best $\eta$ is achieved at around 3 and the best $\gamma_{i}$ at around 0. Thus both hyperparameters are not sensitive to data imbalance. Secondly, for the learnability ratio, setting $\eta = 0$ and setting $\eta$ to be large both lead to degraded performances, which indicates the importance of properly balancing surprise and learnability in online memory selection. Thirdly, for the information thresholding ratio, setting it to be small makes InfoRS act similarly to RS while setting it to be large makes InfoRS more greedy. Therefore, we observe that when the data is balanced $(R = 1, R = 3)$ , setting $\gamma_{i} < 0$ leads to similar optimal performances. In contrast, when the data is imbalanced $(R = 10, R = 30)$ , choosing an intermediate $\gamma_{i}$ can properly balance the stochasticity and the greediness. + +![](images/c4f954b4ceadeb4ddfd58af802d3c540219c7e5678ca5c922540a95cf9d7f290.jpg) + +Evolution of test accuracies along with training. In Figure 11 we show how the test accuracies evolve along with seeing more tasks. Specifically, for each dataset, we visualize the evolutions in RS and InfoRS over a single random run, where the first task is trained for 30 times epochs than the others. + +![](images/330993cda8b1615aab35201d970e38a35060c27268fcd2a283bc7556d1f57c52.jpg) + +![](images/bb9007a49600d94e112c0fafb6f93c9b3a9a9c9c152579ab4054583bd9c07f0d.jpg) + +![](images/5813b28c6883a14471c88e1048411f1b62ca84a4b87f347bf75a5610155d0d1f.jpg) +Figure 11: The evolution of test accuracies. The first task is trained for 30 times longer than others. + +![](images/b48943cd1491d0e4bd1d7b55ad94347569803a52e8cbf79115d04cd81b4e6197.jpg) + +The TSNE plot with a smaller memory. In Figure 2, we demonstrated that incorporating learnability is important to filter out outliers, using the TSNE plot of 200 selected memories. Here we present another comparison to investigate the scenario with a small memory. Specifically, we set the memory buffer as 25. The results are shown in Figure 12. + +![](images/d7b97572ea09a8e4fb1bebb9ed6434db98839ce27d171f538ac2820dea4c80ef.jpg) +Figure 12: TSNE visualizations of the training data (colored dots, where the color represents the label of the data point) and 25 memory points (black digits, where the digit represents the label of the point) for InfoGS without and with learnability, respectively. With a small memory, we observe that InfoGS without learnability performs similarly to InfoGS with learnability. Both select a representative memory buffer that reflects the training distribution. Because the agent needs to select 25 memories out of data points from 10 classes, the surprise will dominate the selection process, and the outlier issue is not protruding. Therefore, incorporating learnability is not critical to the selection when the memory buffer is very small. + +![](images/b7364e9a3799459a6206842351debbd6aa8b78cb36e79dce24f08aa052d10858.jpg) + +Impact of $\alpha$ and $\beta$ . The logit regularization coefficient $\alpha$ and the label regularization coefficient $\beta$ in DER++ control the regularization degree of the replay buffer. We further present an experiment investigate their impact separately, in Figure 13. + +![](images/f9ac664cbff92b91e14281214de5068ff0c37edbee6165a813ca2b04497ab8a7.jpg) +Figure 13: Validation performances against the logit regularization coefficient $(\alpha)$ and the label regularization coefficient $(\beta)$ in DER++, over Split CIFAR10. We compare InfoRS under various data imbalances $(R)$ and plot the means and $95\%$ confidence intervals. We observe that the performance is not sensitive to $\alpha$ and $\beta$ . + +![](images/0b59289adbe9f681520d64feb5bf77594cc7efaeb90681059eb160ed0ff487df.jpg) + +# E PROOFS + +In this section we provide necessary proofs. + +Information Gain. We rewrite the information gain as the following, + +$$ +\begin{array}{l} \operatorname {I G} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \operatorname {K L} \left(p \left(\mathbf {w} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right) | | p (\mathbf {w} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}})\right) \\ = \mathbb {E} _ {p (\mathbf {w} | y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star})} \left[ \log \frac {p (\mathbf {w} | y _ {\star} , \mathbf {y} _ {\mathcal {M}} ; \mathbf {X} _ {\mathcal {M}} , \mathbf {x} _ {\star})}{p (\mathbf {w} | \mathbf {y} _ {\mathcal {M}} ; \mathbf {X} _ {\mathcal {M}})} \right] \\ = \mathbb {E} _ {p (\mathbf {w} | y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star})} \left[ \log \frac {p (\mathbf {w} , y _ {\star} , \mathbf {y} _ {\mathcal {M}} ; \mathbf {X} _ {\mathcal {M}} , \mathbf {x} _ {\star})}{p (\mathbf {w} , \mathbf {y} _ {\mathcal {M}} ; \mathbf {X} _ {\mathcal {M}}) p (y _ {\star} | \mathbf {y} _ {\mathcal {M}} ; \mathbf {X} _ {\mathcal {M}} , \mathbf {x} _ {\star})} \right] \\ = \mathbb {E} _ {p (\mathbf {w} | y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star})} [ \log p (y _ {\star} | \mathbf {w}, \mathbf {y} _ {\mathcal {M}}) - \log p (y _ {\star} | \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}) ] \\ = \mathbb {E} _ {p \left(\mathbf {w} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right)} \left[ \log p \left(y _ {\star} \mid \mathbf {w}; \mathbf {x} _ {\star}\right) \right] - \log p \left(y _ {\star} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}\right). \tag {19} \\ \end{array} +$$ + +![](images/ab7d696e060509172a03441740dcee252bfd7438f26930ff7be7fab8404aeff9.jpg) + +Proof. By applying Jensen's inequality we have + +$$ +\begin{array}{l} \log p \left(y _ {\star} ^ {\prime} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right) | _ {y _ {\star} ^ {\prime} = y _ {\star}} = \log \mathbb {E} _ {p (\mathbf {w} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star})} [ p (y _ {\star} \mid \mathbf {w}; \mathbf {x} _ {\star}) ] \\ \geq \mathbb {E} _ {p (\mathbf {w} | y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {x} _ {\mathcal {M}}, \mathbf {x} _ {\star})} [ \log p (y _ {\star} | \mathbf {w}; \mathbf {x} _ {\star}) ] \tag {20} \\ \end{array} +$$ + +![](images/58d2f14d8be7abc0f930ec31ae8c9b377090d6570b8482819f7d6bd77352dd84.jpg) + +Information Criterion for Bayesian Linear Regression. Given a new point $(\mathbf{x}_{\star},y_{\star})$ , let $\mathbf{h}_{\star}$ be the corresponding feature, then the criterion is represented as, + +$$ +s \left(\left(\mathbf {h} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \eta \log p \left(y _ {\star} ^ {\prime} \mid y _ {\star}, \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}, \mathbf {x} _ {\star}\right) \mid_ {y _ {\star} ^ {\prime} = y _ {\star}} - \log p \left(y _ {\star} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {X} _ {\mathcal {M}}\right). \tag {21} +$$ + +Given the memory $\mathcal{M}$ , the posterior distribution of weights can be computed as, + +$$ +p \left(\mathbf {w} \mid \mathbf {y} _ {\mathcal {M}}; \mathbf {H} _ {\mathcal {M}}\right) = \mathcal {N} \left(\mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {b} _ {\mathcal {M}}, \sigma^ {2} \mathbf {A} _ {\mathcal {M}} ^ {- 1}\right). \tag {22} +$$ + +where the matrix $\mathbf{A}_{\mathcal{M}}^{-1} = \left(\mathbf{H}_{\mathcal{M}}^{\top}\mathbf{H}_{\mathcal{M}} + c\mathbf{I}_d\right)^{-1}$ for $c = \frac{\sigma^2}{\sigma_w^2}$ and $\mathbf{b}_{\mathcal{M}} = \mathbf{H}_{\mathcal{M}}^{\top}\mathbf{y}_{\mathcal{M}}$ . Similarly let $\mathcal{M}^{+} = \mathcal{M} \cup (\mathbf{x}_{\star}, y_{\star})$ , $\mathbf{A}_{\mathcal{M}^{+}} = \mathbf{A}_{\mathcal{M}} + \mathbf{h}_{\star}\mathbf{h}_{\star}^{\top}$ and $\mathbf{b}_{\mathcal{M}^{+}} = \mathbf{b}_{\mathcal{M}} + \mathbf{h}_{\star}y_{\star}$ , then weight posterior given the memory $\mathcal{M}^{+}$ can be computed as, + +$$ +p \left(\mathbf {w} \mid \mathbf {y} _ {\mathcal {M} ^ {+}}; \mathbf {H} _ {\mathcal {M} ^ {+}}\right) = \mathcal {N} \left(\mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {b} _ {\mathcal {M} ^ {+}}, \sigma^ {2} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1}\right). \tag {23} +$$ + +Thus the predictive distributions can be represented as, + +$$ +y _ {\star} ^ {\prime} \left| \mathbf {y} _ {\mathcal {M} ^ {+}} \sim \mathcal {N} \left(\mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {b} _ {\mathcal {M} ^ {+}}, \sigma^ {2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {h} _ {\star} + \sigma^ {2}\right), \right. \tag {24} +$$ + +$$ +y _ {\star} | \mathbf {y} _ {\mathcal {M}} \sim \mathcal {N} \left(y _ {\star} \left| \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {b} _ {\mathcal {M}}, \sigma^ {2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {h} _ {\star} + \sigma^ {2}\right). \right. \tag {25} +$$ + +which directly leads to the expression of the information criterion + +$$ +\begin{array}{l} \operatorname {M I C} _ {\eta} \left(\left(\mathbf {x} _ {\star}, y _ {\star}\right); \mathcal {M}\right) = \eta \log \mathcal {N} \left(y _ {\star} \mid \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {b} _ {\mathcal {M} ^ {+}}, \sigma^ {2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M} ^ {+}} ^ {- 1} \mathbf {h} _ {\star} + \sigma^ {2}\right) \\ - \log \mathcal {N} (y _ {\star} | \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {b} _ {\mathcal {M}}, \sigma^ {2} \mathbf {h} _ {\star} ^ {\top} \mathbf {A} _ {\mathcal {M}} ^ {- 1} \mathbf {h} _ {\star} + \sigma^ {2}). \\ \end{array} +$$ + +We can now combine this with the definition of the log density + +$$ +\log \mathcal {N} (y | a, b) = \log \left(\frac {1}{b \sqrt {2 \pi}} e ^ {- \frac {1}{2} \left(\frac {y - a}{b}\right) ^ {2}}\right) = - \frac {1}{2} \left(\left(\frac {y - a}{b}\right) ^ {2} + \log (2 \pi b ^ {2})\right) +$$ + +of a Gaussian $\mathcal{N}(a,b)$ . Let us denote with $\mu_{+}$ and $\sigma_{+}$ the updated mean and variance, and with $\mu_{-}$ and $\sigma_{-}$ the old mean and variance (not to be confused with the noise variance $\sigma$ ). Then + +$$ +\mathrm {M I C} _ {\eta} ((\mathbf {x} _ {\star}, y _ {\star}); \mathcal {M}) = - \frac {\eta}{2} \left(\left(\frac {y _ {\star} - \mu_ {+}}{\sigma_ {+}}\right) ^ {2} + \log (2 \pi \sigma_ {+} ^ {2})\right) + \frac {1}{2} \left(\left(\frac {y _ {\star} - \mu_ {-}}{\sigma_ {-}}\right) ^ {2} + \log (2 \pi \sigma_ {-} ^ {2})\right) +$$ + +![](images/c47930b5ae21bb0e1ed4495285e30a70dfe327f84da13ecddc36e52bee63efbe.jpg) \ No newline at end of file diff --git a/informationtheoreticonlinememoryselectionforcontinuallearning/images.zip b/informationtheoreticonlinememoryselectionforcontinuallearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b9c548b5c19e60dafb4a74848b711c9449e9ce6d --- /dev/null +++ b/informationtheoreticonlinememoryselectionforcontinuallearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d261dcd06da1786f6e8cefc3de2c1a6c42af608f23397bf625a33a92e97b4257 +size 1547955 diff --git a/informationtheoreticonlinememoryselectionforcontinuallearning/layout.json b/informationtheoreticonlinememoryselectionforcontinuallearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f097d06b6709741db576a6451b0fd0c963e7a1c6 --- /dev/null +++ b/informationtheoreticonlinememoryselectionforcontinuallearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65da165fd65b499006760bde2f9079051aacb4bb1d0f04d47713dc5d98a6d154 +size 910124 diff --git a/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_content_list.json b/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..709f18ff7f00bfcf5bafd64f2e237648fd5547c4 --- /dev/null +++ b/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b65f3ab6afec463ca0ae96520f92129c1abc8d578848aa2ec16fdb7fab05a3a +size 228674 diff --git a/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_model.json b/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6d13552cef914b307b11705098492af070ed9a6d --- /dev/null +++ b/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfcea5846cb17fbce20345f6c0fcbc3e87746e314a24463b4db9bb9604d0ee39 +size 267752 diff --git a/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_origin.pdf b/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..45a1851a27d08e9d93e9b5a3e2fbf173ef89243b --- /dev/null +++ b/interactingcontourstochasticgradientlangevindynamics/de880d02-85da-4d03-a46a-9b31c84c3b45_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef56dcd3ebd3bf565147dd89b9ae00bc8fd524c8f853b537cff3de65774334ff +size 1199198 diff --git a/interactingcontourstochasticgradientlangevindynamics/full.md b/interactingcontourstochasticgradientlangevindynamics/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1e4870bfb69534864f0b1e9947bcc78687f38e46 --- /dev/null +++ b/interactingcontourstochasticgradientlangevindynamics/full.md @@ -0,0 +1,1048 @@ +# INTERACTING CONTOUR STOCHASTIC GRADIENT LANGEVIN DYNAMICS + +Wei Deng $^{1,2}$ , Siqi Liang $^{1}$ , Botao Hao $^{3}$ , Guang Lin $^{1}$ , Faming Liang $^{1}$ + +$^{1}$ Purdue University $^{2}$ Morgan Stanley $^{3}$ DeepMind + +fmliang@purdue.edu; weideng056@gmail.com + +# ABSTRACT + +We propose an interacting contour stochastic gradient Langevin dynamics (IC-SGLD) sampler, an embarrassingly parallel multiple-chain contour stochastic gradient Langevin dynamics (CSGLD) sampler with efficient interactions. We show that ICSGLD can be theoretically more efficient than a single-chain CSGLD with an equivalent computational budget. We also present a novel random-field function, which facilitates the estimation of self-adapting parameters in big data and obtains free mode explorations. Empirically, we compare the proposed algorithm with popular benchmark methods for posterior sampling. The numerical results show a great potential of ICSGLD for large-scale uncertainty estimation tasks. + +# 1 INTRODUCTION + +Stochastic gradient Langevin dynamics (SGLD) (Welling & Teh, 2011) has achieved great successes in simulations of high-dimensional systems for big data problems. It, however, yields only a fast mixing rate when the energy landscape is simple, e.g., local energy wells are shallow and not well separated. To improve its convergence for the problems with complex energy landscapes, various strategies have been proposed, such as momentum augmentation (Chen et al., 2014; Ding et al., 2014), Hessian approximation (Ahn et al., 2012; Li et al., 2016), high-order numerical schemes (Chen et al., 2015; Li et al., 2019b), and cyclical learning rates (Izmailov et al., 2018; Maddox et al., 2019; Zhang et al., 2020b). In spite of their asymptotic properties in Bayesian inference (Vollmer et al., 2016) and non-convex optimization (Zhang et al., 2017), it is still difficult to achieve compelling empirical results for pathologically complex deep neural networks (DNNs). + +To simulate from distributions with complex energy landscapes, e.g., those with a multitude of modes well separated by high energy barriers, an emerging trend is to run multiple chains, where interactions between different chains can potentially accelerate the convergence of the simulation. For example, Song et al. (2014) and Futami et al. (2020) showed theoretical advantages of appropriate interactions in ensemble/population simulations. Other multiple chain methods include particle-based nonlinear Markov (Vlasov) processes (Liu & Wang, 2016; Zhang et al., 2020a) and replica exchange methods (also known as parallel tempering) (Deng et al., 2021a). However, the particle-based methods result in an expensive kernel matrix computation given a large number of particles (Liu & Wang, 2016); similarly, naively extending replica exchange methods to population chains leads to a long waiting time to swap between non- neighboring chains (Syed et al., 2021). Therefore, how to conduct interactions between different chains, while maintaining the scalability of the algorithm, is the key to the success of the parallel stochastic gradient MCMC algorithms. + +In this paper, we propose an interacting contour stochastic gradient Langevin dynamics (ICSGLD) sampler, a pleasingly parallel extension of contour stochastic gradient Langevin dynamics (CSGLD) (Deng et al., 2020b) with efficient interactions. The proposed algorithm requires minimal communication cost in that each chain shares with others the marginal energy likelihood estimate only. As a result, the interacting mechanism improves the convergence of the simulation, while the minimal communication mode between different chains enables the proposed algorithm to be naturally adapted to distributed computing with little overhead. For the single-chain CSGLD algorithm, despite its theoretical advantages as shown in Deng et al. (2020b), estimation of the marginal energy likelihood remains challenging for big data problems with a wide energy range, jeopardizing the empirical performance of the class of importance sampling methods (Gordon et al., 1993; Doucet et al., 2001; + +Wang & Landau, 2001; Liang et al., 2007; Andrieu et al., 2010; Deng et al., 2020b) in big data applications. To resolve this issue, we resort to a novel interacting random-field function based on multiple chains for an ideal variance reduction and a more robust estimation. As such, we can greatly facilitate the estimation of the marginal energy likelihood so as to accelerate the simulations of notoriously complex distributions. To summarize, the algorithm has three main contributions: + +- We propose a scalable interacting importance sampling method for big data problems with the minimal communication cost. A novel random-field function is derived to tackle the incompatibility issue of the class of importance sampling methods in big data problems. +- Theoretically, we study the local stability of a non-linear mean-field system and justify regularity properties of the solution of Poisson's equation. We also prove the asymptotic normality for the stochastic approximation process in mini-batch settings and show that ICSGLD is asymptotically more efficient than the single-chain CSGLD with an equivalent computational budget. +- Our proposed algorithm achieves appealing mode explorations using a fixed learning rate on the MNIST dataset and obtains remarkable performance in large-scale uncertainty estimation tasks. + +# 2 PRELIMINARIES + +# 2.1 STOCHASTIC GRADIENT LANGEVIN DYNAMICS + +A standard sampling algorithm for big data problems is SGLD (Welling & Teh, 2011), which is a numerical scheme of a stochastic differential equation in mini-batch settings: + +$$ +\mathbf {x} _ {k + 1} = \mathbf {x} _ {k} - \epsilon_ {k} \frac {N}{n} \nabla_ {\mathbf {x}} \widetilde {U} (\mathbf {x} _ {k}) + \sqrt {2 \tau \epsilon_ {k}} \boldsymbol {w} _ {k}, \tag {1} +$$ + +where $\mathbf{x}_k\in \mathcal{X}\in \mathbb{R}^d$ $\epsilon_{k}$ is the learning rate at iteration $k$ $N$ denotes the number of total data points, $\tau$ is the temperature, and $\pmb{w}_{k}$ is a standard Gaussian vector of dimension $d$ . In particular, $\frac{N}{n}\nabla_{\mathbf{x}}\widetilde{U} (\mathbf{x})$ is an unbiased stochastic gradient estimator based on a mini-batch data $\mathcal{B}$ of size $n$ and $\frac{N}{n}\widetilde{U} (\mathbf{x})$ is the unbiased energy estimator for the exact energy function $U(\mathbf{x})$ . Under mild conditions on $U$ $\mathbf{x}_{k + 1}$ is known to converge weakly to a unique invariant distribution $\pi (\mathbf{x})\propto e^{-\frac{U(\mathbf{x})}{\tau}}$ as $\epsilon_k\to 0$ + +# 2.2 CONTOUR STOCHASTIC GRADIENT LANGEVIN DYNAMICS + +Despite its theoretical guarantees, SGLD can converge exponentially slow when $U(\mathbf{x})$ is non-convex and exhibits high energy barriers. To remedy this issue, CSGLD (Deng et al., 2020b) exploits the flat histogram idea and proposes to simulate from a flattened density with much lower energy barriers + +$$ +\varpi_ {\Psi_ {\theta}} (\mathbf {x}) \propto \pi (\mathbf {x}) / \Psi_ {\theta} ^ {\zeta} (U (\mathbf {x})), \tag {2} +$$ + +where $\zeta$ is a hyperparameter, $\Psi_{\pmb{\theta}}(u) = \sum_{i=1}^{m}\left(\theta(i-1)e^{\left(\log \theta(i)-\log \theta(i-1)\right)\frac{u-u_{i-1}}{\Delta u}}\right)1_{u_{i-1} 1$ iterations for future works. + +# 4 CONVERGENCE PROPERTIES + +To study theoretical properties of ICSGLD, we first show a local stability property that is well-suited to big data problems, and then we present the asymptotic normality for the stochastic approximation process in mini-batch settings, which eventually yields the desired result that ICSGLD is asymptotically more efficient than a single-chain CSGLD with an equivalent computational cost. + +# 4.1 LOCAL STABILITY FOR NON-LINEAR MEAN-FIELD SYSTEMS IN BIG DATA + +The first obstacle for the theoretical study is to approximate the components of $\theta_{\infty}$ corresponding to the high energy region. To get around this issue, the random field function $\widetilde{H} (\pmb {\theta},\mathbf{x})$ in (8) is adopted to estimate a different target $\pmb{\theta}_{\star}\propto \pmb{\theta}_{\infty}^{\frac{1}{\xi}}$ . As detailed in Lemma 3 in the supplementary material, the mean-field equation is now formulated as follows + +$$ +h _ {i} (\boldsymbol {\theta}) \propto \theta_ {\star} ^ {\zeta} (i) - (\theta (i) C _ {\boldsymbol {\theta}}) ^ {\zeta} + \text {p e r t u r b a t i o n s}, \tag {10} +$$ + +where $C_{\theta} = \left(\frac{\widetilde{Z}_{\zeta,\theta}}{\widetilde{Z}_{\zeta,\theta\star}^{\zeta}}\right)^{\frac{1}{\zeta}}$ and $\widetilde{Z}_{\zeta,\theta} = \sum_{k=1}^{m} \frac{\int_{X_k} \pi(\mathbf{x}) d\mathbf{x}}{\theta^{\zeta-1}(k)}$ . We see that (10) may not be linearly stable as in Deng et al. (2020b). Although the solution of the mean-field system $h(\pmb{\theta}) = 0$ is still unique, there may exist unstable invariant subspaces, leading us to consider the local properties. For a proper initialization of $\pmb{\theta}$ , which can be achieved by pre-training the model long enough time through SGLD, the mean value theorem implies a linear property in a local region + +$$ +h _ {i} (\boldsymbol {\theta}) \propto \theta_ {\star} (i) - \theta (i) + \text {p e r t u r b a t i o n s}. +$$ + +Combining the perturbation theory (Vanden-Eijnden, 2001), we present the following stability result: + +Lemma 1 (Local stability, informal version of Lemma 3) Assume Assumptions A1-A4 (given in the supplementary material) hold. For any properly initialized $\pmb{\theta}$ , we have $\langle h(\pmb{\theta}),\pmb{\theta} - \widehat{\pmb{\theta}}_{\star}\rangle \leq -\phi \| \pmb{\theta} - \widehat{\pmb{\theta}}_{\star}\|^{2}$ , where $\widehat{\pmb{\theta}}_{\star} = \pmb{\theta}_{\star} + \mathcal{O}\left(\sup_{\mathbf{x}}\mathrm{Var}(\xi_n(\mathbf{x})) + \epsilon +\frac{1}{m}\right)$ , $\pmb{\theta}_{\star} \propto \pmb{\theta}_{\infty}^{\frac{1}{\xi}}, \phi >0$ , $\epsilon$ denotes a learning rate, and $\xi_{n}(\mathbf{x})$ denotes the noise in the stochastic energy estimator of batch size $n$ and $\mathrm{Var}(\cdot)$ denotes the variance. + +By justifying the drift conditions of the adaptive transition kernel and relevant smoothness properties, we can prove the existence and regularity properties of the solution of the Poisson's equation in Lemma 6 in the supplementary material. In what follows, we can control the fluctuations in stochastic approximation and eventually yields the $L^2$ convergence. + +Lemma 2 ( $L^2$ convergence rate, informal version of Lemma 7) Given standard Assumptions A1-A5. $\theta_{k}$ converges to $\widehat{\theta}_{\star}$ , where $\widehat{\theta}_{\star} = \theta_{\star} + \mathcal{O}\left(\sup_{\mathbf{x}}\mathrm{Var}(\xi_n(\mathbf{x})) + \epsilon +\frac{1}{m}\right)$ , such that + +$$ +\mathbb {E} \left[ \left\| \pmb {\theta} _ {k} - \widehat {\pmb {\theta}} _ {\star} \right\| ^ {2} \right] = \mathcal {O} \left(\omega_ {k}\right). +$$ + +The result differs from Theorem 1 of Deng et al. (2020b) in that the biased fixed point $\widehat{\theta}_{\star}$ instead of $\theta_{\star}$ is treated as the equilibrium of the continuous system, which provides us a user-friendly proof. Similar techniques have been adopted by Durmus & Éric Moulines (2017); Xu et al. (2018). Although the global stability (Deng et al., 2020b) may be sacrificed when $\zeta \neq 1$ based on Eq.(8), $\theta_{\star} \propto \theta_{\infty}^{\frac{1}{\zeta}}$ is much easier to estimate numerically for any $i$ that yields $0 < \theta_{\infty}(i) \ll 1$ based on a large $\zeta > 1$ . + +# 4.2 ASYMPTOTIC NORMALITY + +To study the asymptotic behavior of $\omega_{k}^{-\frac{1}{2}}(\pmb{\theta}_{k} - \widehat{\pmb{\theta}}_{\star})$ , where $\widehat{\pmb{\theta}}_{\star}$ is the equilibrium point s.t. $\widehat{\pmb{\theta}}_{\star} = \pmb{\theta}_{\star} + \mathcal{O}\left(\mathrm{Var}(\xi_{n}(\mathbf{x})) + \epsilon + \frac{1}{m}\right)$ , we consider a fixed step size $\omega$ in the SA step for ease of explanation. Let $\bar{\theta}_t$ denote the solution of the mean-field system in continuous time $(\bar{\theta}_0 = \theta_0)$ , and rewrite the single-chain SA step (7) as follows + +$$ +\begin{array}{l} \boldsymbol {\theta} _ {k + 1} - \bar {\boldsymbol {\theta}} _ {(k + 1) \omega} = \boldsymbol {\theta} _ {k} - \bar {\boldsymbol {\theta}} _ {k \omega} + \omega \left(H \left(\boldsymbol {\theta} _ {k}, \mathbf {x} _ {k + 1}\right) - H \left(\bar {\boldsymbol {\theta}} _ {k \omega}, \mathbf {x} _ {k + 1}\right)\right) \\ + \omega \left(H (\bar {\boldsymbol {\theta}} _ {k \omega}, \mathbf {x} _ {k + 1}) - h (\bar {\boldsymbol {\theta}} _ {k \omega})\right) - \left(\bar {\boldsymbol {\theta}} _ {(k + 1) \omega} - \bar {\boldsymbol {\theta}} _ {k \omega} - \omega h (\bar {\boldsymbol {\theta}} _ {k \omega})\right). \\ \end{array} +$$ + +Further, we set $\widetilde{\pmb{\theta}}_{k\omega} \coloneqq \omega^{-\frac{1}{2}}(\pmb{\theta}_k - \bar{\pmb{\theta}}_{k\omega})$ . Then the stochastic approximation differs from the mean field system in that + +$$ +\begin{array}{l} \widetilde{\boldsymbol{\theta}}_{(k + 1)\omega} = \underbrace{\omega^{\frac{1}{2}}\sum_{i = 0}^{k}\big(H(\boldsymbol{\theta}_{i},\mathbf{x}_{i + 1}) - H(\bar{\boldsymbol{\theta}}_{i\omega},\mathbf{x}_{i + 1})\big)}_{\text{I: perturbations}} + \omega^{\frac{1}{2}}\sum_{i = 0}^{k}\underbrace{\big(H(\bar{\boldsymbol{\theta}}_{i\omega},\mathbf{x}_{i + 1}) - h(\bar{\boldsymbol{\theta}}_{i\omega})\big)}_{\text{II: martingale $\mathcal{M}_{i}$}}}- \omega^{\frac{1}{2}}\cdot \text{remainder} \\ \approx \omega^ {\frac {1}{2}} \sum_ {i = 0} ^ {k} h _ {\boldsymbol {\theta}} (\boldsymbol {\theta} _ {i \omega}) \underbrace {(\boldsymbol {\theta} _ {i} - \bar {\boldsymbol {\theta}} _ {i \omega})} _ {\approx \omega^ {\frac {1}{2}} \widetilde {\boldsymbol {\theta}} _ {i \omega}} + \omega^ {\frac {1}{2}} \sum_ {i = 0} ^ {k} \mathcal {M} _ {i} \approx \int_ {0} ^ {(k + 1) \omega} h _ {\boldsymbol {\theta}} (\bar {\boldsymbol {\theta}} _ {s}) \widetilde {\boldsymbol {\theta}} _ {s} d s + \int_ {0} ^ {(k + 1) \omega} \boldsymbol {R} ^ {\frac {1}{2}} (\bar {\boldsymbol {\theta}} _ {s}) d \boldsymbol {W} _ {s}, \\ \end{array} +$$ + +where $h_{\pmb{\theta}}(\pmb{\theta}) \coloneqq \frac{d}{d\pmb{\theta}} h(\pmb{\theta})$ is a matrix, $W \in \mathbb{R}^{m}$ is a standard Brownian motion, the last term follows from a certain central limit theorem (Benveniste et al., 1990) and $\pmb{R}$ denotes the covariance matrix of the random-field function s.t. $R(\pmb{\theta}) \coloneqq \sum_{k = -\infty}^{\infty}\mathrm{Cov}_{\pmb{\theta}}(H(\pmb{\theta},\mathbf{x}_k),H(\pmb{\theta},\mathbf{x}_0))$ . + +We expect the weak convergence of $U_{k}$ to the stationary distribution of a diffusion + +$$ +d \boldsymbol {U} _ {t} = h _ {\boldsymbol {\theta}} \left(\boldsymbol {\theta} _ {t}\right) \boldsymbol {U} _ {t} d t + \boldsymbol {R} ^ {1 / 2} \left(\boldsymbol {\theta} _ {t}\right) d \boldsymbol {W} _ {t}, \tag {11} +$$ + +where $\pmb{U}_t = \omega_t^{-1/2} (\pmb{\theta}_t - \widehat{\pmb{\theta}}_\star)$ . Given that $\pmb{\theta}_t$ converges to $\widehat{\pmb{\theta}}_\star$ sufficiently fast and the local linearity of $h_\theta$ , the diffusion (11) resembles the Ornstein-Uhlenbeck process and yields the following solution + +$$ +\pmb {U} _ {t} \approx e ^ {- t h _ {\pmb {\theta}} (\widehat {\pmb {\theta}} _ {\star})} \pmb {U} _ {0} + \int_ {0} ^ {t} e ^ {- (t - s) h _ {\pmb {\theta}} (\widehat {\pmb {\theta}} _ {\star})} \circ \pmb {R} (\widehat {\pmb {\theta}} _ {\star}) d \pmb {W} _ {s}. +$$ + +Then we have the following theorem, whose formal proof is given in section C.3. + +Theorem 1 (Asymptotic Normality) Assume Assumptions A1-A5 (given in the supplementary material) hold. We have the following weak convergence + +$$ +\omega_ {k} ^ {- 1 / 2} (\pmb {\theta} _ {k} - \widehat {\pmb {\theta}} _ {\star}) \Rightarrow \mathcal {N} (0, \pmb {\Sigma}), w h e r e \pmb {\Sigma} = \int_ {0} ^ {\infty} e ^ {t h _ {\pmb {\theta} _ {\star}}} \circ \pmb {R} \circ e ^ {t h _ {\pmb {\theta} _ {\star}} ^ {\top}} d t, h _ {\pmb {\theta} _ {\star}} = h _ {\pmb {\theta}} (\widehat {\pmb {\theta}} _ {\star}). +$$ + +# 4.3 INTERACTING PARALLEL CHAINS ARE MORE EFFICIENT + +For clarity, we first denote an estimate of $\pmb{\theta}$ based on ICSGLD with $P$ interacting parallel chains by $\pmb{\theta}_{k}^{P}$ and denote the estimate based on a single-long-chain CSGLD by $\pmb{\theta}_{kP}$ . + +Note that Theorem 1 holds for any step size $\omega_{k} = \mathcal{O}(k^{-\alpha})$ , where $\alpha \in (0.5, 1]$ . If we simply run a single-chain CSGLD algorithm with $P$ times of iterations, by Theorem 1, + +$$ +\omega_ {k P} ^ {- 1 / 2} \left(\boldsymbol {\theta} _ {k P} - \widehat {\boldsymbol {\theta}} _ {\star}\right) \Rightarrow \mathcal {N} (0, \boldsymbol {\Sigma}). +$$ + +As to ICSGLD, since the covariance $\pmb{\Sigma}$ relies on $\pmb{R}$ , which depends on the covariance of the martingale $\{\mathcal{M}_i\}_{i\geq 1}$ , the conditional independence of $\mathbf{x}^{(1)},\mathbf{x}^{(2)},\dots ,\mathbf{x}^{(P)}$ naturally results in an efficient variance reduction such that + +Corollary 1 (Asymptotic Normality for ICSGLD) Assume the same assumptions. For ICSGLD with $P$ interacting chains, we have the following weak convergence + +$$ +\omega_ {k} ^ {- 1 / 2} \left(\boldsymbol {\theta} _ {k} ^ {P} - \widehat {\boldsymbol {\theta}} _ {\star}\right) \Rightarrow \mathcal {N} (0, \boldsymbol {\Sigma} / P). +$$ + +That is, under a similar computational budget, we have $\frac{\|\mathrm{Var}(\pmb{\theta}_{kP} - \widehat{\pmb{\theta}}_{\star})\|_{\mathrm{F}}}{\|\mathrm{Var}(\pmb{\theta}_k^P - \widehat{\pmb{\theta}}_*)\|_{\mathrm{F}}} = \frac{w_{kP}}{w_k / P}\approx P^{1 - \alpha}$ + +Corollary 2 (Efficiency) Given a decreasing step size $\omega_{k} = \mathcal{O}(k^{-\alpha})$ , where $0.5 < \alpha < 1$ , ICSGLD is asymptotically more efficient than the single-chain CSGLD with an equivalent training cost. + +In practice, slowly decreasing step sizes are often preferred in stochastic algorithms for a better non-asymptotic performance (Benveniste et al., 1990). + +# 5 EXPERIMENTS + +# 5.1 LANDSCAPE EXPLORATION ON MNIST VIA THE SCALABLE RANDOM-FIELD FUNCTION + +This section shows how the novel random-field function (8) facilitates the exploration of multiple modes on the MNIST dataset $^{8}$ , while the standard methods, such as stochastic gradient descent (SGD) and SGLD, only get stuck in few local modes. To simplify the experiments, we choose a large batch size of 2500 and only pick the first five classes, namely digits from 0 to 4. The learning rate is fixed to 1e-6 and the temperature is set to $0.1^{\dagger}$ . We see from Figure 2(a) that both SGD and SGLD lead to fast decreasing losses. By contrast, ICSGLD yields fluctuating losses that traverse freely between high energy and low energy regions. As the particles stick in local regions, the penalty of re-visiting these zones keeps increasing until a negative learning rate is injected to encourage explorations. + +![](images/5cab99ac0c088e33ef85765918844a527e80f2f5b3187ff21a3f4f971d8750a9.jpg) +(a) Training Loss + +![](images/55e3ff531886d7d8a96ec4273ebcc7c9f7c3da0c35a69835d6960f754ea840e3.jpg) +(b) SGD + +![](images/ba1d62c6434079605f2d9897d17f0b73d5852b9bc97356cad3bad0766e0778a9.jpg) +(c) SGLD + +![](images/dde13eb7224884a6ac3eb7059fd2c2844dec4c071ed92d134f49f2ace9bedca8.jpg) +(d) ICSGLD +Figure 2: Visualization of mode exploration on a MNIST example based on different algorithms. + +We conducted a singular value decomposition (SVD) based on the first two coordinates to visualize the trajectories: We first choose a domain that includes all the coordinates, then we recover the parameter based on the grid point and truncated values in other dimensions, and finally we fine-tune the parameters and present the approximate losses of the trajectories in Figure 2(b-d). We see SGD trajectories get stuck in a local region; SGLD exploits a larger region but is still quite limited in the exploration; ICSGLD, instead, first converges to a local region and then escapes it once it overvisits this region. This shows the strength of ICSGLD in the simulations of complex multi-modal distributions. More experimental details are presented in section D.1 of the supplementary material. + +# 5.2 SIMULATIONS OF MULTI-MODAL DISTRIBUTIONS + +This section shows the acceleration effect of ICSGLD via a group of simulation experiments for a multi-modal distribution. The baselines include popular Monte Carlo methods such as CSGLD, SGLD, cyclical SGLD (cycSGLD), replica exchange SGLD (reSGLD), and the particle-based SVGD. + +The target multi-modal density is presented in Figure 3(a). Figure 3(b-g) displays the empirical performance of all the testing methods: the vanilla SGLD with 5 parallel chains ( $\times$ P5) undoubtedly + +performs the worst in this example and fails to quantify the weights of each mode correctly; the single-chain cycSGLD with 5 times of iterations $(\times \mathrm{T}5)$ improves the performance but is still not accurate enough; reSGLD $(\times \mathrm{P}5)$ and SVGD $(\times \mathrm{P}5)$ have good performances, while the latter is quite costly in computations; ICSGLD $(\times \mathrm{P}5)$ does not only traverse freely over the rugged energy landscape, but also yields the most accurate approximation to the ground truth distribution. By contrast, CSGLD $(\times \mathrm{T}5)$ performs worse than ICSGLD and overestimates the weights on the left side. For the detailed setups, the study of convergence speed, and runtime analysis, we refer interested readers to section D.2 in the supplementary material. + +![](images/723ac777dbefea21db7ea55af2a20b9828e7705e9c79849d0d54e7ab0724ffe2.jpg) +(a) Truth + +![](images/43b3aa24f9cdcc4ecbe39a0a6a6682d4b7e97ae4a088d965254f8595971c8340.jpg) +(b) SGLD +(c) cycSGLD + +![](images/995f693a0b9bb4961da875a2f11049432dbb50fd403b7d63cd4807105dc4aa6a.jpg) +Figure 3: Empirical behavior on a simulation dataset. Figure 3(c) and 3(f) show the simulation based on a single chain with 5 times of iterations ( $\times$ T5) and the others run 5 parallel chains ( $\times$ P5). + +![](images/dcf6a18567016f82c567f79adb1081cf2be06b0301767c56b3cd3968aeece2f8.jpg) +(d) SVGD + +![](images/0ff29e56a67689b94496737e4b40f4b1512b99cb0c8fc6fc8440fb451a228f78.jpg) +(e) reSGLD + +![](images/d4e58b587413cb2b291c9210f3779fb460d072aaa016d7e3cfa34368b9041ef6.jpg) +(f) CSGLD + +![](images/ec63630587e44fb3a93f3f62a60c72fcc0200d50ccffee473a59fba5e712816b.jpg) +(g) ICSGLD + +# 5.3 DEEP CONTEXTUAL BANDITS ON MUSHROOM TASKS + +This section evaluates ICSGLD on the contextual bandit problem based on the UCI Mushroom data set as in Riquelme et al. (2018). The mushrooms are assumed to arrive sequentially and the agent needs to take an action at each time step based on past feedbacks. Our goal is to minimize the cumulative regret that measures the difference between the cumulative reward obtained by the proposed policy and optimal policy. We evaluate Thompson Sampling (TS) based on a variety of approximate inference methods for posterior sampling. We choose one $\epsilon$ -greedy policy (EpsGreedy) based on the RMSProp optimizer with a decaying learning rate (Riquelme et al., 2018) as a baseline. Two variational methods, namely stochastic gradient descent with a constant learning rate (ConstSGD) (Mandt et al., 2017) and Monte Carlo Dropout (Dropout) (Gal & Ghahramani, 2016) are compared to approximate the posterior distribution. For the sampling algorithms, we include preconditioned SGLD (pSGLD) (Li et al., 2016), preconditioned CSGLD (pCSGLD) (Deng et al., 2020b), and preconditioned ICSGLD (pICSGLD). Note that all the algorithms run 4 parallel chains with average outputs ( $\times$ P4) except that pCSGLD runs a single-chain with 4 times of computational budget ( $\times$ T4). For more details, we refer readers to section D.3 in the supplementary material. + +Figure 4 shows that $\mathrm{EpsGreedy} \times \mathrm{P4}$ tends to explore too much for a long horizon as expected; ConstSGD $\times$ P4 and Dropout $\times$ P4 perform poorly in the beginning but eventually outperform $\mathrm{EpsGreedy} \times \mathrm{P4}$ due to the inclusion of uncertainty for exploration, whereas the uncertainty seems to be inadequate due to the nature of variational inference. By contrast, pSGLD $\times$ P4 significantly + +outperforms the variational methods by considering preconditioners within an exact sampling framework (SGLD). As a unique algorithm that runs in a single-chain manner, pCSGLD $\times$ T4 leads to the worst performance due to the inefficiency in learning the self-adapting parameters, fortunately, pCSGLD $\times$ T4 slightly outperform pSGLD $\times$ P4 in the later phase with the help of the well-estimated self-adapting parameters. Nevertheless, pICSGLD $\times$ P4 propose to optimize the shared self-adapting parameters at the same time, which in turn greatly contributes to the simulation of the posterior. As a result, pICSGLD $\times$ P4 consistently shows the lowest regret excluding the very early period. This shows the great superiority of the interaction mechanism in learning the self-adapting parameters for accelerating the simulations. + +![](images/0840c477f8f62d95ab5830b131da01296d5d17920fc96d609f6d4d19a7177254.jpg) +Figure 4: Cumulative regret on the mushroom task. + +# 5.4 UNCERTAINTY ESTIMATION + +This section evaluates the quality of our algorithm in uncertainty quantification. For model architectures, we use residual networks (ResNet) (He et al., 2016) and a wide ResNet (WRN) (Zagoruyko & Komodakis, 2016); we choose 20, 32, and 56-layer ResNets (denoted by ResNet20, et al.) and a WRN-16-8 network, a 16-layer WRN that is 8 times wider than ResNet16. We train the models on + +CIFAR100, and report the test accuracy (ACC) and test negative log-likelihood (NLL) based on 5 trials with standard error. For the out-of-distribution prediction performance, we test the well-trained models in Brier scores (Brier) * on the Street View House Numbers dataset (SVHN). + +Due to the wide adoption of momentum stochastic gradient descent (M-SGD), we use stochastic gradient Hamiltonian Monte Carlo (SGHMC) (Chen et al., 2014) as the baseline sampling algorithm and denote the interacting contour SGHMC by ICSHMC. In addition, we include several high performing baselines, such as SGHMC with cyclical learning rates (cycSGHMC) (Zhang et al., 2020b), SWAG based on cyclic learning rates of 10 cycles (cycSWAG) (Maddox et al., 2019) and variance-reduced replica exchange SGHMC (reSGHMC) (Deng et al., 2021a). For a fair comparison, ICSGLD also conducts variance reduction on the energy function to alleviate the bias. Moreover, a large $\zeta = 3\times 10^{6}$ is selected, which only induces mild gradient multipliers ranging from $-1$ to 2 to penalize over-visited partitions. We don't include SVGD (Liu & Wang, 2016) and SPOS (Zhang et al., 2020a) for scalability reasons. A batch size of 256 is selected. We run 4 parallel processes ( $\times \mathrm{P4}$ ) with 500 epochs for M-SGD, reSGHMC and ICSGHMC and run cycSGHMC and cycSWAG 2000 epochs ( $\times \mathrm{T4}$ ) based on a single process with 10 cycles. Refer to section D.4 of the supplementary material for the detailed settings. + +TABLE 1: UNCERTAINTY ESTIMATIONS ON CIFAR100 AND SVHN. + +
MODELResNet20ResNet32
ACC (%)NLLBrier (%)ACC (%)NLLBrier (%)
cycSGHMC×T475.41±0.108437±302.91±0.1377.93±0.177658±193.29±0.13
cycSWAG×T475.46±0.118419±262.78±0.1277.91±0.157656±223.19±0.14
M-SGD×P476.01±0.128175±252.58±0.0878.41±0.127501±232.77±0.15
reSGHMC×P476.15±0.168196±272.73±0.1078.57±0.077454±153.04±0.09
ICSGHMC×P476.34±0.158076±312.54±0.1478.72±0.167406±292.76±0.15
MODELResNet56WRN-16-8
ACC (%)NLLBrier (%)ACC (%)NLLBrier (%)
cycSGHMC×T481.23±0.196770±593.18±0.0882.98±0.036384±112.17±0.05
cycSWAG×T481.14±0.116744±553.06±0.0983.05±0.046359±142.04±0.07
M-SGD×P481.03±0.146847±222.86±0.0882.57±0.076821±211.77±0.06
reSGHMC×P481.11±0.166915±402.92±0.1282.72±0.086452±191.92±0.04
ICSGHMC×P481.51±0.186630±382.88±0.0983.12±0.106338±361.83±0.06
+ +Table 1 shows that the vanilla ensemble results via M-SGD×P4 surprisingly outperform cycSGHMC×T4 and cycSWAG×T4 on medium models, such as ResNet20 and ResNet32, and show very good performance on the out-of-distribution samples in Brier scores. We suspect that the parallel implementation (×P4) provides isolated initializations with less correlated samples; by contrast, cycSGHMC×T4 and cycSWAG×T4 explore the energy landscape contiguously, implying a risk to stay near the original region. reSGHMC×P4 shows a remarkable performance overall, but demonstrates a large variance occasionally; this indicates the insufficiency of the swaps when multiple processes are included. When it comes to testing WRN-16-8, cycSWAG×T4 shows a marvelous result and a large improvement compared to the other baselines. We conjecture that cycSWAG is more independent of hyperparameter tuning, thus leading to better performance in larger models. We don't report CSGHMC×P4 since it becomes quite unstable during the training of ResNet56 and WRN-16-8 models and causes mediocre results. As to ICSGHMC×P4, it consistently performs remarkable in both ACC and NLL and performs comparable to M-SGD×P4 in Brier scores. + +Code is available at github.com/WayneDW/Interacting-Contour-Stochastic-Gradient-Langevin-Dynamics. + +# 6 CONCLUSION + +We have proposed the ICSGLD as an efficient algorithm for sampling from distributions with a complex energy landscape, and shown theoretically that ICSGLD is indeed more efficient than the single-chain CSGLD for a slowly decreasing step size. To our best knowledge, this is the first interacting importance sampling algorithm that adapts to big data problems without scalability concerns. ICSGLD has been compared with numerous state-of-the-art baselines for various tasks, whose remarkable results indicate its promising future in big data applications. + +# ACKNOWLEDGMENT + +Liang's research was supported in part by the grants DMS-2015498, R01-GM117597 and R01-GM126089. Lin acknowledges the support from NSF (DMS-1555072, DMS-2053746, and DMS-2134209), BNL Subcontract 382247, and DE-SC0021142. + +# REFERENCES + +Sungjin Ahn, Anoop Korattikara, and Max Welling. Bayesian Posterior Sampling via Stochastic Gradient Fisher Scoring. In Proc. of the International Conference on Machine Learning (ICML), 2012. +Sungjin Ahn, Babak Shahbaba, and Max Welling. Distributed Stochastic Gradient MCMC. In Proc. of the International Conference on Machine Learning (ICML), 2014. +Laurence Aitchison. A Statistical Theory of Cold Posteriors in Deep Neural Networks. In Proc. of the International Conference on Learning Representation (ICLR), 2021. +C. Andrieu, E. Moulines, and P. Priouret. Stability of Stochastic Approximation under Verifiable Conditions. SIAM J. Control Optim., 44(1):283-312, 2005. +Christophe Andrieu, Arnaud Doucet, and Roman Holenstein. Particle Markov Chain Monte Carlo Methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(3), 2010. +Albert Benveniste, Michael Métivier, and Pierre Priouret. Adaptive Algorithms and Stochastic Approximations. Berlin: Springer, 1990. +Elmar Bittner, Andreas Nussbaumer, and Wolfhard Janke. Make Life Simple: Unleash the Full Power of the Parallel Tempering Algorithm. Physical Review Letters, 101:130603-130603, 2008. +Changyou Chen, Nan Ding, and Lawrence Carin. On the Convergence of Stochastic Gradient MCMC Algorithms with High-order Integrators. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2278-2286, 2015. +Changyou Chen, Nan Ding, Chunyuan Li, Yizhe Zhang, and Lawrence Carin. Stochastic Gradient MCMC with Stale Gradients. In Advances in Neural Information Processing Systems (NeurIPS), 2016. +Tianqi Chen, Emily B. Fox, and Carlos Guestrin. Stochastic Gradient Hamiltonian Monte Carlo. In Proc. of the International Conference on Machine Learning (ICML), 2014. +Wei Deng, Qi Feng, Liyao Gao, Faming Liang, and Guang Lin. Non-Convex Learning via Replica Exchange Stochastic Gradient MCMC. In Proc. of the International Conference on Machine Learning (ICML), 2020a. +Wei Deng, Guang Lin, and Faming Liang. A Contour Stochastic Gradient Langevin Dynamics Algorithm for Simulations of Multi-modal Distributions. In Advances in Neural Information Processing Systems (NeurIPS), 2020b. +Wei Deng, Qi Feng, Georgios Karagiannis, Guang Lin, and Faming Liang. Accelerating Convergence of Replica Exchange Stochastic Gradient MCMC via Variance Reduction. In Proc. of the International Conference on Learning Representation (ICLR), 2021a. +Wei Deng, Yi-An Ma, Zhao Song, Qian Zhang, and Guang Lin. On Convergence of Federated Averaging Langevin Dynamics. arXiv:2112.05120v1, 2021b. +Nan Ding, Youhan Fang, Ryan Babbush, Changyou Chen, Robert D. Skeel, and Hartmut Neven. Bayesian Sampling using Stochastic Gradient Thermostats. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3203-3211, 2014. +Arnaud Doucet, Nando de Freitas, and Neil Gordon. *Sequential Monte Carlo Methods in Practice*. Springer Science & Business Media, 2001. + +Alain Durmus and Éric Moulines. Non-asymptotic Convergence Analysis for the Unadjusted Langevin Algorithm. Annals of Applied Probability, 27:1551-1587, 2017. +David J. Earl and Michael W. Deem. Parallel Tempering: Theory, Applications, and New Perspectives. Phys. Chem. Chem. Phys., 7:3910-3916, 2005. +Murat A Erdogdu, Lester Mackey, and Ohad Shamir. Global Non-convex Optimization with Discretized Diffusions. In Advances in Neural Information Processing Systems (NeurIPS), 2018. +G. Fort, E. Moulines, and P. Priouret. Convergence of Adaptive and Interacting Markov Chain Monte Carlo Algorithms. Annals of Statistics, 39:3262-3289, 2011. +G. Fort, B. Jourdain, E. Kuhn, T. Lelievre, and G. Stoltz. Convergence of the Wang-Landau Algorithm. Math. Comput., 84(295):2297-2327, 2015. +Futoshi Futami, Issei Sato, and Masashi Sugiyama. Accelerating the Diffusion-based Ensemble Sampling by Non-reversible Dynamics. In Proc. of the International Conference on Machine Learning (ICML), 2020. +Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning. In Proc. of the International Conference on Machine Learning (ICML), 2016. +Charles J. Geyer. Markov Chain Monte Carlo Maximum Likelihood. Computing Science and Statistics: Proceedings of the 23rd Symposium on the Interfac, pp. 156-163, 1991. +Neil J Gordon, David J Salmond, and Adrian FM Smith. Novel Approach to Nonlinear/Non-Gaussian Bayesian State Estimation. IEEE Proceedings F (Radar and Signal Processing), 140(2), 1993. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. +Pavel Izmailov, Dmitry Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging Weights Leads to Wider Optima and Better Generalization. In Proc. of the Conference on Uncertainty in Artificial Intelligence (UAI), 2018. +K. Jarrett, K. Kavukcuoglu, M. Ranzato, and Y. LeCun. What is the Best Multi-stage Architecture for Object Recognition? In Proc. of the International Conference on Computer Vision (ICCV), pp. 2146-2153, September 2009. +Helmut G Katzgraber, Simon Trebst, David A Huse, and Matthias Troyer. Feedback-Optimized Parallel Tempering Monte Carlo. Journal of Statistical Mechanics: Theory and Experiment, pp. p. P03018, 2008. +Chunyuan Li, Changyou Chen, David Carlson, and Lawrence Carin. Preconditioned Stochastic Gradient Langevin Dynamics for Deep Neural Networks. In Proc. of the National Conference on Artificial Intelligence (AAAI), pp. 1788-1794, 2016. +Chunyuan Li, Changyou Chen, Yunchen Pu, Ricardo Henao, and Lawrence Carin. Communication-Efficient Stochastic Gradient MCMC for Neural Networks. In Proc. of the National Conference on Artificial Intelligence (AAAI), 2019a. +Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, and Zhihua Zhang. On the Convergence of FedAvg on Non-IID Data. In Proc. of the International Conference on Learning Representation (ICLR), 2020. +Xuechen Li, Denny Wu, Lester Mackey, and Murat A. Erdogdu. Stochastic Runge-Kutta Accelerates Langevin Monte Carlo and Beyond. In Advances in Neural Information Processing Systems (NeurIPS), pp. 7746-7758, 2019b. +Faming Liang, Chuanhai Liu, and Raymond J. Carroll. Stochastic Approximation in Monte Carlo Computation. Journal of the American Statistical Association, 102:305-320, 2007. +Qiang Liu and Dilin Wang. Stein Variational Gradient Descent: A General Purpose Bayesian Inference Algorithm. In Advances in Neural Information Processing Systems (NeurIPS), 2016. + +Wesley Maddox, Timur Garipov, Pavel Izmailov, Dmitry Vetrov, and Andrew Gordon Wilson. A Simple Baseline for Bayesian Uncertainty in Deep Learning. In Advances in Neural Information Processing Systems (NeurIPS), 2019. +Stephan Mandt, Matthew D. Hoffman, and David M. Blei. Stochastic Gradient Descent as Approximate Bayesian Inference. Journal of Machine Learning Research, 18:1-35, 2017. +J.C. Mattingly, A.M. Stuartb, and D.J. Highamc. Ergodicity for SDEs and Approximations: Locally Lipschitz Vector Fields and Degenerate Noise. Stochastic Processes and their Applications, 101: 185-232, 2002. +Jonathan C. Mattingly, Andrew M. Stuart, and M.V. Tretyakov. Convergence of Numerical Time-Averaging and Stationary Measures via Poisson Equations. SIAM Journal on Numerical Analysis, 48:552-577, 2010. +Mariane Pelletier. Weak Convergence Rates for Stochastic Approximation with Application to Multiple Targets and Simulated Annealing. Annals of Applied Probability, 8:10-44, 1998. +Maxim Raginsky, Alexander Rakhlin, and Matus Telgarsky. Non-convex Learning via Stochastic Gradient Langevin Dynamics: a Nonasymptotic Analysis. In Proc. of Conference on Learning Theory (COLT), June 2017. +Tom Rainforth, Christian A. Naesseth, Fredrik Lindsten, Brooks Paige, Jan-Willem van de Meent, Arnaud Doucet, and Frank Wood. Interacting Particle Markov Chain Monte Carlo. In Proc. of the International Conference on Machine Learning (ICML), 2016. +Carlos Riquelme, George Tucker, and Jasper Snoek. Deep Bayesian Bandits Showdown. In Proc. of the International Conference on Learning Representation (ICLR), 2018. +Herbert Robbins and Sutton Monro. A Stochastic Approximation Method. Annals of Mathematical Statistics, 22:400-407, 1951. +Gareth O. Roberts and Richard L. Tweedie. Exponential Convergence of Langevin Distributions and Their Discrete Approximations. Bernoulli, 2(4):341-363, 1996. +Issei Sato and Hiroshi Nakagawa. Approximation Analysis of Stochastic Gradient Langevin Dynamics by Using Fokker-Planck Equation and Ito Process. In Proc. of the International Conference on Machine Learning (ICML), 2014. +Qifan Song, Mingqi Wu, and Faming Liang. Weak Convergence Rates of Population versus Single-Chain Stochastic Approximation MCMC Algorithms. Advances in Applied Probability, 46: 1059-1083, 2014. +Robert H. Swendsen and Jian-Sheng Wang. Replica Monte Carlo Simulation of Spin-Glasses. Physical Review Letters, 57:2607-2609, 1986. +Saifuddin Syed, Alexandre Bouchard-Côté, George Deligiannidis, and Arnaud Doucet. Non-Reversible Parallel Tempering: a Scalable Highly Parallel MCMC scheme. Journal of Royal Statistical Society, Series B, 2021. +Yee Whye Teh, Alexandre Thiery, and Sebastian Vollmer. Consistency and Fluctuations for Stochastic Gradient Langevin Dynamics. Journal of Machine Learning Research, 17:1-33, 2016. +Eric Vanden-Eijnden. Introduction to Regular Perturbation Theory. Slides, 2001. URL https://cims.nyu.edu/~eve2/reg_pert.pdf. +Sebastian J. Vollmer, Konstantinos C. Zygalakis, and Yee Whye Teh. Exploration of the (Non-) Asymptotic Bias and Variance of Stochastic Gradient Langevin Dynamics. Journal of Machine Learning Research, 17(159):1-48, 2016. +Fugao Wang and David P. Landau. Efficient, Multiple-range Random Walk Algorithm to Calculate the Density of States. Physical Review Letters, 86:2050-3, 2001. +T. Weinhart, A. Singh, and A.R. Thornton. Perturbation Theory & Stability Analysis. Slides, 2010. + +Max Welling and Yee Whye Teh. Bayesian Learning via Stochastic Gradient Langevin Dynamics. In Proc. of the International Conference on Machine Learning (ICML), pp. 681-688, 2011. +Florian Wenzel, Kevin Roth, Bastiaan S. Veeling, Jakub Światkowski, Linh Tran, Stephan Mandt, Jasper Snoek, Tim Salimans, Rodolphe Jenatton, and Sebastian Nowozin. How Good is the Bayes Posterior in Deep Neural Networks Really? In Proc. of the International Conference on Machine Learning (ICML), 2020. +Pan Xu, Jinghui Chen, Difan Zou, and Quanquan Gu. Global Convergence of Langevin Dynamics Based Algorithms for Nonconvex Optimization. In Advances in Neural Information Processing Systems (NeurIPS), 2018. +Sergey Zagoruyko and Nikos Komodakis. Wide Residual Networks. In Proceedings of the British Machine Vision Conference (BMVC), pp. 87.1-87.12, September 2016. +Jianyi Zhang, Ruiyi Zhang, Lawrence Carin, and Changyou Chen. Stochastic Particle-Optimization Sampling and the Non-Asymptotic Convergence Theory. In Proceedings of the International Workshop on Artificial Intelligence and Statistics, 2020a. +Ruqi Zhang, Chunyuan Li, Jianyi Zhang, Changyou Chen, and Andrew Gordon Wilson. Cyclic Stochastic Gradient MCMC for Bayesian Deep Learning. In Proc. of the International Conference on Learning Representation (ICLR), 2020b. +Yuchen Zhang, Percy Liang, and Moses Charikar. A Hitting Time Analysis of Stochastic Gradient Langevin Dynamics. In Proc. of Conference on Learning Theory (COLT), pp. 1980-2022, 2017. +Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random Erasing Data Augmentation. ArXiv e-prints, 2017. + +We summarize the supplementary material as follows: Section A provides the preliminary knowledge for stochastic approximation; Section B shows a local stability condition that adapts to high losses; Section C proves the main asymptotic normality for the stochastic approximation process, which naturally yields the conclusion that interacting contour stochastic gradient Langevin dynamics (ICSGLD) is more efficient than the analogous single chain based on slowly decreasing step sizes; Section D details the experimental settings. + +# A PRELIMINARIES + +# A.1 STOCHASTIC APPROXIMATION + +Given a random-field function $\widetilde{H} (\pmb {\theta},\mathbf{x})$ , the stochastic approximation algorithm (Benveniste et al., 1990) proposes to solve the mean-field equation $h(\pmb {\theta}) = 0$ in the analysis of adaptive algorithms + +$$ +h (\boldsymbol {\theta}) = \int_ {\mathcal {X}} \widetilde {H} (\boldsymbol {\theta}, \mathbf {x}) \varpi_ {\boldsymbol {\theta}} (d \mathbf {x}) = 0, +$$ + +where $\mathbf{x} \in \mathcal{X} \subset \mathbb{R}^d$ , $\pmb{\theta} \in \Theta \subset \mathbb{R}^m$ , $\varpi_{\pmb{\theta}}(\mathbf{x})$ is a distribution that depends on the self-adapting parameter $\pmb{\theta}$ . Given the transition kernel $\Pi_{\pmb{\theta}}(\pmb{x}, A)$ for any Borel subset $A \subset \mathcal{X}$ , the algorithm can be written as follows + +(1) Simulate $\mathbf{x}_{k + 1}\sim \Pi_{\pmb{\theta}_k}(\mathbf{x}_k,\cdot)$ , which yields the invariant distribution $\varpi_{\pmb{\theta}_k}(\cdot)$ +(2) Optimize $\pmb{\theta}_{k + 1} = \pmb{\theta}_k + \omega_{k + 1}\widetilde{H} (\pmb {\theta}_k,\mathbf{x}_{k + 1})$ + +Compared with the standard Robbins-Monro algorithm (Robbins & Monro, 1951), the algorithm proposes to simulate $\mathbf{x}$ from a transition kernel $\Pi_{\theta}(\cdot ,\cdot)$ instead of the distribution $\varpi_{\theta}(\cdot)$ directly. In other words, $\widetilde{H} (\pmb {\theta}_k,\mathbf{x}_{k + 1}) - h(\pmb {\theta}_k)$ is not a Martingale but rather a Markov state-dependent noise. + +# A.2 POISSON'S EQUATION + +In the stochastic approximation algorithm, the sequence of $\{(\mathbf{x}_k,\pmb {\theta}_k)\}_{k = 1}^{\infty}$ on the product space $\mathcal{X}\times \Theta$ is generated, which is an inhomogeneous Markov chain and requires the tool of the Poisson's equation to study the convergence + +$$ +\mu_ {\boldsymbol {\theta}} (\boldsymbol {x}) - \Pi_ {\boldsymbol {\theta}} \mu_ {\boldsymbol {\theta}} (\boldsymbol {x}) = \widetilde {H} (\boldsymbol {\theta}, \boldsymbol {x}) - h (\boldsymbol {\theta}), +$$ + +where $\mu_{\theta}(\cdot)$ is a function on $\mathcal{X}$ . The solution $\mu_{\theta}(\pmb{x})$ to the Poisson's equation exists and is formulated in the following form when the above series converges: + +$$ +\mu_ {\boldsymbol {\theta}} (\mathbf {x}) := \sum_ {k \geq 0} \Pi_ {\boldsymbol {\theta}} ^ {k} (\widetilde {H} (\boldsymbol {\theta}, \mathbf {x}) - h (\boldsymbol {\theta})), +$$ + +where $\Pi_{\pmb{\theta}}^{k}(\widetilde{H} (\pmb {\theta},\mathbf{x}) - h(\pmb {\theta})) = \int (\widetilde{H} (\pmb {\theta},\mathbf{y}) - h(\pmb {\theta}))\Pi_{\pmb{\theta}}^{k}(\mathbf{x},d\mathbf{y})$ . To ensure such a convergence, Benveniste et al. (1990) made the following regularity conditions on the solution $\mu_{\pmb{\theta}}(\cdot)$ of the Poisson's equation: + +There exist a Lyapunov function $V:\mathcal{X}\to [1,\infty)$ and a positive constant $C > 0$ such that $\forall \pmb {\theta},\pmb{\theta}^{\prime}\in \Theta$ we have + +$$ +\| \Pi_ {\boldsymbol {\theta}} \mu_ {\boldsymbol {\theta}} (\mathbf {x}) \| \leq C V (\mathbf {x}), \quad \| \Pi_ {\boldsymbol {\theta}} \mu_ {\boldsymbol {\theta}} (\mathbf {x}) - \Pi_ {\boldsymbol {\theta} ^ {\prime}} \mu_ {\boldsymbol {\theta} ^ {\prime}} (\mathbf {x}) \| \leq C \| \boldsymbol {\theta} - \boldsymbol {\theta} ^ {\prime} \| V (\mathbf {x}), \quad \mathbb {E} [ V (\mathbf {x}) ] \leq \infty , \tag {12} +$$ + +where a common choice for the Lyapunov function is to set $V(\mathbf{x}) = 1 + \| \mathbf{x} \|^2$ (Teh et al., 2016; Vollmer et al., 2016). + +# A.3 GAUSSIAN DIFFUSIONS + +Consider a stochastic linear differential equation + +$$ +d \boldsymbol {U} _ {t} = h _ {\boldsymbol {\theta}} \left(\boldsymbol {\theta} _ {t}\right) \boldsymbol {U} _ {t} d t + \boldsymbol {R} ^ {1 / 2} \left(\boldsymbol {\theta} _ {t}\right) d \boldsymbol {W} _ {t}, \tag {13} +$$ + +where $\mathbf{U}$ is a $m$ -dimensional random vector, $h_{\pmb{\theta}} := \frac{d}{d\pmb{\theta}} h(\pmb{\theta})$ , $\mathbf{R}(\pmb{\theta}) := \sum_{k = -\infty}^{\infty} \operatorname{Cov}_{\pmb{\theta}}(H(\pmb{\theta}, \mathbf{x}_k), H(\pmb{\theta}, \mathbf{x}_0))$ is a positive definite matrix that depends on $\pmb{\theta}(\cdot)$ , $\mathbf{W} \in \mathbb{R}^m$ + +is a standard Brownian motion. Given a large enough $t$ such that $\theta_t$ converges to a fixed point $\widehat{\theta}_{\star}$ sufficiently fast, we may write the diffusion associated with Eq.(13) as follow + +$$ +\boldsymbol {U} _ {t} \approx e ^ {- t h _ {\boldsymbol {\theta}} (\widehat {\boldsymbol {\theta}} _ {\star})} \boldsymbol {U} _ {0} + \int_ {0} ^ {t} e ^ {- (t - s) h _ {\boldsymbol {\theta}} (\widehat {\boldsymbol {\theta}} _ {\star})} \circ \boldsymbol {R} (\widehat {\boldsymbol {\theta}} _ {\star}) d \boldsymbol {W} _ {s}, \tag {14} +$$ + +Suppose that the matrix $h_{\pmb{\theta}}(\widehat{\pmb{\theta}}_{\star})$ is negative definite, then $U_{t}$ converges in distribution to a Gaussian variable + +$$ +\mathbb {E} \left[ \boldsymbol {U} _ {t} \right] = e ^ {- t h _ {\boldsymbol {\theta}} \left(\widehat {\boldsymbol {\theta}} _ {\star}\right)} \boldsymbol {U} _ {0} +$$ + +$$ +\operatorname {V a r} \left(\boldsymbol {U} _ {t}\right) = \int_ {0} ^ {t} e ^ {t h _ {\theta} \left(\widehat {\boldsymbol {\theta}} _ {\star}\right)} \circ \boldsymbol {R} \circ e ^ {t h _ {\theta} \left(\widehat {\boldsymbol {\theta}} _ {\star}\right)} d u. +$$ + +The main goal of this supplementary file is to study the Gaussian approximation of the process $\omega_{k}^{-1 / 2}(\pmb{\theta}_{k} - \widehat{\pmb{\theta}}_{\star})$ to the solution Eq.(14) for a proper step size $\omega_{k}$ . Thereafter, the advantage of interacting mechanisms can be naturally derived. + +# B STABILITY AND CONVERGENCE ANALYSIS + +As required by the algorithm, we update $P$ contour stochastic gradient Langevin dynamics (CSGLD) simultaneously. For the notations, we denote the particle of the p-th chain at iteration $k$ by $\mathbf{x}_k^{(p)}\in \mathcal{X}\subset \mathbb{R}^d$ and the joint state of the $P$ parallel particles at iteration $k$ by $\mathbf{x}_k^{\otimes P}:= \left(\mathbf{x}_k^{(1)},\mathbf{x}_k^{(2)},\dots ,\mathbf{x}_k^{(P)}\right)^{\top}\in \mathcal{X}^{\otimes P}\subset \mathbb{R}^{dP}$ . We also denote the learning rate and step size at iteration $k$ by $\epsilon_{k}$ and $\omega_{k}$ , respectively. We denote by $\mathcal{N}(0,I_{dP})$ a standard $dP$ -dimensional Gaussian vector and denote by $\zeta$ a positive hyperparameter. + +# B.1 ICSGLD ALGORITHM + +First, we introduce the interacting contour stochastic gradient Langevin dynamics (ICSGLD) with $P$ parallel chains: + +(1) Simulate $\mathbf{x}_{k + 1}^{\otimes P} = \mathbf{x}_k^{\otimes P} - \epsilon_k\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x}_k^{\otimes P},\pmb {\theta}_k) + \mathcal{N}(0,2\epsilon_k\tau \pmb{I}_{dP})$ (S1) +(2) Optimize $\pmb{\theta}_{k + 1} = \pmb{\theta}_k + \omega_{k + 1}\widetilde{\pmb{H}} (\pmb {\theta}_k,\mathbf{x}_{k + 1}^{\otimes P})$ (S2) + +where $\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x}^{\otimes P},\pmb {\theta})\coloneqq \left(\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x}^{(1)},\pmb {\theta}),\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x}^{(2)},\pmb {\theta}),\dots ,\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x}^{(P)},\pmb {\theta})\right)^{\top}$ , $\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x},\pmb {\theta})$ is the stochastic adaptive gradient given by + +$$ +\nabla_ {\mathbf {x}} \widetilde {L} (\mathbf {x}, \boldsymbol {\theta}) = \frac {N}{n} \underbrace {\left[ 1 + \frac {\zeta \tau}{\Delta u} \left(\log \theta \left(J _ {\widetilde {U}} (\mathbf {x})\right) - \log \theta \left(\left(J _ {\widetilde {U}} (\mathbf {x}) - 1\right) \vee 1\right)\right) \right]} _ {\text {g r a d i e n t m u l t i p l i e r}} \nabla_ {\mathbf {x}} \widetilde {U} (\mathbf {x}). \tag {15} +$$ + +In particular, the interacting random-field function is written as + +$$ +\widetilde {\boldsymbol {H}} \left(\boldsymbol {\theta} _ {k}, \mathbf {x} _ {k + 1} ^ {\otimes P}\right) = \frac {1}{P} \sum_ {p = 1} ^ {P} \widetilde {H} \left(\boldsymbol {\theta} _ {k}, \mathbf {x} _ {k + 1} ^ {(p)}\right), \tag {16} +$$ + +where each random-field function $\widetilde{H} (\pmb {\theta},\mathbf{x}) = (\widetilde{H}_1(\pmb {\theta},\mathbf{x}),\dots ,\widetilde{H}_m(\pmb {\theta},\mathbf{x}))$ follows + +$$ +\widetilde {H} _ {i} (\boldsymbol {\theta}, \mathbf {x}) = \theta \left(J _ {\widetilde {U}} (\mathbf {x})\right) \left(1 _ {i = J _ {\widetilde {U}} (\mathbf {x})} - \theta (i)\right), \quad i = 1, 2, \dots , m. \tag {17} +$$ + +Here $J_{\widetilde{U}}(\mathbf{x})$ denotes the index $i \in \{1, 2, 3, \dots, m\}$ such that $u_{i-1} < \frac{N}{n} \widetilde{U}(\mathbf{x}) \leq u_i$ for a set of energy partitions $\{u_i\}_{i=0}^m$ and $\widetilde{U}(\mathbf{x}) = \sum_{i \in B} U_i(\mathbf{x})$ where $U_i$ denotes the negative log of a posterior based on a single data point $i$ and $B$ denotes a mini-batch of data of size $n$ . Note that the stochastic + +energy estimator $\widetilde{U} (\mathbf{x})$ results in a biased estimation for the partition index $J_{\widetilde{U}}(\mathbf{x})$ due to a non-linear transformation. To avoid such a bias asymptotically with respect to the learning rate $\epsilon_{k}$ , we may consider a variance-reduced energy estimator $\widetilde{U}_{\mathrm{VR}}(\mathbf{x})$ following Deng et al. (2021a) + +$$ +\frac {N}{n} \widetilde {U} _ {\mathrm {V R}} (\mathbf {x}) = \frac {N}{n} \sum_ {i \in B _ {k}} \left(U _ {i} (\mathbf {x}) - U _ {i} \left(\mathbf {x} _ {q \lfloor \frac {k}{q} \rfloor}\right)\right) + \sum_ {i = 1} ^ {N} U _ {i} \left(\mathbf {x} _ {q \lfloor \frac {k}{q} \rfloor}\right), \tag {18} +$$ + +where the control variate $\mathbf{x}_{q\lfloor \frac{k}{q}\rfloor}$ is updated every $q$ iterations. + +Compared with the naive parallelism of CSGLD, a key feature of the ICSGLD algorithm lies in the joint estimation of the interacting random-field function $\widetilde{H} (\pmb {\theta},\mathbf{x}^{\otimes P})$ in Eq.(16) for the same mean-field function $h(\pmb {\theta})$ . + +# B.1.1 DISCUSSIONS ON THE HYPERPARAMETERS + +The most important hyperparameter is $\zeta$ . A fine-tuned $\zeta$ usually leads to a small or even slightly negative learning rate in low energy regions to avoid local-trap problems. Theoretically, $\zeta$ affects the $L^2$ convergence rate hidden in the big-O notation in Lemma 3. + +The other hyperparameters can be easily tuned. For example, the ResNet models yields the full loss ranging from 10,000 to 60,000 after warm-ups, we thus partition the sample space according to the energy into 200 subregions equally without tuning; since the optimization of SA is nearly convex, tuning $\{\omega_k\}$ is much easier than tuning $\{\epsilon_k\}$ for non-convex learning. + +# B.1.2 DISCUSSIONS ON DISTRIBUTED COMPUTING AND COMMUNICATION COST + +In shared-memory settings, the implementation is trivial and the details are omitted. + +In distributed-memory settings: $\theta_{k + 1}$ is updated by the central node as follows: + +- The $p$ -th worker conducts the sampling step $(\mathbf{S}_1)$ and sends the indices $J_{\widetilde{U}(\mathbf{x}_{k+1}^{(p)})}$ 's to the central node; +- The central node aggregates the indices from all worker and updates $\theta_{k}$ based on $(\mathbf{S}_2)$ ; +- The central node sends $\theta_{k + 1}$ back to each worker. + +We emphasize that we don't communicate the model parameters $\mathbf{x} \in \mathbb{R}^d$ , but rather share the self-adapting parameter $\theta \in \mathbb{R}^m$ , where $m \ll d$ . For example, WRN-16-8 has 11 M parameters (40 MB), while $\theta$ can be set to dimension 200 of size 4 KB; hence, the communication cost is not a big issue. Moreover, the theoretical advantage still holds if the communication frequency is slightly reduced. + +# B.1.3 SCALABILITY TO BIG DATA + +Recall that the adaptive sampler follows that + +$$ +\mathbf{x}_{k + 1} = \mathbf{x}_{k} - \epsilon_{k + 1}\frac{N}{n}\underbrace{\left[1 + \zeta\tau\frac{\log\theta_{k}(J_{\widetilde{U}}(\mathbf{x}_{k})) - \log\theta_{k}((J_{\widetilde{U}}(\mathbf{x}_{k}) - 1)\lor 1)}{\Delta u}\right]}_{\text{gradient multiplier}}\nabla_{\mathbf{x}}\widetilde{U} (\mathbf{x}_{k}) + \sqrt{2\tau\epsilon_{k + 1}} w_{k + 1}, +$$ + +The key to the success of (I)CSGLD is to generate sufficiently strong bouncy moves (negative gradient multiplier) to escape local traps. To this end, $\zeta$ can be tuned to generate proper bouncy moves. + +Take the CIFAR100 experiments for example: + +- the self-adjusting mechanism fails if the gradient multiplier uniformly "equals" to 1 and a too small value of $\zeta = 1$ could lead to this issue; +- the self-adjusting mechanism works only if we choose a large enough $\zeta$ such as 3e6 to generate (desired) negative gradient multiplier in over-visited regions. + +However, when we set $\zeta = 3\mathrm{e}6$ , the original stochastic approximation (SA) update proposed in (Deng et al., 2020b) follows that + +$$ +\theta_ {k + 1} (i) = \theta_ {k} (i) + \omega_ {k + 1} \underbrace {\theta_ {k} ^ {\zeta} (J _ {\widetilde {U}} (\mathbf {x} _ {k + 1}))} _ {\text {e s s e n t i a l l y 0 f o r} \zeta \gg 1} \left(1 _ {i = J _ {\widetilde {U}} (\mathbf {x} _ {k + 1})} - \theta_ {k} (i)\right). +$$ + +Since $\theta(i) < 1$ for any $i \in \{1, \dots, m\}$ , $\theta(i)^{\zeta}$ is essentially 0 for such a large $\zeta$ , which means that the original SA fails to optimize when $\zeta$ is large. Therefore, the limited choices of $\zeta$ inevitably limits the scalability to big data problems. Our newly proposed SA scheme + +$$ +\theta_ {k + 1} (i) = \theta_ {k} (i) + \omega_ {k + 1} \underbrace {\theta_ {k} (J _ {\widetilde {U}} (\mathbf {x} _ {k + 1}))} _ {\text {i n d e p e n d e n t o f} \zeta} \Big (1 _ {i = J _ {\widetilde {U}} (\mathbf {x} _ {k + 1})} - \theta_ {k} (i) \Big) +$$ + +is more independent of $\zeta$ and proposes to converge to a much smoother equilibrium $\theta_{\infty}^{1 / \zeta}$ instead of $\theta_{\infty}$ , where $\theta_{\infty}(i) = \int_{\chi_i}\pi (x)dx\propto \int_{\chi_i}e^{-\frac{U(x)}{\tau}}dx$ is the energy PDF. As such, despite the linear stability is sacrificed, the resulting algorithm is more scalable. For example, estimating $e^{-10,000\times \frac{1}{\zeta}}$ is numerically much easier than $e^{-10,000}$ for a large $\zeta$ such as 10,000, where 10,000 can be induced by the high losses in training deep neural networks in big data. + +# B.2 ASSUMPTIONS + +A long-standing problem for stochastic approximation is the difficulty in establishing the stability property and a practical remedy for this problem is to study $\Theta$ on a fixed compact set. + +Assumption A1 (Compactness) The space $\Theta$ is compact and $\inf_{\Theta} \theta(i) > 0$ for any $i \in \{1,2,\ldots,m\}$ . + +For weaker assumptions, we refer readers to Theorem 3.2 (Fort et al., 2015), where a recurrence property can be proved for the Metropolis-based Wang-Landau algorithm, which eventually established that the estimates return to a desired compact set often enough. + +Next, we lay out the smoothness assumption, which is standard in the convergence analysis of SGLD, see e.g. Mattingly et al. (2010), Raginsky et al. (2017) and Xu et al. (2018). + +Assumption A2 (Smoothness) $U(\pmb{x})$ is $M$ -smooth when there exists a positive constant $M$ that satisfies $\forall \mathbf{x}, \mathbf{x}' \in \mathcal{X}$ , + +$$ +\left\| \nabla_ {\mathbf {x}} U (\mathbf {x}) - \nabla_ {\mathbf {x}} U \left(\mathbf {x} ^ {\prime}\right) \right\| \leq M \| \mathbf {x} - \mathbf {x} ^ {\prime} \|. \tag {19} +$$ + +In addition, we assume the dissipativity condition to ensure that the geometric ergodicity of the dynamical system holds. This assumption is also crucial for verifying the solution properties of the solution of Poisson's equation. Similar assumptions have been made in Mattingly et al. (2010); Raginsky et al. (2017) and Xu et al. (2018). + +Assumption A3 (Dissipativity) There exist constants $\tilde{m} > 0$ and $\tilde{b} \geq 0$ that satisfies $\forall \mathbf{x} \in \mathcal{X}$ and any $\theta \in \Theta$ , + +$$ +\left\langle \nabla_ {\mathbf {x}} L (\mathbf {x}, \boldsymbol {\theta}), \mathbf {x} \right\rangle \leq \tilde {b} - \tilde {m} \| \mathbf {x} \| ^ {2}. \tag {20} +$$ + +To further establish a bounded second moment on $\mathbf{x} \in \mathcal{X}$ with respect to a proper Lyapunov function $V(\mathbf{x})$ , we impose the following conditions on the gradient noise: + +Assumption A4 (Gradient noise) The stochastic gradient based on mini-batch settings is an unbiased estimator such that + +$$ +\mathbb {E} \left[ \nabla_ {\mathbf {x}} \widetilde {U} (\mathbf {x} _ {k}) - \nabla_ {\mathbf {x}} U (\mathbf {x} _ {k}) \right] = 0; +$$ + +furthermore, for some positive constants $M$ and $B$ , we have + +$$ +\mathbb {E} [ \| \nabla_ {\mathbf {x}} \tilde {U} (\mathbf {x} _ {k}) - \nabla_ {\mathbf {x}} U (\mathbf {x} _ {k}) \| ^ {2} ] \leq M ^ {2} \| \mathbf {x} \| ^ {2} + B ^ {2}, +$$ + +where $\mathbb{E}[\cdot ]$ acts on the distribution of the noise in the stochastic gradient $\nabla_{\mathbf{x}}\widetilde{U} (\mathbf{x}_k)$ + +# B.3 LOCAL STABILITY VIA THE SCALABLE RANDOM-FIELD FUNCTION + +Now, we are ready to present our first result. Lemma 3 establishes a local stability condition for the non-linear mean-field system of ICSGLD, which implies a potential convergence of $\theta_{k}$ to a unique fixed point that adapts to a wide energy range under mild assumptions. + +Lemma 3 (Local stability, restatement of Lemma 1) Assume Assumptions A1-A4 hold. Given any small enough learning rate $\epsilon$ , a large enough $m$ and batch size $n$ , and any $\pmb{\theta} \in \widetilde{\Theta}$ , where $\widetilde{\Theta}$ is a small neighborhood of $\pmb{\theta}_{\star}$ that contains $\widehat{\pmb{\theta}}_{\star}$ , we have $\langle h(\pmb{\theta}), \pmb{\theta} - \widehat{\pmb{\theta}}_{\star} \rangle \leq -\phi \| \pmb{\theta} - \widehat{\pmb{\theta}}_{\star} \|^2$ , where $\widehat{\pmb{\theta}}_{\star} = \pmb{\theta}_{\star} + \mathcal{O}(\varepsilon)$ , + +$$ +\varepsilon = \mathcal {O} \left(\sup _ {\mathbf {x}} \operatorname {V a r} (\xi_ {n} (\mathbf {x})) + \epsilon + \frac {1}{m}\right) a n d \boldsymbol {\theta} _ {\star} = \left(\frac {\left(\int_ {\mathcal {X} _ {1}} \pi (\mathbf {x}) d \mathbf {x}\right) ^ {\frac {1}{\zeta}}}{\sum_ {k = 1} ^ {m} \left(\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}\right) ^ {\frac {1}{\zeta}}}, \ldots , \frac {\left(\int_ {\mathcal {X} _ {m}} \pi (\mathbf {x}) d \mathbf {x}\right) ^ {\frac {1}{\zeta}}}{\sum_ {k = 1} ^ {m} \left(\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}\right) ^ {\frac {1}{\zeta}}}\right), +$$ + +$\phi = \inf_{\theta} \min_{i} \widehat{Z}_{\zeta, \theta(i)}^{-1}\big(1 - \mathcal{O}(\varepsilon)\big) > 0$ , $\widehat{Z}_{\zeta, \theta(i)}$ is defined below Eq.(28), and $\xi_n(\mathbf{x})$ denotes the noise in the energy estimator $\widetilde{U}(\mathbf{x})$ of batch size $n$ and $\mathrm{Var}(\cdot)$ denotes the variance. + +Proof The random-field function $\widetilde{H}_i(\pmb{\theta},\mathbf{x}) = \theta(J_{\widetilde{U}}(\mathbf{x}))\left(1_{i = J_{\widetilde{U}}(\mathbf{x})} - \theta(i)\right)$ based on the stochastic energy estimator $\widetilde{U}(\mathbf{x})$ yields a biased estimator of $H_i(\pmb{\theta},\mathbf{x}) = \theta(J(\mathbf{x}))\left(1_{i = J(\mathbf{x})} - \theta(i)\right)$ for any $i \in \{1,2,\dots,m\}$ based on the exact energy partition function $J(\cdot)$ . By Lemma 4, we know that the bias caused by the stochastic energy is of order $\mathcal{O}(\mathrm{Var}(\xi_n(\mathbf{x})))$ . + +Now we compute the mean-field function $h(\pmb{\theta})$ based on the measure $\varpi_{\pmb{\theta}}(\mathbf{x})$ simulated from SGLD: + +$$ +\begin{array}{l} h _ {i} (\boldsymbol {\theta}) = \int_ {\mathcal {X}} \widetilde {H} _ {i} (\boldsymbol {\theta}, \mathbf {x}) \varpi_ {\boldsymbol {\theta}} (\mathbf {x}) d \mathbf {x} = \int_ {\mathcal {X}} H _ {i} (\boldsymbol {\theta}, \mathbf {x}) \varpi_ {\boldsymbol {\theta}} (\mathbf {x}) d \mathbf {x} + \mathcal {O} \left(\operatorname {V a r} \left(\xi_ {n} (\mathbf {x})\right)\right) \\ = \int_ {\mathcal {X}} H _ {i} (\boldsymbol {\theta}, \mathbf {x}) \left(\underbrace {\varpi_ {\tilde {\Psi} _ {\boldsymbol {\theta}}} (\mathbf {x})} _ {\mathrm {I} _ {1}} \underbrace {- \varpi_ {\tilde {\Psi} _ {\boldsymbol {\theta}}} (\mathbf {x}) + \varpi_ {\Psi_ {\boldsymbol {\theta}}} (\mathbf {x})} _ {\mathrm {I} _ {2}: \text {p i e c e - w i s e a p p r o x i m a t i o n}} \underbrace {- \varpi_ {\Psi_ {\boldsymbol {\theta}}} (\mathbf {x}) + \varpi_ {\boldsymbol {\theta}} (\mathbf {x})} _ {\mathrm {I} _ {3}: \text {n u m e r i c a l d i s c r e t i z a t i o n}}\right) d \mathbf {x} + \mathcal {O} \left(\operatorname {V a r} \left(\xi_ {n} (\mathbf {x})\right)\right), \tag {21} \\ \end{array} +$$ + +where $\varpi_{\theta}$ is the invariant measure simulated via SGLD that approximates $\varpi_{\Psi_{\theta}}(\mathbf{x})$ . $\varpi_{\Psi_{\theta}}(\mathbf{x})$ and $\varpi_{\widetilde{\Psi}_{\theta}}(\mathbf{x})$ are two invariant measures that follow $\varpi_{\Psi_{\theta}}(\mathbf{x}) \propto \frac{\pi(\mathbf{x})}{\Psi_{\theta}^{\zeta}(U(\mathbf{x}))}$ and $\varpi_{\widetilde{\Psi}_{\theta}}(\mathbf{x}) \propto \frac{\pi(\mathbf{x})}{\widetilde{\Psi}_{\theta}^{\zeta}(U(\mathbf{x}))}$ ; $\Psi_{\theta}(u)$ and $\widetilde{\Psi}_{\theta}(u)$ are piecewise continuous and constant functions, respectively + +$$ +\Psi_ {\boldsymbol {\theta}} (u) = \sum_ {k = 1} ^ {m} \left(\theta (k - 1) e ^ {(\log \theta (k) - \log \theta (k - 1)) \frac {u - u _ {k - 1}}{\Delta u}}\right) 1 _ {u _ {k - 1} < u \leq u _ {k}}; \quad \widetilde {\Psi} _ {\boldsymbol {\theta}} (u) = \sum_ {k = 1} ^ {m} \theta (k) 1 _ {u _ {k - 1} < u \leq u _ {k}}. \tag {22} +$$ + +(i) For the first term $\mathrm{I}_1$ , we have + +$$ +\begin{array}{l} \int_ {\mathcal {X}} H _ {i} (\boldsymbol {\theta}, \mathbf {x}) \varpi_ {\widetilde {\Psi} _ {\boldsymbol {\theta}}} (\mathbf {x}) d \mathbf {x} = \frac {1}{\widetilde {Z} _ {\zeta + 1 , \boldsymbol {\theta}}} \int_ {\mathcal {X}} \theta (J (\mathbf {x})) \left(1 _ {i = J (\mathbf {x})} - \theta (i)\right) \frac {\pi (\mathbf {x})}{\theta^ {\zeta} (J (\mathbf {x}))} d \mathbf {x} \\ = \frac {1}{\widetilde {Z} _ {\zeta + 1 , \theta}} \sum_ {k = 1} ^ {m} \int_ {\mathcal {X} _ {k}} (1 _ {i = k} - \theta (i)) \frac {\pi (\mathbf {x})}{\theta^ {\zeta - 1} (k)} d \mathbf {x} \\ = \frac {1}{\widetilde {Z} _ {\zeta + 1 , \boldsymbol {\theta}}} \left[ \sum_ {k = 1} ^ {m} \int_ {\mathcal {X} _ {k}} \frac {\pi (\mathbf {x})}{\theta^ {\zeta - 1} (k)} 1 _ {k = i} d \mathbf {x} - \theta (i) \sum_ {k = 1} ^ {m} \int_ {\mathcal {X} _ {k}} \frac {\pi (\mathbf {x})}{\theta^ {\zeta - 1} (k)} d \mathbf {x} \right] \tag {23} \\ = \frac {1}{\widetilde {Z} _ {\zeta + 1 , \boldsymbol {\theta}}} \left[ \frac {\int_ {\mathcal {X} _ {i}} \pi (\mathbf {x}) d \mathbf {x}}{\theta^ {\zeta - 1} (i)} - \theta (i) \widetilde {Z} _ {\zeta , \boldsymbol {\theta}} \right], \\ \end{array} +$$ + +where $\widetilde{Z}_{\zeta +1,\theta} = \sum_{k = 1}^{m}\frac{\int_{\mathcal{X}_k}\pi(\mathbf{x})d\mathbf{x}}{\theta^{\zeta}(k)}$ denotes the normalizing constant of $\varpi_{\widetilde{\Psi}_{\theta}}(\mathbf{x})$ + +The solution $\theta_{\star}$ that solves $\frac{\int_{\mathcal{X}_k} \pi(\mathbf{x}) d\mathbf{x}}{\theta^{\zeta - 1}(k)} - \theta(k) \widetilde{Z}_{\zeta, \theta} = 0$ for any $k \in \{1, 2, \dots, m\}$ satisfies $\theta_{\star}(k) = \left( \frac{\int_{\mathcal{X}_k} \pi(\mathbf{x}) d\mathbf{x}}{\widetilde{Z}_{\zeta, \theta_{\star}}} \right)^{\frac{1}{\zeta}}$ . Combining the definition of $\widetilde{Z}_{\zeta, \theta_{\star}} = \sum_{k=1}^{m} \frac{\int_{\mathcal{X}_k} \pi(\mathbf{x}) d\mathbf{x}}{\theta_{\star}^{\zeta - 1}(k)}$ , we have + +$$ +\begin{array}{l} \widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}} = \sum_ {k = 1} ^ {m} \frac {\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}}{\theta_ {\star} ^ {\zeta - 1} (k)} = \sum_ {k = 1} ^ {m} \frac {\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}}{\left(\frac {\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}}{\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}}\right) ^ {\frac {\zeta - 1}{\zeta}}} \\ = \widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}} ^ {\frac {\zeta - 1}{\zeta}} \sum_ {k = 1} ^ {m} \frac {\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}}{\left(\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}\right) ^ {\frac {\zeta - 1}{\zeta}}} = \widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}} ^ {\frac {\zeta - 1}{\zeta}} \sum_ {k = 1} ^ {m} \left(\int_ {\mathcal {X} _ {k}} \pi (\mathbf {x}) d \mathbf {x}\right) ^ {\frac {1}{\zeta}}, \\ \end{array} +$$ + +which leads to $\widetilde{Z}_{\zeta,\theta_{\star}} = \left(\sum_{k=1}^{m}\left(\int_{\mathcal{X}_k}\pi(\mathbf{x})d\mathbf{x}\right)^{\frac{1}{\zeta}}\right)^{\zeta}$ . In other words, the mean-field system without perturbations yields a unique solution $\theta_{\star}(i) = \frac{\left(\int_{\mathcal{X}_i}\pi(\mathbf{x})d\mathbf{x}\right)^{\frac{1}{\zeta}}}{\sum_{k=1}^{m}\left(\int_{\mathcal{X}_k}\pi(\mathbf{x})d\mathbf{x}\right)^{\frac{1}{\zeta}}}$ for any $i \in \{1,2,\dots,m\}$ . + +(ii) For the second term $\mathrm{I}_2$ , we have + +$$ +\int_ {\mathcal {X}} H _ {i} (\boldsymbol {\theta}, \mathbf {x}) \left(- \varpi_ {\widetilde {\Psi} _ {\boldsymbol {\theta}}} (\mathbf {x}) + \varpi_ {\Psi_ {\boldsymbol {\theta}}} (\mathbf {x})\right) d \mathbf {x} = \mathcal {O} \left(\frac {1}{m}\right), \tag {24} +$$ + +where the result follows from the boundedness of $H(\theta, \mathbf{x})$ in (A1) and Lemma B4 (Deng et al., 2020b). + +(iii) For the last term $\mathrm{I}_3$ , following Theorem 6 of Sato & Nakagawa (2014), we have for any fixed $\theta$ + +$$ +\int_ {\mathcal {X}} H _ {i} (\boldsymbol {\theta}, \mathbf {x}) \left(- \varpi_ {\Psi_ {\boldsymbol {\theta}}} (\mathbf {x}) + \varpi_ {\boldsymbol {\theta}} (\mathbf {x})\right) d \mathbf {x} = \mathcal {O} (\epsilon). \tag {25} +$$ + +Plugging Eq.(23), Eq.(24) and Eq.(25) into Eq.(21), we have + +$$ +\begin{array}{l} h _ {i} (\pmb {\theta}) = \widetilde {Z} _ {\zeta + 1, \pmb {\theta}} ^ {- 1} \left[ \varepsilon \tilde {\beta} _ {i} (\pmb {\theta}) + \frac {\int_ {\mathcal {X} _ {i}} \pi (\mathbf {x}) d \mathbf {x}}{\theta^ {\zeta - 1} (i)} - \theta (i) \widetilde {Z} _ {\zeta , \pmb {\theta}} \right] \\ = \widetilde {Z} _ {\zeta + 1, \boldsymbol {\theta}} ^ {- 1} \frac {\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}}{\theta^ {\zeta - 1} (i)} \left[ \varepsilon \widetilde {\beta} _ {i} (\boldsymbol {\theta}) \frac {\theta^ {\zeta - 1} (i)}{\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}} + \frac {\int_ {\mathcal {X} _ {i}} \pi (\mathbf {x}) d \mathbf {x}}{\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}} - \theta^ {\zeta} (i) \frac {\widetilde {Z} _ {\zeta , \boldsymbol {\theta}}}{\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}} \right] \tag {26} \\ = \widetilde {Z} _ {\zeta + 1, \boldsymbol {\theta}} ^ {- 1} \frac {\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}}{\theta^ {\zeta - 1} (i)} \left[ \varepsilon \tilde {\beta} _ {i} (\boldsymbol {\theta}) \frac {\theta^ {\zeta - 1} (i)}{\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}} + \theta_ {\star} ^ {\zeta} (i) - (\theta (i) C _ {\boldsymbol {\theta}}) ^ {\zeta} \right], \\ \end{array} +$$ + +where $\widetilde{\beta}_i(\pmb{\theta})$ is a bounded term such that $\widetilde{Z}_{\zeta + 1,\pmb{\theta}}^{-1}\varepsilon \widetilde{\beta}_i(\pmb{\theta}) = \mathcal{O}\left(\mathrm{Var}(\xi_n(\mathbf{x})) + \epsilon + \frac{1}{m}\right)$ , $\varepsilon = \mathcal{O}\left(\sup_{\mathbf{x}}\mathrm{Var}(\xi_n(\mathbf{x})) + \epsilon + \frac{1}{m}\right)$ and $C_\theta = \left(\frac{\widetilde{Z}_{\zeta,\pmb{\theta}}}{\widetilde{Z}_{\zeta,\pmb{\theta}_\star}}\right)^{\frac{1}{\zeta}}$ . By the definition of $\widetilde{Z}_{\zeta,\pmb{\theta}} = \sum_{k=1}^{m} \frac{\int_{\mathcal{X}_k} \pi(\mathbf{x}) d\mathbf{x}}{\theta^{\zeta-1}(k)}$ , when $\zeta = 1$ , $C_\theta \equiv 1$ for any $\pmb{\theta} \in \Theta$ , which suggests that the stability condition doesn't rely on the initialization of $\pmb{\theta}$ ; however, when $\zeta \neq 1$ , $C_\theta \neq 1$ when $\pmb{\theta} \neq \pmb{\theta}_\star$ , we see that $h_i(\pmb{\theta}) \propto \theta_\star(i)^\zeta - (\theta(i) C_\theta)^\zeta$ + perturbations is a non-linear mean-field system and requires a proper initialization of $\pmb{\theta} \in \widetilde{\Theta}$ . + +For any $\theta \in \widetilde{\Theta} \subset \Theta$ being close enough to $\theta_{\star}$ , there exists a Lipschitz constant $L_{\widetilde{\theta}} = \sup_{i \leq m, \theta \in \widetilde{\Theta}} \frac{|C_{\theta_{\star}} - C_{\theta}|}{|\theta_{\star}(i) - \theta(i)|} < \infty$ . By $C_{\theta_{\star}} = 1$ , $\theta(i) \leq 1$ , and mean value theorem for some $\widetilde{\theta}(i) \in [\theta(i), \theta_{\star}(i)]$ , we have + +$$ +\begin{array}{l} \left| \theta_ {\star} ^ {\zeta} (i) - \left(\theta (i) C _ {\boldsymbol {\theta}}\right) ^ {\zeta} \right| = \zeta (\widetilde {\theta} (i) C _ {\widetilde {\boldsymbol {\theta}}}) ^ {\zeta - 1} \left| \theta_ {\star} (i) - \theta (i) C _ {\boldsymbol {\theta}} \right| \\ = \zeta (\widetilde {\theta} (i) C _ {\widetilde {\boldsymbol {\theta}}}) ^ {\zeta - 1} \left| \theta_ {\star} (i) - \theta (i) + \theta (i) C _ {\boldsymbol {\theta} _ {\star}} - \theta (i) C _ {\boldsymbol {\theta}} \right| \\ \leq \zeta (\widetilde {\theta} (i) C _ {\widetilde {\boldsymbol {\theta}}}) ^ {\zeta - 1} | \theta_ {\star} (i) - \theta (i) | + \theta (i) | C _ {\boldsymbol {\theta} _ {\star}} - C _ {\boldsymbol {\theta}} | \\ \leq \zeta (\widetilde {\theta} (i) C _ {\widetilde {\theta}}) ^ {\zeta - 1} (1 + L _ {\widetilde {\theta}}) | \theta_ {\star} (i) - \theta (i) |, \tag {27} \\ \end{array} +$$ + +Combining Eq.(26) and Eq.(27), we have + +$$ +\begin{array}{l} h _ {i} (\boldsymbol {\theta}) = \widetilde {Z} _ {\zeta + 1, \boldsymbol {\theta}} ^ {- 1} \frac {\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}}{\theta^ {\zeta - 1} (i)} \left[ \varepsilon \tilde {\beta} _ {i} (\boldsymbol {\theta}) \frac {\theta^ {\zeta - 1} (i)}{\widetilde {Z} _ {\zeta , \boldsymbol {\theta} _ {\star}}} + \theta_ {\star} ^ {\zeta} (i) - (\theta (i) C _ {\boldsymbol {\theta}}) ^ {\zeta} \right] \tag {28} \\ = \widehat {Z} _ {\zeta , \theta (i)} ^ {- 1} \left[ \varepsilon \beta_ {i} (\boldsymbol {\theta}) + \theta_ {\star} (i) - \theta (i) \right], \\ \end{array} +$$ + +where $\widehat{Z}_{\zeta,\theta(i)}^{-1} = \frac{\widetilde{Z}_{\zeta+1,\theta}^{-1}\widetilde{Z}_{\zeta,\theta_{\star}}}{\zeta(\widetilde{\theta}(i)C_{\widetilde{\theta}})^{\zeta-1}(1 + L_{\widetilde{\theta}})\theta^{\zeta-1}(i)}$ ; $\beta_i(\pmb{\theta})$ is some bounded term such that $\beta_i(\pmb{\theta}) \leq$ + +$$ +\frac {\tilde {\beta} _ {i} (\pmb {\theta}) \theta^ {\zeta - 1} (i)}{\zeta (\tilde {\theta} (i) C _ {\tilde {\pmb {\theta}}}) ^ {\zeta - 1} (1 + L _ {\tilde {\pmb {\theta}}}) \tilde {Z} _ {\zeta , \pmb {\theta} _ {\star}}}; C _ {\tilde {\pmb {\theta}}} = \left(\frac {\tilde {Z} _ {\zeta , \tilde {\pmb {\theta}}}}{\tilde {Z} _ {\zeta , \pmb {\theta} _ {\star}}}\right) ^ {\frac {1}{\zeta}}; L _ {\tilde {\pmb {\theta}}} = \sup _ {i \leq m, \pmb {\theta} \in \tilde {\Theta}} \frac {| C _ {\pmb {\theta} _ {\star}} - C _ {\pmb {\theta}} |}{| \theta_ {\star} (i) - \theta (i) |} < \infty . +$$ + +Next, we apply the perturbation theory to solve the ODE system with small disturbances (Weinhart et al., 2010) and obtain the equilibrium $\widehat{\theta}_{\star}$ , + +where $\varepsilon \beta (\widehat{\pmb{\theta}}_{\star}) + \pmb{\theta}_{\star} - \widehat{\pmb{\theta}}_{\star} = 0$ to the mean-field equation $h_i(\pmb {\theta})$ such that + +$$ +\begin{array}{l} h _ {i} (\boldsymbol {\theta}) = \widehat {Z} _ {\zeta , \theta (i)} ^ {- 1} \left[ \varepsilon \beta_ {i} (\boldsymbol {\theta}) + \theta_ {\star} (i) - \theta (i) \right] \\ = \widehat {Z} _ {\zeta , \theta (i)} ^ {- 1} \left[ \varepsilon \beta_ {i} (\theta) - \varepsilon \beta_ {i} \left(\widehat {\theta} _ {\star}\right) + \varepsilon \beta_ {i} \left(\widehat {\theta} _ {\star}\right) + \theta_ {\star} (i) - \theta (i) \right] \tag {29} \\ = \widehat {Z} _ {\zeta , \theta (i)} ^ {- 1} \left[ \mathcal {O} (\varepsilon) (\theta (i) - \widehat {\theta} _ {\star} (i)) + \widehat {\theta} _ {\star} (i) - \theta (i) \right] \\ = \widehat {Z} _ {\zeta , \theta (i)} ^ {- 1} \big (1 - \mathcal {O} (\varepsilon) \big) \left(\widehat {\theta} _ {\star} (i) - \theta (i)\right), \\ \end{array} +$$ + +where a smoothness condition clearly holds for the $\beta (\cdot)$ function. Given a positive definite Lyapunov function $\mathbb{V}(\pmb {\theta}) = \frac{1}{2}\| \widehat{\pmb{\theta}}_{\star} - \pmb {\theta}\|^{2}$ , the mean-field system $h(\pmb {\theta}) = \widehat{Z}_{\zeta ,\theta (i)}^{-1}(\varepsilon \beta (\pmb {\theta}) + \pmb{\theta}_{\star} - \pmb {\theta}) =$ $\widehat{Z}_{\zeta ,\theta (i)}^{-1}(1 - \mathcal{O}(\varepsilon))(\widehat{\pmb{\theta}}_{\star} - \pmb {\theta})$ for $i\in \{1,2,\dots ,m\}$ enjoys the following property + +$$ +\begin{array}{l} \langle h (\boldsymbol {\theta}), \nabla \mathbb {V} (\boldsymbol {\theta}) \rangle = \langle h (\boldsymbol {\theta}), \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \rangle \\ \leq - \min _ {i} \widehat {Z} _ {\zeta , \theta (i)} ^ {- 1} \left(1 - \mathcal {O} (\varepsilon)\right) \| \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \| ^ {2} \\ \leq - \phi \| \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \| ^ {2}, \\ \end{array} +$$ + +where $\phi = \inf_{\theta}\min_{i}\widehat{Z}_{\zeta ,\theta (i)}^{-1}\big(1 - \mathcal{O}(\varepsilon)\big) > 0$ given the compactness assumption A1 and a small enough $\varepsilon = \mathcal{O}\left(\sup_{\mathbf{x}}\mathrm{Var}(\xi_n(\mathbf{x})) + \epsilon +\frac{1}{m}\right)$ . + +Remark 1 The newly proposed random-field function Eq.(17) may sacrifice the global stability by including an approximately linear mean-field system Eq.(28) instead of a linear stable system (see formula (15) in Deng et al. (2020b)). The advantage, however, is that such a mechanism facilitates the estimation of $\theta_{\star}$ . We emphasize that the original energy probability in each partition $\left\{\int_{\mathcal{X}_k} \pi(\mathbf{x}) d\mathbf{x}\right\}_{k=1}^m$ (Deng et al., 2020b) may be very difficult to estimate for big data problems. By contrast, the estimation of $\left\{\left(\int_{\mathcal{X}_k} \pi(\mathbf{x}) d\mathbf{x}\right)^{\frac{1}{\zeta}}\right\}_{k=1}^m$ becomes much easier given a proper $\zeta > 0$ . + +# Technical lemmas + +Lemma 4 The stochastic energy estimator $\widetilde{U} (\mathbf{x})$ leads to a controllable bias in the random-field function. + +$$ +\left| \mathbb {E} \left[ \tilde {H} _ {i} (\boldsymbol {\theta}, \mathbf {x}) \right] - H _ {i} (\boldsymbol {\theta}, \mathbf {x}) \right| = \mathcal {O} \left(\operatorname {V a r} \left(\xi_ {n} (\mathbf {x})\right)\right), +$$ + +where the expectation $\mathbb{E}[\cdot ]$ is taken with respect to the random noise in the stochastic energy estimator of $\widetilde{U} (\cdot)$ + +Proof Denote the noise in the stochastic energy estimator by $\xi (\mathbf{x})$ , such that $\widetilde{U} (\cdot) = U(\cdot) + \xi (\cdot)$ . Recall that $\widetilde{H}_i(\pmb {\theta},\mathbf{x}) = \theta (J_{\widetilde{U}}(\mathbf{x}))\left(1_{i = J_{\widetilde{U}}(\mathbf{x})} - \theta (i)\right)$ and $J_{\widetilde{U}}(\mathbf{x})\in \{1,2,\dots ,m\}$ satisfies + +$u_{J_{\widetilde{U}}(\mathbf{x}) - 1} < \frac{N}{n}\widetilde{U} (\mathbf{x})\leq u_{J_{\widetilde{U}}(\mathbf{x})}$ for a set of energy partitions $\{u_i\}_{i = 0}^m$ . We can interpret $\widetilde{H}_i(\pmb {\theta},\mathbf{x})$ as a non-linear transformation $\Phi$ that maps $\widetilde{U} (\mathbf{x})$ to $(0,1)$ . Similarly, $H_{i}(\pmb {\theta},\mathbf{x})$ maps $U(\mathbf{x})$ to $(0,1)$ . In what follows, the bias of random-field function is upper bounded as follows + +$$ +\begin{array}{l} \left| \mathbb {E} \left[ \widetilde {H} _ {i} (\boldsymbol {\theta}, \mathbf {x}) \right] - H _ {i} (\boldsymbol {\theta}, \mathbf {x}) \right| = \left| \int \Phi (U (\mathbf {x}) + \xi (\mathbf {x})) - \Phi (U (\mathbf {x})) d \mu (\xi (\mathbf {x})) \right| \\ = \left| \int \xi (\mathbf {x}) \Phi^ {\prime} (U (\mathbf {x})) + \frac {\xi (\mathbf {x}) ^ {2}}{2} \Phi^ {\prime \prime} (u) d \mu (\xi (\mathbf {x})) \right| \\ \leq \left| \int \xi_ {n} (\mathbf {x}) \Phi^ {\prime} (U (\mathbf {x})) d \mu (\xi_ {n} (\mathbf {x})) \right| + \left| \frac {\Phi^ {\prime \prime} (u)}{2} \int \xi_ {n} (\mathbf {x}) ^ {2} d \mu (\xi_ {n} (\mathbf {x})) \right| \\ \leq \mathcal {O} \left(\operatorname {V a r} \left(\xi_ {n} (\mathbf {x})\right)\right), \\ \end{array} +$$ + +where $\mu (\xi (\mathbf{x}))$ is the probability measure associated with $\xi (\mathbf{x})$ ; the second equality follows from Taylor expansion for some energy $u$ and the third equality follows because the stochastic energy estimator is unbiased; $\Phi^{\prime}(U(\mathbf{x})) = \mathcal{O}(\frac{\theta(J(\mathbf{x})) - \theta(J(\mathbf{x}) - 1)}{\Delta u})$ is clearly bounded due to the definition of $\pmb{\theta}$ ; a similar conclusion also applies to $\Phi ''(\cdot)$ . The last inequality easily follows by applying Cauchy Schwarz inequality. + +# B.4 CONVERGENCE OF THE SELF-ADAPTING PARAMETERS + +The following is a restatement of Lemma 3.2 of Raginsky et al. (2017), which holds for any $\theta$ in the compact space $\Theta$ . + +Lemma 5 (Uniform $L^2$ bounds) Assume Assumptions A1, A3 and A4 hold. We have a bounded second moment $\sup_{k\geq 1}\mathbb{E}[\| \mathbf{x}_k\|^2 ] < \infty$ given a small enough learning rate. + +The following lemma justifies the regularity properties of Poisson's equation, which is crucial in controlling the perturbations through the stochastic approximation process. The first version was proposed in Lemma B2 of Deng et al. (2020b). Now we give a more detailed proof by utilizing a Lyapunov function $V(\mathbf{x}) = 1 + \mathbf{x}^2$ and Lemma 5. + +Lemma 6 (Solution of Poisson's equation) Assume that Assumptions A1-A4 hold. There is a solution $\mu_{\theta}(\cdot)$ on $\mathcal{X}$ to the Poisson's equation + +$$ +\mu_ {\boldsymbol {\theta}} (\boldsymbol {x}) - \Pi_ {\boldsymbol {\theta}} \mu_ {\boldsymbol {\theta}} (\boldsymbol {x}) = \widetilde {H} (\boldsymbol {\theta}, \boldsymbol {x}) - h (\boldsymbol {\theta}). \tag {30} +$$ + +Furthermore, there exists a constant $C$ such that for all $\theta, \theta' \in \Theta$ + +$$ +\mathbb {E} [ \| \Pi_ {\boldsymbol {\theta}} \mu_ {\boldsymbol {\theta}} (\mathbf {x}) \| ] \leq C, +$$ + +$$ +\begin{array}{l} - \left[ \| - \boldsymbol {\theta} + \boldsymbol {\theta} ^ {\prime} (\mathbf {x}) \| \right] = C, \\ \mathbb {E} \left[ \| \Pi_ {\boldsymbol {\theta}} \mu_ {\boldsymbol {\theta}} (\mathbf {x}) - \Pi_ {\boldsymbol {\theta} ^ {\prime}} \mu_ {\boldsymbol {\theta} ^ {\prime}} (\mathbf {x}) \| \right] \leq C \| \boldsymbol {\theta} - \boldsymbol {\theta} ^ {\prime} \|. \end{array} \tag {31} +$$ + +Proof The existence and the regularity property of Poisson's equation can be used to control the perturbations. The key of the proof lies in verifying drift conditions proposed in Section 6 of Andrieu et al. (2005). + +(DRI) By the smoothness assumption A2, we have that $U(\mathbf{x})$ is continuously differentiable almost everywhere. By the dissipative assumption A3 and Theorem 2.1 (Roberts & Tweedie, 1996), we can show that the discrete dynamics system is irreducible and aperiodic. Now consider a Lyapunov function $V = 1 + \| \mathbf{x} \|^2$ and any compact subset $\mathcal{K} \subset \Theta$ , the drift conditions are verified as follows: + +(DRI1) Given small enough learning rates $\{\epsilon_k\}_{k\geq 1}$ , the smoothness assumption A2, and the dissipative assumption A3, applying Corollary 7.5 (Mattingly et al., 2002) yields the minorization condition for the CSGLD algorithm, i.e. there exists $\eta >0$ , a measure $\nu$ , and a set $\mathcal{C}$ such that $\nu (\mathcal{C}) = 1$ . Moreover, we have + +$$ +P _ {\boldsymbol {\theta} \in \mathcal {K}} (x, A) \geq \eta \nu (A) \quad \forall A \in \mathcal {X}, \mathbf {x} \in \mathcal {C}. \tag {I} +$$ + +where $P_{\theta}(\mathbf{x},\mathbf{y})\coloneqq \frac{1}{2\sqrt{(4\pi\epsilon)^{d / 2}}}\mathbb{E}\Big[e^{-\frac{\|\mathbf{y} - \mathbf{x} + \epsilon\nabla_{\mathbf{x}}\tilde{L}(\mathbf{x},\boldsymbol{\theta})\|^2}{4\epsilon}}|\mathbf{x}]$ denotes the transition kernel based on CSGLD with the parameter $\pmb {\theta}\in \mathcal{K}$ and a learning rate $\epsilon$ , in addition, the expectation is taken over the + +adaptive gradient $\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x},\boldsymbol {\theta})$ in Eq.(15). Using Assumption A1-A4, we can prove the uniform L2 upper bound by following Lemma 3.2 (Raginsky et al., 2017). Further, by Theorem 7.2 (Mattingly et al., 2002), there exist $\tilde{\alpha}\in (0,1)$ and $\tilde{\beta}\geq 0$ such that + +$$ +P _ {\boldsymbol {\theta} \in \mathcal {K}} V (\mathbf {x}) \leq \tilde {\alpha} V (\mathbf {x}) + \tilde {\beta}. \tag {II} +$$ + +Consider a Lyapunov function $V = 1 + \| \mathbf{x} \|^2$ and a constant $\kappa = \tilde{\alpha} + \tilde{\beta}$ , it yields that + +$$ +P _ {\theta \in \mathcal {K}} V (\mathbf {x}) \leq \kappa V (\mathbf {x}). \tag {III} +$$ + +Now we have verified the first condition (DRI1) by checking conditions (I),(II), and (III), + +(DRI2) In what follows, we check the boundedness and Lipschitz conditions on the random-field function $\widetilde{H}(\boldsymbol{\theta},\mathbf{x})$ , where each subcomponent is defend as $\widetilde{H}_i(\boldsymbol{\theta},\mathbf{x}) = \theta(J_{\widetilde{U}}(\mathbf{x}))\left(1_{i = J_{\widetilde{U}}(\mathbf{x})} - \theta(i)\right)$ . Recall that $V = 1 + \| \mathbf{x}\|^2$ , the compactness assumption A1 directly leads to + +$$ +\sup _ {\boldsymbol {\theta} \in \mathcal {K} \subset [ 0, 1 ] ^ {m}} \| H (\boldsymbol {\theta}, \mathbf {x}) \| \leq m V (\mathbf {x}). \tag {IV} +$$ + +For any $\theta_{1},\theta_{2}\in \mathcal{K}$ and a fixed $\mathbf{x}\in \mathcal{X}$ , it suffices for us to solely verify the $i$ -th index, which is the index that maximizes $|\theta_1(i) - \theta_2(i)|$ , then + +$$ +\begin{array}{l} \left. \left| \widetilde {H} _ {i} \left(\boldsymbol {\theta} _ {1}, \mathbf {x}\right) - \widetilde {H} _ {i} \left(\boldsymbol {\theta} _ {2}, \mathbf {x}\right) \right| = \theta_ {1} \left(J _ {\widetilde {U}} (\mathbf {x})\right) \left(1 _ {i = J _ {\widetilde {U}} (\mathbf {x})} - \theta_ {1} (i)\right) - \theta_ {2} \left(J _ {\widetilde {U}} (\mathbf {x})\right) \left(1 _ {i = J _ {\widetilde {U}} (\mathbf {x})} - \theta_ {2} (i)\right) \right. \\ \leq | \theta_ {1} (J _ {\widetilde {U}} (\mathbf {x})) - \theta_ {2} (J _ {\widetilde {U}} (\mathbf {x})) | + | \theta_ {1} (J _ {\widetilde {U}} (\mathbf {x})) \theta_ {1} (i) - \theta_ {2} (J _ {\widetilde {U}} (\mathbf {x})) \theta_ {2} (i) | \\ \leq \max _ {j} \left(| \theta_ {1} (j) - \theta_ {2} (j) | + \theta_ {1} (j) | \theta_ {1} (i) - \theta_ {2} (i) | + | \theta_ {1} (j) - \theta_ {2} (j) | \theta_ {2} (i)\right) \\ \leq 3 \left| \theta_ {1} (i) - \theta_ {2} (i) \right|, \\ \end{array} +$$ + +where the last inequality holds since $\theta (i)\in (0,1]$ for any $i\leq m$ + +(DRI3) We proceed to verify the smoothness of the transitional kernel $P_{\theta}(\mathbf{x},\mathbf{y})$ with respect to $\pmb{\theta}$ . For any $\pmb{\theta}_1, \pmb{\theta}_2 \in \mathcal{K}$ and fixed $\mathbf{x}$ and $\mathbf{y}$ , we have + +$$ +\begin{array}{l} \left| P _ {\boldsymbol {\theta} _ {1}} (\mathbf {x}, \mathbf {y}) - P _ {\boldsymbol {\theta} _ {2}} (\mathbf {x}, \mathbf {y}) \right| \\ = \frac {1}{2 \sqrt {(4 \pi \epsilon) ^ {d / 2}}} \mathbb {E} \big [ e ^ {- \frac {\| \mathbf {y} - \mathbf {x} + \epsilon \nabla_ {\mathbf {x}} \tilde {L} (\mathbf {x} , \boldsymbol {\theta} _ {1}) \| ^ {2}}{4 \epsilon}} | \mathbf {x} \big ] - \frac {1}{2 \sqrt {(4 \pi \epsilon) ^ {d / 2}}} \mathbb {E} \big [ e ^ {- \frac {\| \mathbf {y} - \mathbf {x} + \epsilon \nabla_ {\mathbf {x}} \tilde {L} (\mathbf {x} , \boldsymbol {\theta} _ {2}) \| ^ {2}}{4 \epsilon}} | \mathbf {x} \big ] \\ \lesssim | \| \mathbf {y} - \mathbf {x} + \epsilon \nabla_ {\mathbf {x}} \widetilde {L} (\mathbf {x}, \boldsymbol {\theta} _ {1}) \| ^ {2} - \| \mathbf {y} - \mathbf {x} + \epsilon \nabla_ {\mathbf {x}} \widetilde {L} (\mathbf {x}, \boldsymbol {\theta} _ {2}) \| ^ {2} | \\ \lesssim \| \nabla_ {\mathbf {x}} \widetilde {L} (\mathbf {x}, \boldsymbol {\theta} _ {1}) - \nabla_ {\mathbf {x}} \widetilde {L} (\mathbf {x}, \boldsymbol {\theta} _ {2}) \| \\ \lesssim \| \boldsymbol {\theta} _ {1} - \boldsymbol {\theta} _ {2} \|, \\ \end{array} +$$ + +where the first inequality (up to a finite constant) follows by $\| e^{\mathbf{x}} - e^{\mathbf{y}}\| \lesssim \| \mathbf{x} - \mathbf{y}\|$ for any $\mathbf{x},\mathbf{y}$ in a compact space; the last inequality follows by the definition of the adaptive gradient in Eq.(15) and $\| \log (\mathbf{x}) - \log (\mathbf{y})\| \lesssim \| \mathbf{x} - \mathbf{y}\|$ by the compactness assumption A1. + +For $f:\mathcal{X}\to \mathbb{R}^d$ , define the norm $\| f\| _V = \sup_{\mathbf{x}\in \mathcal{X}}\frac{|f(\mathbf{x})|}{V(\mathbf{x})}$ . Following the same technique proposed in Liang et al. (2007) (page 319), we can verify the last drift condition + +$$ +\left\| P _ {\boldsymbol {\theta} _ {1}} f - P _ {\boldsymbol {\theta} _ {2}} f \right\| _ {V} \leq C \| f \| _ {V} \| \boldsymbol {\theta} _ {1} - \boldsymbol {\theta} _ {2} \|, \forall f \in \mathcal {L} _ {V} := \{f: \mathcal {X} \rightarrow \mathbb {R} ^ {d}, \| f \| _ {V} < \infty \}. \tag {VI} +$$ + +Having conditions (I), (II), … and (VI) verified, we are now able to prove the drift conditions proposed in Section 6 of Andrieu et al. (2005). + +Before we present the $L^2$ convergence of $\theta_{k}$ , we make some extra assumptions on the step size. + +Assumption A5 (Learning rate and step size) The learning rate $\{\epsilon_k\}_{k\in \mathbb{N}}$ is a positive nonincreasing sequence of real numbers satisfying the conditions + +$$ +\lim _ {k} \epsilon_ {k} = 0, \quad \sum_ {k = 1} ^ {\infty} \epsilon_ {k} = \infty . +$$ + +The step size $\{\omega_k\}_{k\in \mathbb{N}}$ is a positive non-increasing sequence of real numbers such that + +$$ +\lim _ {k \rightarrow \infty} \omega_ {k} = 0, \quad \sum_ {k = 1} ^ {\infty} \omega_ {k} = + \infty , \quad \sum_ {k = 1} ^ {\infty} \omega_ {k} ^ {2} < + \infty . \tag {32} +$$ + +A practical strategy is to set $\omega_{k} := \mathcal{O}(k^{-\alpha})$ to satisfy the above conditions for any $\alpha \in (0.5, 1]$ . + +The following is an application of Theorem 24 (page 246) (Benveniste et al., 1990) given stability conditions (Lemma 3). + +Lemma 7 ( $L^2$ convergence rate, restatement of Lemma 2) Assume Assumptions A1-A5 hold. For any $\theta_0 \in \widetilde{\Theta} \subset \Theta$ , a large $m$ , small learning rates $\{\epsilon_k\}_{k=1}^{\infty}$ , and step sizes $\{\omega_k\}_{k=1}^{\infty}$ , $\{\pmb{\theta}_k\}_{k=0}^{\infty}$ converges to $\widehat{\theta}_{\star}$ , where $\widehat{\theta}_{\star} = \theta_{\star} + \mathcal{O}\left(\sup_{\mathbf{x}} \operatorname{Var}(\xi_n(\mathbf{x})) + \sup_{k \geq k_0} \epsilon_k + \frac{1}{m}\right)$ for some $k_0$ , such that + +$$ +\mathbb {E} \left[ \| \boldsymbol {\theta} _ {k} - \widehat {\boldsymbol {\theta}} _ {\star} \| ^ {2} \right] = \mathcal {O} \left(\omega_ {k}\right). +$$ + +The theoretical novelty is that we treat the biased $\widehat{\theta}_{\star}$ as the equilibrium of the continuous system instead of analyzing how far we are away from $\theta_{\star}$ in all aspects as in Theorem 1 (Deng et al., 2020b). This enables us to directly apply Theorem 24 (page 246). Nevertheless, it can be interpreted as a special case of Theorem 1 (Deng et al., 2020b) except that there are no perturbation terms and the equilibrium is $\widehat{\theta}_{\star}$ instead of $\theta_{\star}$ . + +# C GAUSSIAN APPROXIMATION + +# C.1 PRELIMINARY: SUFFICIENT CONDITIONS FOR WEAK CONVERGENCE + +To formally prove the asymptotic normality of the stochastic approximation process $\omega_{k}^{-1 / 2}(\pmb{\theta}_{k} - \widehat{\pmb{\theta}}_{\star})$ we first lay out a preliminary result (Theorem 1 of Pelletier (1998)) that provides sufficient conditions to guarantee the weak convergence. + +Lemma 8 (Sufficient Conditions) Consider a stochastic algorithm as follows + +$$ +\boldsymbol {\theta} _ {k + 1} = \boldsymbol {\theta} _ {k} + \omega_ {k + 1} h (\boldsymbol {\theta} _ {k}) + \omega_ {k + 1} \tilde {\nu} _ {k + 1} + \omega_ {k + 1} \boldsymbol {e} _ {k + 1}, +$$ + +where $\widetilde{\nu}_{k + 1}$ denotes a perturbation and $e_{k + 1}$ is a random noise. Given three conditions (C1), (C2), and (C3) defined below, we have the desired weak convergence result + +$$ +\omega^ {- \frac {1}{2}} \left(\boldsymbol {\theta} _ {k} - \widehat {\boldsymbol {\theta}} _ {\star}\right) \Rightarrow \mathcal {N} (0, \boldsymbol {\Sigma}), \tag {33} +$$ + +where $\pmb{\Sigma} = \int_{0}^{\infty}e^{th\theta_{\star}}\circ \pmb{R}\circ e^{th\theta_{\star}^{\top}}dt$ $\pmb{R}$ denotes the limiting covariance of the martingale $\lim_{k\to \infty}\mathbb{E}[e_{k + 1}e_{k + 1}^{\top}|\mathcal{F}_{k}]$ and $\mathcal{F}_k$ is the $\sigma$ -algebra of the events up to iteration $k$ , $h_{\pmb{\theta}_{\star}} = h_{\pmb{\theta}}(\widehat{\pmb{\theta}}_{\star}) + \widehat{\xi}\pmb{I}$ , $\widehat{\xi} = \lim_{k\to \infty}\frac{\omega_k^{0.5} - \omega_{k + 1}^{0.5}}{\omega_k^{1.5}}$ . + +(C1) There exists an equilibrium point $\widehat{\pmb{\theta}}_{\star}$ and a stable matrix $h_{\pmb{\theta}_{\star}} := h_{\pmb{\theta}}(\widehat{\pmb{\theta}}_{\star}) \in \mathbb{R}^{m \times m}$ such that for any $\pmb{\theta} \in \{\pmb{\theta} : \| \pmb{\theta} - \widehat{\pmb{\theta}}_{\star} \| \leq \widetilde{M}\}$ for some $\widetilde{M} > 0$ , the mean-field function $h: \mathbb{R}^m \to \mathbb{R}^m$ satisfies + +$$ +h (\widehat {\boldsymbol {\theta}} _ {\star}) = 0 +$$ + +$$ +\left\| h (\boldsymbol {\theta}) - h _ {\boldsymbol {\theta} _ {\star}} \left(\boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star}\right) \right\| \lesssim \| \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \| ^ {2}, +$$ + +(C2) The step size $\omega_{k}$ decays with an order $\alpha \in (0,1]$ such that $\omega_{k} = \mathcal{O}(k^{-\alpha})$ + +(C3) Assumptions on the disturbances. There exists constants $\widetilde{M} > 0$ and $\widetilde{\alpha} > 2$ such that + +$$ +\mathbb {E} \left[ e _ {k + 1} \mid \mathcal {F} _ {k} \right] \mathbf {1} _ {\{\| \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \| \leq \widetilde {M} \}} = 0, \tag {I_1} +$$ + +$$ +\sup _ {k} \mathbb {E} \left[ \| e _ {k + 1} \| ^ {\widetilde {\alpha}} \mid \mathcal {F} _ {k} \right] \mathbf {1} _ {\{\| \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \| \leq \widetilde {M} \}} < \infty , \tag {I2} +$$ + +$$ +\mathbb {E} \left[ \omega_ {k} ^ {- 1} \| \widetilde {\boldsymbol {\nu}} _ {k + 1} \| ^ {2} \right] \mathbf {1} _ {\{\| \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \| \leq \widetilde {M} \}} \rightarrow 0, \tag {II} +$$ + +$$ +\underline {{\mathbb {E}}} \left[ e _ {k + 1} e _ {k + 1} ^ {\top} | \mathcal {F} _ {k} \right] \mathbf {1} _ {\{\| \boldsymbol {\theta} - \widehat {\boldsymbol {\theta}} _ {\star} \| \leq \widetilde {M} \}} \rightarrow R. \tag {III} +$$ + +For example, $\widehat{\xi} = 0$ if $\omega_{k} = \mathcal{O}(k^{-\alpha})$ , where $\alpha \in (0.5,1]$ and $\widehat{\xi} = \frac{k_0}{2}$ if $\omega_{k} = \frac{k_{0}}{k}$ . + +Remark 2 By the definition of the mean-field function $h(\theta)$ in Eq.(26), it is easy to verify the condition C1. Moreover, Assumption A5 also fulfills the condition C2. Then, the proof hinges on the verification of the condition C3. + +# C.2 PRELIMINARY: CONVERGENCE OF THE COVARIANCE ESTIMATORS + +In particular, to verify the condition $\mathbb{E}\left[e_{k + 1}e_{k + 1}^{\top}|\mathcal{F}_k\right]\mathbf{1}_{\{\| \theta -\widehat{\theta}_*\| \leq \widetilde{M}\}}\to R,$ , we study the convergence of the empirical sample mean $\mathbb{E}[f(\mathbf{x}_k)]$ for a test function $f$ to the posterior expectation $\bar{f} = \int_{\mathcal{X}}f(\mathbf{x})\varpi_{\widehat{\theta}_{\star}}(\mathbf{x})(d\mathbf{x})$ . Poisson's equation is often used to characterize the fluctuation between $f(\mathbf{x})$ and $\bar{f}$ : + +$$ +\mathcal {L} g (\mathbf {x}) = f (\mathbf {x}) - \bar {f}, \tag {34} +$$ + +where $\mathcal{L}$ refers to an infinitesimal generator and $g(\mathbf{x})$ denotes the solution of the Poisson's equation. Similar to the proof of Lemma 6, the existence of the solution of the Poisson's equation has been established in (Mattingly et al., 2002; Vollmer et al., 2016). Moreover, the perturbations of $\mathbb{E}[f(\mathbf{x}_k)] - \bar{f}$ are properly bounded given regularity properties for $g(\mathbf{x})$ , where the 0-th, 1st, and 2nd order of the regularity properties has been established in Erdogdu et al. (2018). + +The following result helps us to identify the convergence of the covariance estimators, which is adapted from Theorem 5 (Chen et al., 2015) with decreasing learning rates $\{\epsilon_k\}_{k\geq 1}$ . The gradient biases from Theorem 2 (Chen et al., 2015) are also included to handle the adaptive biases. + +Lemma 9 (Convergence of the Covariance Estimators) Suppose Assumptions A1-A5 hold. For any $\theta_0 \in \widetilde{\Theta} \subset \Theta$ , a large $m$ , small learning rates $\{\epsilon_k\}_{k=1}^{\infty}$ , step sizes $\{\omega_k\}_{k=1}^{\infty}$ and any bounded function $f$ , we have + +$$ +\left| \mathbb {E} \left[ f (\mathbf {x} _ {k}) \right] - \int_ {\mathcal {X}} f (\mathbf {x}) \varpi_ {\widehat {\theta} _ {\star}} (\mathbf {x}) d \mathbf {x} \right| \to 0, +$$ + +where $\varpi_{\widehat{\theta}_{\star}}(\mathbf{x})$ is the invariant measure simulated via SGLD that approximates $\varpi_{\widetilde{\Psi}_{\theta_{\star}}}\left(\mathbf{x}\right) \propto \frac{\pi(\mathbf{x})}{\theta_{\star}^{\zeta}(J(\mathbf{x}))}$ . + +Proof We study the single-chain CSGLD and reformulate the adaptive algorithm as follows: + +$$ +\begin{array}{l} \mathbf {x} _ {k + 1} = \mathbf {x} _ {k} - \epsilon_ {k} \nabla_ {\mathbf {x}} \widetilde {L} (\mathbf {x} _ {k}, \boldsymbol {\theta} _ {k}) + \mathcal {N} (0, 2 \epsilon_ {k} \tau \boldsymbol {I}) \\ = \mathbf {x} _ {k} - \epsilon_ {k} \left(\nabla_ {\mathbf {x}} \widetilde {L} (\mathbf {x} _ {k}, \widehat {\boldsymbol {\theta}} _ {\star}) + \Upsilon (\mathbf {x} _ {k}, \boldsymbol {\theta} _ {k})\right) + \mathcal {N} (0, 2 \epsilon_ {k} \tau \boldsymbol {I}), \\ \end{array} +$$ + +where $\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x},\pmb {\theta}) = \frac{N}{n}\left[1 + \frac{\zeta\tau}{\Delta u}\left(\log \theta (J(\mathbf{x})) - \log \theta ((J(\mathbf{x}) - 1)\lor 1)\right)\right]\nabla_{\mathbf{x}}\widetilde{U} (\mathbf{x})^{\ddagger},\nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x},\pmb {\theta})$ is defined in Section B.1 and the bias term is given by $\Upsilon (\mathbf{x}_k,\pmb {\theta}_k) = \nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x}_k,\pmb {\theta}_k) - \nabla_{\mathbf{x}}\widetilde{L} (\mathbf{x}_k,\widehat{\pmb{\theta}}_\star)$ . + +Then, by Jensen's inequality and Lemma 7, we have + +$$ +\begin{array}{l} \left\| \mathbb {E} \left[ \Upsilon \left(\mathbf {x} _ {k}, \boldsymbol {\theta} _ {k}\right) \right] \right\| \leq \mathbb {E} \left[ \| \nabla_ {\mathbf {x}} \widetilde {L} \left(\mathbf {x} _ {k}, \boldsymbol {\theta} _ {k}\right) - \nabla_ {\mathbf {x}} \widetilde {L} \left(\mathbf {x} _ {k}, \widehat {\boldsymbol {\theta}} _ {\star}\right) \| \right] \\ \lesssim \mathbb {E} [ \| \boldsymbol {\theta} _ {k} - \widehat {\boldsymbol {\theta}} _ {\star} \| ] \leq \sqrt {\mathbb {E} [ \| \boldsymbol {\theta} _ {k} - \widehat {\boldsymbol {\theta}} _ {\star} \| ^ {2} ]} \leq \mathcal {O} (\sqrt {\omega_ {k}}). \tag {35} \\ \end{array} +$$ + +Combining Eq.(35) and Theorem 5 (Chen et al., 2015), we have + +$$ +\begin{array}{l} \left| \mathbb {E} [ f (\mathbf {x} _ {k}) ] - \int_ {\mathcal {X}} f (\mathbf {x}) \varpi_ {\widehat {\boldsymbol {\theta}} _ {\star}} (\mathbf {x}) d \mathbf {x} \right| = \mathcal {O} \left(\frac {1}{\sum_ {i} ^ {k} \epsilon_ {i}} + \frac {\sum_ {i = 1} ^ {k} \omega_ {i} \| \mathbb {E} [ \Upsilon (\mathbf {x} _ {i} , \boldsymbol {\theta} _ {i}) ] \|}{\sum_ {i} ^ {k} \omega_ {i}} + \frac {\sum_ {i} ^ {k} \epsilon_ {i} ^ {2}}{\sum_ {i} ^ {k} \epsilon_ {i}}\right) \\ \rightarrow 0, \text {a s} k \rightarrow \infty , \\ \end{array} +$$ + +where the last argument directly follows from the conditions on learning rates and step sizes in Assumption A5. + +# C.3 PROOF OF THEOREM 1 + +Recall that the stochastic approximation based on a single process follows from + +$$ +\begin{array}{l} \theta_ {k + 1} \\ = \boldsymbol {\theta} _ {k} + \omega_ {k + 1} H \left(\boldsymbol {\theta} _ {k}, \mathbf {x} _ {k + 1}\right) \\ = \boldsymbol {\theta} _ {k} + \omega_ {k + 1} h (\boldsymbol {\theta} _ {k}) + \omega_ {k + 1} \left(\mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k + 1}) - \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k + 1})\right) \\ = \boldsymbol {\theta} _ {k} + \omega_ {k + 1} h (\boldsymbol {\theta} _ {k}) \\ + \omega_ {k + 1} \underbrace {\left(\Pi_ {\boldsymbol {\theta} _ {k + 1}} \mu_ {\boldsymbol {\theta} _ {k + 1}} (\mathbf {x} _ {k + 1}) - \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k + 1}) + \frac {\omega_ {k + 2} - \omega_ {k + 1}}{\omega_ {k + 1}} \Pi_ {\boldsymbol {\theta} _ {k + 1}} \mu_ {\boldsymbol {\theta} _ {k + 1}} (\mathbf {x} _ {k + 1})\right)} _ {\nu_ {k + 1}} \\ + \omega_ {k + 1} \left(\underbrace {\frac {1}{\omega_ {k + 1}} \left(\omega_ {k + 1} \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k}) - \omega_ {k + 2} \Pi_ {\boldsymbol {\theta} _ {k + 1}} \mu_ {\boldsymbol {\theta} _ {k + 1}} (\mathbf {x} _ {k + 1})\right)} _ {\boldsymbol {\varsigma} _ {k + 1}} + \underbrace {\mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k + 1}) - \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k})}\right) \\ = \boldsymbol {\theta} _ {k} + \omega_ {k + 1} h \left(\boldsymbol {\theta} _ {k}\right) + \omega_ {k + 1} \underbrace {\left(\boldsymbol {\nu} _ {k + 1} + \varsigma_ {k + 1}\right)} _ {\text {p e r t u r b a t i o n}} + \omega_ {k + 1} \underbrace {\boldsymbol {e} _ {k + 1}} _ {\text {m a r t i n g a l e}}, \tag {36} \\ \end{array} +$$ + +where the second equality holds from the solution of Poisson's equation in Eq.(30). + +We denote $\ddot{\pmb{\theta}}_k = \pmb{\theta}_k + \omega_{k+1} \Pi_{\pmb{\theta}_k} \mu_{\pmb{\theta}_k}(\mathbf{x}_k)$ . Adding $\omega_{k+2} \Pi_{\pmb{\theta}_{k+1}} \mu_{\pmb{\theta}_{k+1}}(\mathbf{x}_{k+1})$ on both sides of Eq.(36), we have + +$$ +\begin{array}{l} \ddot {\theta} _ {k + 1} \\ = \ddot {\boldsymbol {\theta}} _ {k} + \omega_ {k + 1} h (\boldsymbol {\theta} _ {k}) + \omega_ {k + 1} \left(\boldsymbol {\nu} _ {k + 1} + \boldsymbol {e} _ {k + 1} + \boldsymbol {\varsigma} _ {k + 1}\right) + \omega_ {k + 2} \Pi_ {\boldsymbol {\theta} _ {k + 1}} \mu_ {\boldsymbol {\theta} _ {k + 1}} \left(\mathbf {x} _ {k + 1}\right) - \omega_ {k + 1} \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} \left(\mathbf {x} _ {k}\right) \\ = \tilde {\boldsymbol {\theta}} _ {k} + \omega_ {k + 1} h (\boldsymbol {\theta} _ {k}) + \omega_ {k + 1} \left(\boldsymbol {\nu} _ {k + 1} + \boldsymbol {e} _ {k + 1}\right) \\ = \ddot {\boldsymbol {\theta}} _ {k} + \omega_ {k + 1} h \left(\ddot {\boldsymbol {\theta}} _ {k}\right) + \omega_ {k + 1} \left(\tilde {\nu} _ {k + 1} + \boldsymbol {e} _ {k + 1}\right), \tag {37} \\ \end{array} +$$ + +where $\tilde{\pmb{\nu}}_{k + 1} = \pmb{\nu}_{k + 1} + h(\pmb{\theta}_k) - h(\ddot{\pmb{\theta}}_k)$ . Next, we proceed to verify the conditions in C3. + +(I) By the martingale difference property of $\{e_k\}$ and the compactness assumption A1, we know that for any $\widetilde{\alpha} > 2$ + +$$ +\mathbb {E} \left[ \boldsymbol {e} _ {k + 1} \mid \mathcal {F} _ {k} \right] = \mathbf {0}, \quad \sup _ {k \geq 0} \mathbb {E} \left[ \| \boldsymbol {e} _ {k + 1} \| ^ {\widetilde {\alpha}} \mid \mathcal {F} _ {k} \right] < \infty . \tag {I} +$$ + +(II) By the definition of $h(\pmb{\theta}_k)$ in Eq.(26), we can easily check that $h(\pmb{\theta}_k)$ is Lipschitz continuous in a neighborhood of $\widehat{\pmb{\theta}}_{\star}$ . Combining Eq.(31), we have $\| h(\pmb{\theta}_k) - h(\ddot{\pmb{\theta}}_k)\| = \mathcal{O}(\| \pmb{\theta}_k - \ddot{\pmb{\theta}}_k\|) = \mathcal{O}(\| \omega_{k + 1}\Pi_{\pmb{\theta}_k}\mu_{\pmb{\theta}_k}(\mathbf{x}_k)\|) = \mathcal{O}(\omega_{k + 1})$ . Then $\mathbb{E}[\| \pmb{\nu}_{k + 1}\| ]\leq C\| \pmb {\theta}_k - \ddot{\pmb{\theta}}_k\| +\mathcal{O}(\omega_{k + 2}) = \mathcal{O}(\omega_{k + 1})$ by the step size condition Eq.(32). In what follows, we can verify + +$$ +\mathbb {E} \left[ \frac {\| \tilde {\boldsymbol {\nu}} _ {k + 1} \| ^ {2}}{\omega_ {k}} \right] \leq 2 \mathbb {E} \left[ \frac {\| \boldsymbol {\nu} _ {k + 1} \| ^ {2}}{\omega_ {k}} \right] + 2 \mathbb {E} \left[ \frac {\| h (\boldsymbol {\theta} _ {k}) - h (\ddot {\boldsymbol {\theta}} _ {k}) \| ^ {2}}{\omega_ {k}} \right] = \mathcal {O} (\omega_ {k}) \rightarrow 0. \tag {II} +$$ + +(III) For the martingale difference noise $\pmb{e}_{k + 1} = \mu_{\pmb{\theta}_k}(\mathbf{x}_{k + 1}) - \Pi_{\pmb{\theta}_k}\mu_{\pmb{\theta}_k}(\mathbf{x}_k)$ with mean 0, we have + +$$ +\mathbb {E} [ \boldsymbol {e} _ {k + 1} \boldsymbol {e} _ {k + 1} ^ {\top} | \mathcal {F} _ {k} ] = \mathbb {E} [ \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k + 1}) \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k + 1}) ^ {\top} | \mathcal {F} _ {k} ] - \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k}) \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k}) ^ {\top}. +$$ + +We denote $\mathbb{E}[e_{k + 1}e_{k + 1}^{\top}|\mathcal{F}_k]$ by a function $f(\mathbf{x}_k)$ . Applying Lemma 9, we have + +$$ +\mathbb {E} \left[ e _ {k + 1} e _ {k + 1} ^ {\top} \mid \mathcal {F} _ {k} \right] = \mathbb {E} \left[ f (\mathbf {x} _ {k}) \right]\rightarrow \int f (\mathbf {x}) \varpi_ {\widehat {\boldsymbol {\theta}} _ {\star}} d \mathbf {x} = \lim _ {k \rightarrow \infty} \mathbb {E} \left[ e _ {k + 1} e _ {k + 1} ^ {\top} \mid \mathcal {F} _ {k} \right] := \boldsymbol {R}, \quad (\text {I I I}) +$$ + +where $\pmb{R} \coloneqq \pmb{R}(\widehat{\theta}_{\star})$ and $\pmb{R}(\pmb{\theta})$ is also equivalent to $\sum_{k = -\infty}^{\infty}\operatorname{Cov}_{\pmb{\theta}}(H(\pmb{\theta},\mathbf{x}_k),H(\pmb{\theta},\mathbf{x}_0))$ . + +Having the conditions C1, C2 and C3 verified, we apply Lemma 8 and have the following weak convergence for $\ddot{\theta}_k$ + +$$ +\omega_ {k} ^ {- 1 / 2} \left(\ddot {\boldsymbol {\theta}} _ {k} - \widehat {\boldsymbol {\theta}} _ {\star}\right) \Rightarrow \mathcal {N} (0, \Sigma), +$$ + +where $\pmb{\Sigma} = \int_0^\infty e^{th_{\pmb{\theta}_\star}} \circ \pmb{R} \circ e^{th_{\pmb{\theta}_\star}^\top} dt$ and $h_{\pmb{\theta}_\star} = h_\pmb{\theta}(\widehat{\pmb{\theta}}_\star) + \widehat{\xi}\pmb{I}, \widehat{\xi} = \lim_{k \to \infty} \frac{\omega_k^{0.5} - \omega_{k+1}^{0.5}}{\omega_k^{1.5}}$ . + +Considering the definition that $\ddot{\pmb{\theta}}_k = \pmb{\theta}_k + \omega_{k+1} \Pi_{\pmb{\theta}_k} \mu_{\pmb{\theta}_k}(\mathbf{x}_k)$ and $\mathbb{E}[\| \Pi_{\pmb{\theta}_k} \mu_{\pmb{\theta}_k}(\mathbf{x}_k) \|]$ is uniformly bounded by Eq.(31), we have + +$$ +\omega_ {k} ^ {1 / 2} \Pi_ {\boldsymbol {\theta} _ {k}} \mu_ {\boldsymbol {\theta} _ {k}} (\mathbf {x} _ {k}) \rightarrow 0 \quad \text {i n p r o b a b i l i t y}. +$$ + +By Slutsky's theorem, we eventually have the desired result + +$$ +\omega_ {k} ^ {- 1 / 2} (\boldsymbol {\theta} _ {k} - \widehat {\boldsymbol {\theta}} _ {\star}) \Rightarrow \mathcal {N} (0, \Sigma). +$$ + +where the step size $\omega_{k}$ decays with an order $\alpha \in (0.5,1]$ such that $\omega_{k} = \mathcal{O}(k^{-\alpha})$ + +# D MORE ON EXPERIMENTS + +# D.1 MODE EXPLORATION ON MNIST VIA THE SCALABLE RANDOM-FIELD FUNCTION + +For the network structure, we follow Jarrett et al. (2009) and choose a standard convolutional neural network (CNN). Such a CNN has two convolutional (conv) layers and two fully-connected (FC) layers. The two conv layers have 32 and 64 feature maps, respectively. The FC layers both have 50 hidden nodes and the network has 5 outputs. A large batch size of 2500 is selected to reduce the gradient noise and reduce the stochastic approximation bias. We fix $\zeta = 3e4$ and weight decay 25. For simplicity, we choose 100,000 partitions and $\Delta u = 10$ . The step size follows $\omega_{k} = \min \{0.01, \frac{1}{k^{0.6} + 100}\}$ . + +# D.2 SIMULATIONS OF MULTI-MODAL DISTRIBUTIONS + +The target density function is given by $\pi (\mathbf{x})\propto \exp (-U(\mathbf{x}))$ where $\mathbf{x} = (x_{1},x_{2})$ and $U(\mathbf{x})$ follows $U(\mathbf{x}) = 0.2(x_1^2 +x_2^2) - 2(\cos (2\pi x_1) + \cos (2\pi x_2))$ + +We also include a regularization term $L(x) = \mathbb{I}_{(x_1^2 + x_2^2) > 20} \times ((x_1^2 + x_2^2) - 20)$ . This design leads to a highly multi-modal distribution with 25 isolated modes. Figure 5 shows the contour and the 3-D plot of the target density. The ICSGLD and baseline algorithms are applied to this example. For IC-SGLD, we set $\epsilon_k = 3e^{-3}$ , $\tau = 1$ , $\zeta = 0.75$ and total number of iterations $= 8e^4$ . Besides, we partition the sample space into 100 subregions with bandwidth $\Delta u = 0.125$ and set $\omega_k = \min(3e^{-3}, \frac{1}{k^{0.6} + 100})$ . + +![](images/f631a54787fc864028bb750fd36c766c3a082b01645c2fc7bf9f02cbf8fb948f.jpg) +Figure 5: Target density. + +For comparison, we run the baseline algorithms under similar settings. For CSGLD, we run a single process 5 times of the + +time budget and all the settings are the same as those used by ICSGLD. For reSGLD, we run five parallel chains with learning rates 0.001, 0.002, ..., 0.005 and temperatures 1, 2, ..., 5, respectively. We estimate the correction every 100 iterations. We fix the initial correction 30 and choose the same step size for the stochastic approximation as in ICSGLD. For SGLD, we run five chains in parallel with the learning rate $3e^{-3}$ and a temperature of 1. For cycSGLD, we run a single-chain with 5 times of the time budget. We set the initial learning rate as $1e^{-2}$ and choose 10 cycles. For the particle-based SVGD, we run five chains in parallel. For each chain, we initialize 100 particles as being drawn from a uniform distribution over a rectangle. The learning rate is set to $3e^{-3}$ . + +![](images/af59ea21d47e22c491e9ec8732a0b6712d8ebcf8cc335c21760d5810d9fa919c.jpg) +Figure 6: Estimation KL divergence versus time steps for ICSGLD and baseline methods. We repeat experiments 20 times. + +![](images/07997297d3d80d35cafe9c94eba6ef345716bdde63bc03db82d50f47c4b44538.jpg) + +To compare the convergence rates in terms of running steps and time between ICSGLD and other algorithms, we repeat each algorithm 20 times and calculate the mean and standard error over 20 trials. Note that we run all the algorithms based on 5 parallel chains ( $\times$ P5) except that cycSGLD and CSGLD are run in a single-chain with 5 times of time budget ( $\times$ T5) and the steps and running + +time are also scaled accordingly. Figure 6 shows that the vanilla SGLD $\times$ P5 converges the slowest among the five algorithms due to the lack of mechanism to escape local traps; cycSGLD $\times$ T5 slightly alleviates that problem by adopting cyclical learning rates; reSGLD $\times$ P5 greatly accelerates the computations by utilizing high-temperature chains for exploration and low-temperature chains for exploitation, but the large correction term inevitably slows down the convergence; ICSGLD $\times$ P5 converges faster than all the others and the noisy energy estimators only induce a bias for the latent variables and don't affect the convergence rate significantly. + +For the particle-based SVGD method, since more particles require expensive computations while fewer particles lead to a crude approximation. Therefore, we don't show the convergence of SVGD and only compare the Monte Carlo methods. + +# D.3 DEEP CONTEXTUAL BANDITS ON MUSHROOM TASKS + +For the UCI Mushroom data set, each mushroom is either edible or poisonous. Eating an edible mushroom yields a reward of 5, but eating a poisonous mushroom has a $50\%$ chance to result in a reward of -35 and a reward of 5 otherwise. Eating nothing results in 0 reward. All the agents use the same architecture. In particular, we fit a two-layer neural network with 100 neurons each and ReLU activation functions. The input of the network is a feature vector with dimension 22 (context) and there are 2 outputs, representing the predicted reward for eating or not eating a mushroom. The mean squared loss is adopted for training the models. We initialize 1024 data points and keep a data buffer of size 4096 as the training proceeds. The size of the mini-batch data is set to 512. To adapt to online scenarios, we train models after every 20 new observations. + +We choose one $\epsilon$ -greedy policy (EpsGreedy) based on the RMSProp optimizer with a decaying learning rate (Riquelme et al., 2018) as a baseline. Two variational methods, namely stochastic gradient descent with a constant learning rate (ConstSGD) (Mandt et al., 2017) and Monte Carlo Dropout (Dropout) (Gal & Ghahramani, 2016) are compared to approximate the posterior distribution. For the sampling algorithms, we include preconditioned SGLD (pSGLD) (Li et al., 2016), preconditioned CSGLD (pCSGLD) (Deng et al., 2020b), and preconditioned ICSGLD (pICSGLD). Note that all the algorithms run 4 parallel chains with average outputs ( $\times$ P4) except that pCSGLD runs a single-chain with 4 times of computational budget ( $\times$ T4). In particular for the two contour algorithms, we set $\zeta = 20$ and choose a constant step size for the stochastic approximation to fit for the time-varying posterior distributions. For more details on the experimental setups, we refer readers to section D in the supplementary material. + +We report the experimental setups for each algorithm. Similar to Table 2 of Riquelme et al. (2018), the inclusion of advanced techniques may change the optimal settings of the hyperparameters. Nevertheless, we try to report the best setups for each individual algorithm. We train each algorithm 2000 steps. We initialize 1024 mushrooms and keep a data buffer of size 4096 as the training proceeds. For each step, we are given 20 random mushrooms and train the model 16 iterations every step for the parallel algorithms $(\times \mathrm{P4})$ ; we train pCSGLD $\times$ T4 64 iterations every step. + +EpsGreedy decays the learning rate by a factor of 0.999 every step; by contrast, all the others choose a fixed learning rate. RMSprop adopts a regularizer of 0.001 and a learning rate of 0.01 to learn the preconditioners. Dropout proposes a $50\%$ dropout rate and each subprocess simulates 5 models for predictions. For the two importance sampling (IS) algorithms, we partition the energy space into $m = 100$ subregions and set the energy depth $\Delta u$ as 10. We fix the hyperrameter $\zeta = 20$ . The step sizes for pICSGLD $\times$ P4 and pCSGLD $\times$ T4 are chosen as 0.03 and 0.006, respectively. A proper regularizer is adopted for the low importance weights. See Table 2 for details. + +TABLE 2: DETAILS OF THE EXPERIMENTAL SETUPS. + +
ALGORITHMLEARNING RATETemperatureRMSpropISTrainDropoutε-Greedy
EPSGreEDY×P45e-7 (0.999)0YESNO16NO0.3%
CONSTSGD×P41e-60NONO16NONO
DROPOUT×P41e-60NONO16YES (50%)NO
PCSGLD×T45e-80.3YESYES64NONO
PSGLD×P43e-70.3YESNO16NoNO
PICSGLD×P43e-70.3YESYES16NoNO
+ +# D.4 UNCERTAINTY ESTIMATION + +All the algorithms, excluding M-SGD $\times$ P4, choose a temperature of $0.0003^{\dagger}$ . We run the parallel algorithms 500 epochs ( $\times$ P4) and run the single-chain algorithms 2000 epochs ( $\times$ T4). The initial learning rate is 2e-6 (Bayesian settings), which corresponds to the standard 0.1 for averaged data likelihood. + +We train cycSGHMC $\times$ T4 and MultiSWAG $\times$ T4 based on the cosine learning rates with 10 cycles. The learning rate in the last $15\%$ of each cycle is fixed at a constant value. MultiSWAG simulates 10 random models at the end of each cycle. M-SGD $\times$ P4 follows the same cosine learning rate strategy with one cycle. + +$\mathrm{reSGHMC}\times \mathrm{P4}$ proposes swaps between neighboring chains and requires a fixed correction of 4000 for ResNet20, 32, and 56 and a correction of 1000 for WRN-16-8. The learning rate is annealed at 250 and 375 epochs with a factor of 0.2. ICSGHMC $\times$ P4 also applies the same learning rate. We choose $m = 200$ and $\Delta u = 200$ for ResNet20, 32, and 56 and $\Delta u = 60$ for WRN-16-8. Proper regularizations may be applied to the importance weights and gradient multipliers for training deep neural networks. + +Variance reduction (Deng et al., 2021a) only applies to reSGHMC $\times$ P4 and ICSGHMC $\times$ P4 because they are the only two algorithms that require accurate estimations of the energy. We only update control variates every 2 epochs in the last 100 epochs, which maintain a reasonable training time and a higher reduction of variance due to a small learning rate. Other algorithms yield a worse performance when variance reduction is applied to the gradients. + +# D.5 EMPIRICAL VALIDATION OF REDUCED VARIANCE + +To compare the $\theta$ 's learned from ICSGLD and CSGLD, we try to simulate from a Gaussian mixture distribution $0.4N(-6,1) + 0.6N(4,1)$ , where $N(u,v)$ denotes a Gaussian distribution with mean $u$ and standard deviation $v$ . We fix $\zeta = 0.9$ and $\Delta u = 1$ . We run ICSGLD with 1,000,000 iterations + +based on 10 interacting parallel chains and run CSGLD with 10,000,000 iterations using a single chain. We refer to them as ICSGLD $\times$ P10 and CSGLD $\times$ T10, respectively. The rest of the settings follows from the experimental setup in section 4.1 (Deng et al., 2020a). + +To measure the variance of the estimates, we repeated the experiments 10 times and present the mean and two standard deviations for both $\mathrm{CSGLD}\times \mathrm{T10}$ and $\mathrm{ICSGLD}\times \mathrm{P10}$ in Figure 7. The results indicate that both estimates of $\theta^{\zeta}$ (by CSGLD and ICSGLD) converge to the equilibrium that approximates the ground truth of the density of states. Notably, $\mathrm{ICSGLD}\times \mathrm{P10}$ yields a significantly smaller variance than $\mathrm{CSGLD}\times \mathrm{T10}$ , but with the same computational budget. This shows the clear advantage of ICSGLD (many interacting short runs) over CSGLD (a single long run) in tackling the large variance issue for importance sampling. + +![](images/c61c0361da079ded90c38a1feb01cd98f771a25ec8ed490c1d7503436905c5f6.jpg) +Figure 7: ICSGLD v.s. CSGLD. \ No newline at end of file diff --git a/interactingcontourstochasticgradientlangevindynamics/images.zip b/interactingcontourstochasticgradientlangevindynamics/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..54e841a464bc2054a6f5024449781047ee7290eb --- /dev/null +++ b/interactingcontourstochasticgradientlangevindynamics/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77262e60001eaa4864a324e21e1640491fc7884cf5376d90ce63cd00bd3d54af +size 1201002 diff --git a/interactingcontourstochasticgradientlangevindynamics/layout.json b/interactingcontourstochasticgradientlangevindynamics/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7c4990135cf4b661c592340d3bff45932f937875 --- /dev/null +++ b/interactingcontourstochasticgradientlangevindynamics/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45f35b6731a6e3c1fa0c7e521ff4c6eda468f2a36e65380bd342b0904fbc5368 +size 1356075 diff --git a/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_content_list.json b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fc76dfd8b850e807f771e07cab7ed43f7cb46ebd --- /dev/null +++ b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cfc0811daf3fd848ac88e055b632f1aa8232303bcd7c4440b0af89faf234f2a +size 248669 diff --git a/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_model.json b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d2be6619760a9b8831ae9444be7ddfabb641c83d --- /dev/null +++ b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5ea483fd71866c0ed336327307f462f9e3f00fb835682bd8b30eb11c75a1936 +size 315994 diff --git a/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_origin.pdf b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0287e237e3d134459cfe9f92ea511ff1745f6e82 --- /dev/null +++ b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/b8596f5e-31e2-4e1a-94c7-b2e7c91e457a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d979507f3869bea02f01b3605d164f3d7cd50a84a9dca311c52c7b442ec80a1 +size 3242192 diff --git a/invariantcausalrepresentationlearningforoutofdistributiongeneralization/full.md b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..36435884efb17d85b0ff2876670ccfcbe49a3015 --- /dev/null +++ b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/full.md @@ -0,0 +1,1136 @@ +# INvariant CAusal Representation Learning FOR OUT-OF-DISTRIBUTION GENERALIZATION + +Chaochao Lu $^{1,2}$ , Yuhuai Wu $^{3,4\dagger}$ , Jose Miguel Hernandez-Lobato $^{1,5*}$ , Bernhard Scholkopf $^{2*}$ + +# ABSTRACT + +Due to spurious correlations, machine learning systems often fail to generalize to environments whose distributions differ from the ones used at training time. Prior work addressing this, either explicitly or implicitly, attempted to find a data representation that has an invariant relationship with the target. This is done by leveraging a diverse set of training environments to reduce the effect of spurious features and build an invariant predictor. However, these methods have generalization guarantees only when both data representation and classifiers come from a linear model class. We propose invariant Causal Representation Learning (iCaRL), an approach that enables out-of-distribution (OOD) generalization in the nonlinear setting (i.e., nonlinear representations and nonlinear classifiers). It builds upon a practical and general assumption: the prior over the data representation (i.e., a set of latent variables encoding the data) given the target and the environment belongs to general exponential family distributions, i.e., a more flexible conditionally non-factorized prior that can actually capture complicated dependences between the latent variables. Based on this, we show that it is possible to identify the data representation up to simple transformations. We also show that all direct causes of the target can be fully discovered, which further enables us to obtain generalization guarantees in the nonlinear setting. Experiments on both synthetic and real-world datasets demonstrate that our approach outperforms a variety of baseline methods. + +# 1 INTRODUCTION + +Modern machine learning algorithms still lack robustness, and may fail to generalize outside of a specific training distribution because they learn easy-to-fit spurious correlations which are prone to change between training and testing environments. We recall the widely used example of classifying images of camels and cows (Beery et al., 2018). Here, the training dataset has a selection bias, i.e., many pictures of cows are taken on green pastures, while most pictures of camels happen to be in deserts. After training, it is found that the model builds on spurious correlations, i.e., it relates green pastures with cows and deserts with camels, and fails to recognize images of cows on the beach. + +To address this problem, a natural idea is to identify which features of the training data present domain-varying spurious correlations with labels and which features describe true correlations of interest that are stable across domains. In the example above, the former are the features describing the context (e.g., pastures and deserts), whilst the latter are the features describing the animals (e.g., animal shape). By exploiting the varying degrees of spurious correlation naturally present in training data collected from multiple environments, one can try to identify stable features and build invariant predictors. Invariant risk minimization (IRM) seeks to find data representations (Arjovsky et al., 2019) or features (Rojas-Carulla et al., 2018) for which the optimal predictor is invariant across all environments. The general formulation of IRM is a challenging bi-leveled optimization problem, and theoretical guarantees require constraining both data representations and classifiers to be linear (Arjovsky et al., 2019, Theorem 9), or considering the special case of feature selection (Rojas-Carulla et al., 2018, Theorem 4). Ahuja et al. (2020a) study the problem from the perspective of game theory, with an approach termed invariant risk minimization games (IRMG). They show that the set of Nash equilibria for a proposed game is equivalent to the set of invariant predictors for any finite number of environments, even with nonlinear data representations and nonlinear classifiers. However, these + +theoretical results in the nonlinear setting only guarantee that one can learn invariant predictors from training environments, but do not guarantee that the learned invariant predictors can generalize well across all environments including unseen testing environments. + +We propose invariant Causal Representation Learning (iCaRL), a novel approach that enables out-of-distribution (OOD) generalization in the nonlinear setting (i.e., nonlinear representations and nonlinear classifiers $^1$ ). We achieve this by extending and using methods from representation learning and graphical causal discovery. In more detail, we first introduce our main general assumption: when conditioning on the target (e.g., labels) and the environment (represented as an index), the prior over the data representation (i.e., a set of latent variables encoding the data) belongs to a general exponential family. Unlike the conditionally factorized prior assumed in recent identifiable variational autoencoders (iVAE) (Khemakhem et al., 2020a), this is a more flexible conditionally non-factorized prior, which can actually capture complicated dependences between the latent variables. We then extend iVAE to the case in which the latent variable prior belongs to such a general exponential family. The combination of this result and the previous general assumption allows us to guarantee that the data representation can be identified up to simple transformations. We then show that the direct causes of the target can be fully discovered by analyzing all possible graphs in a structural equation model setting. Once they are discovered, the challenging bi-leveled optimization problem in IRM and IRMG can be reduced to two simpler independent optimization problems, that is, learning the data representation and learning the optimal classifier can be performed separately. This leads to a practical algorithm and enables us to obtain generalization guarantees in the nonlinear setting. + +Overall, we make a number of key contributions: (1) We propose a general framework for out-of-distribution generalization in the nonlinear setting with the theoretical guarantees on both identifiability and generalizability; (2) We propose a general assumption on the underlying causal diagram for prediction (Assumption 1 and Fig. 1c), which covers many real-world scenarios (Section 3.2); (3) We propose a general assumption on the prior over the latent variables (Assumption 2), i.e., a more flexible conditionally non-factorized prior; (4) We prove that an extended iVAE with this conditionally non-factorized prior is also identifiable (Theorems 1, 2&3); (5) We prove that our framework has the theoretical guarantees for OOD generalization in the nonlinear setting (Proposition 1). + +# 2 PRELIMINARIES + +# 2.1 IDENTIFIABLE VARIATIONAL AUTOENCODERS + +Variational autoencoders (VAEs, see Appendix B) (Kingma & Welling, 2013; Rezende et al., 2014) lack identifiability guarantees. Consider a VAE model where $\pmb{X} \in \mathbb{R}^{d}$ stands for the observed variables (data) and $\pmb{Z} \in \mathbb{R}^{n}$ for the latent variables. Khemakhem et al. (2020a) show that a VAE with an unconditional prior distribution $p_{\theta}(Z)$ over the latent variables is unidentifiable. However, they also show that it is possible to obtain an identifiable model if one posits a conditionally factorized prior distribution over the latent variables, $p_{\theta}(Z|U)$ , where $U \in \mathbb{R}^{m}$ is an additional observed variable (Hyvarinen et al., 2019). Specifically, let $\pmb{\theta} = (\pmb{f},\pmb{T},\pmb{\lambda}) \in \Theta$ be the parameters of the conditional generative model + +$$ +p _ {\boldsymbol {\theta}} (\boldsymbol {X}, \boldsymbol {Z} | \boldsymbol {U}) = p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) p _ {\boldsymbol {T}, \lambda} (\boldsymbol {Z} | \boldsymbol {U}), \tag {1} +$$ + +where $p_{f}(\pmb{X}|\pmb{Z}) = p_{\epsilon}(\pmb{X} - \pmb{f}(\pmb{Z}))$ in which $\epsilon$ is an independent noise variable with probability density function $p_{\epsilon}(\epsilon)$ . Importantly, the prior $p_{T,\lambda}(\pmb{Z}|\pmb{U})$ is assumed to be conditionally factorial, where each element of $Z_{i} \in \mathbf{Z}$ has a univariate exponential family distribution given $\pmb{U}$ . The conditioning on $\pmb{U}$ is through an arbitrary function $\lambda(\pmb{U})$ (e.g., a neural net) that outputs the individual exponential family parameters $\lambda_{i}(\pmb{U})$ for each $Z_{i}$ . The prior probability density thus takes the form + +$$ +p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {U}) = \prod_ {i} \mathcal {Q} _ {i} \left(Z _ {i}\right) / \mathcal {C} _ {i} (\boldsymbol {U}) \exp \left[ \sum_ {j = 1} ^ {k} T _ {i, j} \left(Z _ {i}\right) \lambda_ {i, j} (\boldsymbol {U}) \right], \tag {2} +$$ + +where $\mathcal{Q}_i$ is the base measure, $Z_{i}$ the $i$ -th dimension of $\pmb{Z}$ , $\mathcal{C}_i(\pmb{U})$ the normalizing constant, $\pmb{T}_i = (T_{i,1},\dots,T_{i,k})$ the sufficient statistics, $\lambda_i(\pmb{U}) = (\lambda_{i,1}(\pmb{U}),\dots,\lambda_{i,k}(\pmb{U}))$ the corresponding natural parameters depending on $\pmb{U}$ , and $k$ the dimension of each sufficient statistic that is fixed in advance. It is worth noting that this prior is restrictive as it is factorial and therefore cannot capture dependencies. As in VAEs, the model parameters are estimated by maximizing the corresponding evidence lower bound (ELBO), + +$$ +\mathcal {L} _ {\mathrm {i V A E}} (\boldsymbol {\theta}, \phi) := \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {U})} \left[ \log p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) + \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {U}) - \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {U}) \right] \right], \tag {3} +$$ + +where we denote by $p_D$ the empirical data distribution given by the dataset $\mathcal{D} = \{\left(\boldsymbol{X}^{(i)},\boldsymbol{U}^{(i)}\right)\}_{i=1}^N$ and $q_{\phi}(\boldsymbol{Z}|\boldsymbol{X},\boldsymbol{U})$ denotes an approximate conditional distribution for $\boldsymbol{Z}$ given by a recognition network with parameters $\phi$ . This approach is called identifiable VAE (iVAE). Most importantly, it can be proved that under the conditions stated in Theorem 2 of Khemakhem et al. (2020a), iVAE can identify the latent variables $\boldsymbol{Z}$ up to a permutation and a simple componentwise transformation, see Appendix F. + +# 2.2 INVARIANT RISK MINIMIZATION + +Arjovsky et al. (2019) introduced invariant risk minimization (IRM), whose goal is to construct an invariant predictor $f$ that performs well across all environments $\mathcal{E}_{all}$ by exploiting data collected from multiple environments $\mathcal{E}_{tr}$ , where $\mathcal{E}_{tr} \subseteq \mathcal{E}_{all}$ . Technically, they consider datasets $D_{e} := \{(x_{i}^{e}, y_{i}^{e})\}_{i=1}^{n_{e}}$ from multiple training environments $e \in \mathcal{E}_{tr}$ , where $x_{i}^{e} \in \mathcal{X} \subseteq \mathbb{R}^{d}$ is the input observation and its corresponding label is $y_{i}^{e} \in \mathcal{Y} \subseteq \mathbb{R}^{s}$ . The dataset $D_{e}$ , collected from environment $e$ , consists of examples identically and independently distributed according to some probability distribution $P(\boldsymbol{X}^{e}, \boldsymbol{Y}^{e})$ . The goal of IRM is to use these multiple datasets to learn a predictor $\boldsymbol{Y} = f(\boldsymbol{X})$ that performs well for all the environments. Here we define the risk reached by $f$ in environment $e$ as $R^{e}(f) = \mathbb{E}_{\boldsymbol{X}^{e}, \boldsymbol{Y}^{e}}[\ell(f(\boldsymbol{X}^{e}), \boldsymbol{Y}^{e})]$ , where $\ell(\cdot)$ is a loss function. Then, the invariant predictor can be formally defined as follows: + +Definition 1 (Invariant Predictor (Arjovsky et al., 2019)). We say that a data representation $\Phi \in \mathcal{H}_{\Phi}:\mathcal{X}\to \mathcal{F}$ elicits an invariant predictor $w\circ \Phi$ across environments $\mathcal{E}$ if there is a classifier $w\in \mathcal{H}_w:\mathcal{F}\rightarrow \mathcal{Y}$ simultaneously optimal for all environments, that is, $w\in \arg \min_{\bar{w}\in \mathcal{H}_w}R^e (\bar{w}\circ \Phi)$ for all $e\in \mathcal{E}$ , where $\circ$ means function composition. + +Mathematically, IRM can be phrased as the following constrained optimization problem: + +$$ +\min _ {\Phi \in \mathcal {H} _ {\Phi}, w \in \mathcal {H} _ {w}} \sum_ {e \in \mathcal {E} _ {t r}} R ^ {e} (w \circ \Phi) \quad \text {s . t .} w \in \arg \min _ {\bar {w} \in \mathcal {H} _ {w}} R ^ {e} (\bar {w} \circ \Phi), \forall e \in \mathcal {E} _ {t r}. \tag {4} +$$ + +Since this is a generally infeasible bi-leveled optimization problem, Arjovsky et al. (2019) rephrased it as a tractable penalized optimization problem by transferring the inner optimization routine to a penalty term. The main generalization result (Theorem 9 in Arjovsky et al. (2019)) states that if both $\Phi$ and $w$ come from the class of linear models (i.e., $\mathcal{H}_{\Phi} = \mathbb{R}^{n\times n}$ and $\mathcal{H}_w = \mathbb{R}^{n\times 1}$ ), under certain conditions on the diversity of training environments (Assumption 8 in Arjovsky et al. (2019)) and the data generation, the invariant predictor $w\circ \Phi$ obtained by solving Eq. (4) remains invariant in $\mathcal{E}_{all}$ . + +# 3 PROBLEM SETUP + +# 3.1 A MOTIVATING EXAMPLE + +In this section, we extend the example which was introduced by Wright (1921) and discussed by Arjovsky et al. (2019), and provide a further in-depth analysis. + +Model 1. Consider a structural equation model (SEM) with a discrete environment variable $E$ that modulates the noises in the structural assignments connecting the other variables (cf. Fig. 1a below): $Z_{1} \gets \text{Gaussian}(0, \sigma_{1}(E))$ , $Y \gets Z_{1} + \text{Gaussian}(0, \sigma_{2}(E))$ , $Z_{2} \gets Y + \text{Gaussian}(0, \sigma_{3}(E))$ , where Gaussian(0, $\sigma$ ) denotes a Gaussian random variable with zero mean and standard deviation $\sigma$ , and $\sigma_{1}, \ldots, \sigma_{3}$ are functions of the value $e \in \mathcal{E}_{\text{all}}$ taken by the environment variable $E$ . + +To ease exposition, here we consider the simple scenario in which $\mathcal{E}_{\mathrm{all}}$ only contains all modifications varying the noises of $Z_{1}$ , $Z_{2}$ and $Y$ within a finite range, i.e., $\sigma_{i}(e)\in [0,\sigma_{\max}^{2}]$ . Then, to predict $Y$ from $(Z_{1},Z_{2})$ using a least-square predictor $\hat{Y}^e = \hat{\alpha}_1Z_1^e +\hat{\alpha}_2Z_2^e$ for environment $e$ , we can + +- Case 1: regress from $Z_1^e$ , to obtain $\hat{\alpha}_1 = 1$ and $\hat{\alpha}_2 = 0$ +- Case 2: regress from $Z_2^e$ , to obtain $\hat{\alpha}_1 = 0$ and $\hat{\alpha}_2 = \frac{\sigma_1(e) + \sigma_2(e)}{\sigma_1(e) + \sigma_2(e) + \sigma_3(e)}$ , +- Case 3: regress from $(Z_1^e, Z_2^e)$ , to obtain $\hat{\alpha}_1 = \frac{\sigma_3(e)}{\sigma_2(e) + \sigma_3(e)}$ and $\hat{\alpha}_2 = \frac{\sigma_2(e)}{\sigma_2(e) + \sigma_3(e)}$ . + +In the generic scenario (i.e., $\sigma_{1}(e)\neq 0$ , $\sigma_{2}(e)\neq 0$ , and $\sigma_3(e)\neq 0$ ), the regression using $Z_{1}$ in Case 1 is an invariant correlation: it is the only regression whose coefficients do not vary with $e$ . By contrast, + +![](images/9a9af91667570bc26c5aaeea2f5f9e139f4563fce280eaaec486f7d05c0e406a.jpg) +(a) + +![](images/95796f8f9158f7248128f9aa5b56103eac820cf5e0c4a477060d2abd42ef71ed.jpg) +(b) +Figure 1: (a) Causal structure of Model 1. (b) A more practical extension of Model 1, where $Z_{1}$ and $Z_{2}$ are not directly observed and $X$ is their observation. (c) A general version of (b), where we assume there exist multiple unobserved variables. Each of them could be either a parent, a child of $Y$ , or has no direct connection with $Y$ . We allow for arbitrary connections between the latent variables (red dashed lines) as long as the resulting causal diagram including $Y$ is a directed acyclic graph (DAG). Grey nodes denote observed variables and white nodes represent unobserved variables. Dashed lines denote the edges which might vary across environments and even be absent in some scenarios, whilst solid lines indicate that they are invariant across all the environments. + +![](images/5347fc4ef82004e3385b0bde086be32ed0f253cf6aaf1ba89e05d43d52fe4d67.jpg) +(c) + +the regressions in both Case 2 and Case 3 have coefficients that depend on $e$ . Therefore, only the invariant correlation in Case 1 will generalize well to new test environments. + +Another way to understand Model 1 is through its graphical representation3, as shown in Fig. 1a. We treat the environment as a random variable $E$ , where $E$ could be any information specific to the environment (Storkey, 2009; Peters et al., 2015; Zhang et al., 2017; Huang et al., 2020). Unless stated otherwise, for simplicity, we let $E$ be the environment index, i.e., $E \in \{1, \dots, N\}$ , where $N$ is the number of training environments. A more realistic version appearing in many settings is shown in Fig. 1b, where the true variables $\{Z_1, Z_2\}$ are unobserved and we can only observe their transformation $X$ . In this case, Invariant Causal Prediction (ICP) (Peters et al., 2015) will fail when applied to $X$ , even when $Y$ is not affected by $E$ (i.e., the edge $E \rightarrow Y$ is removed). The reason is that each variable (i.e., each dimension) of $X$ is jointly influenced by both $Z_1$ and $Z_2$ so that ICP is unable to find the variables containing the information only about $Z_1$ by searching for a subset of variables $X$ . By contrast, both IRM and IRMG work, as long as the transformation is linear. These findings are also empirically illustrated in Appendix K.1. We now go even further and consider a more general causal graph in which $Y$ can have more than one parent or child. + +# 3.2 ASSUMPTIONS ON THE CAUSAL GRAPH + +We extend the causal graph in Fig. 1b to a more general setting, as encapsulated in Fig. 1c. In particular, we now have $\mathbf{X} \in \mathcal{X} \subseteq \mathbb{R}^d$ , $\mathbf{Y} \in \mathcal{Y} \subseteq \mathbb{R}^s$ , $\mathbf{Z} = (Z_{p_1},\ldots,Z_{p_r},Z_{c_1},\ldots,Z_{c_k}) \in \mathcal{Z} \subseteq \mathbb{R}^n$ , where $n = r + k$ , and $\{Z_i\}_{i \in I_p = \{p_1,\dots,p_r\}}$ and $\{Z_j\}_{j \in I_c = \{c_1,\dots,c_k\}}$ are multiple scalar causal factors and non-causal factors of $\mathbf{Y}$ , respectively. We denote $Z_p \doteq (Z_{p_1},\ldots,Z_{p_r})$ and $Z_c \doteq (Z_{c_1},\ldots,Z_{c_k})$ for the ease of clarification. We also assume that $\mathbf{Z}$ is of lower dimension than $\mathbf{X}$ , that is, $n \leq d$ . We allow for arbitrary connections between the latent variables $\mathbf{Z}$ as long as the resulting causal diagram including $\mathbf{Y}$ is a directed acyclic graph (DAG). We use dashed lines to indicate the causal mechanisms which might vary across environments and even be absent in some scenarios, whilst solid lines indicate that they are invariant across all the environments. To sum up, we assume that the underlying causal graph encapsulated in Fig. 1c satisfies the following assumption: + +Assumption 1. (a) $Z_{i}$ depends on one or both of $Y$ and $E$ for any $i$ ; (b) The causal graph containing $Z$ and $Y$ is a DAG; (c) $X \perp Y$ , $E|Z$ , implying that $p(\mathbf{X}|Z)$ is invariant across all the environments; (d) $Y \perp E|Z_{p}$ , implying that $p(\mathbf{Y}|Z_{p})$ is invariant across all the environments. + +One may be wondering how practical Assumption 1 is in real world applications. Let us explore this in more detail. Assumption 1a rules out all the useless $Z_{i}$ in the task of predicting $\mathbf{Y}$ . This is because if Assumption 1a is violated, meaning that $Z_{i}$ is independent of $\mathbf{Y}$ and $\mathbf{E}$ and has no influence in predicting $\mathbf{Y}$ , then such $Z_{i}$ should be viewed as noise and thus eliminated during learning. Assumption 1b is a common assumption in causal discovery (Spirtes et al., 2000; Pearl, 2009; Peters et al., 2015). It also makes sense in Assumption 1c that the generative mechanism $p(\mathbf{X}|\mathbf{Z})$ is + +# Algorithm 1: Invariant Causal Representation Learning (iCaRL) + +Phase 1: We first learn a NF-iVAE model, including the decoder and its corresponding encoder, by optimizing the objective function in (10) on the data $\{X,Y,E\}$ . Then, we use the mean of the NF-iVAE encoder to infer the latent variables $Z$ from observations $\{X,Y,E\}$ . The latent variables are guaranteed to be identified up to a permutation and simple transformation. +Phase 2: After inferring $Z$ , we first conduct the PC algorithm to learn a Markov equivalence class of DAGs, and then discover direct causes (parents) of $Y$ among its neighbors by testing all pairs of latent variables with (conditional) independence testing, i.e., finding a set of latent variables in which each pair of $Z_{i}$ and $Z_{j}$ satisfies that the dependency between them increases after additionally conditioning on $Y$ . +Phase 3: Having obtained $\mathrm{Pa}(\mathbf{Y})$ , we can solve (11) to learn the invariant classifier $w$ . When in a new environment, we first infer $\mathrm{Pa}(\mathbf{Y})$ from $\mathbf{X}$ by solving (12) and then leverage the learned $w$ for prediction. + +invariant across all the environments. Otherwise, it is impossible to infer $\mathbf{Z}$ from $\mathbf{X}$ in any unseen environment. Assumption 1d is a widely-used default assumption in OOD generalization (Peters et al., 2015; Arjovsky et al., 2019). In fact, Assumption 1d can be further relaxed to the more practical one that $\mathbb{E}[Y|Z_p]$ is invariant across all the environments. That is, given $Z_{p}$ , we allow $\mathbf{E}$ to only affect the amount of noise in the distribution of $Y$ , because that would not change the expected value of $\mathbf{Y}$ since the mean of the noise would be zero. Apparently, Assumption 1, together with the causal graph in Fig. 1c, covers most scenarios (e.g., the ones of Zhang et al. (2013); von Kugelgen et al. (2020); Sun et al. (2020); Ahuja et al. (2021); von Kugelgen et al. (2021)) and is a very flexible model for causal analysis when predicting $\mathbf{Y}$ from $\mathbf{X}$ . + +# 3.3 ASSUMPTIONS ON THE PRIOR + +When the underlying causal graph satisfies Assumption 1, our primary assumption leading to identifiability in this general setting is that the conditional prior $p(\mathbf{Z}|\mathbf{Y},\mathbf{E})$ belongs to a general exponential family. This is formalized as follows: + +Assumption 2. $p(\mathbf{Z}|\mathbf{Y},\mathbf{E})$ belongs to a general exponential family with parameter vector given by an arbitrary function $\lambda (\mathbf{Y},\mathbf{E})$ and sufficient statistics $\pmb {T}(\pmb {Z}) = [\pmb{T}_f(\pmb {Z})^T,\pmb{T}_{NN}(\pmb {Z})^T ]^T$ given by the concatenation of a) the sufficient statistics $\pmb {T}_f(\pmb {Z}) = [\pmb {T}_1(\pmb {Z}_1)^T,\dots ,\pmb {T}_n(\pmb {Z}_n)^T ]^T$ of a factorized exponential family, where all the $\pmb {T}_i(Z_i)$ have dimension larger or equal to 2, and b) the output $\pmb{T}_{NN}(\pmb {Z})$ of a neural network with ReLU activations. The resulting density function is thus given by + +$$ +p _ {T, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) = \mathcal {Q} (\boldsymbol {Z}) / \mathcal {C} (\boldsymbol {Y}, \boldsymbol {E}) \exp [ \boldsymbol {T} (\boldsymbol {Z}) ^ {T} \boldsymbol {\lambda} (\boldsymbol {Y}, \boldsymbol {E}) ], \tag {5} +$$ + +where $\mathcal{Q}$ is the base measure and $\mathcal{C}$ the normalizing constant. + +A neural network with ReLU activation has universal approximation power. Therefore, the term $T_{NN}(Z)$ in the above prior distribution will allow us to capture arbitrary dependencies between the latent variables. The distribution in Eq. (5) is more flexible than the conditionally factorized prior assumed by iVAEs. However, surprisingly, the identifiability results of iVAEs also hold when using the more flexible prior in Eq. (5), as we will show in Section 4.1. This motivates using an extended iVAE model with the above prior to model data generated by the ground truth model in Fig. 1c. However, in this case, the data generating model and the learned model might have different priors. For example, in the ground truth model, the prior for each $Z_{i\in I_p}$ might be $p(Z_i|E)$ , when $Z_{i}$ is only caused by $E$ . By contrast, in the extended iVAE model the prior is $p(\mathbf{Z}|\mathbf{Y},\mathbf{E})$ . Is this going to affect the identifiability of the latent variables? Well, in practice not because the posterior distribution for $\mathbf{Z}$ given $X,Y$ and $E$ would be equivalent in both models (up to identifiability guarantees). + +# 4 INVARIANT CAUSAL REPRESENTATION LEARNING + +We now introduce our algorithm, invariant Causal Representation Learning (iCaRL), which consists of 3 phases as summarized in Algorithm 1. The idea is that we first identify $Z$ by using an extended iVAE model under Assumptions 1&2 (Phase 1), then discover direct causes of $Y$ among the identified $Z$ (Phase 2), and finally learn an invariant predictor for $Y$ from the discovered causes (Phase 3). + +# 4.1 PHASE 1: IDENTIFYING LATENT VARIABLES USING NF-IVAE + +In this section, we describe our identifiable model, namely NF-iVAE, which is an extended iVAE with a general non-factorized prior that is able to capture complex dependences between the latent variables. Technically, in the general setting under Assumption 1, it is straightforward to obtain a + +corresponding generative model by directly substituting $U$ with $(Y, E)$ in Eq. (1): + +$$ +p _ {\boldsymbol {\theta}} (\boldsymbol {X}, \boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) = p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) p _ {\boldsymbol {T}, \lambda} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}), \tag {6} +$$ + +$$ +p _ {\boldsymbol {f}} (\boldsymbol {X} \mid \boldsymbol {Z}) = p _ {\epsilon} (\boldsymbol {X} - \boldsymbol {f} (\boldsymbol {Z})). \tag {7} +$$ + +The corresponding ELBO is + +$$ +\mathcal {L} _ {\text {p h a s e 1}} ^ {\text {E L B O}} (\boldsymbol {\theta}, \phi) := \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \log p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) + \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) - \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) \right] \right]. \tag {8} +$$ + +To obtain an identifiability result, we assume that the prior $p_{T,\lambda}(Z|\mathbf{Y},\mathbf{E})$ satisfies Assumption 2 (i.e., Eq. (5)). Since the prior is a general multivariate exponential family distribution with unknown normalization constant, we cannot learn its parameters $(T,\lambda)$ by directly maximizing Eq. (8). Instead, we use score matching, a well-known method for training unnormalized probabilistic models (Hyvärinen, 2005; Vincent, 2011), and learn $(T,\lambda)$ by minimizing + +$$ +\mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {S M}} (\boldsymbol {T}, \boldsymbol {\lambda}) := \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \left| \left| \nabla_ {\boldsymbol {Z}} \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) - \nabla_ {\boldsymbol {Z}} \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) \right| \right| ^ {2} \right] \right]. \tag {9} +$$ + +In practice, we can use a simple trick of partial integration to simplify the evaluation of Eq. (9), see Appendix C. Furthermore, we can jointly learn $(\bar{\theta},\phi)$ by combining Eq. (8) and Eq. (9) in the following objective: + +$$ +\mathcal {L} _ {\text {p h a s e 1}} (\boldsymbol {\theta}, \phi) = \mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {E L B O}} (\boldsymbol {f}, \hat {\boldsymbol {T}}, \hat {\lambda}, \phi) - \mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {S M}} (\hat {\boldsymbol {f}}, \boldsymbol {T}, \boldsymbol {\lambda}, \hat {\phi}), \tag {10} +$$ + +where $\hat{f},\hat{T},\hat{\lambda},\hat{\phi}$ are copies of $f,T,\lambda ,\phi$ that are treated as constants and whose gradient is not calculated during learning. More details can be found in Appendix M. + +We now state our main theoretical results: + +Theorem 1. Assume that we observe data sampled from a generative model defined according to Eqs. (5-7), with parameters $\theta \coloneqq (\pmb{f},\pmb{T},\pmb{\lambda})$ , where $p_{T,\lambda}(\pmb{Z}|\pmb{Y},\pmb{E})$ satisfies Assumption 2. Furthermore, assume the following holds: (i) The set $\{\pmb{X}\in \mathcal{O}|\varphi_{\epsilon}(\pmb{X}) = 0\}$ has measure zero, where $\varphi_{\epsilon}$ is the characteristic function of the density $p_{\epsilon}$ defined in Eq. (7). (ii) Function $\pmb{f}$ in Eq. (7) is injective, and has all second-order cross derivatives. (iii) The sufficient statistics in $\pmb{T}_{f}$ are all twice differentiable. (iv) There exist $k + 1$ distinct points $(\pmb{Y},\pmb{E})^{0},\dots ,(\pmb{Y},\pmb{E})^{k}$ such that the matrix $L = \left(\lambda ((\pmb {Y},\pmb {E})^{1}) - \lambda ((\pmb {Y},\pmb {E})^{0}),\dots ,\lambda ((\pmb {Y},\pmb {E})^{k}) - \lambda ((\pmb {Y},\pmb {E})^{0})\right)$ of size $k\times k$ is invertible, where $k$ is the dimension of $\pmb{T}$ . Then the parameters $\theta$ are identifiable up to a permutation and a "simple transformation" of the latent variables $\pmb{Z}$ , defined as a componentwise nonlinearity making each recovered $\pmb{T}_i(Z_i)$ in $\pmb{T}_f(\pmb{Z})$ equal to the original up to a linear operation. + +Note that, this theorem is inspired by but beyond the main results of iVAEs in that the former is predicated on Assumption 2 which is more flexible than the conditionally factorized prior assumed in iVAEs. It results in several key changes in the proof, clarified in Appendix H. Interestingly, from (iv) we can further see that $\pmb{E}$ is unnecessary when there exist $k + 1$ distinct points $\mathbf{Y}^0,\dots ,\mathbf{Y}^k$ such that the matrix $L = \left(\lambda (\mathbf{Y}^{1}) - \lambda (\mathbf{Y}^{0}),\ldots ,\lambda (\mathbf{Y}^{k}) - \lambda (\mathbf{Y}^{0})\right)$ of size $k\times k$ is invertible. Not requiring $\pmb{E}$ would make our approach even more applicable. + +We further have the following consistency result for the estimation. + +Theorem 2. Assume that the following holds: (i) The family of distributions $q_{\phi}(\mathbf{Z}|X,\mathbf{Y},\mathbf{E})$ contains $p_{\theta}(\mathbf{Z}|\mathbf{X},\mathbf{Y},\mathbf{E})$ , and $q_{\phi}(\mathbf{Z}|\mathbf{X},\mathbf{Y},\mathbf{E}) > 0$ everywhere. (ii) We maximize $\mathcal{L}_{phase1}(\theta, \phi)$ with respect to both $\theta$ and $\phi$ . Then in the limit of infinite data, we learn the true parameters $\theta^{*}$ up to a permutation and simple transformation of the latent variables $\mathbf{Z}$ . + +As a consequence of Theorems 1&2, we have: + +Theorem 3. Assume the hypotheses of Theorem 1 and Theorem 2 hold, then in the limit of infinite data, we identify the true latent variables $Z^{*}$ up to a permutation and simple transformation. + +Theorem 3 states that we can use NF-iVAE to infer the true $Z^{*}$ up to a permutation and simple transformation. We use the mean of $q_{\phi}(Z|X,Y,E)$ for this task. Note that the noise $\epsilon$ may introduce uncertainty in the estimation of $Z$ . However, when $X$ is high dimensional and $Z$ is low dimensional (as common in real world applications), $q_{\phi}(Z|X,Y,E)$ will be highly concentrated and we will still be able to estimate $Z$ with high accuracy. The good results obtained by our method in various experiments seem to corroborate this. All three theorems are proven in Appendix H. + +# 4.2 PHASE 2: DISCOVERING DIRECT CAUSES + +After estimating $Z$ for each data point, the next step is to determine which components of $Z$ are direct causes of $Y$ . We denote these components by $\mathrm{Pa}(Y)$ . We first conduct the PC algorithm (Spirtes et al., 2000) to learn a Markov equivalence class of DAGs, which gives us the direct neighbors of $Y$ , + +denoted by $\mathrm{Ne}(\mathbf{Y})$ . Then, from Assumption 1, one observation is that in the generic case, for any two latent variables $Z_{i}$ and $Z_{j}$ from $\mathrm{Ne}(\mathbf{Y})$ , only when both are causes of $\mathbf{Y}$ do we have that the dependency between them increases after additionally conditioning on $\mathbf{Y}$ . Thus, when there exist at least two causal latent variables in $\mathrm{Ne}(\mathbf{Y})$ , we can test all pairs of latent variables with conditional independence testing8 (Zhang et al., 2012) to discover $\mathrm{Pa}(\mathbf{Y})$ by comparing $p$ -values from the two tests: IndTest $(Z_{i}, Z_{j} | \mathbf{E})$ and IndTest $(Z_{i}, Z_{j} | \mathbf{Y}, \mathbf{E})$ , where IndTest denotes (conditional) independence test. Conversely, if no such a pair is found, it implies that there is at most one causal latent variable. This is a highly unlikely case in real world applications, which is left to Appendix G. + +# 4.3 PHASE 3: LEARNING AN INVARIANT PREDICTOR + +After having obtained the causal latent variables $\mathrm{Pa}(\mathbf{Y})$ for $\mathbf{Y}$ across training environments, we can learn $w$ by solving the following optimization problem: + +$$ +\min _ {w \in \mathcal {H} _ {w}} \sum_ {e \in \mathcal {E} _ {t r}} R ^ {e} (w) = \min _ {w \in \mathcal {H} _ {w}} \sum_ {e \in \mathcal {E} _ {t r}} \mathbb {E} _ {\mathrm {P a} \left(\boldsymbol {Y} ^ {e}\right), \boldsymbol {Y} ^ {e}} \left[ \ell_ {1} \left(w \left(\mathrm {P a} \left(\boldsymbol {Y} ^ {e}\right)\right), \boldsymbol {Y} ^ {e}\right) \right], \tag {11} +$$ + +where $\ell_1(\cdot)$ could be any loss. Since we assume that $\mathbb{E}(\boldsymbol{Y}|\mathrm{Pa}(\boldsymbol{Y}))$ is invariant across $\mathcal{E}_{all}$ (the relaxed version of Assumption 1d), the learned $w$ is guaranteed to perform well across $\mathcal{E}_{all}$ . + +The remaining question is how to infer $\mathrm{Pa}(\pmb {Y})$ (i.e., $Z_{p}$ ) from $\pmb{X}$ in a new environment. This can be implemented by leveraging the learned $p(\pmb {X}|\pmb {Z})$ . The rationale behind is that $p(\pmb {X}|\pmb {Z})$ is assumed to be invariant across $\mathcal{E}_{all}$ (Assumption 1c). In light of this idea, we follow Sun et al. (2020) and infer $Z_{p}$ from $\pmb{X}$ in any new testing environment by solving the following optimization problem: + +$$ +\max _ {\boldsymbol {Z} _ {p}, \boldsymbol {Z} _ {c}} \log p _ {\boldsymbol {f}} \left(\boldsymbol {X} \mid \boldsymbol {Z} _ {p}, \boldsymbol {Z} _ {c}\right) + \lambda_ {1} \| \boldsymbol {Z} _ {p} \| _ {2} ^ {2} + \lambda_ {2} \| \boldsymbol {Z} _ {c} \| _ {2} ^ {2}, \tag {12} +$$ + +where the hyperparameters $\lambda_1 > 0$ and $\lambda_{2} > 0$ control the learned $Z_{p}$ and $Z_{c}$ in a reasonable scale, and both are selected on training/validation data. For optimization, we follow Schott et al. (2018) to first use values of $Z$ sampled from the training set as initial points and then use Adam to optimize for several iterations. Note that the noise $\epsilon$ will introduce uncertainty in the estimation of $Z_{p}$ and $Z_{c}$ from $X$ . However, as we mentioned before (below Theorem 3), this noise is not going to affect the estimation much because the likelihood will be highly concentrated around the ground truth values, as corroborated by our good empirical results. + +A key question is if iCaRL performs well across $\mathcal{E}_{all}$ even though it uses only data from $\mathcal{E}_{tr}$ . That is, does iCaRL enable OOD generalization, as defined by Arjovsky et al. (2019)? The answer is positive since Theorem A.1 in Arjovsky (2021) indicates that i) any predictor $w\circ \Phi$ with optimal OOD generalization uses only $\mathrm{Pa}(\pmb {Y})$ to compute $\Phi$ and ii) the classifier $w$ in this optimal predictor can be estimated using data from any environment $e$ for which the distribution of $\mathrm{Pa}(\pmb {Y}^e)$ has full support, which will always be the case since the conditional prior in Eq. (5) has full support. Finally, Theorem A.1 in Arjovsky (2021) also indicates that iii) the optimal predictor will be invariant across $\mathcal{E}_{all}$ . Key to these results is that $\mathrm{Pa}(\pmb {Y}^{e})$ are available when solving (12). This requires first to identify the latent variables $\pmb{Z}$ from $\pmb {X}$ , $\pmb{Y}$ and $\pmb{E}$ and second, to discover the direct causes of $\pmb{Y}$ . The hypotheses of Theorems 1 and 2 and Assumption 1 provide this guarantee. We therefore have the following result whose proof is in Appendix H. + +Proposition 1. Under Assumption 1 and the assumptions of Theorems 1 and 2, the predictor learned by iCaRL across $\mathcal{E}_{tr}$ in the limit of infinite data has optimal OOD generalization across $\mathcal{E}_{all}$ . + +# 5 EXPERIMENTS + +We compare our approach with a variety of methods on both synthetic and real-world datasets. In all comparisons, unless stated otherwise, we average performance over ten runs. Due to space constraints, we only highlight some key results while pointing to the extensive appendices for more information. The supplement contains all the details of the experiments, e.g., datasets (Appendix J), implementation (Appendix M), hyperparameters and architectures (Appendix N), etc. + +# 5.1 SYNTHETIC DATA + +To verify the identifiability of NF-iVAE, we conduct a series of experiments on synthetic data generated according to the causal graph shown in Fig. 2e. Details of the ground truth data generating + +![](images/0d6314586689428e00864504347757e13208a59ac31cb117f9d105afae248262.jpg) + +![](images/99bf048e09c9e4673205cada7691b9241220f40d56bc0277814127db5bb87b7b.jpg) +(a) Ground truth +(e) Causal graph +Figure 2: (a-d) Visualization of the samples (i.e., $\hat{Z} = (\hat{Z}_1, \hat{Z}_2)$ ) in latent space recovered through different algorithms: (a) Samples from the true distribution; (b-c) Samples from the posterior inferred using VAE and iVAE, respectively. Apparently, our method (d) can recover the original data up to a permutation and a simple componentwise transformation. (e) The causal structure with $\mathbf{Y}$ having two causes describes the data generating process of the synthetic dataset. (f) Mean correlation coefficient (MCC) scores for VAE, iVAE, and NF-iVAE on synthetic data. (g) MCC scores for VAE, iVAE, and NF-iVAE on CMNIST. (h) The effects on the CMNIST images of digit 8 (top two rows) and digit 3 (bottom two rows) when intervening on a causal factor $Z_{i \in I_p}$ and on a non-causal factor (effect) $Z_{j \in I_c}$ , respectively. + +![](images/ee7d8f75d10055766715e724dca60767d0e40d831b23f80176c891892c26e675.jpg) +(b) VAE + +![](images/4bb23b635facb010e90c5c2b9f5a7d5568ca4859e2d4a82e99616b2e427b09b9.jpg) +(f) MCC on synthetic data + +![](images/db7924fce4e0af805333581d5548d45faa6612a09b4e7260da825379960317d3.jpg) + +![](images/d9dbf1000677a5af1181ddf2bdcfefaa6988e3ccb3514ee6cf1842c1340ef979.jpg) +(c) iVAE +(g) MCC on CMNIST + +![](images/5b1f8d3ab809de521cd63ce51405fbb1e6779a9ec55dcf13178d0f1079771635.jpg) + +![](images/050e75840e54183756223eaedcc33143dc26f96ddb46378ff1bdbe8a15700d74.jpg) +(d) NF-iVAE +(h) Intervening CMNIST + +process are given in Appendix K. The reason we choose this setting is that it is the simplest case satisfying our requirements: a) For ease of visualization, the latent space had better be 2-dimensional; b) To introduce the non-factorized prior given $\mathbf{Y}$ and $\mathbf{E}$ (i.e., $Z_{i} \nsubseteq Z_{j} | \mathbf{Y}, \mathbf{E}$ ), $\mathbf{Y}$ has at least two causes. We draw 1000 samples from each of the four environments $\mathbf{E} = \{0.2, 2, 3, 5\}$ , and thus the whole synthetic dataset consists of 4000 samples. The task is to recover the true latent variable $\mathbf{Z} = (Z_{1}, Z_{2})$ using the samples of $\mathbf{X}$ , $\mathbf{E}$ , and $\mathbf{Y}$ . We compare with two widely-used baselines: VAE (Kingma & Welling, 2013) (without identifiability guarantees) and iVAE (Khemakham et al., 2020a) (with a conditionally factorized prior for identifiability). Through the aforementioned theoretical analysis, it is evident that our method has a more general assumption on the prior leading to identifiability. This is demonstrated empirically in Figs. 2b-2d. Our method NF-iVAE can recover the original data $\mathbf{Z}$ up to a permutation and a simple componentwise transformation, whereas all the other methods fail because they are unable to handle the non-factorized case in which $Z_{i} \nsubseteq Z_{j} | \mathbf{Y}, \mathbf{E}$ . We also compute the mean correlation coefficient (MCC) used in Khemakham et al. (2020a), which can be obtained by calculating the correlation coefficient between all pairs of true and recovered latent factors and then solving a linear sum assignment problem by assigning each recovered latent factor to the true latent factor with which it best correlates. By definition, higher MCC scores indicate stronger identifiability. From Fig. 2f, we can see that the MCC score for NF-iVAE is significantly greater than those of VAE and iVAE, indicating much stronger identifiability. Note that, in Appendix K we additionally compare with more methods, whose differences are further summarized in a table. + +# 5.2 COLORED MNIST, COLORED FASHION MNIST, AND VLCS + +In this section, we first report experiments on two datasets used in IRM and IRMG: Colored MNIST (CMNIST) and Colored Fashion MNIST (CFMNIST). We follow the same setting of Ahuja et al. (2020a) to create these two datasets (see the details in Appendix J). The task is to predict a binary label assigned to each image which is originally grayscale but artificially colored in a way that the color is correlated strongly but spuriously with the class label. For all the experiments on these two datasets, we set the number of the latent variables to $n = 10$ . + +Likewise, we investigate the identifiability of NF-iVAE on CMNIST by computing the MCC score between samples of the true latent variable and of the recovered latent variable. Since the true latent variable on CMNIST is inaccessible to us, we follow Khemakhem et al. (2020b) and compute an average MCC score between samples of latent variables recovered by different models trained with different random initialization. As shown in Fig. 2g, it is evident that the MCC score for NF-iVAE greatly outperforms the others, showing that the latent variables recovered by NF-iVAE have much better identifiability. + +Furthermore, we demonstrate the ability of iCaRL to discover the causal latent variables (Phase 2) by visualizing the generated images through performing intervention upon a causal latent variable and a non-causal latent variable, respectively. Fig. 2h shows how intervening upon each of them affects the image. Obviously, intervening on a causal latent variable affects the shape of the digit but not its color + +Table 1: Colored Fashion MNIST. Comparisons in terms of accuracy $(\%)$ (mean $\pm$ std deviation). + +
METHODTRAINTEST
ERM83.17 ± 1.0122.46 ± 0.68
ERM 181.33 ± 1.3533.34 ± 8.85
ERM 284.39 ± 1.8913.16 ± 0.82
ROBUST MIN MAX82.81 ± 0.1129.22 ± 8.56
F-IRM GAME62.31 ± 2.3569.25 ± 5.82
V-IRM GAME68.96 ± 0.9570.19 ± 1.47
IRM75.01 ± 0.2555.25 ± 12.42
iCaRL (ours)74.96 ± 0.3773.61 ± 0.63
ERM GRYSCALE74.79 ± 0.3774.67 ± 0.48
OPTIMAL7575
+ +Table 2: VLCS. Comparisons in terms of accuracy $(\%)$ (mean $\pm$ std deviation). + +
METHODTEST
ERM77.4 ± 0.3
IRM78.1 ± 0.0
DRO (Sagawa et al., 2019)77.2 ± 0.6
Mixup (Yan et al., 2020)77.7 ± 0.4
CORAL (Sun & Saenko, 2016)77.7 ± 0.5
MMD (Li et al., 2018b)76.7 ± 0.9
DANN (Ganin et al., 2016)78.7 ± 0.3
C-DANN (Li et al., 2018c)78.2 ± 0.4
LaCIM (Sun et al., 2020)78.4 ± 0.5
iCaRL (ours)81.8 ± 0.6
+ +(top plots), whilst intervening on a non-causal latent variable, which is an effect in Fig. 2h, affects the color of the digit only (bottom plots). This visually verifies the results of iCaRL in Phase 2. + +In terms of the OOD generalization performance, we compare iCaRL with 1) IRM, 2) two variants of IRMG: F-IRM Game (with $\Phi$ fixed to the identity) and V-IRM Game (with a variable $\Phi$ ), 3) three variants of ERM: ERM (on entire training data), ERM $e$ (on each environment $e$ ), and ERM GRAYSCALE (on data with no spurious correlations), and 4) ROBUST MIN MAZ (minimizing the maximum loss across the multiple environments). Table 1 shows that iCaRL outperforms all other baselines on CFMNIST. It is worth emphasising that the train and test accuracies of iCaRL closely approach the ones of ERM GRAYSCALE and OPTIMAL, implying that iCaRL approximately learns the true invariant causal representations with almost no correlation with the spurious color feature. We can draw similar conclusions from the results on CMNIST (Appendix L). + +We also report the results on one of the widely used realistic datasets for OOD generalization: VLCS (Fang et al., 2013). This dataset consists of 10,729 photographic images of dimension (3,224,224) and 5 classes from four domains: Caltech101, LabelMe, SUN09, and VOC2007. We used the exact experimental setting that is described in Gulrajani & Lopez-Paz (2020). We provide results averaged over all possible train and test environment combination for one of the commonly used hyper-parameter tuning procedure: train domain validation. As shown in Table 2, iCaRL achieves state-of-the-art performance when compared to those most popular domain generalization alternatives. We further include experimental evidence on another popular dataset: PACS (Li et al., 2017a), all the details of which are placed in Appendix L. + +# 6 RELATED WORK + +Invariant Causal Prediction (ICP), aims to find the causal feature set (i.e., all direct causes of a target variable of interest) (Peters et al., 2015) by exploiting the invariance property in causality which has been discussed under the term "autonomy", "modularity", and "stability" (Haavelmo, 1944; Aldrich, 1989; Hoover, 1990; Pearl, 2009; Dawid et al., 2010; Scholkopf et al., 2012). This invariance property assumed in ICP and its nonlinear extension (Heinze-Deml et al., 2018) is limited, because no intervention is allowed on the target variable $Y$ . Besides, ICP methods implicitly assume that the variables of interest $Z$ are given. The works of Magliacane et al. (2018) and Subbaswamy et al. (2019) attempt to find invariant predictors that are maximally predictive using conditional independence tests and other graph-theoretic tools, both of which also assume that the $Z$ are given and further assume that additional information about the structure over $Z$ is known. Mitrovic et al. (2020) analyze data augmentations in self-supervised learning from the perspective of invariant causal mechanisms. Arjovsky et al. (2019) reformulate this invariance as an optimization-based problem, allowing us to learn an invariant data representation from $X$ constrained to be a linear transformation of $Z$ . The risks of this approach have been discussed in Rosenfeld et al. (2020); Kamath et al. (2021); Nagarajan et al. (2020) and its sample complexity is analyzed in Ahuja et al. (2020b). + +Another line of related work is in the field of domain generalization, which we discuss in Appendix A. + +# 7 CONCLUSION + +We have proposed a novel framework to learn invariant predictors from a diverse set of training environments. It is based on a practical and general assumption: the prior over the data representation belongs to a general exponential family when conditioning on the target and the environment. This assumption leads to guarantees that the components in the representation can be identified up to a permutation and simple transformation. This allows us to discover all the direct causes of the target, which enables generalization guarantees in the nonlinear setting. We hope our framework will inspire new ways to address the OOD generalization problem through a causal lens. + +# ACKNOWLEDGEMENTS + +We are thankful to Wenlin Chen for contributing to Step III in the proof of Theorem 4 and for generalizing the proof in Theorem 5 to the case in which each $T_{i}(Z_{i})$ in $T_{f}(\mathbf{Z})$ contains arbitrary sufficient statistics instead of just $Z_{i}$ and $Z_{i}^{2}$ . We also thank Ilyes Khemakhem, Aapo Hyvärinen, and Arthur Gretton for their helpful discussions, and the anonymous reviewers for their constructive comments on an earlier version of this paper. + +# REFERENCES + +Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaojiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org. +Kartik Ahuja, Karthikeyan Shanmugam, Kush Varshney, and Amit Dhurandhar. Invariant risk minimization games. arXiv preprint arXiv:2002.04692, 2020a. +Kartik Ahuja, Jun Wang, Amit Dhurandhar, Karthikeyan Shanmugam, and Kush R Varshney. Empirical or invariant risk minimization? a sample complexity perspective. arXiv preprint arXiv:2010.16412, 2020b. +Kartik Ahuja, Ethan Caballero, Dinghuai Zhang, Yoshua Bengio, Ioannis Mitliagkas, and Irina Rish. Invariance principle meets information bottleneck for out-of-distribution generalization. arXiv preprint arXiv:2106.06607, 2021. +John Aldrich. Autonomy. Oxford Economic Papers, 41(1):15-34, 1989. +Martín Arjovsky. Out of distribution generalization in machine learning. CoRR, abs/2103.02667, 2021. +Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. +Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain generalization using meta-regularization. Advances in Neural Information Processing Systems, 31: 998-1008, 2018. +Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 456-473, 2018. +Shai Ben-David, John Blitzer, Koby Crammer, Fernando Pereira, et al. Analysis of representations for domain adaptation. Advances in neural information processing systems, 19:137, 2007. +Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1):151-175, 2010. +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. +Pierre Comon. Independent component analysis, a new concept? Signal processing, 36(3):287-314, 1994. +Koby Crammer, Michael Kearns, and Jennifer Wortman. Learning from multiple sources. Journal of Machine Learning Research, 9(8), 2008. +Povilas Daniusis, Dominik Janzing, Joris Mooij, Jakob Zscheischler, Bastian Steudel, Kun Zhang, and Bernhard Scholkopf. Inferring deterministic causal relations. arXiv preprint arXiv:1203.3475, 2012. + +A Philip Dawid, Vanessa Didelez, et al. Identifying the consequences of dynamic treatment strategies: A decision-theoretic overview. Statistics Surveys, 4:184-231, 2010. +Zhengming Ding and Yun Fu. Deep domain generalization with structured low-rank constraint. IEEE Transactions on Image Processing, 27(1):304-313, 2017. +Qi Dou, Daniel C Castro, Konstantinos Kamnitsas, and Ben Glocker. Domain generalization via model-agnostic learning of semantic features. arXiv preprint arXiv:1910.13580, 2019. +Sarah Erfani, Mahsa Baktashmotlagh, Masud Moshtaghi, Xuan Nguyen, Christopher Leckie, James Bailey, and Rao Kotagiri. Robust domain generalisation by enforcing distribution invariance. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16), pp. 1455–1461. AAAI Press, 2016. +Chen Fang, Ye Xu, and Daniel N Rockmore. Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1657-1664, 2013. +Jose AR Fonollosa. Conditional distribution variability measures for causality detection. In Cause Effect Pairs in Machine Learning, pp. 339-347. Springer, 2019. +Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096-2030, 2016. +Muhammad Ghifary, W. Bastiaan Kleijn, Mengjie Zhang, and David Balduzzi. Domain generalization for object recognition with multi-task autoencoders. In ICCV, pp. 2551-2559. IEEE Computer Society, 2015. +Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020. +Trygve Haavelmo. The probability approach in econometrics. *Econometrica: Journal of the Econometric Society*, pp. iii-115, 1944. +Christina Heinze-Deml, Jonas Peters, and Nicolai Meinshausen. Invariant causal prediction for nonlinear models. Journal of Causal Inference, 6(2), 2018. +Kevin D Hoover. The logic of causal inference: Econometrics and the conditional analysis of causation. Economics & Philosophy, 6(2):207-234, 1990. +Patrik O Hoyer, Dominik Janzing, Joris M Mooij, Jonas Peters, and Bernhard Scholkopf. Nonlinear causal discovery with additive noise models. In Advances in neural information processing systems, pp. 689-696, 2009. +Biwei Huang, Kun Zhang, Jiji Zhang, Joseph Ramsey, Ruben Sanchez-Romero, Clark Glymour, and Bernhard Scholkopf. Causal discovery from heterogeneous/nonstationary data. Journal of Machine Learning Research, 21(89):1-53, 2020. +Aapo Hyvärinen. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(4), 2005. +Aapo Hyvarinen and Erkki Oja. Independent component analysis: algorithms and applications. Neural networks, 13(4-5):411-430, 2000. +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, pp. 859-868, 2019. +Dominik Janzing, Joris Mooij, Kun Zhang, Jan Lemeire, Jakob Zscheischler, Povilas Daniusis, Bastian Steudel, and Bernhard Scholkopf. Information-geometric approach to inferring causal directions. Artificial Intelligence, 182:1-31, 2012. +Pritish Kamath, Akilesh Tangella, Danica J Sutherland, and Nathan Srebro. Does invariant risk minimization capture invariance? arXiv preprint arXiv:2101.01134, 2021. + +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, pp. 2207-2217, 2020a. +Ilyes Khemakhem, Ricardo Monti, Diederik Kingma, and Aapo Hyvarinen. Ice-beem: Identifiable conditional energy-based deep models based on nonlinear ica. Advances in Neural Information Processing Systems, 33, 2020b. +Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. +Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the IEEE international conference on computer vision, pp. 5542-5550, 2017a. +Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Meta-learning for domain generalization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018a. +Da Li, Jianshu Zhang, Yongxin Yang, Cong Liu, Yi-Zhe Song, and Timothy M Hospedales. Episodic training for domain generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1446-1455, 2019a. +Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5400-5409, 2018b. +Wen Li, Zheng Xu, Dong Xu, Dengxin Dai, and Luc Van Gool. Domain generalization and adaptation using low rank exemplar svms. IEEE transactions on pattern analysis and machine intelligence, 40(5):1114-1127, 2017b. +Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 624-639, 2018c. +Yiying Li, Yongxin Yang, Wei Zhou, and Timothy Hospedales. Feature-critic networks for heterogeneous domain generalization. In International Conference on Machine Learning, pp. 3915-3924. PMLR, 2019b. +Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Scholkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In international conference on machine learning, pp. 4114-4124, 2019. +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 Advances in Neural Information Processing Systems, pp. 10846-10856, 2018. +Massimiliano Mancini, Samuel Rota Bulò, Barbara Caputo, and Elisa Ricci. Best sources forward: domain generalization through source-specific nets. In 2018 25th IEEE international conference on image processing (ICIP), pp. 1353-1357. IEEE, 2018. +Jovana Mitrovic, Brian McWilliams, Jacob Walker, Lars Buesing, and Charles Blundell. Representation learning via invariant causal mechanisms. arXiv preprint arXiv:2010.07922, 2020. +Saeid Motiian, Marco Piccirilli, Donald A. Adjeroh, and Gianfranco Doretto. Unified deep supervised domain adaptation and generalization. In ICCV, pp. 5716-5726. IEEE Computer Society, 2017. +Krikamol Muandet, David Balduzzi, and Bernhard Scholkopf. Domain generalization via invariant feature representation. In ICML, volume 28 of JMLR Workshop and Conference Proceedings, pp. 10-18, 2013. +Vaishnavh Nagarajan, Anders Andreassen, and Behnam Neyshabur. Understanding the failure modes of out-of-distribution generalization. arXiv preprint arXiv:2010.15775, 2020. + +Li Niu, Wen Li, and Dong Xu. Multi-view domain generalization for visual recognition. In Proceedings of the IEEE international conference on computer vision, pp. 4193-4201, 2015. +Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345-1359, 2009. +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'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 8024-8035. Curran Associates, Inc., 2019. +Vishal M Patel, Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Visual domain adaptation: A survey of recent advances. IEEE signal processing magazine, 32(3):53-69, 2015. +Judea Pearl. Causality. Cambridge university press, 2009. +Jonas Peters, Peter Buhlmann, and Nicolai Meinshausen. Causal inference using invariant prediction: identification and confidence intervals. arXiv preprint arXiv:1501.01332, 2015. +Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. *Elements of causal inference*. The MIT Press, 2017. +Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014. +M. Rojas-Carulla, B. Scholkopf, R. Turner, and J. Peters. Invariant models for causal transfer learning. Journal of Machine Learning Research, 19(36):1-34, 2018. +Elan Rosenfeld, Pradeep Ravikumar, and Andrej Risteski. The risks of invariant risk minimization. arXiv preprint arXiv:2010.05761, 2020. +Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019. +B. Schölkopf, D. Janzing, J. Peters, E. Sgouritsa, K. Zhang, and J. M. Mooij. On causal and anticausal learning. In Proceedings of the 29th International Conference on Machine Learning (ICML), pp. 1255-1262, 2012. +Lukas Schott, Jonas Rauber, Matthias Bethge, and Wieland Brendel. Towards the first adversarially robust neural network model on mnist. arXiv preprint arXiv:1805.09190, 2018. +Peter Spirtes, Clark N Glymour, Richard Scheines, and David Heckerman. Causation, prediction, and search. MIT press, 2000. +Amos Storkey. When Training and Test Sets Are Different: Characterizing Learning Transfer. 2009. +Adarsh Subbaswamy, Bryant Chen, and Suchi Saria. A universal hierarchy of shift-stable distributions and the tradeoff between stability and performance. arXiv preprint arXiv:1905.11374, 2019. +Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pp. 443-450. Springer, 2016. +Xinwei Sun, Botong Wu, Chang Liu, Xiangyu Zheng, Wei Chen, Tao Qin, and Tie-yan Liu. Latent causal invariant model. arXiv preprint arXiv:2011.02203, 2020. +Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5018-5027, 2017. +Pascal Vincent. A connection between score matching and denoising autoencoders. Neural computation, 23(7):1661-1674, 2011. + +Julius von Kugelgen, Yash Sharma, Luigi Gresele, Wieland Brendel, Bernhard Scholkopf, Michel Besserve, and Francesco Locatello. Self-supervised learning with data augmentations provably isolates content from style. arXiv preprint arXiv:2106.04619, 2021. +J. von Kugelgen, A. Mey, M. Loog, and B. Scholkopf. Semi-supervised learning, causality and the conditional cluster assumption. Conference on Uncertainty in Artificial Intelligence (UAI), 2020. +Changzhang Wang, You Zhou, Qiang Zhao, and Zhi Geng. Discovering and orienting the edges connected to a target variable in a dag via a sequential local learning approach. Computational Statistics & Data Analysis, 77:252-266, 2014. +Haohan Wang, Aaksha Meghawat, Louis-Philippe Morency, and Eric P Xing. Select-additive learning: Improving generalization in multimodal sentiment analysis. In 2017 IEEE International Conference on Multimedia and Expo (ICME), pp. 949-954. IEEE, 2017. +Haohan Wang, Zexue He, Zachary C Lipton, and Eric P Xing. Learning robust representations by projecting superficial statistics out. arXiv preprint arXiv:1903.06256, 2019. +Garrett Wilson and Diane J Cook. A survey of unsupervised deep domain adaptation. ACM Transactions on Intelligent Systems and Technology (TIST), 11(5):1-46, 2020. +Sewall Wright. Correlation and causation. J. agric. Res., 20:557-580, 1921. +Shen Yan, Huan Song, Nanxiang Li, Lincan Zou, and Liu Ren. Improve unsupervised domain adaptation with mixup training. arXiv preprint arXiv:2001.00677, 2020. +Kun Zhang, Jonas Peters, Dominik Janzing, and Bernhard Scholkopf. Kernel-based conditional independence test and application in causal discovery. arXiv preprint arXiv:1202.3775, 2012. +Kun Zhang, Bernhard Schölkopf, Krikamol Muandet, and Zhikun Wang. Domain adaptation under target and conditional shift. In International Conference on Machine Learning, pp. 819-827. PMLR, 2013. +Kun Zhang, Mingming Gong, and Bernhard Schölkopf. Multi-source domain adaptation: A causal view. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 29, 2015. +Kun Zhang, Biwei Huang, Jiji Zhang, Clark Glymour, and Bernhard Scholkopf. Causal discovery from nonstationary/heterogeneous data: Skeleton estimation and orientation determination. In *IJCAI: Proceedings of the Conference*, volume 2017, pp. 1347. NIH Public Access, 2017. +Han Zhao, Remi Tachet Des Combes, Kun Zhang, and Geoffrey Gordon. On learning invariant representations for domain adaptation. In International Conference on Machine Learning, pp. 7523-7532. PMLR, 2019. + +# A DOMAIN GENERALIZATION + +The goal of domain generalization (DG) (Muandet et al., 2013) is OOD generalization: learning a predictor that performs well at unseen test domains. Unlike domain adaptation (Pan & Yang, 2009; Ben-David et al., 2007; 2010; Crammer et al., 2008; Patel et al., 2015; Zhao et al., 2019; Wilson & Cook, 2020; Zhang et al., 2015), DG assumes that the test domain data are not available during training. One thread of DG is to explore techniques from kernel methods (Muandet et al., 2013; Niu et al., 2015; Erfani et al., 2016; Li et al., 2017b). Muandet et al. (2013) propose a kernel-based optimization algorithm that learns an invariant transformation by minimizing the discrepancy among domains and preventing the loss of relationship between input and output features. Another line of DG work is using end-to-end methods from deep learning: (a) reducing the differences of representations across domains through adversarial or similar techniques (Ghifary et al., 2015; Wang et al., 2017; Motiian et al., 2017; Li et al., 2018b;c); (b) projecting out superficial domain-specific statistics to reduce sensitivity to the domain (Wang et al., 2019); (c) fusing representations from an ensemble of models across domains (Ding & Fu, 2017; Mancini et al., 2018). Meta-learning can also be applied to domain generalization, by dividing source domains into meta-training and meta-test sets, and aiming for a low generalization error on meta-test sets after training on meta-training sets (Balaji et al., 2018; Dou et al., 2019; Li et al., 2018a; 2019a;b). Recently, an extensive empirical survey of many DG algorithm (Gulrajani & Lopez-Paz, 2020) suggested that with current models and data augmentation techniques, plain ERM may be competitive with the state-of-the-art. It is worth noting that Sun et al. (2020) also propose an approach to learning latent causal factors for prediction. However, their assumptions over the underlying causal graph are restricted due to two reasons: 1) they only consider the scenarios when $Z$ and $Y$ are generated concurrently, which excludes the cases in which some part of $Z$ could also be affected by $Y$ in some manner; 2) They assume that the causal latent factors $Z_{p}$ and the non-causal latent factors $Z_{c}$ are independent when conditioning on $E$ , that is, $Z_{p} \perp Z_{c}|E$ . In practice, during model learning, they actually further assume that $Z_{i} \perp Z_{j}|E$ for any $i \neq j$ so that VAE could be leveraged to learn the model. In this sense, their approach has the same issue as the one in iVAE, i.e., unable to deal with the non-factorized cases. This point is also verified in Table 2, where our approach greatly outperforms theirs. + +# B VARIATIONAL AUTOENCODERS + +We briefly describe the framework of variational autoencoders (VAEs), which allows us to efficiently learn deep latent-variable models and their corresponding inference models (Kingma & Welling, 2013; Rezende et al., 2014). Consider a simple latent variable model where $\mathbf{X} \in \mathbb{R}^d$ stands for an observed variable and $\mathbf{Z} \in \mathbb{R}^n$ for a latent variable. A VAE method learns a full generative model $p_{\theta}(X, Z) = p_{\theta}(X|Z)p_{\theta}(Z)$ and an inference model $q_{\phi}(Z|X)$ , typically a factorized Gaussian distribution whose mean and variance parameters are given by the output of a neural network with input $X$ . This inference model approximates the posterior $p_{\theta}(Z|X)$ , where $\theta$ is a vector of parameters of the generative model, $\phi$ a vector of parameters of the inference model, and $p_{\theta}(Z)$ is a prior distribution over the latent variables. Instead of maximizing the data log-likelihood, we maximize its lower bound $\mathcal{L}_{\mathrm{VAE}}(\theta, \phi)$ : + +$$ +\log p _ {\boldsymbol {\theta}} (\boldsymbol {X}) \geq \mathcal {L} _ {\mathrm {V A E}} (\boldsymbol {\theta}, \phi) := \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X})} [ \log p _ {\boldsymbol {\theta}} (\boldsymbol {X} | \boldsymbol {Z}) ] - \operatorname {K L} \left(q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}) \| p _ {\boldsymbol {\theta}} (\boldsymbol {Z})\right), +$$ + +where we have used Jensen's inequality, and $\mathrm{KL}(\cdot ||\cdot)$ denotes the Kullback-Leibler divergence between two distributions. + +# C DERIVATION + +# C.1 IVAE + +In Section 2.1, the evidence lower bound of iVAE is defined by + +$$ +\begin{array}{l} \mathcal {L} _ {\mathrm {i V A E}} (\boldsymbol {\theta}, \phi) := \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {U})} [ \log p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) ] - \operatorname {K L} (q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {U}) | | p _ {\boldsymbol {T}, \lambda} (\boldsymbol {Z} | \boldsymbol {U})) \right] \\ = \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {U})} \left[ \log p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) + \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {U}) - \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {U}) \right] \right]. \\ \end{array} +$$ + +# C.2 SCORE MATCHING + +In Section 4.1, we follow Hyvarinen (2005) and use a simple trick of partial integration to simplify the evaluation of the score matching objective $\mathcal{L}_{\mathrm{phase1}}^{\mathrm{SM}}$ in Eq. (10) of the main text: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {S M}} (\boldsymbol {T}, \boldsymbol {\lambda}) := \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \| \nabla_ {\boldsymbol {Z}} \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) - \nabla_ {\boldsymbol {Z}} \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) \| ^ {2} \right] \right] \\ = \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \sum_ {j = 1} ^ {n} \left[ \frac {\partial^ {2} p _ {\boldsymbol {T} , \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y} , \boldsymbol {E})}{\partial Z _ {j} ^ {2}} + \frac {1}{2} \left(\frac {\partial p _ {\boldsymbol {T} , \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y} , \boldsymbol {E})}{\partial Z _ {j}}\right) ^ {2} \right] \right] \right] + c o n s t. \\ \end{array} +$$ + +where the last equality is due to the Theorem 1 in Hyvarinen (2005). + +# D DEFINITIONS FOR SEM AND IRM + +Definition 2. A structural equation model (SEM) $\mathcal{M} \coloneqq (\mathcal{S}, N)$ governing the random vector $Z = (Z_{1}, \ldots, Z_{d})$ is a set of structural equations: + +$$ +\mathcal {S} _ {i}: Z _ {i} \leftarrow f _ {i} (\operatorname {P a} (Z _ {i}), N _ {i}), +$$ + +where $\mathrm{Pa}(Z_i) \subseteq \{Z_1, \ldots, Z_d\} \setminus \{Z_i\}$ are called the parents of $Z_i$ , and the $N_i$ are independent noise random variables. We say that “ $Z_i$ causes $Z_j$ ” if $Z_i \in \mathrm{Pa}(Z_j)$ . We call causal graph of $Z$ to the graph obtained by drawing $i$ ) one node for each $Z_i$ , and $ii$ ) one edge from $Z_i$ to $Z_j$ if $Z_i \in \mathrm{Pa}(Z_j)$ . We assume acyclic causal graphs. + +Definition 3. Consider a SEM $\mathcal{M} \coloneqq (\mathcal{S}, N)$ . An intervention $e$ on $\mathcal{M}$ consists of replacing one or several of its structural equations to obtain an intervened SEM $\mathcal{M}^e \coloneqq (\mathcal{S}^e, N^e)$ , with structural equations: + +$$ +\mathcal {S} _ {i} ^ {e}: Z _ {i} ^ {e} \leftarrow f _ {i} ^ {e} \left(\operatorname {P a} ^ {e} \left(Z _ {i} ^ {e}\right), N _ {i} ^ {e}\right), +$$ + +The variable $Z^{e}$ is intervened if $S_{i} \neq S_{i}^{e}$ or $N_{i} \neq N_{i}^{e}$ . + +Definition 4. Consider a structural equation model (SEM) $S$ governing the random vector $(Z_{1},\ldots ,Z_{n},Y)$ , and the learning goal of predicting $Y$ from $Z$ . Then, the set of all environments $\mathcal{E}_{all}(\mathcal{S})$ indexes all the interventional distributions $P(\mathbf{Z}^{e},\mathbf{Y}^{e})$ obtainable by valid interventions $e$ . An intervention $e\in \mathcal{E}_{all}(\mathcal{S})$ is valid as long as (i) the causal graph remains acyclic, (ii) $\mathbb{E}\left[\mathbf{Y}^e |\mathrm{Pa}(\mathbf{Y})\right] = \mathbb{E}\left[\mathbf{Y}|\mathrm{Pa}(\mathbf{Y})\right]$ , and (iii) $\mathbb{V}\left[\mathbf{Y}^e |\mathrm{Pa}(\mathbf{Y})\right]$ remains within a finite range. + +# E DEFINITIONS AND LEMMAS FOR THE EXPONENTIAL FAMILIES + +Definition 5. (Exponential family) A multivariate exponential family is a set of distributions whose probability density function can be written as + +$$ +p (\boldsymbol {Z}) = \frac {\mathcal {Q} (\boldsymbol {Z})}{\mathcal {C} (\boldsymbol {\theta})} \exp \left(\langle \boldsymbol {T} (\boldsymbol {Z}), \boldsymbol {\theta} \rangle\right), \tag {13} +$$ + +where $\mathcal{Q}:\mathcal{Z}\to \mathbb{R}$ is the base measure, $\mathcal{C}(\pmb {\theta})$ is the normalizing constant, $\pmb {T}:\mathcal{Z}\rightarrow \mathbb{R}^k$ is the sufficient statistics, and $\pmb {\theta}\in \mathbb{R}^{k}$ is the natural parameter. The size $k\geq n$ is the dimension of the sufficient statistics $\pmb{T}$ and depends on the latent space dimension $n$ . Note that $k$ is fixed given $n$ . + +Definition 6. (Strongly exponential distributions) A multivariate exponential family distribution + +$$ +p (\boldsymbol {Z}) = \frac {\mathcal {Q} (\boldsymbol {Z})}{\mathcal {C} (\boldsymbol {\theta})} \exp \left(\langle \boldsymbol {T} (\boldsymbol {Z}), \boldsymbol {\theta} \rangle\right) \tag {14} +$$ + +is strongly exponential, if + +$$ +(\exists \boldsymbol {\theta} \in \mathbb {R} ^ {k} s. t. \langle \boldsymbol {T} (\boldsymbol {Z}), \boldsymbol {\theta} \rangle = c o n s t, \forall \boldsymbol {Z} \in \mathcal {Z}) \Longrightarrow (l (\mathcal {Z}) = 0 o r \boldsymbol {\theta} = \mathbf {0}), \quad \forall \mathcal {Z} \subset \mathbb {R} ^ {n}, \tag {15} +$$ + +where $l$ is the Lebesgue measure. + +The density of a strongly exponential distribution has almost surely the exponential component and can only be reduced to the base measure on a set of measure zero. Note that all common multivariate exponential family distributions (e.g. multivariate Gaussian) are strongly exponential. + +# F DEFINITIONS FOR IDENTIFIABILITY + +Definition 7. Let $\Theta$ be the domain of the parameters $\pmb{\theta} = \{\pmb{f},\pmb{T},\pmb{\lambda}\}$ . Let $\sim$ be an equivalence relation on $\Theta$ . A deep generative model is said to be $\sim$ -identifiable if + +$$ +p _ {\boldsymbol {\theta}} (\boldsymbol {X}) = p _ {\tilde {\boldsymbol {\theta}}} (\boldsymbol {X}) \Longrightarrow \boldsymbol {\theta} \sim \tilde {\boldsymbol {\theta}}. \tag {16} +$$ + +![](images/477755d381893c6fb1aee0134b547a484efe3136974df081b15fb62e2787c765.jpg) +(a) + +![](images/6d6c74c6dd109312aa02ed5d1b3646ce060824d1997576cb37918f52275f1b76.jpg) + +![](images/5e69364edf9672142d9d8492ff8de91a10bb1f799feef493a95b096ef71b5b0a.jpg) + +![](images/03b0adb879e5d8b3adbd4463f12f9635c596daa3d72303de0b17a9d54d98e835.jpg) +(g) +Figure 3: (a) General causal structure over $\{X_i, Y, X, E\}$ , where the arrow from $Z_i$ to $X$ is a must- have connection and the other four might not be necessary. (b) Ten possible causal structures from (a) under Assumptions 1&2. + +![](images/b3188986940b748644d12125e6f1aa026cb2f5e6eced61ab0b1793358cc4ba49.jpg) +(h) + +![](images/5a19862fb3f0a0154d0588c1cd19bb6f930faddda255f7797794842d5c8a1a9c.jpg) +(d) + +![](images/ff157af906d7edfe30114ff8e6155aaf33f74529759ce14f6d518c6182e68f7e.jpg) +(e) + +![](images/9c3b3c9c731cd24758bd0b8b38aa4030313c04f71dc528b956cf408d87605f61.jpg) +(f) + +![](images/a46f2abe5b4c199c30ce64ebe1a1a79c883a2528d17499763508d06cfe9248a9.jpg) +(i) + +![](images/df6ab8dd1e5f7e3934457778f877aa12aaaf1e0bab8cd50b8db81b1fcb48b89e.jpg) +(j) + +![](images/0551b94f006be950ce9047168107c48016bbfc1126cfd7cd9457527a4a7f259e.jpg) +(k) + +The elements in the quotient space $\Theta \setminus \sim$ are called the identifiability classes. + +Definition 8. Let $\sim_A$ be an equivalence relation on $\Theta$ defined by: + +$$ +(\boldsymbol {f}, \boldsymbol {T}, \boldsymbol {\lambda}) \sim_ {A} (\tilde {\boldsymbol {f}}, \tilde {\boldsymbol {T}}, \tilde {\boldsymbol {\lambda}}) \iff \exists A, c. s. t. \boldsymbol {T} (\boldsymbol {f} ^ {- 1} (\boldsymbol {X})) = A \tilde {\boldsymbol {T}} (\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X})) + \boldsymbol {c}, \forall \boldsymbol {X} \in \mathcal {O}, \tag {17} +$$ + +where $A\in \mathbb{R}^{k\times k}$ is an invertible matrix and $c\in \mathbb{R}^k$ is a vector. + +Definition 9. Let $\sim_P$ be an equivalence relation on $\Theta$ defined by: + +$$ +(\boldsymbol {f}, \boldsymbol {T}, \boldsymbol {\lambda}) \sim_ {P} (\tilde {\boldsymbol {f}}, \tilde {\boldsymbol {T}}, \tilde {\boldsymbol {\lambda}}) \iff \exists P, \text {c . s . t .} \boldsymbol {T} (\boldsymbol {f} ^ {- 1} (\boldsymbol {X})) = P \tilde {\boldsymbol {T}} (\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X})) + \boldsymbol {c}, \forall \boldsymbol {X} \in \mathcal {O}, \tag {18} +$$ + +where $P\in \mathbb{R}^{k\times k}$ is a block permutation matrix and $c\in \mathbb{R}^k$ is a vector. + +# G PHASE 2: DISCOVERING SINGLE CAUSE + +# G.1 SOME SPECIAL CASES IN MULTI-CAUSE SETTINGS + +These conditional independence tests can be performed in parallel to largely accelerate the testing procedure. Note that, in practice, it might occur that there exist some $Z_{i}$ which is independent of any other $Z_{j}$ when conditioning on $\mathbf{Y}$ and $\mathbf{E}$ . It is probably because such $Z_{i}$ is a deterministic transformation of $\mathbf{Y}$ . In this special case, we can use IGCI (Daniusis et al., 2012; Janzing et al., 2012) to determine whether or not $Z_{i}$ is a cause of $\mathbf{Y}$ . Also note that, in some scenarios in which the dependence signals between a pair of causal latent variables might be weak due to the data issue, we can test the conditional independence of such a latent variable with all the other causal latent variables. If it is conditionally dependent on more than half of them or its average p-value is larger than the pre-specified threshold, we will select it as one cause of $\mathbf{Y}$ . + +# G.2 DISCOVERING SINGLE CAUSE + +In the single-cause case, by following Wang et al. (2014), we leverage the $MB$ -by- $MB$ algorithm to first construct a local structure around $Y$ and then discover the single parent of $Y$ according to the constructed local graph. One obvious advantage of this approach is in efficiency, because there is no need to construct the whole causal graph containing all the latent variables and $Y$ . + +We could have an even more efficient solution to the single-cause case in some special scenarios where we assume that $Z_{i} \perp Z_{j}|Y, E$ for any $i \neq j$ . In fact, this assumption covers more scenarios than the common assumption that $Z_{i} \perp Z_{j}$ for $i \neq j$ in latent variable models, e.g., disentanglement (Bengio et al., 2013; Locatello et al., 2019), autoencoders (Kingma & Welling, 2013; Rezende et al., 2014), ICA (Comon, 1994; Hyvarinen & Oja, 2000), etc. If $Y$ is caused by at most one of $Z_{i}$ and $Z_{j}$ , and no matter whether $Z_{i}$ and $Z_{j}$ are caused by $E$ or not, then $Z_{i} \perp Z_{j}|Y, E$ holds, but we may well have $Z_{i} \nsubseteq Z_{j}$ (e.g., if $Y$ causes both $Z_{i}$ and $Z_{j}$ , or if there is a chain $Z_{i} \to Y \to Z_{j}$ ). If $Y$ causes or is caused by at most one of $Z_{i}$ and $Z_{j}$ , and at most one of $Z_{i}$ and $Z_{j}$ is caused by $E$ , then both $Z_{i} \perp Z_{j}$ and $Z_{i} \perp Z_{j}|Y, E$ hold. If $\{Y, Z_{i}, Z_{j}\}$ form a collider $Z_{i} \to Y \leftarrow Z_{j}$ , and no matter whether $Z_{i}$ and $Z_{j}$ are caused by $E$ or not, then $Z_{i} \perp Z_{j}|E$ hold, but we may have $Z_{i} \nsubseteq Z_{j}$ (e.g., when both $Z_{i}$ and $Z_{j}$ are caused by $E$ ). + +Under this assumption, we are able to separately look into each $Z_{i}$ given $\mathbf{Y}$ and $\mathbf{E}$ , without considering any other $Z_{j}$ . Fig. 5a shows that there exist only five possible connections between $Z_{i}, \mathbf{Y}, \mathbf{E}$ , and $\mathbf{X}$ . Among them, only the arrow from $Z_{i}$ to $\mathbf{X}$ must exist, because $\mathbf{X}$ is generated from $\mathbf{Z}$ . The other four arrows might not be present, with the exception that there must be at least one connection between $Z_{i}$ and $\mathbf{Y}$ or $\mathbf{E}$ (Assumption 1a). This leaves ten possible structures, shown in Figs. 3b-3k. + +Given data $\{\hat{Z}_i, Y, E, X\}$ in which the $\hat{Z}_i$ are obtained using $q_{\phi}(Z|X, Y, E)$ (for example, as given by the mean of this distribution), we are able to distinguish all ten structures in Figs. 3b-3k by using causal discovery algorithms (Peters et al., 2017; Zhang et al., 2017; Huang et al., 2020) and performing conditional independence tests (Spirtes et al., 2000; Zhang et al., 2012). This is summarized in Proposition 2 below. Its proof can be found in Appendix H, which also describes the specific assumptions made. In practice, we can assess in parallel whether or not each $Z_i$ is a direct cause of $Y$ , which accelerates this phase significantly. + +Proposition 2. Under the assumptions stated in Appendix $H$ , the ten structures shown in Figs. $3b-3k$ can be identified using causal discovery methods consistent in the infinite sample limit. + +Note that there are only four cases in which $Z_{i}$ is a parent of $Y$ (i.e., Figs. 3b, 3e, 3g, and 3j). We can identify these by applying rules 1.2, 1.6, 2.1, and 3.1 from Appendix H.5. + +# H PROOFS + +# H.1 PROOF OF THEOREM 1 + +The proof of this theorem consists of three parts. + +In Part I, we prove that the parameters $\theta$ are $\sim_A$ identifiable (Definition 8) by using assumption (i), the first half of assumption (ii), and assumption (iv) of Theorem 1. + +In Part II, based on the result in Part I, we further prove that the parameters $\theta$ are $\sim_{P}$ identifiable (Definition 9) by additionally using Assumption 2, the second half of assumption (ii) and assumption (iii) of Theorem 1. + +In Part III, we combine the results (Theorems 4&5) in both Part I and Part II into one theorem (Theorem 1), which completes the proof. + +It is worth noting that, compared to the proof in iVAE, the main changes in our proof consist of + +- Part I, In step III. + +- It has been updated to account for vectors of sufficient statistics whose entries can be arbitrary functions of all entries in the random variable vector, while in the previous proof the sufficient statistics contained entries that are functions of individual entries in the random variable vector. +- The assumption of "The sufficient statistics in $T$ are all linearly independent." is not required in our proof, but it is in the proof of iVAE. + +- Part II. + +- It has been updated to account for the part of the sufficient statistics which is the output of a deep neural network with ReLU activation functions. + +# H.1.1 PART I + +For notational simplicity, in the proof of this part we denote $(\mathbf{Y},\mathbf{E})$ by $\pmb{U}$ . Hence, our generative model defined according to Eqs. (6-8) in the main text now becomes: + +$$ +p _ {\boldsymbol {\theta}} (\boldsymbol {X}, \boldsymbol {Z} | \boldsymbol {U}) = p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) p _ {\boldsymbol {T}, \lambda} (\boldsymbol {Z} | \boldsymbol {U}), \tag {19} +$$ + +$$ +p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) = p _ {\epsilon} (\boldsymbol {X} - \boldsymbol {f} (\boldsymbol {Z})), \tag {20} +$$ + +$$ +p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {U}) = \mathcal {Q} (\boldsymbol {Z}) / \mathcal {C} (\boldsymbol {U}) \exp \left[ \boldsymbol {T} (\boldsymbol {Z}) ^ {\mathrm {T}} \boldsymbol {\lambda} (\boldsymbol {U}) \right]. \tag {21} +$$ + +Theorem 4. Suppose that we observe data sampled from a deep generative model defined according to Eqs. (19-21) with parameters $(\pmb{f},\pmb{T},\pmb{\lambda})$ . Assume that + +(i) The set $\{\mathbf{X} \in \mathbb{O} | \varphi_{\varepsilon}(\mathbf{X}) = 0\}$ has measure zero, where $\varphi_{\varepsilon}$ is the characteristic function of the density $p_{\varepsilon}$ defined in Eq. (20); + +(ii) The mixing function $\pmb{f}$ in Eq. (20) is injective; + +(iii) There exist $k + 1$ points $\pmb{U}^0, \pmb{U}^1, \dots, \pmb{U}^k \in \mathcal{U}$ such that the matrix + +$$ +L = \left[ \boldsymbol {\lambda} \left(\boldsymbol {U} ^ {1}\right) - \boldsymbol {\lambda} \left(\boldsymbol {U} ^ {0}\right), \dots , \boldsymbol {\lambda} \left(\boldsymbol {U} ^ {k}\right) - \boldsymbol {\lambda} \left(\boldsymbol {U} ^ {0}\right) \right] \in \mathbb {R} ^ {k \times k} \tag {22} +$$ + +is invertible. + +Then the parameters $\{\pmb {f},\pmb {T},\pmb {\lambda}\}$ are $\sim_{A}$ identifiable. + +Proof. Define $\mathrm{vol}(B) = \sqrt{\operatorname*{det}(B^T B)}$ for any full column rank matrix $B$ . Suppose that we have two sets of parameters $\pmb{\theta} = (\pmb{f}, \pmb{T}, \pmb{\lambda})$ and $\tilde{\pmb{\theta}} = (\tilde{\pmb{f}}, \tilde{\pmb{T}}, \tilde{\pmb{\lambda}})$ such that $p_{\pmb{\theta}}(\pmb{X}|\pmb{U}) = p_{\tilde{\pmb{\theta}}}(\pmb{X}|\pmb{U})$ , $\forall (\pmb{X}, \pmb{U}) \in \mathcal{O} \times \mathcal{U}$ . We want to show $\pmb{\theta} \sim_A \tilde{\pmb{\theta}}$ . + +Step I. The proof of this step is similar to Step I in the proof of Theorem 1 in Khemakhem et al. (2020a). We transform the equality of the marginal distributions over observed data into the equality of noise-free distributions. For all pairs $(\boldsymbol{X},\boldsymbol{U})\in \mathcal{O}\times \mathcal{U}$ , we have + +$$ +\begin{array}{l} p _ {\boldsymbol {\theta}} (\boldsymbol {X} | \boldsymbol {U}) = p _ {\tilde {\boldsymbol {\theta}}} (\boldsymbol {X} | \boldsymbol {U}) (23) \\ \Rightarrow \int_ {\mathcal {Z}} p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) p _ {\boldsymbol {T}, \lambda} (\boldsymbol {Z} | \boldsymbol {U}) d \boldsymbol {Z} = \int_ {\mathcal {Z}} p _ {\tilde {\boldsymbol {f}}} (\boldsymbol {X} | \boldsymbol {Z}) p _ {\tilde {\boldsymbol {T}}, \tilde {\lambda}} (\boldsymbol {Z} | \boldsymbol {U}) d \boldsymbol {Z} (24) \\ \Rightarrow \int_ {\mathcal {Z}} p _ {\varepsilon} (\boldsymbol {X} - \boldsymbol {f} (\boldsymbol {Z})) p _ {\boldsymbol {T}, \lambda} (\boldsymbol {Z} | \boldsymbol {U}) d \boldsymbol {Z} = \int_ {\mathcal {Z}} p _ {\varepsilon} (\boldsymbol {X} - \tilde {\boldsymbol {f}} (\boldsymbol {Z})) p _ {\tilde {\boldsymbol {T}}, \tilde {\lambda}} (\boldsymbol {Z} | \boldsymbol {U}) d \boldsymbol {Z} (25) \\ \Rightarrow \int_ {\mathcal {O}} p _ {\varepsilon} (\boldsymbol {X} - \bar {\boldsymbol {X}}) p _ {\boldsymbol {T}, \lambda} \left(\boldsymbol {f} ^ {- 1} (\bar {\boldsymbol {X}}) | U\right) \operatorname {v o l} \left(J _ {\boldsymbol {f} ^ {- 1}} (\bar {\boldsymbol {X}})\right) d \bar {\boldsymbol {X}} = \int_ {\mathcal {O}} p _ {\varepsilon} (\boldsymbol {X} - \bar {\boldsymbol {X}}) p _ {\bar {\boldsymbol {T}}, \bar {\lambda}} \left(\tilde {\boldsymbol {f}} ^ {- 1} (\bar {\boldsymbol {X}}) | U\right) \operatorname {v o l} \left(J _ {\bar {\boldsymbol {f}} ^ {- 1}} (\bar {\boldsymbol {X}})\right) d \bar {\boldsymbol {X}} (26) \\ \Rightarrow \int_ {\mathbb {R} ^ {d}} p _ {\varepsilon} (\boldsymbol {X} - \bar {\boldsymbol {X}}) \tilde {p} _ {\boldsymbol {f}, T, \boldsymbol {\lambda}, U} (\bar {\boldsymbol {X}}) d \bar {\boldsymbol {X}} = \int_ {\mathbb {R} ^ {d}} p _ {\varepsilon} (\boldsymbol {X} - \bar {\boldsymbol {X}}) \tilde {p} _ {\tilde {\boldsymbol {f}}, \tilde {\boldsymbol {T}}, \tilde {\boldsymbol {\lambda}}, \tilde {\boldsymbol {U}}} (\bar {\boldsymbol {X}}) d \bar {\boldsymbol {X}} (27) \\ \Longrightarrow \left(\tilde {p} _ {\boldsymbol {f}, \boldsymbol {T}, \boldsymbol {\lambda}, U} * p _ {\varepsilon}\right) (\boldsymbol {X}) = \left(\tilde {p} _ {\tilde {\boldsymbol {f}}, \tilde {\boldsymbol {T}}, \tilde {\boldsymbol {\lambda}}, \tilde {\boldsymbol {U}}} * p _ {\varepsilon}\right) (\boldsymbol {X}) (28) \\ \Longrightarrow F [ \tilde {p} _ {\boldsymbol {f}, \boldsymbol {T}, \boldsymbol {\lambda}, U} ] (\omega) \varphi_ {\varepsilon} (\omega) = F [ \tilde {p} _ {\tilde {\boldsymbol {f}}, \tilde {\boldsymbol {T}}, \tilde {\boldsymbol {\lambda}}, \tilde {\boldsymbol {U}}} ] (\omega) \varphi_ {\varepsilon} (\omega) (29) \\ \Longrightarrow F \left[ \tilde {p} _ {\boldsymbol {f}, \boldsymbol {T}, \boldsymbol {\lambda}, \boldsymbol {U}} \right] (\boldsymbol {\omega}) = F \left[ \tilde {p} _ {\tilde {\boldsymbol {f}}, \tilde {\boldsymbol {T}}, \tilde {\boldsymbol {\lambda}}, \tilde {\boldsymbol {U}}} \right] (\boldsymbol {\omega}) (30) \\ \Longrightarrow \tilde {p} _ {\boldsymbol {f}, \boldsymbol {T}, \lambda , U} (\boldsymbol {X}) = \tilde {p} _ {\tilde {\boldsymbol {f}}, \tilde {\boldsymbol {T}}, \tilde {\lambda}, \tilde {U}} (\boldsymbol {X}) (31) \\ \end{array} +$$ + +where + +- in Eq. (26), $J$ denotes the Jacobian, and we made the change of variable $\bar{X} = f(Z)$ on the left hand side, and $\bar{X} = \tilde{f}(Z)$ on the right hand side. +in Eq. (27), we introduced + +$$ +\tilde {p} _ {\boldsymbol {f}, \boldsymbol {T}, \boldsymbol {\lambda}, \boldsymbol {U}} (\boldsymbol {X}) \triangleq p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {f} ^ {- 1} (\boldsymbol {X}) | \boldsymbol {U}) \operatorname {v o l} \left(J _ {\boldsymbol {f} ^ {- 1}} (\boldsymbol {X})\right) \mathbb {I} _ {\mathcal {O}} (\boldsymbol {X}) \tag {32} +$$ + +on the left hand side, and similarly on the right hand side. + +- in Eq. (28), we used $*$ for the convolution operator. +- in Eq. (29), we used $F[\cdot]$ to designate the Fourier transform, and where $\varphi_{\varepsilon} = F[p_{\varepsilon}]$ (by definition of the characteristic function). +- in Eq. (30), we dropped $\varphi_{\varepsilon}(\omega)$ from both sides as it is non-zero almost everywhere (by assumption (i)). + +Step II. In this step, we remove all terms that are either a function of $X$ or $U$ . First, by replacing both sides of Eq. (31) by their corresponding expressions from Eq. (32), we have + +$$ +p _ {T, \lambda} (\boldsymbol {f} ^ {- 1} (\boldsymbol {X}) | \boldsymbol {U}) \operatorname {v o l} \left(J _ {\boldsymbol {f} ^ {- 1}} (\boldsymbol {X})\right) = p _ {\tilde {T}, \tilde {\lambda}} \left(\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X}) | \boldsymbol {U}\right) \operatorname {v o l} \left(J _ {\tilde {\boldsymbol {f}} ^ {- 1}} (\boldsymbol {X})\right). \tag {33} +$$ + +Then, by taking logarithm on both sides of Eq. (33) and replacing $p_{T,\lambda}$ by its expression from Eq. (21), we obtain + +$$ +\begin{array}{l} \log \operatorname {v o l} \left(J _ {\boldsymbol {f} ^ {- 1}} (\boldsymbol {X})\right) + \log Q \left(\boldsymbol {f} ^ {- 1} (\boldsymbol {X})\right) - \log Z (\boldsymbol {U}) + \left\langle \boldsymbol {T} \left(\boldsymbol {f} ^ {- 1} (\boldsymbol {X})\right), \boldsymbol {\lambda} (\boldsymbol {U}) \right\rangle \\ = \log \operatorname {v o l} \left(J _ {\tilde {\boldsymbol {f}} ^ {- 1}} (\boldsymbol {X})\right) + \log \tilde {Q} \left(\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X})\right) - \log \tilde {Z} (\boldsymbol {U}) + \left\langle \tilde {\boldsymbol {T}} \left(\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X})\right), \tilde {\boldsymbol {\lambda}} (\boldsymbol {U}) \right\rangle . \tag {34} \\ \end{array} +$$ + +Let $U^0, U^1, \dots, U^k \in \mathcal{U}$ be the $k + 1$ points defined in assumption (iii). We evaluate the above equation at these points to obtain $k + 1$ equations, and subtract the first equation from the remaining + +$k$ equations to obtain: + +$$ +\begin{array}{l} \left\langle \boldsymbol {T} (\boldsymbol {f} ^ {- 1} (\boldsymbol {X})), \boldsymbol {\lambda} (\boldsymbol {U} ^ {l}) - \boldsymbol {\lambda} (\boldsymbol {U} ^ {0}) \right\rangle + \log \frac {Z (\boldsymbol {U} ^ {0})}{Z (\boldsymbol {U} ^ {l})} \\ = \left\langle \tilde {\boldsymbol {T}} \left(\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X})\right), \tilde {\boldsymbol {\lambda}} \left(\boldsymbol {U} ^ {l}\right) - \tilde {\boldsymbol {\lambda}} \left(\boldsymbol {U} ^ {0}\right) \right\rangle + \log \frac {\tilde {Z} \left(\boldsymbol {U} ^ {0}\right)}{\tilde {Z} \left(\boldsymbol {U} ^ {l}\right)}, \quad l = 1, \dots , k. \tag {35} \\ \end{array} +$$ + +Let $L$ be defined as in assumption (iii) and $\tilde{L}$ defined similarly for $\tilde{\lambda}$ . Note that $L$ is invertible by assumption, but $\tilde{L}$ is not necessarily invertible. Letting $\boldsymbol{b} \in \mathbb{R}^k$ in which $b_{l} = \log \frac{\tilde{Z}(\boldsymbol{U}^{0})Z(\boldsymbol{U}^{l})}{\tilde{Z}(\boldsymbol{U}^{l})Z(\boldsymbol{U}^{0})}$ , we have + +$$ +L ^ {T} \boldsymbol {T} (\boldsymbol {f} ^ {- 1} (\boldsymbol {X})) = \tilde {L} ^ {T} \tilde {\boldsymbol {T}} (\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X})) + \boldsymbol {b}. \tag {36} +$$ + +Left multiplying both sides of the above equation by $L^{-T}$ gives + +$$ +\boldsymbol {T} \left(\boldsymbol {f} ^ {- 1} (\boldsymbol {X})\right) = A \tilde {\boldsymbol {T}} \left(\tilde {\boldsymbol {f}} ^ {- 1} (\boldsymbol {X})\right) + \boldsymbol {c}, \tag {37} +$$ + +where $A = L^{-T}\tilde{L}\in \mathbb{R}^{k\times k}$ and $\pmb {c} = L^{-T}\pmb {b}\in \mathbb{R}^k$ + +Step III. To complete the proof, we need to show that $A$ is invertible. Let $\mathbf{Z}_l \in \mathcal{Z}$ , $\mathbf{X}_l = \mathbf{f}(\mathbf{Z}_l)$ , $l = 0, \dots, k$ . We evaluate Eq. (37) at these $k + 1$ points to obtain $k + 1$ equations and subtract the first equation from the remaining $k$ equations to obtain + +$$ +\begin{array}{l} \underbrace{\left[ \boldsymbol{T}(\boldsymbol{Z}_{1}) - \boldsymbol{T}(\boldsymbol{Z}_{0}),\cdots,\boldsymbol{T}(\boldsymbol{Z}_{k}) - \boldsymbol{T}(\boldsymbol{Z}_{0})\right]}_{\triangleq R\in \mathbb{R}^{k\times k}} \\ = A \underbrace {\left[ \tilde {\boldsymbol {T}} \left(\tilde {\boldsymbol {f}} ^ {- 1} \left(\boldsymbol {X} _ {1}\right)\right) - \tilde {\boldsymbol {T}} \left(\tilde {\boldsymbol {f}} ^ {- 1} \left(\boldsymbol {X} _ {0}\right)\right), \cdots , \tilde {\boldsymbol {T}} \left(\tilde {\boldsymbol {f}} ^ {- 1} \left(\boldsymbol {X} _ {k}\right)\right) - \tilde {\boldsymbol {T}} \left(\tilde {\boldsymbol {f}} ^ {- 1} \left(\boldsymbol {X} _ {0}\right)\right) \right]} _ {\triangleq \tilde {R} \in \mathbb {R} ^ {k \times k}}. \tag {38} \\ \end{array} +$$ + +We need to show that for a given $Z_0 \in \mathcal{Z}$ , there exist $k$ points $Z_1, \dots, Z_k \in \mathcal{Z}$ such that the columns of $R$ are linearly independent. Suppose, for contradiction, that the columns of $R$ would never be linearly independent for any choice of $Z_1, \dots, Z_k \in \mathcal{Z}$ . Then the function $\mathbf{g}(Z) \triangleq T(Z) - T(Z_0)$ would live in a $k-1$ or lower dimensional subspace, and thus we could find a non-zero vector $\lambda \in \mathbb{R}^k$ orthogonal to that subspace. This would imply that $\langle T(Z) - T(Z_0), \lambda \rangle = 0$ and thus $\langle T(Z), \lambda \rangle = \langle T(Z_0), \lambda \rangle = \text{const}, \forall Z \in \mathcal{Z}$ , which contradicts the assumption that the prior is strongly exponential (Definition 6). Therefore, we have shown that there exist $k+1$ points $Z_0, Z_1, \dots, Z_k \in \mathcal{Z}$ such that $R$ is invertible. Since $R = A\tilde{R}$ and $A$ is not a function of $Z$ , $A$ must be invertible. This completes the proof. + +# H.1.2 PART II + +Theorem 5. Suppose that all assumptions in Theorem 4 hold. Let the sufficient statistics $\pmb{T}(\pmb{Z}) = [\pmb{T}_f(\pmb{Z})^T, \pmb{T}_{NN}(\pmb{Z})^T]^T$ given by the concatenation of a) the sufficient statistics $\pmb{T}_f(\pmb{Z}) = [\pmb{T}_1(Z_1)^T, \dots, \pmb{T}_n(Z_n)^T]^T$ of a factorized exponential family, where all the $\pmb{T}_i(Z_i)$ have dimension larger or equal to 2, and b) the output $\pmb{T}_{NN}(\pmb{Z})$ of a neural network with ReLU activations. (note that a neural network with ReLU activation has universal approximation power and should be able to capture any dependencies of interest). Let $k'$ be the dimension of $\pmb{T}_f$ and thus that $k' \geq 2n$ . Assume that + +(i) the sufficient statistics $\mathbf{T}_f$ have all second-order own derivatives; +(ii) the mixing function $\pmb{f}$ has all second-order cross derivatives. + +Then the parameters $\{\pmb {f},\pmb {T},\pmb {\lambda}\}$ are $\sim_P$ identifiable. + +Proof. Let $\pmb{v} = \tilde{\pmb{f}}^{-1} \circ \pmb{f}: \mathcal{Z} \to \mathcal{Z}$ . Since all assumptions in Theorem 4 hold, we have + +$$ +\boldsymbol {T} (\boldsymbol {Z}) = A \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z})) + \boldsymbol {c}, \tag {39} +$$ + +where $A \in \mathbb{R}^{k \times k}$ is invertible. We want to show that $A$ is a block permutation matrix. + +Step I. In this step, we show that $\pmb{v}$ is a componentwise function. First we differentiate both sides of Eq. (39) with respect to $Z_{s}$ and $Z_{t}$ ( $s \neq t$ ) to obtain + +$$ +\frac {\partial \boldsymbol {T} (\boldsymbol {Z})}{\partial Z _ {s}} = A \sum_ {i = 1} ^ {n} \frac {\partial \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {i} (\boldsymbol {Z})} \cdot \frac {\partial v _ {i} (\boldsymbol {Z})}{\partial Z _ {s}} \tag {40} +$$ + +$$ +\frac {\partial^ {2} \boldsymbol {T} (\boldsymbol {Z})}{\partial Z _ {s} \partial Z _ {t}} = A \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {n} \frac {\partial^ {2} \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {i} (\boldsymbol {Z}) \partial v _ {j} (\boldsymbol {Z})} \cdot \frac {\partial v _ {j} (\boldsymbol {Z})}{\partial Z _ {t}} \cdot \frac {\partial v _ {i} (\boldsymbol {Z})}{\partial Z _ {s}} + A \sum_ {i = 1} ^ {n} \frac {\partial \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {i} (\boldsymbol {Z})} \cdot \frac {\partial^ {2} v _ {i} (\boldsymbol {Z})}{\partial Z _ {s} \partial Z _ {t}}. \tag {41} +$$ + +By construction, the second-order cross derivatives of $T$ and $\tilde{T}$ are all zero. Therefore, we have + +$$ +\mathbf {0} = A \sum_ {i = 1} ^ {n} \frac {\partial^ {2} \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {i} (\boldsymbol {Z}) ^ {2}} \cdot \frac {\partial v _ {i} (\boldsymbol {Z})}{\partial Z _ {t}} \cdot \frac {\partial v _ {i} (\boldsymbol {Z})}{\partial Z _ {s}} + A \sum_ {i = 1} ^ {n} \frac {\partial \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {i} (\boldsymbol {Z})} \cdot \frac {\partial^ {2} v _ {i} (\boldsymbol {Z})}{\partial Z _ {s} \partial Z _ {t}}. \tag {42} +$$ + +The above equation can be written in the matrix-vector form: + +$$ +\mathbf {0} = A \tilde {\boldsymbol {T}} ^ {\prime \prime} (\boldsymbol {Z}) \boldsymbol {v} _ {s, t} ^ {\prime} (\boldsymbol {Z}) + A \tilde {\boldsymbol {T}} ^ {\prime} (\boldsymbol {Z}) \boldsymbol {v} _ {s, t} ^ {\prime \prime} (\boldsymbol {Z}), \tag {43} +$$ + +where + +$$ +\tilde {\boldsymbol {T}} ^ {\prime \prime} (\boldsymbol {Z}) = \left[ \frac {\partial^ {2} \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {1} (\boldsymbol {Z}) ^ {2}}, \dots , \frac {\partial^ {2} \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {n} (\boldsymbol {Z}) ^ {2}} \right] \in \mathbb {R} ^ {k \times n} \tag {44} +$$ + +$$ +\boldsymbol {v} _ {s, t} ^ {\prime} (\boldsymbol {Z}) = \left[ \frac {\partial v _ {1} (\boldsymbol {Z})}{\partial Z _ {t}} \cdot \frac {\partial v _ {1} (\boldsymbol {Z})}{\partial Z _ {s}}, \dots , \frac {\partial v _ {n} (\boldsymbol {Z})}{\partial Z _ {t}} \cdot \frac {\partial v _ {n} (\boldsymbol {Z})}{\partial Z _ {s}} \right] ^ {T} \in \mathbb {R} ^ {n}, \tag {45} +$$ + +and + +$$ +\tilde {\boldsymbol {T}} ^ {\prime} (\boldsymbol {Z}) = \left[ \frac {\partial \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {1} (\boldsymbol {Z})}, \dots , \frac {\partial \tilde {\boldsymbol {T}} (\boldsymbol {v} (\boldsymbol {Z}))}{\partial v _ {n} (\boldsymbol {Z})} \right] \in \mathbb {R} ^ {k \times n} \tag {46} +$$ + +$$ +\boldsymbol {v} _ {s, t} ^ {\prime \prime} (\boldsymbol {Z}) = \left[ \frac {\partial^ {2} v _ {1} (\boldsymbol {Z})}{\partial Z _ {s} \partial Z _ {t}}, \dots , \frac {\partial^ {2} v _ {n} (\boldsymbol {Z})}{\partial Z _ {s} \partial Z _ {t}} \right] ^ {T} \in \mathbb {R} ^ {n}. \tag {47} +$$ + +Now by concatenating + +$$ +\tilde {\boldsymbol {T}} ^ {\prime \prime \prime} (\boldsymbol {Z}) = \left[ \tilde {\boldsymbol {T}} ^ {\prime \prime} (\boldsymbol {Z}), \tilde {\boldsymbol {T}} ^ {\prime} (\boldsymbol {Z}) \right] \in \mathbb {R} ^ {k \times 2 n} \quad \text {a n d} \quad \boldsymbol {v} _ {s, t} ^ {\prime \prime} (\boldsymbol {Z}) = \left[ \boldsymbol {v} _ {s, t} ^ {\prime} (\boldsymbol {Z}) ^ {T}, \boldsymbol {v} _ {s, t} ^ {\prime \prime} (\boldsymbol {Z}) ^ {T} \right] ^ {T} \in \mathbb {R} ^ {2 n}, \tag {48} +$$ + +we obtain + +$$ +\mathbf {0} = A \tilde {\boldsymbol {T}} ^ {\prime \prime \prime} (\boldsymbol {Z}) \boldsymbol {v} _ {s, t} ^ {\prime \prime \prime} (\boldsymbol {Z}). \tag {49} +$$ + +Finally, we take the rows of $\tilde{T}'''(Z)$ that corresponds to the factorized strongly exponential family distribution part and denote them by $\tilde{T}_f'''(Z) \in \mathbb{R}^{k' \times 2n}$ . By Lemma 5 in the iVAE paper (Khemakhem et al., 2020a) and the assumption that $k' \geq 2n$ , we have that the rank of $\tilde{T}_f'''(Z)$ is $2n$ . Since $k \geq k' \geq 2n$ , the rank of $\tilde{T}'''(Z)$ is also $2n$ . Since the rank of $A$ is $k$ , the rank of $A\tilde{T}'''(Z) \in \mathbb{R}^{k \times 2n}$ is $2n$ . This implies that $\boldsymbol{v}_{s,t}''(Z)$ must be a zero vector. In particular, we have that $\boldsymbol{v}_{s,t}'(Z) = \mathbf{0}, \forall s \neq t$ . Therefore, we have shown that $\boldsymbol{v}$ is a componentwise function. + +Step II. To complete the proof, we need to show that $A$ is a block permutation matrix. Without loss of generality, we assume that the permutation in $\pmb{v}$ is the identity. That is $\pmb{v}(\pmb{Z}) = [v_{1}(Z_{1}),\dots ,v_{n}(Z_{n})]^{T}$ for some nonlinear univariate scalar functions $v_{1},\dots ,v_{n}$ . Since $\pmb{f}$ and $\tilde{\pmb{f}}$ are bijective, we have that $\pmb{v}$ is also bijective and $\pmb{v}^{-1}(\pmb {Z}) = [v_1^{-1}(Z_1),\dots ,v_n^{-1}(Z_n)]^T$ . We denote $\bar{T} (\pmb {v}(\pmb {Z})) = \tilde{T} (\pmb {v}(\pmb {Z})) + A^{-1}\pmb{c}$ and plug it into Eq. (39) to obtain $\pmb {T}(\pmb {Z}) = A\bar{T} (\pmb {v}(\pmb {Z}))$ . Applying $\pmb{v}^{-1}$ to the variables $\pmb{Z}$ at both sides gives + +$$ +\boldsymbol {T} \left(\boldsymbol {v} ^ {- 1} (\boldsymbol {Z})\right) = A \bar {\boldsymbol {T}} (\boldsymbol {Z}). \tag {50} +$$ + +Let $t$ be the index of an entry in the sufficient statistics $T$ that corresponds to the factorized strongly exponential family distribution part $T_f$ . For all $s \neq t$ , we have + +$$ +0 = \frac {\partial \boldsymbol {T} (\boldsymbol {v} ^ {- 1} (\boldsymbol {Z})) _ {t}}{\partial Z _ {s}} = \sum_ {j = 1} ^ {k} a _ {t j} \frac {\partial \bar {\boldsymbol {T}} (\boldsymbol {Z}) _ {j}}{\partial Z _ {s}}. \tag {51} +$$ + +Since the entries of $\tilde{T}$ are linearly independent (if they were not linearly independent, then $\tilde{T}$ can be compressed into a smaller vector by removing the redundant entries), we have that $a_{tj}$ is zero for any $j$ such that $\frac{\partial\bar{T}(Z)_j}{\partial Z_s} \neq 0$ . This includes the entries $j$ in the sufficient statistics $\tilde{T}$ that corresponds to 1) the factorized strongly exponential family distribution part which do not depend on $Z_t$ ; and 2) the neural network part. + +Therefore, when $t$ is the index of an entry in the sufficient statistics $T$ that corresponds to factor $i$ in the factorized strongly exponential family distribution part $T_{f}$ , the only non-zero $a_{tj}$ are the ones that map between $T_{i}(Z_{i})$ and $\bar{T}_i(v_i(Z_i))$ , where $T_{i}$ are the factors in $T_{f}$ that only depend on $Z_{i}$ and $\bar{T}_i$ is defined similarly. Therefore, we can construct an invertible submatrix $A_{i}^{\prime}$ with all non-zero elements $a_{tj}$ for all $t$ that corresponds to factor $i$ , such that + +$$ +\boldsymbol {T} _ {i} (Z _ {i}) = A _ {i} ^ {\prime} \tilde {\boldsymbol {T}} _ {i} \left(v _ {i} (Z _ {i})\right) = A _ {i} ^ {\prime} \tilde {\boldsymbol {T}} _ {i} \left(v _ {i} (Z _ {i})\right) + \boldsymbol {c} _ {i}, \quad i = 1, \dots , n, \tag {52} +$$ + +where $\tilde{T}_i$ are the factors in $\tilde{T}_f$ that only depends on $Z_{i}$ , and $c_{i}$ are the corresponding elements of $c$ . This means that the matrix $A$ is a block permutation matrix. For each $i = 1,\dots ,n$ , the block $A_i^\prime$ of $A$ affinely transforms $T_{i}(Z_{i})$ into $\tilde{T}_i(v_i(Z_i))$ . There is also an additional block $A^{\prime}$ which affinely transforms $T_{NN}(Z)$ into $\tilde{T}_{NN}(\pmb {v}(\pmb {Z}))$ . This completes the proof. + +# H.1.3 PART III + +Now we combine Theorem 4 in Part I and Theorem 5 in Part II into one theorem, which completes the proof of Theorem 1. + +# H.2 PROOF OF THEOREM 2 + +We recall that the loss function in Phase 1 is as follows: + +$$ +\mathcal {L} _ {\text {p h a s e 1}} (\boldsymbol {\theta}, \phi) = \mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {E L B O}} (\boldsymbol {f}, \hat {\boldsymbol {T}}, \hat {\boldsymbol {\lambda}}, \phi) - \mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {S M}} (\hat {\boldsymbol {f}}, \boldsymbol {T}, \boldsymbol {\lambda}, \hat {\phi}), \tag {53} +$$ + +where + +$$ +\mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {E L B O}} (\boldsymbol {\theta}, \phi) := \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \log p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) + \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) - \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) \right] \right], \tag {54} +$$ + +$$ +\mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {S M}} (\boldsymbol {T}, \boldsymbol {\lambda}) := \mathbb {E} _ {P D} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \| \nabla_ {\boldsymbol {Z}} \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) - \nabla_ {\boldsymbol {Z}} \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) \| ^ {2} \right] \right]. \tag {55} +$$ + +Proof. If the family of $q_{\phi}(Z|X,Y,E)$ is flexible enough to contain $p_{\theta}(Z|X,Y,E)$ , then by optimizing the loss over its parameter $\phi$ , we will minimize the score matching term $\mathcal{L}_{\mathrm{phase1}}^{\mathrm{SM}}$ in Eq. (55), which will eventually reach zero. If we assume that the model is not degenerate and that $q_{\phi} > 0$ everywhere, then having that $\mathcal{L}_{\mathrm{phase1}}^{\mathrm{SM}} = 0$ implies that $\nabla_Z\log q_\phi (Z|\bar{X},Y,E)$ and $\nabla_Z\log p_{T,\lambda}(Z|Y,E)$ are equal. This implies that $\log q_{\phi}(Z|X,Y,E) = \log p_{T,\lambda}(Z|Y,E) + c$ for some constant $c$ . But $c$ is necessarily 0 because both $q_{\phi}(Z|X,Y,E)$ and $p_{T,\lambda}(Z|Y,E)$ are pdf's. Therefore, the ELBO term $\mathcal{L}_{\mathrm{phase1}}^{\mathrm{ELBO}}$ in Eq. (54) will be equal to the log-likelihood, meaning that the loss $\mathcal{L}_{\mathrm{phase1}}$ in Eq. (53) will be equal to the log-likelihood. Under this circumstance, the estimation in Eq. (53) inherits all the properties of maximum likelihood estimation (MLE). In this particular case, since our identifiability is guaranteed up to a permutation and componentwise transformation, the consistency of MLE means that we converge to the true parameter $\theta^{*}$ up to a permutation and componentwise transformation in the limit of infinite data. Because true identifiability is one of the assumptions for MLE consistency, replacing it by identifiability up to a permutation and componentwise transformation does not change the proof but only the conclusion. + +# H.3 PROOF OF THEOREM 3 + +Proof. Theorem 1 and Theorem 2 guarantee that in the limit of infinite data, NF-iVAE can learn the true parameters $\theta^{*} := (f^{*}, T^{*}, \lambda^{*})$ up to a permutation and componentwise transformation of the latent variables. Let $(\hat{f}, \hat{T}, \hat{\lambda})$ be the parameters obtained by NF-iVAE. We, therefore, have $(\hat{f}, \hat{T}, \hat{\lambda}) \sim_{P} (f^{*}, T^{*}, \lambda^{*})$ , where $\sim_{P}$ denotes the equivalence up to a permutation and componentwise transformation. If there were no noise, this would mean that the learned $\hat{f}$ transforms $X$ into $\hat{Z} = \hat{f}^{-1}(X)$ that are equal to $Z^{*} = (f^{*})^{-1}(X)$ up to a permutation and componentwise transformation (Definition 9). If with noise, we obtain the posterior distribution of the latent variables up to an analogous indeterminacy. + +# H.4 PROOF OF PROPOSITION 1 + +Proof. Theorem A.1 in (Arjovsky, 2021) has showed that i) any predictor $w \circ \Phi$ with optimal OOD generalization uses only $\mathrm{Pa}(\mathbf{Y})$ to compute $\Phi$ ; ii) the classifier $w$ in this optimal predictor can be estimated using data from any environment $e$ for which the distribution of $\mathrm{Pa}(\mathbf{Y}^e)$ has full support; + +iii) the optimal predictor will be invariant across $\mathcal{E}_{all}$ . In iCaRL, the hypotheses of Theorems 1 and 2 and Assumption 1 guarantee that $\mathrm{Pa}(\pmb{Y})$ can be recovered by first identifying the latent variables $\pmb{Z}$ from $\pmb{X},\pmb{Y}$ and $\pmb{E}$ and then discovering the direct causes of $\pmb{Y}$ through solving Eq. (12). Furthermore, since the conditional prior in Eq. (5) of the main text has full support, the distribution of $\mathrm{Pa}(\pmb{Y}^e)$ always has full support. Also, under Assumption 1 we have that $p(\pmb{Y}|\mathrm{Pa}(\pmb{Y}))$ is invariant across $\mathcal{E}_{all}$ . Hence, the classifier $w$ in this optimal predictor can be estimated using data from any environment $e$ . We therefore have that the resulting optimal predictor will be invariant across $\mathcal{E}_{all}$ . This completes the proof. + +![](images/49d65a390cb3c5de9cf62d5c5a994fc9c78d4e5f6ead85ebac5bcd21f2e0d922.jpg) + +# H.5 PROOF OF PROPOSITION 2 + +Proof. The following rules can be independently performed to distinguish all the 10 structures shown in Figs. 3b-3k. For clarity, we divide them into three groups. Note that, since these rules rely on different algorithms of causal discovery and conditional independence tests, unless stated otherwise, we assume that the assumptions of these algorithms are satisfied during the proof process. + +Group 1 All the six structures in this group can be discovered only by performing conditional independence tests. + +- Rule 1.1 If $Z_{i} \perp \perp Y$ , $Z_{i} \nVdash E$ , and $E \perp \perp Y$ , then Fig. 3d is discovered. +- Rule 1.2 If $Z_{i} \not\perp Y$ , $Z_{i} \perp E$ , and $E \not\perp Y$ , then Fig. 3g is discovered. +- Rule 1.3 If $Z_{i} \nVdash Y$ , $Z_{i} \nVdash E$ , and $E \perp \perp Y$ , then Fig. 3f is discovered. +- Rule 1.4 If $Z_{i} \not\perp Y, Z_{i} \not\perp E, E \not\perp Y$ , and $Z_{i} \perp Y|E$ , then Fig. 3i is discovered. +- Rule 1.5 If $Z_{i} \not\perp Y$ , $Z_{i} \not\perp E$ , $E \not\perp Y$ , and $Z_{i} \perp E|Y$ , then Fig. 3h is discovered. +- Rule 1.6 If $Z_{i} \not\perp Y$ , $Z_{i} \not\perp E$ , $E \not\perp Y$ , and $Y \perp E|Z_{i}$ , then Fig. 3e is discovered. + +Group 2 If $Z_{i} \not\perp Y$ , $Z_{i} \perp E$ , and $E \perp Y$ , then we can discover both Fig. 3b and Fig. 3c. These two structures cannot be further distinguished only by conditional independence tests, because they come from the same Markov equivalence class. Fortunately, we can further distinguish them by running binary causal discovery algorithms (Peters et al., 2017), e.g., ANM (Hoyer et al., 2009) for continuous data and CDS (Fonollosa, 2019) for continuous and discrete data. + +- Rule 2.1 If $Z_{i} \not\perp Y$ , $Z_{i} \perp E$ , and $E \perp Y$ , and a chosen binary causal discovery algorithm prefers $Z_{i} \to Y$ to $Z_{i} \gets Y$ , then Fig. 3b is discovered. +- Rule 2.2 If $Z_{i} \nparallel Y$ , $Z_{i} \perp E$ , and $E \perp Y$ , and a chosen binary causal discovery algorithm prefers $Z_{i} \gets Y$ to $Z_{i} \to Y$ , then Fig. 3c is discovered. + +Group 3 If $Z_{i} \nsubseteq Y$ , $Z_{i} \nsubseteq E$ , $E \nsubseteq Y$ , $Z_{i} \nsubseteq Y|E$ , $Z_{i} \nsubseteq E|Y$ , and $Y \nsubseteq E|Z_{i}$ , then we can discover both Fig. 3j and Fig. 3k. These two structures cannot be further distinguished only by conditional independence tests, because they come from the same Markov equivalence class. They also cannot be distinguished by any binary causal discovery algorithm, since both $Z_{i}$ and $Y$ are affected by $E$ . Fortunately, Zhang et al. (2017) provided a heuristic solution to this case based on the invariance of causal mechanisms, i.e., $P(\text{cause})$ and $P(\text{effect|cause})$ change independently. The detailed description of their method is given in Section 4.2 of Zhang et al. (2017). For convenience, here we directly borrow their final result. Zhang et al. (2017) states that determining the causal direction between $Z_{i}$ and $Y$ in Fig. 3j and Fig. 3k is finally reduced to calculating the following term: + +$$ +\Delta_ {Z _ {i} \rightarrow Y} = \left\langle \log \frac {\bar {P} (\mathbf {Y} \mid Z _ {i})}{\langle \hat {P} (\mathbf {Y} \mid Z _ {i}) \rangle} \right\rangle , \tag {56} +$$ + +where $\langle \cdot \rangle$ denotes the sample average, $\bar{P} (\mathbf{Y}|Z_i)$ is the empirical estimate of $P(\mathbf{Y}|Z_i)$ on all data points, and $\langle \hat{P} (\mathbf{Y}|Z_i)\rangle$ denotes the sample average of $\hat{P} (\mathbf{Y}|Z_i)$ , which is the estimate of $P(\mathbf{Y}|Z_i)$ in each environment. We take the direction for which $\Delta$ is smaller to be the causal direction. + +- Rule 3.1 If $Z_{i} \nsubseteq Y$ , $Z_{i} \nsubseteq E$ , $E \nsubseteq Y$ , $Z_{i} \nsubseteq Y|E$ , $Z_{i} \nsubseteq E|Y$ , $Y \nsubseteq E|Z_{i}$ , and $\Delta_{Z_{i} \to Y}$ is smaller than $\Delta_{Y \to Z_{i}}$ , then Fig. 3j is discovered. +- Rule 3.2 If $Z_{i} \nsubseteq Y$ , $Z_{i} \nsubseteq E$ , $E \nsubseteq Y$ , $Z_{i} \nsubseteq Y|E$ , $Z_{i} \nsubseteq E|Y$ , $Y \nsubseteq E|Z_{i}$ , and $\Delta_{\mathbf{Y} \to Z_i}$ is smaller than $\Delta_{Z_i \to Y}$ , then Fig. 3k is discovered. + +![](images/2faa39f72b399fbaa05bbc31f85c7ab5467c4a79b4ababcc860a77370e24f522.jpg) + +# I ILLUSTRATIONS FOR MODEL LEARNING + +As described in Section 3.3, in the ground truth model, the prior for each $Z_{i\in I_p}$ is either $p(Z_i|E)$ or $p(Z_i)$ , depending on whether $Z_{i}$ is caused by $E$ or not. By contrast, in the NF-iVAE model the prior is $p(\mathbf{Z}|\mathbf{Y},\mathbf{E})$ . Is this going to affect the identifiability of the latent variables? Well, in practice not because the posterior distribution for $\mathbf{Z}$ given $\mathbf{X}$ , $\mathbf{Y}$ and $\mathbf{E}$ would be equivalent in both models (up to identifiability guarantees). + +# J DATASETS + +For convenience and completeness, we provide descriptions of Colored MNIST Digits and Colored Fashion MNIST here. Please refer to the original papers (Arjovsky et al., 2019; Ahuja et al., 2020a; Gulrajani & Lopez-Paz, 2020; Venkateswara et al., 2017) for more details. + +# J.1 SYNTHETIC DATA + +For the nonlinear transformation, we use the MLP: + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 10$ + +# J.2 COLORED MNIST DIGITS + +We use the exact same environment as in Arjovsky et al. (2019). Arjovsky et al. (2019) propose to create an environment for training to classify digits in MNIST data10, where the images in MNIST are now colored in such a way that the colors spuriously correlate with the labels. The task is to classify whether the digit is less than 5 (not including 5). There are three environments (two training containing 30,000 points each, one test containing 10,000 points) We add noise to the preliminary label ( $\tilde{y} = 0$ if the digit is between 0-4 and $\tilde{y} = 1$ if the digit is between 5-9) by flipping it with 25 percent probability to construct the final labels. We sample the color id $z$ by flipping the final labels with probability $p_e$ , where $p_e$ is 0.2 in the first environment, 0.1 in the second environment, and 0.9 in the third environment. The third environment is the testing environment. We color the digit red if $z = 1$ or green if $z = 0$ . + +# J.3 COLORED FASHION MNIST + +We modify the fashion MNIST dataset11 in a manner similar to the MNIST digits dataset. Fashion MNIST data has images from different categories: "t-shirt", "trouser", "pullover", "dress", "coat", "sandal", "shirt", "sneaker", "bag", "ankle boots". We add colors to the images in such a way that the colors correlate with the labels. The task is to classify whether the image is that of foot wear or a clothing item. There are three environments (two training, one test) We add noise to the preliminary label $(\tilde{y} = 0$ : "t-shirt", "trouser", "pullover", "dress", "coat", "shirt" and $\tilde{y} = 1$ : "sandal", "sneaker", "ankle boots") by flipping it with 25 percent probability to construct the final label. We sample the color id $z$ by flipping the noisy label with probability $p_e$ , where $p_e$ is 0.2 in the first environment, 0.1 + +Table 3: Results on synthetic data. Comparisons are in terms of MSE (mean ± std deviation). + +
g(·)METHODTRAIN +(σ3 = {0.2,2})TEST +(σ3 = 100)
IdentityERM0.00 ± 0.000.00 ± 0.00
IRM0.00 ± 0.000.00 ± 0.00
F-IRM GAME0.98 ± 0.231.03 ± 0.04
V-IRM GAME0.99 ± 2.741.07 ± 2.26
iCaRL (ours)0.01 ± 0.031.00 ± 0.01
LinearERM0.00 ± 0.000.00 ± 0.00
IRM0.00 ± 0.000.00 ± 0.00
F-IRM GAME0.99 ± 0.011.08 ± 0.06
V-IRM GAME1.00 ± 5.981.05 ± 0.04
iCaRL (ours)0.01 ± 0.031.01 ± 0.04
NonlinearERM0.06 ± 0.01220.79 ± 229.97
IRM0.08 ± 0.01149.60 ± 104.85
F-IRM GAME1.06 ± 0.09196.59 ± 150.71
V-IRM GAME1.00 ± 0.01170.46 ± 125.62
iCaRL (ours)0.29 ± 0.0428.16 ± 2.54
+ +in the second environment, and 0.9 in the third environment, which is the test environment. We color the object red if $z = 1$ or green if $z = 0$ . + +# K IN-DEPTH ANALYSIS ON SYNTHETIC DATA + +# K.1 COMPARISONS WITH STATE-OF-THE-ART + +We first conduct a series of experiments on synthetic data generated according to an extension of the SEM in Model 1. The extension is to map the variables $\mathbf{Z} \coloneqq (Z_1, Z_2)$ into a 10 dimensional observation $\mathbf{X}$ through a linear or nonlinear transformation. Our goal is to predict $Y$ from $\mathbf{X}$ , where $\mathbf{X} = g(\mathbf{Z})$ . We consider three transformations: (a) Identity: $g(\cdot)$ is the identity matrix $\mathbf{I} \in \mathbb{R}^{2 \times 2}$ , i.e., $\mathbf{X} = g(\mathbf{Z}) = \mathbf{Z}$ . (b) Linear: $g(\cdot)$ is a random matrix $\mathbf{S} \in \mathbb{R}^{2 \times 10}$ , i.e., $\mathbf{X} = g(\mathbf{Z}) = \mathbf{Z} \cdot \mathbf{S}$ . (c) Nonlinear: $g(\cdot)$ is given by a neural network with 2-dimensional input and 10-dimensional output, whose parameters are randomly set in advance. Since this is a regression task, we use the mean squared error (MSE) as a metric of performance. Note that, in this problem, there is only one causal latent variable $Z_1$ , meaning that the conditional prior in Eq. (5) will not exhibit dependencies. Because of this, in this case we do not include a $T_{NN}(\mathbf{Z})$ term in our NF-iVAE conditional prior. In the following section we do consider settings with many potential causal latent variables and, in that case, we do include $T_{NN}(\mathbf{Z})$ in the NF-iVAE prior. + +We consider a simple scenario in which we fix $\sigma_{1} = 1$ and $\sigma_{2} = 0$ for all environments and only allow $\sigma_{3}$ to vary across environments. In this case, $\sigma_{3}$ controls the spurious correlations between $Z_{2}$ and $Y$ . Each experiment draws 1000 samples from each of the three environments $\sigma_{3} = \{0.2, 2, 100\}$ , where the first two are for training and the third for testing. We compare with the following baselines: $^{12}$ ERM, and two variants of IRMG: F-IRM Game (with $\Phi$ fixed to the identity) and V-IRM Game (with variable $\Phi$ ). + +As shown in Table 3, in the cases of Identity and Linear, our approach is better than IRMG but only comparable with ERM and IRM. This might be because the identifiability result up to a simple nonlinear transformation renders the problem more difficult by converting the original identity or linear problem into a nonlinear problem. In the Nonlinear case, the gains of iCaRL are very clear. + +Table 4: Comparisons of assumptions on the prior leading to identifiability in different algorithms. + +
METHODAssumption on the Prior for Identifiability
VAE (Kingma & Welling, 2013)Non-identifiability with pT,λ(Z) = ∏i p(Zi) e.g. N(0, I)
iVAE (Khemakhem et al., 2020a)pT,λ(Z|Y, E) = ∏i Qi(Zi)/Ci(Y, E) exp[∑j=1k Tij(Zi)λi,j(Y, E)]
ICE-BeeM (Khemakhem et al., 2020b)pT,λ(Z|Y, E) = Q(Z)/C(Y, E) ∏i exp[∑j=1k Tij(Zi)λi,j(Y, E)]
NF-iVAEpT,λ(Z|Y, E) = Q(Z)/C(Y, E) exp[T(Z)^Tλ(Y, E)]
+ +![](images/bf5d22cf6940bce7d96afc7dbfafbfe0962dc3fdebd7cb77a4435ce0e70d2c18.jpg) +(a) + +$$ +\boldsymbol {E} \sim \mathcal {U} \{0. 2, 2, 3, 5 \} \tag {57} +$$ + +$$ +Z _ {1} \sim \mathcal {N} \left(Z _ {1} \mid E, 1\right) \tag {58} +$$ + +$$ +Z _ {2} \sim \mathcal {N} (Z _ {2} | 2 E, 2) \tag {59} +$$ + +$$ +\boldsymbol {Y} \sim \mathcal {N} (\boldsymbol {Y} | Z _ {1} + Z _ {2}, 1) \tag {60} +$$ + +$$ +\boldsymbol {X} = g \left(Z _ {1}, Z _ {2}\right) \tag {61} +$$ + +![](images/d2f85ffcb80d54ff9db4baa9afe4062f7fd1e41e83538f4d067b250b27411885.jpg) +(a) Data generating model + +![](images/ba619185617d2ab3b81ac6aed21eb711ff35b90544cff4898520fbe432d29256.jpg) +Figure 4: (a) Causal structure with $\mathbf{Y}$ having two causes. (b) Data generating process corresponding to (a), where $\mathcal{U}\{\cdot\}$ denotes the discrete uniform distribution, $\mathcal{N}(\cdot)$ the Gaussian distribution, and $g(\cdot)$ is given by a neural network with 2-dimensional input and 10-dimensional output, whose parameters are randomly set in advance. + +![](images/e3aa597519a7b5f553bf8d35e1befed2d9d2b8798880852600ca47f481af3f09.jpg) +(b) + +![](images/4ea8cb6a8e816ab10f4eccd144596d33e849d022e3e92e24030fd159f4325bfe.jpg) +(b) VAE +(d) ICE-BeeM + +![](images/5edc69f365313d9d2e3f1a206bdaa89f4ca2d3498dff746cfec5e39023b81933.jpg) +(c) iVAE +(e) iCaRL-NF-iVAE +Figure 5: Visualization of the samples (i.e., $\hat{\mathbf{Z}} = (\hat{Z}_1, \hat{Z}_2)$ ) in latent space generated through different algorithms. (a) Samples from the true distribution. (b-e) Samples from the posterior of different algorithms. Apparently, our method (e) can recover the original data up to a permutation and a simple componentwise transformation. + +# K.2 VISUALIZATION OF IDENTIFIABILITY OF NF-IVAE + +To further verify identifiability of NF-iVAE, we conduct a series of experiments on synthetic data generated according to the data generating process (Fig. 4b) corresponding to the causal graph shown in Fig. 4a. The reason we choose this setting is that it is the simplest case satisfying our requirements: a) For ease of visualization, the latent space had better be 2-dimensional; b) To introduce the non-factorized prior given $\mathbf{Y}$ and $\mathbf{E}$ (i.e., $Z_{i} \nsubseteq Z_{j} | \mathbf{Y}, \mathbf{E}$ ), $\mathbf{Y}$ has at least two causes. + +We draw 1000 samples from each of the four environments $\pmb{E} = \{0.2, 2, 3, 5\}$ , and thus the whole synthetic dataset consists of 4000 samples. We compare with the following baselines: VAE Kingma & Welling (2013) (without identifiability guarantees), iVAE Khemakhem et al. (2020a) (with a conditionally factorized prior for identifiability), and ICE-BeeM Khemakhem et al. (2020b). It is worth noting that in ICE-BeeM the primary assumption leading to identifiability is similar to that in iVAE, where the base measure $\mathcal{Q}(Z)$ could be arbitrary to capture the dependences between latent variables but the exponential term still has to factorize across components (dimensions). All these are summarized in Table 4. Clearly, from the table we can see that our method has a more general assumption on the prior leading to identifiability. This is also demonstrated empirically in Fig. 5. Our method iCaRL can recover the original data $Z$ up to a permutation and a simple componentwise + +Table 5: Colored MNIST. Comparisons in terms of accuracy $(\%)$ (mean $\pm$ std deviation). + +
METHODTRAINTEST
ERM84.88 ± 0.1610.45 ± 0.66
ERM 184.84 ± 0.2110.86 ± 0.52
ERM 284.95 ± 0.2010.05 ± 0.23
ROBUST MIN MAX84.25 ± 0.4315.24 ± 2.45
F-IRM GAME63.37 ± 1.1459.91 ± 2.69
V-IRM GAME63.97 ± 1.0349.06 ± 3.43
IRM59.27 ± 4.3962.75 ± 9.59
iCaRL (ours)70.56 ± 0.8168.75 ± 1.45
ERM GRAYSCALE71.81 ± 0.4771.36 ± 0.65
OPTIMAL7575
+ +Table 6: PACS. Comparisons in terms of accuracy $(\%)$ (mean $\pm$ std deviation). + +
METHODTEST
ERM85.7 ± 0.5
IRM84.4 ± 1.1
DRO (Sagawa et al., 2019)84.1 ± 0.4
Mixup (Yan et al., 2020)84.3 ± 0.5
CORAL (Sun & Saenko, 2016)86.0 ± 0.2
MMD (Li et al., 2018b)85.0 ± 0.2
DANN (Ganin et al., 2016)84.6 ± 1.1
C-DANN (Li et al., 2018c)82.8 ± 1.5
LaCIM (Sun et al., 2020)83.5 ± 1.2
iCaRL (ours)88.7 ± 0.6
+ +transformation, whereas all the other methods fail because they are unable to handle the case in which $Z_{i} \nsubseteq Z_{j}|Y, E$ . + +# L IN-DEPTH ANALYSIS ON MORE REALISTIC DATA + +# L.1 COLORED MNIST + +We compare iCaRL with 1) IRM, 2) two variants of IRMG: F-IRM Game (with $\Phi$ fixed to the identity) and V-IRM Game (with a variable $\Phi$ ), 3) three variants of ERM: ERM (on entire training data), ERM $e$ (on each environment $e$ ), and ERM GRAYSCALE (on data with no spurious correlations), and 4) ROBUST MIN MAZ (minimizing the maximum loss across the multiple environments). Table 1 shows that iCaRL outperforms all other baselines on Colored MNIST. However, this dataset seems more difficult because even ERM GRAYSCALE, where the spurious correlation with color is removed, falls well short of the optimum. + +# L.2 PACS + +We report the results on another one of the widely used realistic datasets for OOD generalization: PACS (Li et al., 2017a). This dataset consists of 9,991 images of dimension (3,224,224) and 7 classes from four domains: art, cartoons, photos, and sketches. We used the exact experimental setting that is described in Gulrajani & Lopez-Paz (2020). We provide results averaged over all possible train and test environment combination for one of the commonly used hyper-parameter tuning procedure: train domain validation. As shown in Table 6, iCaRL achieves state-of-the-art performance when compared to those most popular domain generalization alternatives. + +# M IMPLEMENTATION DETAILS + +# M.1 JOINT TRAINING + +As described in Section 4.1, we can jointly learn $(\theta ,\phi)$ by optimizing the following objective: + +$$ +\begin{array}{l} \mathcal {L} _ {\text {p h a s e 1}} (\boldsymbol {\theta}, \phi) = \mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {E L B O}} (\boldsymbol {f}, \hat {\boldsymbol {T}}, \hat {\boldsymbol {\lambda}}, \phi) - \mathcal {L} _ {\text {p h a s e 1}} ^ {\mathrm {S M}} (\hat {\boldsymbol {f}}, \boldsymbol {T}, \boldsymbol {\lambda}, \hat {\phi}) (62) \\ = \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \log p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) + \log p _ {\hat {\boldsymbol {T}}, \hat {\boldsymbol {\lambda}}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) - \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) \right] \right] \\ \left. - \mathbb {E} _ {p D} \left[ \mathbb {E} _ {q _ {\hat {\phi}} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \left\| \nabla_ {\boldsymbol {Z}} \log q _ {\hat {\phi}} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) - \nabla_ {\boldsymbol {Z}} \log p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) \right\| ^ {2} \right] \right] \right. (63) \\ = \mathbb {E} _ {P D} \left[ \mathbb {E} _ {q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \log p _ {\boldsymbol {f}} (\boldsymbol {X} | \boldsymbol {Z}) + \log p _ {\hat {\boldsymbol {T}}, \hat {\boldsymbol {\lambda}}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) - \log q _ {\phi} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E}) \right] \right] \\ \left. \right. - \mathbb {E} _ {p _ {D}} \left[ \mathbb {E} _ {q _ {\hat {\phi}} (\boldsymbol {Z} | \boldsymbol {X}, \boldsymbol {Y}, \boldsymbol {E})} \left[ \sum_ {j = 1} ^ {n} \left[ \frac {\partial^ {2} p _ {\boldsymbol {T} , \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y} , \boldsymbol {E})}{\partial Z _ {j} ^ {2}} + \frac {1}{2} \left(\frac {\partial p _ {\boldsymbol {T} , \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y} , \boldsymbol {E})}{\partial Z _ {j}}\right) ^ {2} \right]\right]\right] \\ + c o n s t. (64) \\ \end{array} +$$ + +where the last equality is due to the equation in Appendix C.2, and $\hat{f},\hat{T},\hat{\lambda},\hat{\phi}$ are copies of $f,T,\lambda ,\phi$ that are treated as constants and whose gradient is not calculated during learning. In practice, $\hat{f},\hat{T},\hat{\lambda},\hat{\phi}$ can be easily implemented through either "detach" in PyTorch Paszke et al. (2019) or "stop_gradient" in TensorFlow Abadi et al. (2015). + +# M.2 THE GENERAL NON-FACITORIZED PRIOR + +In the experiments, the general non-factorized prior in Assumption 2 is implemented as follows: + +$$ +p _ {\boldsymbol {T}, \boldsymbol {\lambda}} (\boldsymbol {Z} | \boldsymbol {Y}, \boldsymbol {E}) = \big \langle \underbrace {\mathrm {N N} (\boldsymbol {Z} ; \mathrm {p a r a m 1})} _ {\boldsymbol {T} _ {N N} (\boldsymbol {Z})}, \underbrace {\mathrm {N N} (\boldsymbol {Y} , \boldsymbol {E} ; \mathrm {p a r a m 2})} _ {\boldsymbol {\lambda} _ {N N} (\boldsymbol {Y}, \boldsymbol {E})} \big \rangle + \big \langle \underbrace {\mathrm {c o n c a t} (\boldsymbol {Z} , \boldsymbol {Z} ^ {2})} _ {\boldsymbol {T} _ {f} (\boldsymbol {Z})}, \underbrace {\mathrm {N N} (\boldsymbol {Y} , \boldsymbol {E} ; \mathrm {p a r a m 3})} _ {\boldsymbol {\lambda} _ {f} (\boldsymbol {Y}, \boldsymbol {E})} \big \rangle , +$$ + +where $\langle \cdot, \cdot \rangle$ is the dot product of two vectors, and $\operatorname{concat}(\cdot, \cdot)$ means the concatenation of two vectors. Now let us explain each term in details. + +Firstly, $\operatorname{concat}(\mathbf{Z},\mathbf{Z}^2)$ is a vector of the latent variables and their squared values, and $\mathrm{NN}(\mathbf{Y},\mathbf{E};\mathrm{param3})$ is a deep neural network parameterized by param3 that computes a vector of natural parameters as a function of $\mathbf{Y}$ and $\mathbf{E}$ . Hence, the term $\left\langle \operatorname{concat}(\mathbf{Z},\mathbf{Z}^2),\mathrm{NN}(\mathbf{Y},\mathbf{E};\mathrm{param3})\right\rangle$ is equivalent to the factorized exponential family, which also satisfies that each $T_{i}(Z_{i})$ has dimension larger or equal to 2. + +Secondly, $\mathrm{NN}(Z; \mathrm{param1})$ is a neural network that receives as input a vector of latent variables and outputs another vector representing complicated nonlinear transformations of those variables. $\mathrm{NN}(Y, E; \mathrm{param2})$ is another neural network that generates a corresponding vector of natural parameters. Hence, the term $\langle \mathrm{NN}(Z; \mathrm{param1}), \mathrm{NN}(Y, E; \mathrm{param2}) \rangle$ will allow this prior to capture the dependencies between the latent variables $Z$ . + +# N HYPERPARAMETERS AND ARCHITECTURES + +In this section, we describe the hyperparameters and architectures of different models used in different experiments. Unless stated otherwise, we have $\lambda_1 = 1$ and $\lambda_2 = 1$ , both of which are selected on training/validation data. + +# N.1 SYNTHETIC DATA + +We used Adam optimizer for training with learning rate set to 1e-3 and batch size set to 128. + +# N.1.1 ERM + +# Linear ERM + +- Input layer: Input batch (batch size, input dimension) +Output layer: Fully connected layer, output size $= 1$ + +# Nonlinear ERM + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 1$ + +# N.1.2 IRM + +# Linear Data Representation $\Phi$ + +- Input layer: Input batch (batch size, input dimension) +Output layer: Fully connected layer, output size $= 1$ + +# Nonlinear Data Representation $\Phi$ + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 1$ + +# N.1.3 F-IRM GAME + +# Linear Classifier $w$ + +- Input layer: Input batch (batch size, input dimension) +Output layer: Fully connected layer, output size $= 1$ + +# Nonlinear Classifier $w$ + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 1$ + +# N.1.4 V-IRM GAME + +# Linear Data Representation $\Phi$ + +- Input layer: Input batch (batch size, input dimension) +Output layer: Fully connected layer, output size $= 2$ + +# Nonlinear Data Representation $\Phi$ + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 2$ + +# Linear Classifier $w$ + +- Input layer: Input batch (batch size, 2) +Output layer: Fully connected layer, output size $= 1$ + +# Nonlinear Classifier $w$ + +- Input layer: Input batch (batch size, 2) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 1$ + +# N.1.5 ICARL + +# NF-iVAE $\lambda_{f}$ -Linear Prior + +- Input layer: Input batch (batch size, input dimension) +Output layer: Fully connected layer, output size $= 4$ + +# NF-iVAE $\lambda_{f}$ -Nonlinear Prior + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 4$ + +# NF-iVAE $T_{NN}$ -Nonlinear Prior + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 1$ + +# NF-iVAE $\lambda_{NN}$ -Nonlinear Prior + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 1$ + +# NF-iVAE Linear Encoder + +- Input layer: Input batch (batch size, input dimension) +- Mean Output layer: Fully connected layer, output size = 2 +- Log Variance Output layer: Fully connected layer, output size = 2 + +# NF-iVAE Nonlinear Encoder + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size $= 6$ , activation = ReLU +- Mean Output layer: Fully connected layer, output size = 2 +- Log Variance Output layer: Fully connected layer, output size = 2 + +# NF-iVAE Linear Decoder + +- Input layer: Input batch (batch size, 2) +- Mean Output layer: Fully connected layer, output size = output dimension +- Variance Output layer: $0.01 \times 1$ , where 1 is a vector full of 1 with the length of output dimension + +# NF-iVAE Nonlinear Decoder + +- Input layer: Input batch (batch size, 2) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +- Mean Output layer: Fully connected layer, output size = output dimension +- Variance Output layer: $0.01 \times 1$ , where 1 is a vector full of 1 with the length of output dimension + +# Linear Classifier $w$ + +- Input layer: Input batch (batch size, 1) +Output layer: Fully connected layer, output size $= 1$ + +# Nonlinear Classifier $w$ + +- Input layer: Input batch (batch size, 1) +- Layer 1: Fully connected layer, output size = 6, activation = ReLU +Output layer: Fully connected layer, output size $= 1$ + +# N.2 CMNIST AND CFMNIST + +Considering that the results of most baselines come from IRMG (Ahuja et al., 2020a), for a fair comparison, we follow the same setting of IRMG in terms of hyper-parameters and validation considerations. For example, the batch size is set to 256, and the learning rate is $10^{-4}$ . We also did not use the test environment data for validation. Please find more details in Ahuja et al. (2020a). + +# NF-iVAETNN-Prior + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 50, activation = ReLU +Output layer: Fully connected layer, output size $= 45$ + +# NF-iVAE $\lambda_{NN}$ -Prior + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 50, activation = ReLU +Output layer: Fully connected layer, output size $= 45$ + +# NF-iVAE $\lambda_{f}$ -Prior + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 50, activation = ReLU +Output layer: Fully connected layer, output size $= 20$ + +# NF-iVAE X-Encoder + +- Input layer: Input batch (batch size, 2, 28, 28) +- Layer 1: Convolutional layer, output channels = 32, kernel size = 3, stride = 2, padding = 1, activation = ReLU +- Layer 2: Convolutional layer, output channels = 32, kernel size = 3, stride = 2, padding = 1, activation = ReLU +- Layer 3: Convolutional layer, output channels = 32, kernel size = 3, stride = 2, padding = 1, activation = ReLU +Output layer: Flatten + +# NF-iVAE $(Y,E)$ -Encoder + +- Input layer: Input batch (batch size, input dimension) +Output layer: Fully connected layer, output size $= 100$ activation $=$ ReLU + +# NF-iVAE $(X,Y,E)$ -Merger/Encoder + +- Input layer: Input batch (batch size, input dimension) +- Layer 1: Fully connected layer, output size = 100, activation = ReLU +- Mean Output layer: Fully connected layer, output size $= 10$ +- Log Variance Output layer: Fully connected layer, output size = 10 + +# NF-iVAE Decoder + +- Input layer: Input batch (batch size, 10) +- Layer 1: Fully connected layer, output size $= {32} \times 4 \times 4$ ,activation $=$ ReLU +- Layer 2: Reshape to (batch size, 32, 4, 4) +- Layer 3: Deconvolutional layer, output channels $= {32}$ ,kernel size $= 3$ ,stride $= 2$ ,padding $=$ 1,outpadding $= 0$ ,activation $=$ ReLU +- Layer 4: Deconvolutional layer, output channels $= {32}$ ,kernel size $= 3$ ,stride $= 2$ ,padding $=$ 1,outpadding $= 1$ ,activation $=$ ReLU +- Layer 5: Deconvolutional layer, output channels $= 2$ , kernel size $= 3$ , stride $= 2$ , padding $= 1$ , outpadding $= 1$ +- Mean Output layer: activation = Sigmoid +- Variance Output layer: $0.01 \times 1$ , where 1 is a matrix full of 1 with the size of $2 \times 28 \times 28$ . + +# Classifier $w$ + +- Input layer: Input batch (batch size, 50) +- Layer 1: Fully connected layer, output size = 100, activation = ReLU +- Output layer: Fully connected layer, output size = 1, activation = Sigmoid + +# N.3 VLCS AND PACS + +We used the exact experimental setting that is described in Gulrajani & Lopez-Paz (2020). Specifically, we trained our model over all possible train and test environment combination for one of the commonly used hyper-parameter tuning procedure: train domain validation. We use ResNet-50 as an encoder and reverse the architecture of ResNet-50 as a decoder. We set the number of the latent variables to $n = 50$ . We do the hyperparameter search by exactly following the guides given in Gulrajani & Lopez-Paz (2020). \ No newline at end of file diff --git a/invariantcausalrepresentationlearningforoutofdistributiongeneralization/images.zip b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a49785bfcce466c009c6f3910091cb9a53ac1609 --- /dev/null +++ b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7943f44992b10a64746feb698e4bbc4f193942b0d675f1cb9daf024b9f159df +size 1087554 diff --git a/invariantcausalrepresentationlearningforoutofdistributiongeneralization/layout.json b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..aec925a3ea4c194bda02fd445c14a76945901cd5 --- /dev/null +++ b/invariantcausalrepresentationlearningforoutofdistributiongeneralization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b82cf2c34b61607a267857ecc85d2447f585cf8c56c51b98ab4d8f104076d5a0 +size 1853663 diff --git a/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_content_list.json b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ebf56184b58fab631d5f8b14d0a353a5488afea4 --- /dev/null +++ b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d010f39e4c1aea6122576236d1fb9a3b9abbf0c3214a526ecbe0a91a49195c7d +size 94945 diff --git a/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_model.json b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a0dbf785556e2660ba527fa943c99e74fd8c1485 --- /dev/null +++ b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3dae602dee4e00b68b5a96d13d580debcc39a17ab118730237a5efb167fc0e10 +size 113302 diff --git a/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_origin.pdf b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d80a0efd74fa4dcdbfe9291b9ceee7c40181594c --- /dev/null +++ b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/e6d85393-4e68-4cde-8522-49b731ce56aa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50a8ffeacfff1bd2cd2641244c2756f1533b0f7d45e2fd42bc072731a5d8dcab +size 936315 diff --git a/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/full.md b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e45b6e949f109a85f7446e965a383da6979d8ce9 --- /dev/null +++ b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/full.md @@ -0,0 +1,344 @@ +# INVERSE ONLINE LEARNING: UNDERSTANDING NON-STATIONARY AND REACTIONARY POLICIES + +Alex J. Chan, Alicia Curth, and Mihaela van der Schaar + +University of Cambridge + +Department of Applied Mathematics and Theoretical Physics + +Cambridge, UK + +{ajc340, amc253, mv472}@cam.ac.uk + +# ABSTRACT + +Human decision making is well known to be imperfect and the ability to analyse such processes individually is crucial when attempting to aid or improve a decision-maker's ability to perform a task, e.g. to alert them to potential biases or oversights on their part. To do so, it is necessary to develop interpretable representations of how agents make decisions and how this process changes over time as the agent learns online in reaction to the accrued experience. To then understand the decision-making processes underlying a set of observed trajectories, we cast the policy inference problem as the inverse to this online learning problem. By interpreting actions within a potential outcomes framework, we introduce a meaningful mapping based on agents choosing an action they believe to have the greatest treatment effect. We introduce a practical algorithm for retrospectively estimating such perceived effects, alongside the process through which agents update them, using a novel architecture built upon an expressive family of deep state-space models. Through application to the analysis of UNOS organ donation acceptance decisions, we demonstrate that our approach can bring valuable insights into the factors that govern decision processes and how they change over time. + +# 1 INTRODUCTION + +Decision modelling is often viewed through the lens of policy learning (Bain & Sammut, 1995; Abbeel & Ng, 2004), where the aim is to learn some imitation policy that captures the actions (and thus decisions) of an agent in some structured way (Hüyük et al., 2021a). Unfortunately, this usually implicitly relies on the assumption that the actions taken are already optimal with respect to some objective, and hence do not change over time. While this might be appropriate to approximate the stationary policy of an autonomous agent, such assumptions often break down when applying them to more flexible agents that might be learning on-the-fly. In particular, we may want to model the decision making process of a human decision-maker, whose actions we may see executed over time - this is clearly of great use in a range of fields including economics and medicine (Hunink et al., 2014; Zavadskas & Turskis, 2011). In the context of machine learning, they would be considered to be undergoing a process of online learning (Hoi et al., 2018); training while interacting with the environment, where it is to be expected that beliefs and strategies are constantly adapted based on accumulating experience (Elio & Pelletier, 1997). Additionally, such belief updates are often imperfect; for example, people are known to a priori over-weight the potential impact of rare events when they first start a task, before proceeding to neglect them when they do not occur in their experience (Hertwig & Erev, 2009). If our goal is to analyse human decision-making, it is thus important to be able to model non-stationary policies that are potentially imperfect in two senses: both marginally at each time-step, and in the way that they become adapted to new information. + +In this work, instead of relying on the assumption that an agent follows a stationary optimal policy, we consider their actions to be consistent within an online leaning framework where they learn from an incoming sequence of examples (Hoi et al., 2018) and update their policies accordingly, as in Figure 1. Thus, instead of assuming that actions are globally optimal, we assume that at any exact time the agent thought that the action was better than the alternatives. As a natural consequence, we frame the problem of decision modelling as that of inverse online learning; that is, we aim to uncover + +![](images/25e4484fbc1013936292d02ced632f187093863375d8cac28645f14174eb07ea.jpg) +Figure 1: Capturing online learning behaviour. We assume the agent models the response surfaces in their mind, and that their belief changes each time step in response to the actions they take and the consequent observations they make. The response surface they model need not converge on the true surface since the update method of the agent may be biased and not appropriately use the information available to them. + +![](images/d49d1119ef929eb5eb4367750f30b61464ea0919224474e34668413420d25f53.jpg) + +![](images/81bd173a4394a8fb06572bfbb1a88d964883d482a0dbc760d9e8fc39a9af2927.jpg) + +![](images/3cf56dc723ac9faee05183dd586dd3d488f478cb289e8d9c67ab84ab4d59d050.jpg) + +the process through which an agent is learning online. Note that this does not involve coming up with a new way to do online learning itself, rather we recover how it appears a given agent may have learnt. We do this by modelling the (non-stationary) policy of the agent using a deep state-space model (Krishnan et al., 2017), allowing us to track the memory of the agent while allowing policies to evolve in a non-parametric and non-prescribed fashion. We construct an interpretable mapping from the accrued memory to policies by framing the decision-making process within a potential-outcome setting (Rubin, 2005); letting actions correspond to interventions (or treatments), and assuming that agents make decisions by choosing an action which they perceive to have the highest (treatment) effect. + +Contributions. In this work we make a number of contributions: First, we formalise the inverse online learning problem and a connection between decision modelling, online learning and potential outcomes, highlighting how they complement each other to result in an interpretable understanding of policies (Section 2); Second, we introduce a practical method to estimate the nonstationary policy and update method of an agent given demonstrations (Section 4); And third, we demonstrate how we can uncover useful practical insights into the decision making process of agents with a case study on the acceptance of liver donation offers (Section 5). Code is made available at https://github.com/XanderJC/inverse-online, along with the group codebase at https://github.com/vanderschaarlab/mlforhealthlabpub. + +# 2 PROBLEM FORMALISATION + +Preliminaries. Assume we observe a data trajectory $^1$ of the form $\mathcal{D} = \{(X_t, A_t, Y_t)\}_{t=1}^T$ . Here, $X_t \in \mathcal{X} \subset \mathbb{R}^d$ , denotes a context vector of possible confounders; $A_t \in \mathcal{A} = \{0,1\}$ , a binary action or intervention; and $Y_t \in \mathcal{V}$ , a binary or continuous outcome of interest. The subscript $t$ indicates a time-ordering of observed triplets; any time-step $t$ is generated by (i) arrival of context $x$ , (ii) an intervention $a$ being performed by an agent according to some policy $\pi_t(x)$ and (iii) a corresponding outcome $y$ being observed. + +Goal. We are interested in recovering the agent's non-stationary policy $\pi_t(x) = P(A = 1|X = x, H_t = h_t)$ , which depends on the observed context $x$ and can change over time due to the observed history $H_t = \{(X_k, A_k, Y_k)\}_{k=1}^{t-1}$ . We make the key assumption that the agent acts with the intention to choose an intervention $a$ leading to the best (largest) potential outcome $Y(a)$ , but that the perception of the optimal intervention may change over time throughout the agent's learning process about their environment. This problem formalisation naturally places us at the in + +![](images/d0eba3c1b8dccd57dd2699de8a7f62a4d9db6c6bcad2c366c1a998723b3538ae.jpg) +Figure 2: Simplified inverse process. Our task is to infer the evolving perceived effect over time (the blue line) given only realisations of the agent's behaviour. + +tersection of treatment effect inference within the Neyman-Rubin potential outcomes (PO) framework + +(Rubin, 2005) with the classical (inverse) reinforcement learning (RL) paradigm (Abbeel & Ng, 2004). More specifically though the RL-subproblem of logged contextual bandits (Swaminathan & Joachims, 2015; Atan et al., 2018), where the setting is offline and the contexts arrive independently. + +Perception Versus Reality. As is standard within the PO framework, we assume that any observation has two potential outcomes $Y(a)$ , associated with each intervention (treatment-level), which are generated from some true distribution inherent to the environment, i.e. $Y(0), Y(1) \sim \mathbb{P}^e(\cdot | X = x)$ , yet only the potential outcome associated with the chosen treatment is revealed to the agent. If the agent had full knowledge of the environment, its optimal policy would be to choose an action as $\arg \max_a \mu_a^e(x)$ where $\mu_a^e(x) = \mathbb{E}_{\mathbb{P}^e}[Y(a) | X = x]$ , or conversely to choose to perform the intervention only when its expected conditional average treatment effect (CATE) $\tau^e(x) = \mu_1^e(x) - \mu_0^e(x)$ is positive. In general, we assume that such perfect knowledge of the environment is not available to the agent in many scenarios of practical interest. Instead, we assume that at any time $t$ , the agent acts according to some perceived model $\tilde{\mathbb{P}}$ of its environment, which induces the perceived expected potential outcomes $\tilde{\mu}_a(x; t)$ and associated treatment effect $\tilde{\tau}(x; t)$ . Here, $\tilde{\mu}_a(x; t) = \mathbb{E}_{\tilde{\mathbb{P}}} [Y(a) | X = x, H_t = h_t]$ , is a function not only of the observed context but also the history, such that the agent can update its beliefs according to observed outcomes. Note that we allow the agent's model of the environment to be misspecified; in this case $\tilde{\mu}_a(x; t)$ would not converge to $\mu_a^e(x)$ even for very long trajectories. We consider this an important feature, as we assume that human decision-makers generally need to make simplifications (Griffiths et al., 2015). Formally, we make the following assumption about the agent's decision making process: + +Assumption 1 Mutual Observability: The observable space $\mathcal{X}$ contains only and all the information available to the agent at the point of assigning an action. + +Assumption 2 Perceived Optimality: An agent assigns the action they think will maximise the outcome. For a deterministic policy $\pi_t$ , the agent believes $\pi_t(x) = 1 \iff \tilde{\mu}_1(x; t) > \tilde{\mu}_0(x; t)$ . Given a stochastic agent, the policy $\pi_t(x) = P(A_t = 1|x)$ is a monotonic increasing function of the agent's belief over the treatment effect $\tilde{\tau}(x; t)$ . + +Assumption 3 Continual Adaptation: The agent may continually adjust their strategy based on experience. The index in the dataset $\mathcal{D}$ represents a temporal ordering which $\pi$ is non-stationary with respect to, i.e. $\pi_i(x)$ may not equal $\pi_j(x), i \neq j \geq 1$ where $\pi_i$ represents the policy at time step $i$ . + +Assumptions 1 and 2 are generally unverifiable in practice, yet, they are necessary: there would be little opportunity to learn anything meaningful about a non-stationary policy without them. Mutual observability is crucial, as assuming that different information streams are available to the observer and the agent would make it impossible to accurately describe the decision-making process. Assumption 2, albeit untestable, appears very reasonable: in the medical setting, for example, a violation would imply malicious intent – i.e. that a clinician purposefully chooses the intervention with a sub-optimal expected outcome. Nonetheless, this does mean that we do not consider exploratory agents that are routinely willing to sacrifice outcomes for knowledge, a constraint we do not consider too restrictive within the medical applications we have in mind. Assumption 3, on the other hand, is not at all restrictive; on the contrary, it explicitly specifies a more flexible framework than is usual in imitation or inverse reinforcement learning as the set of policies it describes contains stationary policies. + +# 3 RELATED WORK + +Our problem setting is related to, but distinct from, a number of problems considered within related literature. Effectively, we assume that we observe *logged data* generated by a learning agent that acts according to its evolving belief over effects of its actions, and aim to solve the inverse problem by making inferences over said belief given the data. Below, we discuss our relationship to work studying both the forward and the inverse problem of decision modelling, with main points summarised in Table 1. + +The Forward Problem: Inferring Prescriptive Models for Behaviour. The agent, whose (nonstationary) policy we aim to understand, actively learns online through repeated interaction with an environment and thus effectively solves an online learning problem (Hoi et al., 2018). The most prominent example of such an agent would be a contextual bandit (Agarwal et al., 2014), which learns to assign sequentially arriving contexts to (treatment) arms. Designing agents that update + +policies online is thus the inverse of the problem we consider here. Another seemingly related problem within the RL context is learning optimal policies from logged bandit data (Swaminathan & Joachims, 2015); this is different from our setting as it is prescriptive rather than descriptive. + +If the goal was to infer the true $\tau^e (x)$ from the (logged) observational data $\mathcal{D}$ (instead of the effect perceived by the agent), this would constitute a standard static CATE estimation problem, for which many solutions have been proposed in the recent ML literature (Alaa & van der Schaar, 2018; Shalit et al., 2017; Künzel et al., 2019). Note that within this literature, the treatment-assignment policy (the so-called propensity score $\pi (x) = \mathbb{P}(A = 1|X = x)$ ) is usually assumed to be stationary and considered a nuisance parameter that is not of primary interest. Estimating CATE can also be a pretext task to the problem of developing optimal treatment rules (OTR) (Zhang et al., 2012a;b; Zhao et al., 2012), as $g(x) = \mathbb{1}(\tau (x) > 0)$ is such an optimal rule (Zhang et al., 2012b). + +The Backward Problem: Obtaining a Descriptive Summary of an Agent. When no outcomes are observed (unlike in the bandit problem) the task of learning a policy becomes imitation learning (IL), itself a large field that aims to match the policy of a demonstrator (Bain & Sammut, 1995; Ho & Ermon, 2016). Note that, compared to the bandit problem, there is a subtle shift from obtaining a policy that is optimal with respect to some true notion of outcome to one that minimises some divergence from the demonstrator. While IL is often used in the forward problem to find an optimal policy – thereby implicitly assuming that the demonstrator is themselves acting optimally –, it can also, if done interpretably, be used in the backward problem to very effectively reason about the goals and preferences of the agent (Hüyük et al., 2021a). One way to achieve this is through inverse reinforcement learning (IRL), which aims to recover the reward function that is seemingly maximised by the agent (Ziebart et al., 2008; Fu et al., 2018; Chan & van der Schaar, 2021). This need not be the true reward function, and can be interpreted as a potentially more compact way to describe a policy, which is also more easily portable given shifts in environment dynamics. + +Our problem formalisation is conceptually closely related to the counterfactual inverse reinforcement learning (CIRL) work of Bica et al. (2021). There the authors similarly aim to explain decisions based on the PO framework, specifically by augmenting a max-margin IRL (Abbeel & Ng, 2004) approach to parameterise the learnt reward as a weighted sum of counterfactual outcomes. However, CIRL involves a pre-processing counterfactual estimation step that focuses on estimating the true treatment effects, and implicitly assumes that these are identical to the ones perceived by the agent (i.e. it assumes that the agent has perfect knowledge of the environment dynamics generating the potential outcomes), marking a significant departure from our (much weaker) assumptions. Without the focus on treatment effects, our method could be seen as a generalised non-parametric extension of the inverse contextual bandits of Huyuk et al. (2021b). In general, the backward problem is hard to evaluate empirically since information about the true beliefs of agents is not normally available in the data, thus relying on simulation to validate (Chan et al., 2021). + +Table 1: Problems considered in related work, noting the relationship between both input and output. + +
ProblemInputTarget quantity
Online Learning of Optimal Polices (Agarwal et al., 2014)(Xt, At, Yt)πtopt(x)
Learning Optimal Policy from Logged Bandits (Swaminathan & Joachims, 2015)(Xi, Ai, Yt)πopt(x)
Estimating Heterogeneous Treatment Effects (Alaa & van der Schaar, 2018)(Xi, Ai, Yt)τe(x)
Learning Imitator Policies via Imitation Learning (Bain & Sammut, 1995)(Xi, Ai)πobs(x)
Learning Reward Functions via IRL (Abbeel & Ng, 2004)(Xi, Ai)Robs(x)
Learning Reward Functions via CIRL (Bica et al., 2021)(Xi, Ai, Yt)Robs(x)
Modelling Dynamic Policies via Inverse Online Learning(Xt, At, Yt)πtobs(x)
+ +# 4 INFERRING THE ONLINE LEARNING PROCESS + +Preliminaries: The Forward Problem. In the forward context, the problem we consider amounts to an agent attempting to, at each time-step, take the action they believe will maximise the outcome, without being aware of the true effect of their intervention. We assume that the agent believes the potential outcomes are a linear combination of the contextual features such that $\tilde{\mu}_a(X_t; t) = \langle X_t, \omega_a^t \rangle$ , with $\omega_a^t \in \Omega$ a set of weights for the action $a$ at time $t$ , and $\langle \cdot, \cdot \rangle$ denoting the inner product. Normally we may consider a linear model an oversimplification, but + +![](images/4688337ff0ef3b51e02f8f3a86f276b0ab19b5c10b39875de76fba0e019cf792.jpg) +Figure 3: Model. Solid black lines indicate single time step dependencies. Given covariates $X_{i}$ and an observed history then treatment effects are estimated in the mind of the agent. An action $A_{i}$ is selected based on these effect and an outcome $Y_{i}$ is observed. The dashed grey lines then indicate information flow over time. + +when modelling the thought process of an agent it appears much more reasonable - for example, does a doctor consider higher order terms when weighing up potential outcomes of a patient? It seems unlikely, especially as clinical guidelines are often given as linear cutoffs (Burgers et al., 2003). The considered forward problem thus proceeds as follows for every given time step $t$ : + +1. A context $X_{t} \sim P_{\mathcal{X}}$ arrives independently over time. We make no assumptions on the form of $P_{\mathcal{X}}$ , in particular noting that there is no need for any level of stationarity. +2. Given $X_{t}$ and the current set of weights $\{\omega_1^t, \omega_0^t\}$ , the agent predicts their perceived potential outcomes $\tilde{\mu}_1(X_t; t)$ and $\tilde{\mu}_0(X_t; t)$ . +3. Action $A_{t}$ is assigned by some probabilistic optimal treatment rule $\pi : \mathcal{Y}^2 \mapsto [0,1]$ such that $\mathbb{P}(A_t = 1 | X_t) = \pi (\tilde{\mu}_1(X_t; t), \tilde{\mu}_0(X_t; t))$ , before the associated true outcome is observed. +4. Based on this new information the agent (potentially stochastically) updates their belief over the response surface for the taken action according to some update function $f: \Omega^2 \times \mathcal{X} \times \mathcal{A} \times \mathcal{Y} \mapsto \triangle(\Omega^2)$ such that $\omega_1^{t+1}, \omega_0^{t+1} \sim f(\omega_1^t, \omega_0^t, X_t, A_t, Y_t)$ . + +To maximise outcomes it is crucial to employ an update function $f$ that maximally captures the available information at each step of the process. This then allows for an appropriate determination of $\pi$ that aims to maximise the total (potentially future discounted) outcomes. + +# 4.1 A MODEL OF INVERSE ONLINE LEARNING + +Here, we focus on the inverse to the problem outlined above, which, to the best of our knowledge, has received little to no attention in related work. That is, after observing an agent's actions, can we recover how they arrived at their decisions, and how this changed over time? In the following, we use vector notation $\vec{x}_{t:t'} = \{x_i\}_{i=t}^{t'}$ with $\vec{x} = \vec{x}_{1:T}$ for all realised variables, with histories $\vec{h}_{t:t'} = \{(x_i, a_i, y_i)\}_{i=t}^{t'}$ . Note that the previously described forward model assumes a factorisation of the full generative distribution of the observed data given by: + +$$ +p (\vec {x}, \vec {a}, \vec {y}) = \prod_ {t = 1} ^ {T} p \left(y _ {t} \mid a _ {t}, x _ {t}\right) \times p \left(a _ {t} \mid \vec {x} _ {1: t - 1}, \vec {a} _ {1: t - 1}, \vec {y} _ {1: t - 1}\right) \times p \left(x _ {t}\right). \tag {1} +$$ + +We assume that $p(x_{t})$ and $p(y_{t}|a_{t},x_{t})$ are governed by some true environment dynamics, independent from the perception of the agent and thus not part of our modelling problem. This seems trivially true, as the perception of the agent will neither affect the contexts that arrive nor the true outcome conditional on the action being taken. + +Our model for the evolving beliefs of an agent with respect to their interaction with the environment revolves around a specialised deep state-space model. Crucially, this takes the form of a latent random variable $M_{t} \in \mathbb{R}^{d}$ , which captures the memory of the agent at time $t$ , and can evolve in a flexible way based on the observed history. We consider the memory to be an efficient summary of the history, which can be interpreted as a sufficient statistic for the beliefs of the agent at a given time. Naturally, this memory is unobserved and must be learnt in an unsupervised + +manner. The introduction of this latent variable leads to an extended probabilistic model with a more structured factorisation of the conditional distribution of the actions, and a model given by: + +$$ +p _ {\theta} (\vec {a} | \vec {x}, \vec {y}) = \prod_ {t = 1} ^ {T} \underbrace {\pi_ {\theta} \left(a _ {t} \mid \tilde {\tau} _ {t}\right)} _ {\text {T r e a t m e n t R u l e}} \times \underbrace {\mathcal {O} _ {\theta} \left(\tilde {\tau} _ {t} \mid x _ {t} , m _ {t}\right)} _ {\text {O u t c o m e E s t i m a t i o n}} \times \underbrace {\mathcal {S} _ {\theta} \left(m _ {t} \mid \vec {x} _ {1 : t - 1} , \vec {a} _ {1 : t - 1} , \vec {y} _ {1 : t - 1}\right)} _ {\text {M e m o r y A g g r e g a t i o n}}. \tag {2} +$$ + +This model consists of three components: a memory summarisation network $S_{\theta}:\mathcal{H}\mapsto \triangle (\mathcal{M})$ , which maps the history into a (distribution over) memory; a (perceived) potential outcome predictor network $\mathcal{O}_{\theta}:\mathcal{X}\times \mathcal{M}\mapsto \mathbb{R}^{2}$ , that takes the memory and a context and predicts the perceived potential outcomes; and a treatment rule $\pi_{\theta}:\mathcal{Y}^2\mapsto [0,1]$ , that given the potential outcomes (summarised by the perceived treatment effect) outputs a distribution over actions. Throughout, $\theta$ denotes the full set of parameters of the generative model and notation is shared across components to reflect that they can all be optimised jointly. Below, we discuss each component in turn. + +Memory Aggregation. We define the base structure of $S_{\theta}$ to be relatively simple and recursive, and assume the memory at a given time step to be distributed as: + +$$ +M _ {t} \sim \mathcal {N} \left(\boldsymbol {\mu} _ {t}, \boldsymbol {\Sigma} _ {t}\right) \quad \text {w i t h} \quad \boldsymbol {\mu} _ {t}, \boldsymbol {\Sigma} _ {t} = \mathrm {M L P} \left(\left[ M _ {t - 1}, X _ {t - 1}, A _ {t - 1}, Y _ {t - 1} \right]\right), \tag {3} +$$ + +where $\pmb{\mu}_t$ and $\pmb{\Sigma}_t$ are two output heads of the memory network $S$ given the history $h_{t-1}$ . It is important to note that the memory network does not get the $t$ -th step information (including the context) when predicting the memory at time $t$ . This means the network cannot provide any specific predictive power for a given context and is forced to model the general response surfaces. + +In many models of behaviour the update function $f$ of the agent is modelled as perfect Bayesian inference (Kaelbling et al., 1998; Colombo & Hartmann, 2017). While this may seem natural on the surface given the logical consistency of Bayesian inference, it seems unlikely in practice that agents (and especially humans) will be capable of it. Not least because in all but the simplest cases it will become intractable for computational agents and humans themselves are well known to make simplifying approximations when dealing with past histories (Genewein et al., 2015). By employing a flexible neural architecture, we remove this relatively restrictive assumption on the memory update process. Our model then learns exactly how the agent appears to use previous information to update their predictions - allowing us to model common cognitive biases such as overly weighting recent or largely negative events (Hertwig & Erev, 2009). + +Outcome Estimation. Having obtained a memory state $m_t$ , the second stage involves predicting the perceived potential outcomes for a context $x_t$ with the network $\mathcal{O}_{\theta}(\tilde{\tau}_t|x_t,m_t)$ . Given the forward model where the potential outcomes are considered a linear combination of the features this then proceeds again in three steps: + +$$ +\omega_ {1} ^ {t}, \omega_ {0} ^ {t} = \operatorname {M L P} \left(m _ {t}\right), \tag {4} +$$ + +$$ +\tilde {\mu} _ {1} \left(x _ {t}; t\right) = \left\langle x _ {t}, \omega_ {1} ^ {t} \right\rangle , \quad \tilde {\mu} _ {0} \left(x _ {t}; t\right) = \left\langle x _ {t}, \omega_ {0} ^ {t} \right\rangle \tag {5} +$$ + +$$ +\tilde {\tau} _ {t} = \tilde {\mu} _ {1} \left(x _ {t}; t\right) - \tilde {\mu} _ {0} \left(x _ {t}; t\right). \tag {6} +$$ + +First the memory $m_{t}$ is decoded into a set of weights for each action using some standard feedforward multi-layer perceptron (MLP), before the potential outcomes are predicted by taking the inner product with the context. This is preferable to, for example, concatenating and passing both $x_{t}$ and $m_{t}$ through a network since, while it may be potentially more expressive, it loses the connection to the forward model as well as the interpretability that is given by linearity. As it is, while our model of the potential outcomes is linear at each time step, the memory allows this to flexibly change throughout the course of the history. The perceived treatment effect is then calculated as the difference between potential outcomes. However, given the linear nature of the predictions, there is no non-degenerate solution for the $\omega$ s. Thus, to ensure identifiability, we set $\omega_0^t = 0$ as a baseline. + +Treatment Rule. Under Assumption 2, the agent should be expected to take an action that maximises the outcome. There are different possible options for the exact treatment rule, the most obvious being $\pi (a_t|\tilde{\tau}_t) = \mathbb{1}(\tilde{\tau}_t > 0)$ ; assuming that as long as the treatment effect is positive then the intervention will be taken. However, in order to maintain differentiability, as well as to allow for more modelling flexibility to capture the stochasticity of agents, we parameterise the policy as a soft version of the indicator function: + +$$ +\pi \left(a _ {t} \mid \tilde {\tau} _ {t}\right) = \frac {1}{1 + \exp \left(- \alpha \left(\tilde {\tau} _ {t} - \beta\right)\right)}. \tag {7} +$$ + +Assuming positive $\alpha$ , this is clearly monotonically increasing, satisfying Assumption 2. These parameters are learnt by the model and thus allow us to model a flexible threshold with $\beta$ as well as aleatoric uncertainty in the actions of the agent with $\alpha$ . + +# 4.2 LEARNING WITH AN INFERENCE NETWORK + +As with all flavours of deep state space models, exact posterior inference is analytically intractable, making optimisation of the marginal likelihood equally so. As such, we aim to maximise an Evidence Lower BOund (ELBO) on this likelihood of the data following standardised variational principles (Blei et al., 2017; Hoffman et al., 2013). This is achieved by positing a parameterised approximate posterior distribution $q_{\phi}(\vec{m}|\vec{h})$ , and with a simple application of Jensen's inequality arrive at: + +$$ +\log p _ {\theta} (\vec {h}) \geq \mathbb {E} _ {q _ {\phi}} \left[ \log p _ {\theta} (\vec {m}, \vec {h}) - \log q _ {\phi} (\vec {m} | \vec {h}) \right]. \tag {8} +$$ + +Maximising this bound is not only useful in terms of the marginal likelihood but also equivalently minimises the Kullback-Leibler divergence between the approximate and true posterior $D_{KL}[q_{\phi}(\vec{m}|\vec{h})||p(\vec{m}|\vec{h})]$ , giving us more confidence in our inferred posterior. + +Factorising the Posterior for Efficient Inference. In order to accelerate learning and make inference quick, we factorise the approximate posterior in the same way as the true posterior: + +$$ +q _ {\phi} (\vec {m} | \vec {h}) = q _ {\phi} (m _ {1} | \vec {h}) \prod_ {t = 2} ^ {T} q _ {\phi} \left(m _ {t} \mid m _ {t - 1}, \vec {h} _ {t - 1: T}\right) \tag {9} +$$ + +Thus to estimate the approximate posterior, we use a backwards LSTM to create a summary $b_{t} = \mathrm{LSTM}(h_{t:T})$ . This is then concatenated with the previous memory at time step $t - 1$ before being passed through a fully connected layer to estimate parameters. Given that the memory can be seen as a sufficient statistic of the past within the model, + +it is well known that given this factorisation, conditioning on the memory leads to a Rao-Blackwellization of the more general network that would be conditioned on all variables (Krishnan et al., 2017; Alaa & van der Schaar, 2019). This accelerates learning not only by parameter sharing between $\phi$ and $\theta$ but also by reducing the variance of the gradient estimates during training. With the specified inference network $q_{\phi}$ , this leads to an optimisation objective: + +![](images/276c20427fe2dfb01ece5da8d81564f4755a50d84125d997bf90799483e9f715.jpg) +Figure 4: Structure of the approximate posterior inference network. + +$$ +\begin{array}{l} \mathcal {F} (\phi , \theta) = \mathbb {E} _ {q _ {\phi} (\vec {m} | \vec {h})} [ p _ {\theta} (\vec {a} | \vec {h}) ] - D _ {K L} (q _ {\phi} (m _ {1} | \vec {x}) | | p _ {\theta} (m _ {1})) \tag {10} \\ - \sum_ {t = 2} ^ {T} \mathbb {E} _ {q _ {\phi} (m _ {t - 1} | \vec {h})} \left[ D _ {K L} \left(q _ {\phi} (m _ {t} | m _ {t - 1}, \vec {h} _ {t - 1: T}) | | p _ {\theta} (m _ {t} | m _ {t - 1})\right) \right] \\ \end{array} +$$ + +This can optimised in a straightforward manner using stochastic variational inference and reparameterised Monte Carlo samples from the approximate posterior distribution. At each step a sample is drawn from the posterior through which gradients can flow and the ELBO is evaluated. This can be backpropagated through to get gradients with respect to $\phi$ and $\theta$ which can then be updated as appropriate using an optimiser of the practitioner's choice. + +# 5 CASE STUDY: LIVER TRANSPLANTATION ACCEPTANCE DECISIONS + +In this section we explore the explainability benefits of our method for evaluating real decision making. Given space constraints, we relegate validation of the method on synthetic examples to the appendix, and focus here on a real medical example of accepting liver donation offers for transplantation. This is an important area where much has been done to improve decision support for clinicians (Volk et al., 2015; Berrevoets et al., 2020), but which often focuses on simply suggesting theoretically optimal actions. Here, by trying to understand better the decision making process, we hope to be able to provide more bespoke support in the future. + +![](images/f422fb83659ae24c5570dfeda5345be6b9294023f4a2a51bce869bbe613c008c.jpg) +Figure 5: Changing Focuses. Predicted weights of different covariates at two-year time intervals. + +![](images/992dc79b7463e4be846b4c1e5ae5dec3e7fcfc3a6fcf6bc36557d543776cf4bd.jpg) + +![](images/0782e741040ca26b718dd26e3434ef06b0bd23661650493ad134bd5d09cdced3.jpg) + +Organ transplantation is an extreme medical procedure, often considered the last resort for critically ill patients (Merion et al., 2005). Despite the significant risks associated with major surgery, transplantation can offer the chance of a relatively normal life (Starzl et al., 1982) and as a result demand for donor organs far outstrips supply (Wynn & Alexander, 2011). Yet, perhaps surprisingly, a large proportion of organ offers are turned down by clinicians (in consultation with the receiving patients) for various reasons including donor quality or perceived poor compatibility with the recipient (Volk et al., 2015). This decision faced by clinicians can be (under some simplification) described by the process: 1) A donor organ becomes available and is offered to a patient; 2) The clinician considers the state of the organ, the state of the patient, as well as other information such as the previous reject history of the organ (this is the context $X$ ); 3) The clinician makes the binary decision to accept/reject the organ (the intervention $A$ ); 4) The patient receives/does not receive the organ and a measure of their outcome is recorded - we measure their survival time as the main outcome of interest (the outcome $Y$ ). Full details of the dataset, preprocessing steps, and experimental setup can be found in the appendix. Note that in this example we are not trying to capture the policy of any individual doctor, but rather the general policy of a treatment centre over time and how what they find important changes - this is due to the form of the data available, but the method could equally be applied to individual clinicians if that information was made available. Additionally, while survival time will not be recorded immediately, the most powerful signal in this case is usually a death that follows very soon after the decision, which will be effectively captured in the data. + +Evolving Relative Importances. First, we now examine exactly how our method can explain a nonstationary policy over time. In Figure 5 we plot the relative weights for covariates in terms of the treatment effect for accepting the organ offer as they change at two-year periods. The Model for End-Stage Liver Disease (MELD) score (Kamath & Kim, 2007) was introduced in 2002 to give an overall rating of how sick a patient is. On introduction, it was the main consideration when making an acceptance decision, as can be seen clearly in Figure 5. However, over time this became seen as less important as clinicians started to not want to rely on a single score, with some clinicians even turning down offers for patients with high scores in hopes of a better match, with one study showing that 84 + +![](images/835c82b8ad6668288c0326b7912ef14c1f557039632babdf33d110e4981a1956.jpg) +Figure 6: One-step policy shift densities after observing an outcome. + +$\%$ of the patients who died while waiting for an organ had MELD scores $\geq 15$ and had previously declined at least one offer (Lai et al., 2012). This can also be seen reflected in Figure 5 as the importance of the MELD score in accepting the offer decreases and the policy stabilises. + +Reactionary Policies The most important aspect of our method is that we can model the reaction of the agent to their experience on the fly. For example we can see how observing various outcomes change the opinion of the agent moving forward. This is demonstrated in Figure 6 which plots density estimates of the policy shift (measured as the distance the decision boundary moves) after rejecting the offer and measuring a positive/negative outcome. Here it can be + +seen that when an offer is rejected then a negative outcome shifts the decision boundary downwards more than a positive outcome, making it less likely to reject an offer in the next time-step. + +Matching Clinical Decisions. While it should be emphasised that our method is (to the best of our knowledge) the only method with the aim or capability to model the evolving decision process of the agent, as mentioned in Section 3 there are a variety of methods that are tangentially related. First, we consider a few standard approaches to imitation learning with behavioural cloning (BC) (Bain & Sammut, 1995), where we consider both a linear (BC-Linear) and deep (BC-Deep) functionapproximator, representing both ends of the interpretability spectrum for BC. Continuing in imitation learning, we also compare alongside reward-regularised classification for apprenticeship learning (RCAL) (Piot et al., 2014), a method that regularises the reward implied by the learnt $Q$ -values. We additionally consider an adaptation of counterfactual inverse reinforcement learning (CIRL) (Bica et al., 2021) to the bandit setting where we first estimate the true CATE of the interventions and thus the true potential outcomes. We use these as the reward and apply an optimal policy, which in this one-step case is trivially achieved by choosing the action that maximises the potential outcome. + +In Table 2 we compare the predictive power of our method and all benchmarks on the task of imitation learning - i.e. matching the actions of the real demonstrator in some held-out test set. This is the only task for which we can make meaningful comparison with the existing literature, given our divergent goals. Despite the fact that at each step our method only considers a linear decision boundary, we are still able to outperform the deep network architectures used in BC and RCAL in terms of AUC and APS. This can be put down to the flexible way in which the policy can change over time to allow for adaptation. Less surprisingly, we also outperform the stationary linear classifier as well as the version of CIRL, the poor performance of which is probably ex + +Table 2: Action prediction performance. Comparison of methods on transplant offer acceptances. Performance of the methods is evaluated on the quality of action matching against a held out test set of demonstrations. We report the area under the receiving operator characteristic curve (AUC) and the average precision score (APS). + +
MethodAUC ↑APS ↑
BC-Linear0.798 ± 0.0020.647 ± 0.001
BC-Deep0.803 ± 0.0020.655 ± 0.001
RCAL0.797 ± 0.0080.662 ± 0.003
CIRL0.553 ± 0.0080.510 ± 0.002
IOL (Ours)0.824 ± 0.0060.677 ± 0.011
+ +plained by the unrealistic nature of the causal assumptions in this setting. Further experimental results on action matching in on multiple additional datasets are provided in the appendix. + +# 6 DISCUSSION + +Limitations. By employing a deep architecture our method is able to learn a non-parametric and accurate form of both the non-stationary policy and update function, making far fewer assumptions on their true form than is normal in the literature. This does mean, however, that it works best when training data is abundant, and can otherwise be prone to over-fitting as is common with deep neural networks. Additionally, the assumption that agents are always taking the action they believe will maximise the outcome does mean our method is out-of-the-box unable to account for strategies that deliberately pick actions that could be sub-optimal but may yield useful information (i.e. exploratory strategies). An interesting future direction would include exploring this, potentially by augmenting the outcome to include a measure of expected information. + +Societal Impact and Ethics. Being able to better understand decision making processes could be highly useful in combating biases or correcting mistakes made by human decision-makers. Nonetheless, it should be noted that any method that aims to analyse and explain observed behaviour has the potential to be misused, for example to unfairly attribute incorrect intentions to someone. As such, it is important to emphasise that, as is the nature of inverse problems, we are only giving one plausible explanation for the behaviour of an agent and cannot suggest that this is exactly what has gone on in their mind. + +Conclusions. In this paper we have tackled the problem of inverse online learning – that is descriptively modelling the process through which an observed agent adapts their policy over time – by interpreting actions as targeted interventions, or treatments. We drew together policy learning and treatment effect estimation to present a practical algorithm for solving this problem in an interpretable and meaningful manner, before demonstrating how this could be using in the medical domain to analyse the decisions of clinicians when choosing whether to accept offers for transplantation. + +# ACKNOWLEDGEMENTS + +AJC would like to acknowledge and thank Microsoft Research for its support through its PhD Scholarship Program with the EPSRC. AC gratefully acknowledges funding from AstraZeneca. This work was additionally supported by the Office of Naval Research (ONR) and the NSF (Grant number: 1722516). We would like to thank all of the anonymous reviewers on OpenReview, alongside the many members of the van der Schaar lab, for their input, comments, and suggestions at various stages that have ultimately improved the manuscript. + +# REFERENCES + +Pieter Abbeel and Andrew Y Ng. Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1, 2004. +Alekh Agarwal, Daniel Hsu, Satyen Kale, John Langford, Lihong Li, and Robert Schapire. Taming the monster: A fast and simple algorithm for contextual bandits. In International Conference on Machine Learning, pp. 1638-1646. PMLR, 2014. +Ahmed Alaa and Mihaela van der Schaar. Limits of estimating heterogeneous treatment effects: Guidelines for practical algorithm design. In International Conference on Machine Learning, pp. 129-138, 2018. +Ahmed Alaa and Mihaela van der Schaar. Attentive state-space modeling of disease progression. Proceedings of the 33rd Conference on Neural Information Processing Systems, 2019. +Onur Atan, James Jordon, and Mihaela van der Schaar. Deep-treat: Learning optimal personalized treatments from observational data using neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +Michael Bain and Claude Sammut. A framework for behavioural cloning. In Machine Intelligence 15, pp. 103-129, 1995. +Jeroen Berrevoets, James Jordan, Ioana Bica, Alexander Gimson, and Mihaela van der Schaar. Organite: Optimal transplant donor organ offering using an individual treatment effect. https://proceedings.neurips.cc/paper/2020, 33, 2020. +Ioana Bica, Daniel Jarrett, Alihan Hüyük, and Mihaela van der Schaar. Learning "what-if" explanations for sequential decision-making. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=h0de3QWtGG. +David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American statistical Association, 112(518):859-877, 2017. +Jako S Burgers, Richard PTM Grol, Joost OM Zaat, Teun H Spies, Akke K van der Bij, and Henk GA Mokkink. Characteristics of effective clinical guidelines for general practice. British journal of general practice, 53(486):15-19, 2003. +Alex James Chan and Mihaela van der Schaar. Scalable bayesian inverse reinforcement learning. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=4qR3coinaiv. +Alex James Chan, Ioana Bica, Alihan Hüyük, Daniel Jarrett, and Mihaela van der Schaar. The medkit-learn (ing) environment: Medical decision modelling through simulation. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2021. +Matteo Colombo and Stephan Hartmann. Bayesian cognitive science, unification, and explanation. The British Journal for the Philosophy of Science, 68(2):451-484, 2017. +Renée Elio and Francis Jeffry Pelletier. Belief change as propositional update. Cognitive Science, 21 (4):419-460, 1997. +Justin Fu, Katie Luo, and Sergey Levine. Learning robust rewards with adversarial inverse reinforcement learning. In International Conference on Learning Representations, 2018. + +Tim Genewein, Felix Leibfried, Jordi Grau-Moya, and Daniel Alexander Braun. Bounded rationality, abstraction, and hierarchical decision-making: An information-theoretic optimality principle. Frontiers in Robotics and AI, 2:27, 2015. +Thomas L Griffiths, Falk Lieder, and Noah D Goodman. Rational use of cognitive resources: Levels of analysis between the computational and the algorithmic. Topics in cognitive science, 7(2): 217-229, 2015. +Ralph Hertwig and Ido Erev. The description-experience gap in risky choice. Trends in cognitive sciences, 13(12):517-523, 2009. +Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pp. 4572-4580, 2016. +Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14(5), 2013. +Steven CH Hoi, Doyen Sahoo, Jing Lu, and Peilin Zhao. Online learning: A comprehensive survey. arXiv preprint arXiv:1802.02871, 2018. +MG Myriam Hunink, Milton C Weinstein, Eve Wittenberg, Michael F Drummond, Joseph S Pliskin, John B Wong, and Paul P Glasziou. Decision making in health and medicine: integrating evidence and values. Cambridge university press, 2014. +Alihan Hüyük, Daniel Jarrett, Cem Tekin, and Mihaela van der Schaar. Explaining by imitating: Understanding decisions by interpretable policy learning. In International Conference on Learning Representations, 2021a. URL https://openreview.net/forum?id=unI5ucw_Jk. +Alihan Hüyük, Daniel Jarrett, and Mihaela van der Schaar. Inverse contextual bandits: Learning how behavior evolves over time. arXiv preprint arXiv:2107.06317, 2021b. +Leslie Pack Kaelbling, Michael L Littman, and Anthony R Cassandra. Planning and acting in partially observable stochastic domains. Artificial intelligence, 101(1-2):99-134, 1998. +Patrick S Kamath and W Ray Kim. The model for end-stage liver disease (meld). Hepatology, 45(3): 797-805, 2007. +Rahul Krishnan, Uri Shalit, and David Sontag. Structured inference networks for nonlinear state space models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. +Sören R Künzel, Jasjeet S Sekhon, Peter J Bickel, and Bin Yu. Metalearners for estimating heterogeneous treatment effects using machine learning. Proceedings of the national academy of sciences, 116(10):4156-4165, 2019. +Jennifer Cindy Lai, Sandy Feng, and John Paul Roberts. An examination of liver offers to candidates on the liver transplant wait-list. Gastroenterology, 143(5):1261-1265, 2012. +Robert M Merion, Douglas E Schaubel, Dawn M Dykstra, Richard B Freeman, Friedrich K Port, and Robert A Wolfe. The survival benefit of liver transplantation. American Journal of Transplantation, 5(2):307-313, 2005. +Bilal Piot, Matthieu Geist, and Olivier Pietquin. Boosted and reward-regularized classification for apprenticeship learning. In Proceedings of the 2014 international conference on Autonomous agents and multi-agent systems, pp. 1249–1256. International Foundation for Autonomous Agents and Multiagent Systems, 2014. +Donald B Rubin. Causal inference using potential outcomes: Design, modeling, decisions. Journal of the American Statistical Association, 100(469):322-331, 2005. +Uri Shalit, Fredrik D Johansson, and David Sontag. Estimating individual treatment effect: generalization bounds and algorithms. In International Conference on Machine Learning, pp. 3076-3085. PMLR, 2017. + +Thomas E Starzl, Shunzaburo Iwatsuki, David H Van Thiel, J Carlton Gartner, Basil J Zitelli, J Jeffrey Malatack, Robert R Schade, Byers W Shaw Jr, Thomas R Hakala, J Thomas Rosenthal, et al. Evolution of liver transplantation. Hepatology, 2(5):614S-636S, 1982. +Adith Swaminathan and Thorsten Joachims. Batch learning from logged bandit feedback through counterfactual risk minimization. The Journal of Machine Learning Research, 16(1):1731-1755, 2015. +Michael L Volk, Nathan Goodrich, Jennifer C Lai, Christopher Sonnenday, and Kerby Shedden. Decision support for organ offers in liver transplantation. *Liver transplantation*, 21(6):784-791, 2015. +James J Wynn and Charles E Alexander. Increasing organ donation and transplantation: the use experience over the past decade. Transplant International, 24(4):324-332, 2011. +Edmundas Kazimieras Zavadskas and Zenonas Turskis. Multiple criteria decision making (mcdm) methods in economics: an overview. Technological and economic development of economy, 17(2): 397-427, 2011. +Baqun Zhang, Anastasios A Tsiatis, Marie Davidian, Min Zhang, and Eric Laber. Estimating optimal treatment regimes from a classification perspective. Stat, 1(1):103-114, 2012a. +Baqun Zhang, Anastasios A Tsiatis, Eric B Laber, and Marie Davidian. A robust method for estimating optimal treatment regimes. Biometrics, 68(4):1010-1018, 2012b. +Yingqi Zhao, Donglin Zeng, A John Rush, and Michael R Kosorok. Estimating individualized treatment rules using outcome weighted learning. Journal of the American Statistical Association, 107(499):1106-1118, 2012. +Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In Aaai, volume 8, pp. 1433-1438. Chicago, IL, USA, 2008. + +# APPENDIX + +Algorithm 1: Inverse Online Learning (IOL) +Result: Parameters $\phi$ of variational distribution and $\theta$ of generative model +Input: $\mathcal{D},\mathcal{X},\mathcal{A},\mathcal{Y}$ , learning rate $\eta$ ; +Initialise $\phi, \theta$ ; +while not converged do + Evaluate $p_{\theta}(m_t|m_{t-1})$ ; $\triangleright$ Calculate forward model next step priors + Evaluate $q_{\phi}(m_t|m_{t-1},\vec{h})$ ; $\triangleright$ Inference network to get posterior sample $\hat{\vec{m}} \sim q_{\phi}(\vec{m}|\vec{h})$ ; $\triangleright$ Straight-through MC sample $NLL_{loss} = \mathbb{E}_{q_{\phi}(\vec{m}|\vec{h})}[p_{\theta}(\vec{a}|\vec{m})]$ ; + $KL_{loss} = D_KL(q_{\phi}(m_1|\vec{x})||p_{\theta}(m_1)) + \sum_{t=2}^{T}\mathbb{E}[D_KL(q_{\phi}(m_t|m_{t-1},\vec{h})||p_{\theta}(m_t|m_{t-1}))]$ ; + $\mathcal{F}(\phi,\theta) = NLL_{loss} + KL_{loss}$ ; + $(\phi',\theta') \gets (\phi,\theta) - \eta\nabla_{\phi,\theta}\mathcal{F}(\phi,\theta)$ ; + $\phi,\theta \gets \phi',\theta'$ +end +Return: $\phi,\theta$ + +# A EXPERIMENTAL DETAILS + +All experiments were performed on a 2016 MacBook Pro, using a 2.9 GHz Dual-Core Intel Core i5 with 8GB of LPDDR3 RAM and no GPU acceleration. + +Code was written in PyTorch Paszke et al. (2019) and no external code was used in the implementation of either the model nor the benchmarks. Hyperparameters were selected through grid search over a validation fold of the training data. + +All medical data used has undergone a de-identification process and consent was obtained by the relevant curators for their data to be publicly released. + +# A.1 UNOS DATA + +Our data focuses on data from the United Network for Organ Sharing (UNOS), the US non-profit that manages their national waiting list and maintains a database and record of transplantations that occur. + +We focus on liver-transplantations, where the donor is deceased. The data is made up of patient details from various centres around the United States. Of the multiple million records of individual transplantations available, once those with missing information on either the donor or recipient are removed we are left with around 500,000 patients spread across 31 centres. Available variables are listed in Table 3 + +In our action matching experiments we split the data into Train/Validation/Test folds by separating the data by centre. In particular we use centre CTR23901 with 114,314 patients for training; CTR124 with 21,067 patients for validation; and finally CTR279 with 14,295 patients for testing. + +For the more exploratory experiments who's focus is on inference over some data and not extrapolated prediction, we simply train on centre CTR23901, and examine what is inferred about the treatment of those specific patients + +# B ADDITIONAL VALIDATION + +While we focused on an important case study in the main paper, we appreciate the need to provide additional evidence that our model can work outside of one specific case example. As such, we now report results on some experiments focusing first on a toy (but relevant) synthetic example, followed by performance results on multiple further real datasets. + +Table 3: UNOS Variables + +
AGERecipient's age at transplant
AGE_DONDonor's age at transplant
ALBUMIN_TXRecipient's albumin concentration at transplant
ASCITES_TXRecipient had ascites at the time of transplant
BMI_CALCRecipient's BMI
COD_CAD_DONCause of death of the donor
COLD_ISCHCold ischemia time - length of time from the donor being recovered until it is transplanted
CREAT_DONDonor's creatinine concentration
CREAT_TXRecipient's creatinine concentration at transplant
DIAL_TXWhether recipient was on dialysis before transplant
ETHCATRecipient's ethnicity
ETHCAT_DONDonor's ethnicity
EXC_HCCWhether the recipient received a hepatocellular carcinoma exception point
FUNC_STAT_TRRRecipient's functional status at the time of transplant
HCV_SEROSTATUSWhether the recipient has hepatitis C
INR_TXRecipient's INR value at the time transplant
LIFE_SUP_TRRWhether the recipient was on life support at the time of transplant
MED_COND_TRRWhether the recipient was in an icu, hospital bed, or came from home before transplant
MELD_PELDLAB_SCORERecipient MELD score
NON_HRT_DONWhether the donor was a DCD (donation after cardiac death)
NUM_PREV_TXNumber of previous liver transplants the recipient has had
ON_VENT_TRRWhether the recipient was on a mechanical ventilator before transplant
PORTAL_VEIN_TRRWhether the recipient had a portal vein thrombosis at the time of transplant
PREV_ABSURG_TRRWhether the recipient had prior abdominal surgery before the liver transplant
PREV_TXWhether the recipient had any previous transplant
SHARE_TXWhether the donor is local, regional, or national
TBILI_TXRecipient's bilirubin at the time of transplant
TXLIVWhether the graft is whole or segmental
death_mech_don_groupDonor mechanism of death
deathcircDonor circumstance of death
diag1Recipient's primary cause of liver disease
meldstatWhether the recipient is status 1a
statushccWhether the recipient has hcc
status1Whether the recipient is status 1a
+ +# B.1 SYNTHETIC EXPERIMENT + +We consider a toy example of an agent that is learning online about the treatment effect of the interventions they are performing. + +We let $\mathcal{X} = \mathbb{R}^5, \mathcal{A} = [0,1]$ , and $\mathcal{V} = \mathbb{R}$ , with the true outcomes a linear combination of the features given the action (with weights stochastically samples). From a sampled prior set of weights in the agents mind, the agent then interacts, estimating the potential outcomes and choosing an action stochastically according to equation 7 with $\alpha = 1, \beta = 0$ . After every context, action, outcome triple $(x, a, y)$ , the agent adjusts its beliefs over the weights of the potential outcome functions using an online gradient descent method: + +$$ +\omega_ {a} = \omega_ {a} - \lambda ((\tilde {y} - y) \times x), \tag {11} +$$ + +with $\lambda$ some learning rate. Clearly then the policy of the agent is nonstationary and changes over time in reaction to the observed outcomes. + +Results. We simulate 10000 trajectories of length 50. When applying IOL to this simulated data, we can achieve an accuracy of $99\%$ , meaning $99\%$ of the time we can accurately determine which of the potential outcomes the agent thins will be higher. This is compared to a stationary estimate of the CATE which can only reach $52\%$ given the fact that the policy is detached from the truth of the treatment effect. Clearly this is an extreme example designed to fail the existing approaches but it does serve to show how stark the contrast is. + +# B.2 FURTHER PERFORMANCE ON REAL DATA + +Alongside the synthetic example above, we also provide further results on real medical data, demonstrating improved performance across a variety of domains. These datasets do not contain a recorded outcome, consequently so we do not include CIRL, and the next state is used as a substitute in IOL. Results are given in Table 2, and a description of the datasets follows: + +Intensive Care Unit. The ICU data covers the treatment of 23,106 of patients in the intensive care unit from Amsterdam UMC Elbers (2019). These patients are in a more critical state than those on the general wards while suffering similarly from a variety of conditions and consequently are monitored more frequently, with the database containing around 1 billion clinical observations at varying timesteps down to minute by minute recordings. The data is aggregated into one hour timesteps and models the treatment of the prescription of antibiotics. Included are 24 series features focusing on vital signs including heart rate, blood pressure, and various chemical blood concentration levels. + +Cystic Fibrosis. The $CF$ data considers patients enrolled in the UK Cystic Fibrosis Registry Taylor-Robinson et al. (2018), coviering around 5,800 patients over the course of multiple years. Measurements were taken on average every 6 months, and the 79 features cover common comorbidities, test results, and infections that arise. The intervention corresponds to the prescription of cortico steroids. + +Hospital Wards. The Wards data is based on the care of 6,321 patients at the Ronald Reagan UCLA Medical Center in California who were treated on the general medicine floor between 2013-2016 Alaa et al. (2017). These patients were treated for a variety of conditions including pneumonia, sepsis, and fevers were in general stable and deterioration that required ICU care was rare. Measurements were taken roughly every 4 hours, with average stays lasting 9 days, and include common vital signs such as pulse and blood pressure alongside lab tests and results and 35 temporal features. The action space is taken as a choice of application of oxygen therapy. + +Table 4: Medical examples performance. Comparison of methods on three different medical datasets. Performance of the policy is evaluated on the quality of action matching against a held out test set of demonstrations. We report the area under the receiving operator characteristic curve (AUC) and average precision score (APS). + +
ICUCFWards
MetricAUCAPSAUCAPSAUCAPS
BC-L0.681 ± 0.0010.655 ± 0.0000.830 ± 0.0100.797 ± 0.0090.896 ± 0.0060.853 ± 0.002
BC-D0.668 ± 0.0030.654 ± 0.0010.952 ± 0.0100.834 ± 0.0030.845 ± 0.0100.811 ± 0.013
RCAL0.396 ± 0.0180.563 ± 0.0070.689 ± 0.0220.745 ± 0.0080.942 ± 0.0030.920 ± 0.004
IOL0.686 ± 0.0920.631 ± 0.0650.942 ± 0.0310.943 ± 0.0260.965 ± 0.0310.941 ± 0.055
+ +# REFERENCES + +Alaa, A. M., Yoon, J., Hu, S., and Van der Schaar, M. (2017). Personalized risk scoring for critical care prognosis using mixtures of gaussian processes. IEEE Transactions on Biomedical Engineering, 65(1):207-218. +Elbers, P. W. G. (2019). AmsterdamUMCdb v1.0.2 ICU database. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. (2019). Pytorch: An imperative style, high-performance deep learning library. In Advances in neural information processing systems, pages 8026-8037. +Taylor-Robinson, D., Archangelidi, O., Carr, S. B., Cosgriff, R., Gunn, E., Keogh, R. H., MacDougall, A., Newsome, S., Schluter, D. K., Stanojevic, S., et al. (2018). Data resource profile: the uk cystic fibrosis registry. International journal of epidemiology, 47(1):9-10e. \ No newline at end of file diff --git a/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/images.zip b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8cd4e61e18d4d0e53c3f2a567b3e3d4c23a61218 --- /dev/null +++ b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2b0979302fca051342ce7040d3378c553ee2369c77e59867eda44c6beb30a59 +size 588095 diff --git a/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/layout.json b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e567e53f5ca00ab921a3c51f75756dea2f48f07b --- /dev/null +++ b/inverseonlinelearningunderstandingnonstationaryandreactionarypolicies/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d738b46aa3e284d2cce104e0d15b7ea15439d7974ede3f988c587a1e9f84cb17 +size 463502 diff --git a/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_content_list.json b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..709ff2d2e91b7bce859f438dd3d94bb1fa441501 --- /dev/null +++ b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:822a6957c0808c632dd7e8ba69de146c07565671191b211aa8af15f8163abcde +size 230044 diff --git a/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_model.json b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..25eebbebbe78fd9653b2aea8620be6def54147db --- /dev/null +++ b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12695cc061e9f7d93e55c090fa5d15a3518be796d530753b2302b1f438412e8a +size 267156 diff --git a/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_origin.pdf b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..faa934722b95c12f20725629e5dd4b918f00dd47 --- /dev/null +++ b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/5159342a-4199-4535-9478-db07748aeed6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9baaccd09fb2e5475c79f247f33f84323b196ad98b91098877216351c10ad363 +size 4564870 diff --git a/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/full.md b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4a689e636df3fb51b8e2e6649792953abeb74a12 --- /dev/null +++ b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/full.md @@ -0,0 +1,803 @@ +# IS FAIRNESS ONLY METRIC DEEP? EVALUATING AND ADDRESSING SUBGROUP GAPS IN DML + +Natalie Dullerud1, Karsten Roth2, Kimia Hamidieh1, Nicolas Papernot1, Marzyeh Ghassemi3 + +1University of Toronto & Vector Institute, 2University of Tübingen, 3MIT + +# ABSTRACT + +Deep metric learning (DML) enables learning with less supervision through its emphasis on the similarity structure of representations. There has been much work on improving generalization of DML in settings like zero-shot retrieval, but little is known about its implications for fairness. In this paper, we are the first to evaluate state-of-the-art DML methods trained on imbalanced data, and to show the negative impact these representations have on minority subgroup performance when used for downstream tasks. In this work, we first define fairness in DML through an analysis of three properties of the representation space – inter-class alignment, intra-class alignment, and uniformity – and propose finDML, the fairness in non-balanced DML benchmark to characterize representation fairness. Utilizing finDML, we find bias in DML representations to propagate to common downstream classification tasks. Surprisingly, this bias is propagated even when training data in the downstream task is re-balanced. To address this problem, we present Partial Attribute De-correlation (PARADE) to de-correlate feature representations from sensitive attributes and reduce performance gaps between subgroups in both embedding space and downstream metrics. + +# 1 INTRODUCTION + +Deep metric learning (DML) extends standard metric learning to deep neural networks, where the goal is to learn metric spaces such that embedded data sample distance is connected to actual semantic similarities (Globerson & Roweis, 2006; Weinberger et al., 2006; Hoffer & Ailon, 2018; Wang et al., 2014). The explicit optimization of similarity makes deep metric spaces well suited for usage in unseen classes, such as zero-shot image or video retrieval or facial re-identification (Milbich et al., 2021; Roth et al., 2020c; Musgrave et al., 2020; Hoffer & Ailon, 2018; Wang et al., 2014; Schroff et al., 2015; Wu et al., 2018; Roth et al., 2020c; Brattoli et al., 2020; Hu et al., 2014; Deng et al., 2019; Liu et al., 2017). However, while DML is effective in establishing notions of similarity, work describing potential fairness issues is limited to individual fairness in standard metric learning (Ilvento, 2020), disregarding embedding models. + +Indeed, the impacts and metrics of fairness are well studied in machine learning (ML) generally, and representation learning specifically (Dwork et al., 2012; Mehrabi et al., 2019; Locatello et al., 2019b). This is especially true on high-risk tasks such as facial recognition and judicial decision-making (Chouldechova, 2017; Berk, 2017), where there are known risks to minoritized subgroups (Samadi et al., 2018). Yet, relatively little work has been done in the domain of DML (Rosenberg et al., 2021). It is crucial to address this knowledge gap – if DML embeddings are used to create upstream embeddings that facilitate downstream transfer tasks, biases may propagate unknowingly. + +To tackle this issue, this work first proposes a benchmark to characterize fairness in non-balanced DML - finDML. finDML introduces three subgroup fairness definitions based on feature space performance metrics - recall@k, alignment and group uniformity. These metrics measure clustering ability and generalization performance via feature space uniformity. Thus, we select the metrics for our definitions to enforce independence between inclusion in a particular cluster or class, and a protected attribute (given the ground-truth label). We leverage existing datasets with fairness limitations (CelebA (Liu et al., 2015) and LFW (Huang et al., 2007)) and induce imbalance in training data of standard DML benchmarks, CARS196 (Krause et al., 2013) and CUB200 (Wah et al., 2011), in order to create an effective benchmark for fairness analysis in DML. + +Making use of finDML, we then perform an evaluation of 11 state-of-the-art (SOTA) DML methods representing frequently used losses and sampling strategies, including: ranking-based losses (Wang et al., 2014; Hoffer & Ailon, 2018), proxy-based (Kim et al., 2020) losses, semi-hard sampling (Schroff et al., 2015) and distance-weighted sampling (Wu et al., 2018). Our experiments suggest that imbalanced data during upstream embedding impacts the fairness of all benchmarks methods in both upstream embeddings (subgroup gaps up to $21\%$ ) as well as downstream classifications (subgroup gaps up to $45.9\%$ ). This imbalance is significant even when downstream classifiers are given access to balanced training data, indicating that data cannot naively be used to de-bias downstream classifiers from imbalanced embeddings. + +Finally, inspired by prior work in DML on multi-feature learning (Milbich et al., 2020), we introduce PARtial Attribute DE-correlation (PARADE). PARADE addresses imbalance by de-correlating two learned embeddings: one learnt to represent similarity in class labels, and one learnt to represent similarity in the values of a sensitive attribute, which is discarded at test-time. This creates a model in which the ultimate target class embeddings have been de-correlated from the sensitive attributes of the input. We note that as opposed to previous work on variational latent spaces, PARADE de-correlates a learned similarity metric. We find that PARADE reduces gaps of SOTA DML methods by up to $2\%$ downstream in finDML. + +In total, our contributions can be summarized as follows: + +1. We define finDML; introducing three definitions of fairness in DML to capture multifaceted minoritized subgroup performance in upstream embeddings through focus on feature representation characteristics across subgroups, and five datasets for benchmarking. +2. We analyze SOTA DML methods using finDML, and find that common DML approaches are significantly impacted by imbalanced data. We show empirically that learned embedding bias cannot be overcome by naive inclusion of balanced data in downstream classifiers. +3. We present PARADE, a novel adaptation of previous zero-shot generalization techniques to enhance fairness guarantees through de-correlation of class discriminative features with sensitive attributes. + +# 2 BACKGROUND + +Deep Metric Learning DML extends standard metric learning by fusing feature extraction and learning a parametrized metric space into one end-to-end learnable setup. In this setting, a large convolutional network $\psi$ provides the mapping to a feature space $\Psi$ , while a small network $f$ , usually a single linear layer, generates the final mapping to the metric or embedding space $\Phi$ . The overall mapping from the image space $X$ is thus given by $\phi = f \circ \psi$ . Generally, the embedding space is projected on the unit hypersphere $S^{D-1}$ through normalization (Weisstein, 2002; Wu et al., 2018; Roth et al., 2020c; Wang & Isola, 2020) to limit the volume of the representation space with increasing embedding dimensionality. The embedding network $\phi$ is then trained to provide a metric space $\Phi$ that operates well under some predefined, usually non-parametric metric such as the Euclidean or cosine distance defined over $\Phi$ . + +Typical objectives used to learn such metric spaces range from contrastive ranking-based training using tuples of data, such as pairwise (Hadsell et al., 2006), triplet- (Schroff et al., 2015; Wu et al., 2018) or higher-order tuple-based training (Sohn, 2016; Wang et al., 2020a), procedures to bring down the effective complexity of the tuple space (Schroff et al., 2015; Harwood et al., 2017; Wu et al., 2018) or the introduction of learnable tuple constituents (Movshovitz-Attias et al., 2017; Qian et al., 2019; Kim et al., 2020). + +More recent work (Milbich et al., 2020; Roth et al., 2020c; Jacob et al., 2019) extends standard DML training through incorporation of objectives going beyond just sole class label discrimination: e.g., through the introduction of artificial samples (Lin et al., 2018; Duan et al., 2018), regularization of higher-order moments (Jacob et al., 2019), curriculum learning (Zheng et al., 2019; Harwood et al., 2017; Roth et al., 2020a), knowledge distillation (Roth et al., 2020b) or the inclusion of additional features (DiVA) to produce diverse and de-correlated representations (Milbich et al., 2020). + +DML Evaluation Standard performance measures reflect the goal of DML: namely, optimizing an embedding space $\Phi$ for best transfer to new test classes via learning semantic similarities. As + +![](images/a148f4bb5afd80e25c304723025c496a53d899a05e74a627044669a47175c6b3.jpg) + +![](images/dde2a8cd2839b2e5002fa3b16c85c0648e6645410035786ac17c093bcf0a4b83.jpg) +Figure 1: a) Visualization of the standard DML pipelines and the aspects of intra-class alignment and uniformity in the embedding space. b) Infographic of the fairness issue in DML, where learned representational bias can even transfer to downstream models building on previously learned representations. c) Layout of our proposed PARADE approach to better incorporate sensitive attribute context and improve representational fairness. + +immediate applications are commonly found in zero-shot clustering or image retrieval, respective retrieval and clustering metrics are predominantly utilized for evaluation. Recall@k (Jegou et al., 2011) or mean average precision measured on recall (Roth et al., 2020c; Musgrave et al., 2020) typically estimate retrieval performance. Normalized mutual information (NMI) on clustered embeddings (Manning et al., 2010) is used as a proxy for clustering quality (see Supplemental for detailed definitions). We leverage these performance metrics to inform finDML and our experiments. + +Fairness in Classification Formalizing fairness in ML continues to be an open problem (Mehrabi et al., 2019; Chen et al., 2018a; Chouldechova, 2017; Berk, 2017; Locatello et al., 2019b; Chouldechova & Roth, 2018; Dwork et al., 2012; Hardt et al., 2016; Zafar et al., 2017). In classification, definitions for fairness such as demographic parity, equalized odds, and equality of opportunity, rely on model outputs across the random variables of protected attribute and ground-truth label (Dwork et al., 2012; Hardt et al., 2016). + +Fairness in Representations A more relevant family of fairness definitions for DML would be those explored in fairness for general representation learning (Edwards & Storkey, 2015; Beutel et al., 2017; Louizos et al., 2015; Madras et al., 2018). Here, the goal is to learn a fair mapping from an original domain to a latent domain so that classifiers trained on these representations are more likely to be agnostic to the sensitive attribute in unknown downstream tasks. This assumption distinguishes our setting from previous fairness work in which the downstream tasks are known at train time (Madras et al., 2018; Edwards & Storkey, 2015; Moyer et al., 2018; Song et al., 2019; Jaiswal et al., 2019). DML differs from this form of representation learning as it aims to learn a mapping capturing semantic similarity, as opposed to latent space representation. + +Earlier works in fair representation learning intended to obfuscate any information about sensitive attributes to approximately satisfy demographic parity (Zemel et al., 2013) while a wealth of more recent works focus on using adversarial methods or feature disentanglement in latent spaces of VAEs (Locatello et al., 2019a; Kingma & Welling, 2013; Gretton et al., 2006; Louizos et al., 2015; Amini et al., 2019; Alemi et al., 2018; Burgess et al., 2018; Chen et al., 2018b; Kim & Mnih, 2018; Esmaeili et al., 2019; Song et al., 2019; Gitiaux & Rangwala, 2021; Rodríguez-Gálvez et al., 2020; Sarhan et al., 2020; Paul & Burlina, 2021; Chakraborty et al., 2020). In this setting, the literature has focused on optimizing on approximations of the mutual information between representations and sensitive attributes: maximum mean discrepancy (Gretton et al., 2006) for deterministic or variational (Li et al., 2014; Louizos et al., 2015) autoencoders (VAEs); cross-entropy of an adversarial network that predicts sensitive attributes from the representations (Edwards & Storkey, 2015; Xie et al., 2017; Beutel et al., 2017; Zhang et al., 2018; Madras et al., 2018; Adel et al., 2019; Zhao & + +Gordon, 2019; Xu et al., 2018); balanced error rate on both target loss and adversary loss (Zhao et al., 2019); Weak-Conditional InfoNCE for conditional contrastive learning (Tsai et al., 2021). + +PARADE shares aspects of these previous methods in its choice of de-correlation or disentanglement. However, PARADE de-correlates the learned similarity metric as opposed to the latent space. In addition, with DML-specific criteria, PARADE learns similarities over the sensitive attribute while not directly removing all information about the sensitive attribute, as the sensitive attribute and target class embeddings share a base network. + +# 3 EXTENDING FAIRNESS TO DML - finDML BENCHMARK + +To characterize fairness with finDML, this section introduces the key constituents - definitions to characterize fairness in embedding spaces and respective benchmark datasets. + +# 3.1 PRELIMINARIES + +Our embedding space fairness definitions rely on embedding space metrics adapted from (Wang & Isola, 2020) and (Roth et al., 2020c), namely alignment and uniformity. Both metrics we use to characterize embeddings for our definitions in the next section (intra- as well as inter-class alignment and uniformity) have been successfully linked to generalization performance in contrastive self-supervised and metric learning models (Wang & Isola, 2020; Roth et al., 2020c; Sinha et al., 2020). Alignment succinctly captures the similarity structure learned by the representation space with respect to the target labels through measuring distances between pairs of samples. On the other hand, notions of uniformity can differ. Uniformity of the sample distribution over the hypersphere has been studied through the radial basis function (RBF) over pairs of samples. Alternatively, uniformity of the feature space has been studied through the KL-divergence $\mathcal{D}_{\mathrm{KL}}$ between the discrete uniform distribution $\mathcal{U}_D$ and the sorted singular value distribution $S_{\phi(X)}$ of the representation space $\phi$ on dataset $X$ . + +$$ +U _ {\mathrm {K L}} (X) = \mathcal {D} _ {\mathrm {K L}} \left(\mathcal {U} _ {\mathrm {D}}, \mathcal {S} _ {\phi (X)}\right) \tag {1} +$$ + +Here, lower scores indicate more significant directions of variance in learned representations. Both introduced notions of uniformity represent important aspects of the embedding space, but the computational overhead in computing RBF over all pairs of samples in large datasets makes it impractical for our uses and is less interpretable than $U_{\mathrm{KL}}$ . Therefore, we leave the uniformity metric utilized in finDML general, but utilize $U_{\mathrm{KL}}$ for our experiments. + +# 3.2 DEFINING FAIRNESS + +Building on the aforementioned performance metrics, we introduce three definitions for fairness in the embedding spaces of DML models. As the recall@k and alignment metrics inform inclusion in an embedded cluster (or class), we follow fair classification literature in the motivation for our first fairness definition: inclusion in a class should be independent of a protected attribute given the ground-truth label. Thus, we examine the probability of encountering a data instance of the same class in a data point's $k$ -nearest neighbors to form the first definition. The second definition relies on equal expectation of alignment across sensitive attribute values. Departing from classification literature, our third definition encapsulates fairness in a task-agnostic sense (as DML is often applied in such settings): fairness across the "goodness" of the learned features via a uniformity metric. + +Let $X$ denote the input data, and $A$ a protected attribute variable. Denote $X_{a}$ the partition of $X$ with attribute $a \in A$ . To recap common DML terminology, a positive pair of samples is defined as $(x_{1}, x_{2}) \in X \times X$ s.t. the class label of $x_{1}$ and $x_{2}$ are identical. A negative pair of samples is defined as $(x_{1}, x_{2}) \in X \times X$ such that the class label of $x_{1}$ and $x_{2}$ differ. Let $\mathbb{P}_{a}$ denote the set of all positive pairs s.t. at least one of $x_{1}$ or $x_{2}$ has attribute $a \in A$ , and analogously for $\mathbb{N}_{a}$ and negative pairs. + +Definition 1 (K-Close Fairness). Define $NN_{k}:\Phi \subset S^{D - 1}\to \mathcal{P}(X)$ as a function that receives a point $\phi (x)\in \Phi$ and returns a set in the powerset of $X$ , $\mathcal{P}(X)$ , containing points in $X$ that map to the $k$ nearest neighbors of $\phi (x)$ in $\Phi$ . Thus, $\phi$ is $k$ -close fair with respect to attribute $A$ if: + +$$ +\Pr_ {x \in X _ {a}} (\exists \tilde {x} \in N N _ {k} (\phi (x)) s. t. Y (\tilde {x}) = Y (x)) = \Pr_ {x \in X _ {b}} (\exists \tilde {x} \in N N _ {k} (\phi (x)) s. t. Y (\tilde {x}) = Y (x)) \quad \forall a, b \in A \tag {2} +$$ + +Note: the criteria weakens as $k$ increases, similar to recall@ $k$ . + +Definition 2 (Alignment). $\phi$ is fair, according to alignment with respect to attribute $A$ , if: + +$$ +\mathbb {E} _ {\left(x _ {1}, x _ {2}\right) \in \mathbb {P} _ {a}} \left[ \left| \left| \phi (x _ {1}) - \phi (x _ {2}) \right| \right| ^ {2} \right] = \mathbb {E} _ {\left(x _ {1}, x _ {2}\right) \in \mathbb {P} _ {b}} \left[ \left| \left| \phi (x _ {1}) - \phi (x _ {2}) \right| \right| ^ {2} \right] \tag {3} +$$ + +$$ +\mathbb {E} _ {\left(x _ {1}, x _ {2}\right) \in \mathbb {N} _ {a}} \left[ \left| \left| \phi \left(x _ {1}\right) - \phi \left(x _ {2}\right) \right| \right| ^ {2} \right] = \mathbb {E} _ {\left(x _ {1}, x _ {2}\right) \in \mathbb {N} _ {b}} \left[ \left| \left| \phi \left(x _ {1}\right) - \phi \left(x _ {2}\right) \right| \right| ^ {2} \right] \quad \forall a, b \in A \tag {4} +$$ + +i.e. the expectation of the alignment is equal across domain of $A$ . + +Definition 3 (Uniformity Across Groups). $\phi$ is fair, according to uniformity, and with respect to attribute $A$ , if the expectation of the uniformity is equal across domain of $A$ : + +$$ +U \left(\phi \left(X _ {a}\right)\right) = U \left(\phi \left(X _ {b}\right)\right) \quad \forall a, b \in A \tag {5} +$$ + +where $U(\cdot)$ denotes some measure of uniformity over a set $V\in \mathcal{S}^{D - 1}$ . + +# 3.3 CONSTRUCTED finDML BENCHMARK DATASETS + +finDML encompasses existing DML benchmark datasets, CUB200 and CARS196, and facial recognition datasets, CelebA and LFW (Wah et al., 2011; Krause et al., 2013; Liu et al., 2015; Huang et al., 2007). For fairness analysis, we investigate bird color in CUB2001, Race in LFW and Skintone in CelebA (Kumar et al., 2009). A detailed description of dataset and attribute labeling is included in the Supplemental. To create additional fairness benchmarks, we induce class imbalance in CUB200 and CARS196, as both datasets are naturally balanced w.r.t. class. + +Manually Introduced Class Imbalance We introduce imbalance by reducing the number of training data samples of 50 randomly selected classes by $90\%$ (Imbalanced). We run an experiment with the original datasets as a balanced control (Balanced) for comparison. In the imbalanced setting, we adjust (increase) the number of training samples of the majoritized groups to match the number of datapoints in the balanced control experiments. We average metrics over 10 sets of 50 randomly selected classes for imbalanced experiments. We use the standard ratio of $50 - 50$ for train-test split of these datasets, but split over number of data points per class, as opposed to splitting over the classes themselves. The manually imbalanced datasets are used to benchmark standard DML methods, validate our framework, and analyze downstream effects. + +Although dataset imbalance does not constitute the sole source of bias in machine learning applications, unfairness as a result of imbalance is the most well-understood in the literature (Chen et al., 2018a). Additionally, we do not assume for our naturally imbalanced datasets, particularly the facial datasets, that attribute imbalance is the only source of bias we observe. + +# 4 PARTIAL ATTRIBUT DE-CORRELATION (PARADE) + +In this section, we present Partial Attribute De-correlation, or PARADE, in which we incorporate adversarial separation (Milbich et al., 2020) during training to de-correlate separate embeddings. We enumerate several significant changes: 1) only target embedding released at test-time; 2) triplet formation and loss term w.r.t. sensitive attribute; 3) de-correlation with sensitive attribute as opposed to de-correlation to reduce redundancy in concatenated feature space. These two representations branch off from the deep metric embedding model at the last layer. The two representations encode the similarity metrics learned over the sensitive attribute and target class, respectively. The sensitive attribute embedding layer is discarded at test time. The resulting network expresses a similarity metric with respect to the target class, de-correlated from the sensitive attribute (Figure 1). Therefore, PARADE figuratively optimizes the first two fairness definitions proposed in Section 3.2 via an objective that maximizes independence between the sensitive attribute and target class. + +Objective Term Per Embedding To achieve efficient training and de-correlation of the target class and the sensitive attribute embedding layers, we simultaneously train both layers that branch from the penultimate layer of the model and de-correlate at each iteration. Because PARADE must learn one embedding w.r.t. target class $(\phi_{\text{target}})$ and one embedding w.r.t. the sensitive attribute $(\phi_{\text{SA}})$ , we introduce separate objectives for each embedding: + +$$ +\mathcal {L} _ {t a r g} = \frac {1}{N} \sum_ {t \sim \mathcal {T} _ {t a r g}} \mathcal {L} (t) \qquad \mathcal {L} _ {S A} = \frac {1}{N} \sum_ {t \sim \mathcal {T} _ {S A}} \mathcal {L} (t) +$$ + +![](images/fe17fb752093844d35e889be454fccd666c200afe642af74396292efff03540c.jpg) +Figure 2: A t-SNE (Maaten & Hinton, 2008) visualization of the two distinct PARADE embeddings for bird color CUB200 experiments: the sensitive attribute embedding (left) and the class label embedding (right). In the sensitive attribute embedding, both example images are mapped to clusters with birds of the same plumage (yellow and blue, respectively). Due to de-correlation, in the class label embedding, the images are separated from the region of space with other birds of the same plumage, but are still well-clustered, indicating that PARADE can find other attributes to distinguish these species clusters. + +![](images/8f74df66e81cb380bae2cb59e7752fb9a396f974dca6daa621f13a574c8fd4b4.jpg) + +where $N$ is the number of training triplet samples, and $\mathcal{L}$ represents a generic loss function, such as triplet loss (Hoffer & Ailon, 2018). We use $t\sim \mathcal{T}_{\text{target}}$ to illustrate sampling over triplets of the form $(x_{a},x_{p},x_{n})$ where $x_{a}$ and $x_{p}$ are of the same target class and $x_{a}$ and $x_{n}$ are of differing target classes. Similarly, $t\sim \mathcal{T}_{\text{SA}}$ indicates sampling over triplets of the form $(x_{a},x_{p},x_{n})$ where $x_{a}$ and $x_{p}$ are of the same sensitive attribute subgroup and $x_{a}$ and $x_{n}$ are of differing sensitive attribute subgroups. See Figure 2 for a t-SNE visualization of the distinct embeddings of PARADE. + +Partial De-correlation In order to minimize the correlation between $\phi^{targ}$ and $\phi^{SA}$ , we use the adversarial separation (de-correlation) method from (Milbich et al., 2020), which minimizes the mutual information between a pair of embeddings. The task of mutual information minimization is accomplished through learning an MLP to maximize the pair's correlation, $c$ , and consequently performing a gradient reversal $R$ , which inverts the gradients during backpropagation. The MLP, $\xi$ , is trained to maximize $c(\phi_i^{targ}, \phi_i^{SA}) = \| R(\phi_i^{targ}) \odot \xi(R(\phi_i^{SA}))\|_2^2$ , s.t. $\odot$ denotes element-wise multiplication. Combining the loss terms results in total loss: + +$$ +\mathcal {L} _ {P A R A D E} = \mathcal {L} _ {t a r g} + \alpha_ {S A} \mathcal {L} _ {S A} - \rho \cdot c \left(\phi^ {t a r g}, \phi^ {S A}\right) +$$ + +where $\alpha_{SA}$ weights the sensitive attribute loss and $\rho$ weights the degree of de-correlation. $\rho$ modulates the de-correlation term to allow $\psi$ to retain some attribute information (i.e. partial de-correlation). Thus, the deployed model $\phi_{targ} = f_{targ} \circ \psi$ can retain information about the sensitive attribute in its feature representations, as $\alpha_{SA}\mathcal{L}_{SA}$ appears in the loss function back-propagated through the full model $\psi$ . The extent to which the sensitive attribute affects the output features is controlled by $\alpha_{SA}$ ; we suggest optimizing $\alpha_{SA} \in (0,1)$ and $\rho$ through maximization of worst-group performance (Lahoti et al., 2020) (See Supplemental C.5 for further analysis of PARADE hyperparameters). + +# 5 EXPERIMENTS + +Baseline DML Methods For all datasets, we use a ResNet-50 (He et al., 2016) architecture with best performing parameters on a validation set (for further implementation details, see Supplemental). To investigate a sweeping set of frequently used DML methods, we benchmark across a diverse, representative set of 11 techniques, including: three standard ranking-based losses (margin, triplet, n-pair, and contrastive) three batch mining strategies (random, semi-hard and distance-weighted sampling) and three common loss functions (multisimilarity loss, ArcFace loss for handling facial datasets, and proxy-based loss, ProxyNCA) (Hoffer & Ailon, 2018; Hadsell et al., 2006; Wu et al., 2018; Sohn, 2016; Hadsell et al., 2006; Kim et al., 2020; Wang et al., 2020a; Deng et al., 2019; Wu et al., 2018; Schroff et al., 2015). See Supplementary for more details. + +Fairness Evaluation In the embedding space, we analyze fairness via performance gaps between minoritized groups and majoritized groups, or worst-group performance gaps (Lahoti et al., 2020). For fairness of the feature representations, we compute gaps in three metrics: recall@k and NMI for intra- and inter-class distance (Section 3.2), and the uniformity measure $U_{\mathrm{KL}}$ corresponding to Definition 3 (defined in Section 3.1). + +Training and Evaluation on Downstream Classifiers To link fairness performance in the embedding space to downstream classification (in which more extensive prior work has been completed), we train downstream classifiers and evaluate classification bias. After training the DML model with the aforementioned criteria, the network is fixed. The output embeddings from the image training datasets, in addition to the class labels, are used to train four downstream classification models: logistic regression (LR), support vector machine (SVM), K-Means (KM), and random forest (RF) (Pedregosa et al., 2011). In the manually imbalanced upstream setting, we train downstream classifiers on the original balanced image datasets to ascertain if bias incurred in the embedding can propagate downstream even if the downstream classifier is trained with real balanced data. + +We execute class imbalanced experiments for CARS196 and CUB200 and vary the level of imbalance between minoritized and majoritized classes in the upstream training set. + +PARADE Configuration We test Partial Attribute De-correlation, PARADE, by training models in the listed settings: manually color imbalanced dataset for CUB200, CelebA and LFW. The attribute used to train the sensitive attribute embedding for each dataset, and the attribute used for fairness evaluation. We compare PARADE with margin loss and distance-weighted sampling (Wu et al., 2018) to standard margin loss and distance-weighted sampling. + +# 6 RESULTS + +# 6.1 SOTA DML METHODS HAVE LARGE FAIRNESS GAPS IN finDML BENCHMARK + +Our experiments indicate that current DML methods encounter crucial fairness limitations in the presence of imbalanced training data. Table 1 (along with a corresponding table for CARS196 in the Supplemental) demonstrate that gaps in the manually class imbalanced setting are greater than the balanced control setting. In four combinations of loss functions and sampling strategies, we do not observe a scenario in which the class imbalanced setting achieves a smaller gap than the control in the embedding space, nor the downstream classification. This is particularly significant due to the nature of sampling strategies studied (Wu et al., 2018; Schroff et al., 2015), which batch samples to force the model to correct "hard" examples. The results validate finDML as a benchmark and framework for fairness through the lens of well-studied fairness characterization in classification. + +Interestingly, Table 1 displays non-negligible gaps in downstream performance metrics recall and precision even in the balanced control case. This could represent stenography of underlying structures in the data, such as car color or bird size. More likely, however, these gaps are due to use of macroaveraging in recall and precision calculations. Nonetheless, the manually class imbalanced settings consistently produce larger gaps. + +# 6.2 PROPAGATION OF BIAS TO DOWNSSTREAM TASKS + +The tabular results emphasize a significant result: naive re-balancing with real data downstream cannot overcome bias incurred in the upstream embedding in any setting studied. Indeed, Table 1 exhibits propagation of bias from upstream embeddings (trained on imbalanced data) to downstream tasks (trained on fixed upstream embeddings with a re-balanced dataset). To provide additional context for the result, we direct to increasing use of DML models as components of larger classification models. This trend is arising in literature such as supervised contrastive learning, and recent developments in pre-training and lifting DML models for classification (Khosla et al., 2020). This necessitates tackling bias in the representation space of DML as opposed to patches downstream, and emphasizes the importance of defining fairness in this setting as done in our work. + +Impact of imbalance degree on lack of fairness Figure 3 shows that gaps in downstream classification mimic those upstream, even as we vary the level of imbalance introduced when training the upstream embedding. Here, the random forest classifier sees greater gaps in downstream metrics + +Table 1: Gap study on CUB200-2011. Average gaps in representation space and downstream classification (logistic regressor) over 10 seeds between minoritized and majoritized classes in manually class imbalanced experiments (Imbalanced) and control experiments (Balanced) for CUB200-2011. Results for CARS196 are available in the supplementary with similar conclusions. **Bold** represents larger gap for each method shown (Loss $\cdot$ Batch Mining). + +
Experiments →BalancedImbalancedBalancedImbalanced
Objective →Margin · DistanceMargin · Semi-hard
UPSTREAM EMBEDDINGRecall@10.017 ± 0.0070.212 ± 0.0290.02 ± 0.0070.187 ± 0.031
NMI-0.001 ± 0.0040.112 ± 0.012-0.004 ± 0.0040.092 ± 0.017
\(U_{\text{KL}}\)-0.042 ± 0.0030.0 ± 0.002-0.048 ± 0.0040.002 ± 0.004
DOWNSTREAM CLASSIFICATIONPrecision0.339 ± 0.0070.39 ± 0.0140.33 ± 0.0040.393 ± 0.015
Recall0.36 ± 0.0070.424 ± 0.0180.351 ± 0.0050.43 ± 0.016
Accuracy0.014 ± 0.0020.131 ± 0.0270.016 ± 0.0050.131 ± 0.031
Objective →Triplet · DistanceTriplet · Semi-hard
UPSTREAM EMBEDDINGRecall@10.019 ± 0.0060.159 ± 0.0310.019 ± 0.0060.168 ± 0.036
NMI-0.001 ± 0.0040.103 ± 0.016-0.004 ± 0.0060.082 ± 0.016
\(U_{\text{KL}}\)-0.054 ± 0.006-0.004 ± 0.009-0.051 ± 0.0060.014 ± 0.011
DOWNSTREAM CLASSIFICATIONPrecision0.336 ± 0.0050.41 ± 0.0140.338 ± 0.0070.384 ± 0.014
Recall0.357 ± 0.0040.459 ± 0.0160.359 ± 0.0070.426 ± 0.016
Accuracy0.016 ± 0.0030.179 ± 0.0310.02 ± 0.0050.134 ± 0.031
+ +![](images/9091e86f22e7d8214f52f7ff639a4533563b750b4a27470eaea6c44def888184.jpg) +Figure 3: Impact of varying imbalance between the minoritized and majoritized classes on upstream embedding and downstream classifier (RF) in the manually class imbalanced CARS196 experiments. (Note: the imbalance percentage $50 - 50$ is equivalent to the balanced setting). Gaps increase both upstream and downstream with more imbalance introduced to the upstream training data. + +![](images/9e87ae31c1002b40dc4ad45ae9dec6aa36a38785548abe5f431cd46c7e27cfb9.jpg) + +than the control, even when manual imbalance is set at $40 - 60$ upstream, and the downstream training dataset is balanced. For results with additional downstream classifiers, see Supplemental. This experiment demonstrates that the propagation of bias to downstream will occur even with lower levels of imbalance, and does not appear to depend on the downstream classifier chosen. + +# 6.3 REDUCED SUBGROUP GAPS THROUGH PARTIAL DE-CORRELATION WITH SENSITIVE ATTRIBUTE + +Table 2a shows results for performance gaps between relevant subgroups in both facial recognition datasets. PARADE shows strong results for CUB200 bird color dataset, primarily reducing gaps downstream and accordingly to recall@1 (Definition 1). PARADE can reliably reduce gaps for both the representation space and downstream classifiers on LFW. Interestingly, we observe that the majoritized subgroup ("White") had worst performance of all "Race" subgroups (see Supplemental), contrary to previous results (Samadi et al., 2018).3 As such, we measure gaps between the worst-performing subgroup and others. + +Table 2: Comparison between PARADE and standard losses with distance-weighted sampling of average gaps in representation space and downstream classification (logistic regressor) over 3 seeds between minoritized and majoritized groups in (a) facial dataset studies, namely on CelebA (w.r.t. "Fitzpatrick Skintone") and between worst-performing subgroup and other subgroups in LFW $^2$ (w.r.t. "Race") with Margin loss and (b) bird color experiments for CUB200 image dataset (w.r.t. color) with Margin and Triplet loss. Bold represents smaller gap (better fairness performance). +(a) + +
Facial DatasetsCelebA (skintone)LFW (race)
PARADEMargin · DistancePARADEMargin · Distance
UPSTREAM EMBEDDINGRecall@10.085 ± 0.0090.122 ± 0.0050.075 ± 0.0140.068 ± 0.013
NMI-0.012 ± 0.003-0.002 ± 0.0030.041 ± 0.0030.048 ± 0.003
\( U_{\text{KL}} \)-0.04 ± 0.011-0.03 ± 0.0070.163 ± 0.0030.165 ± 0.005
DOWNSTREAM CLASSIFICATIONPrecision0.146 ± 0.0060.1 ± 0.0070.004 ± 0.0020.005 ± 0.005
Recall0.141 ± 0.0070.098 ± 0.0070.003 ± 0.0010.007 ± 0.006
Accuracy0.131 ± 0.0060.082 ± 0.0050.009 ± 0.0030.012 ± 0.009
+ +(b) + +
CUB200-2011 colorPARADE (M · D)Margin · DistancePARADE (T · D)Triplet · Distance
UPSTREAM EMBEDDINGRecall@10.172 ± 0.0210.176 ± 0.0410.172 ± 0.0270.195 ± 0.051
NMI0.349 ± 0.0310.326 ± 0.1840.372 ± 0.2910.359 ± 0.024
\( U_{KL} \)0.167 ± 0.0130.153 ± 0.0130.174 ± 0.0350.159 ± 0.018
DOWNSTREAM CLASSIFICATIONPrecision0.317 ± 0.0460.333 ± 0.0490.248 ± 0.0380.308 ± 0.119
Recall0.352 ± 0.0390.363 ± 0.0460.276 ± 0.0420.337 ± 0.123
Accuracy0.163 ± 0.0180.153 ± 0.0280.148 ± 0.0490.154 ± 0.029
+ +For CelebA, we find for standard methods the minoritized subgroups to generally perform worst. PARADE excels at gap reduction upstream but encounters larger subgroup gaps downstream compared to standard methods. While PARADE does reduce downstream gaps between light skintones (I, II, and III), and the two lighter dark skintones (IV, V), gaps increase between lighter skintones and the darkest skintone (VI) (see Supplemental). Because skintone VI constitutes $< 1\%$ of the CelebA dataset, PARADE is likely not able to learn similarity between faces over attributes besides skintone. And PARADE is prevented from learning similarities based on skintone due to de-correlation. In such settings, PARADE could be combined with oversampling minoritized subgroups to ensure better performance. + +In general, the results show promising benefits of PARADE to adequately address and improve on the challenge of subgroup gaps for DML models used in facial recognition; and in the standard DML dataset CUB200, for recall@1 upstream (Definition 1) and across metrics downstream (Table 2b). + +# 7 DISCUSSION + +In this work, we introduce the finDML benchmark, a framework for fairness in deep metric learning (§3.2). We demonstrate the fairness limitations of established DML techniques, and the surprising propagation of embedding space bias to downstream classifiers. Importantly, we find that this bias cannot be addressed at the level of downstream classifiers but instead needs to be addressed at the DML stage. We investigate the limit of this propagation in manually introduced imbalance, and finally show that PARADE can reduce subgroup gaps in several settings. + +Limitations PARADE suffers from pitfalls similar to other "fairness with awareness" methods: PARADE uses information only on pre-defined sensitive attributes and therefore can be unfair w.r.t. other sensitive attributes. PARADE does have an advantage in addressing the combinatorial number of attributes considered in multi-attribute fairness through DML, which will scale sub-combinatorially in time/space complexity. We also note that subgroup gaps are not sufficient to capturing societal understandings of fairness, and there is no consensus as to how to remedy such gaps (Chouldechova & Roth, 2018; Dwork et al., 2012; Hardt et al., 2016; Zemel et al., 2013; Zafar et al., 2017). Additionally, while PARADE intentionally optimizes Definitions 1 and 2, we provide no explicit guarantee and optimization of uniformity, Definition 3, remains an open problem. Finally, PARADE does incur slight decrease in overall performance, similar to other methods (Wick et al., 2019) (see Supplemental for per-subgroup performance and additional fairness-utility trade-off analysis for PARADE). + +Code of Ethics Statement The work presented here deals with fairness in deep metric learning. A portion of our studies in the paper focuses on CARS196 and CUB200-2011 datasets, which have consistently been used in benchmarking novel DML frameworks (Krause et al., 2013; Wah et al., 2011). The fairness analysis considered for CUB200-2011 deals with bird color, which does not, to our knowledge, correspond with any societal problems relating to fairness. Nonetheless, as CUB200-2011 is used in a litany of papers for SOTA performance comparison, finDML includes CUB200 so that DML methods can be analyzed w.r.t. fairness on a dataset used in their original paper. + +We do include facial recognition datasets and tasks and analyze fairness with respect to facial attributes. Facial recognition does raise ethical concerns in practice. We note that our paper attempts to address primary social concerns in facial identity recognition. We do not encourage the task of facial attribute recognition, and solely use labeled attributes that correspond to known axes of bias for fairness analysis (e.g. Race and Skintone). As PARADE has solely been tested in two widely used public facial recognition datasets, we cannot guarantee fairness nor privacy in practical settings with private facial datasets. + +Reproducibility Statement Additional experimental results discussed in the main paper and others are contained in Supplemental C. Implementation details including attribute information, generation of attributes, training parameters, metric calculation and gap computation are listed in Supplemental D. Code available here: https://github.com/ndullerud/dml-fairness. + +# ACKNOWLEDGEMENTS + +We would like to acknowledge and thank our sponsors, who support our research with financial and in-kind contributions: CIFAR through the Canada CIFAR AI Chair, Intel, NFRF through an Exploration grant, NSERC through the COHESA Strategic Alliance, International Max Planck Research School for Intelligent Systems (IMPRS-IS), European Laboratory for Learning and Intelligent Systems (ELLIS) PhD program, Mitacs Accelerate through internship program, and Microsoft Research. Resources used in preparing this research were provided, in part, by the Province of Ontario, the Government of Canada through CIFAR, and companies sponsoring the Vector Institute. We would like to thank members of the CleverHans Lab and HealthyML Lab for their invaluable feedback. + +# REFERENCES + +Tameem Adel, Isabel Valera, Zoubin Ghahramani, and Adrian Weller. One-network adversarial fairness. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 2412-2420, 2019. +Alexander Alemi, Ben Poole, Ian Fischer, Joshua Dillon, Rif A Saurous, and Kevin Murphy. Fixing a broken elbo. In International Conference on Machine Learning, pp. 159-168. PMLR, 2018. +Alexander Amini, Ava P Soleimany, Wilko Schwarting, Sangeeta N Bhatia, and Daniela Rus. Uncovering and mitigating algorithmic bias through learned latent structure. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pp. 289-295, 2019. +Richard Berk. An impact assessment of machine learning risk forecasts on parole board decisions and recidivism. Journal of Experimental Criminology, 13(2):193-216, 2017. +Alex Beutel, Jilin Chen, Zhe Zhao, and Ed H Chi. Data decisions and theoretical implications when adversarially learning fair representations. arXiv preprint arXiv:1707.00075, 2017. +Biagio Brattoli, Joseph Tighe, Fedor Zhdanov, Pietro Perona, and Krzysztof Chalupka. Rethinking zero-shot video classification: End-to-end training for realistic applications. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthew, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in $\beta$ -vae. arXiv preprint arXiv:1804.03599, 2018. + +Souradip Chakraborty, Ekansh Verma, Saswata Sahoo, and Jyotishka Datta. Fairmixrep: Self-supervised robust representation learning for heterogeneous data with fairness constraints. In 2020 International Conference on Data Mining Workshops (ICDMW), pp. 458-463. IEEE, 2020. +Irene Chen, Fredrik D Johansson, and David Sontag. Why is my classifier discriminatory? arXiv preprint arXiv:1805.12002, 2018a. +Ricky TQ Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentangle-ment in variational autoencoders. arXiv preprint arXiv:1802.04942, 2018b. +Victoria Cheng, Vinith M. Suriyakumar, Natalie Dullerud, Shalmali Joshi, and Marzyeh Ghassemi. Can you fake it until you make it? impacts of differentially private synthetic data on downstream classification fairness. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, FAccT '21, pp. 149-160, New York, NY, USA, 2021. Association for Computing Machinery. ISBN 9781450383097. doi: 10.1145/3442188.3445879. URL https://doi.org/10.1145/3442188.3445879. +Alexandra Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. *Big data*, 5(2):153–163, 2017. +Alexandra Chouldechova and Aaron Roth. The frontiers of fairness in machine learning. arXiv preprint arXiv:1810.08810, 2018. +J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. +J. Deng, J. Guo, N. Xue, and S. Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4685-4694, 2019. doi: 10.1109/CVPR.2019.00482. +Y. Duan, W. Zheng, X. Lin, J. Lu, and J. Zhou. Deep adversarial metric learning. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2780-2789, 2018. doi: 10.1109/CVPR.2018.00294. +Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In Proceedings of the 3rd innovations in theoretical computer science conference, pp. 214-226, 2012. +Harrison Edwards and Amos Storkey. Censoring representations with an adversary. arXiv preprint arXiv:1511.05897, 2015. +Babak Esmaeili, Hao Wu, Sarthak Jain, Alican Bozkurt, Narayanaswamy Siddharth, Brooks Paige, Dana H Brooks, Jennifer Dy, and Jan-Willem Meent. Structured disentangled representations. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 2525-2534. PMLR, 2019. +Xavier Gitiaux and Huzefa Rangwala. Fair representations by compression. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 11506-11515, 2021. +Amir Globerson and Sam T. Roweis. Metric learning by collapsing classes. In Y. Weiss, B. Scholkopf, and J. C. Platt (eds.), Advances in Neural Information Processing Systems 18, pp. 451-458. MIT Press, 2006. URL http://papers.nips.cc/paper/2947-metric-learning-by-collapsing-classes.pdf. +Arthur Gretton, Karsten Borgwardt, Malte Rasch, Bernhard Scholkopf, and Alex Smola. A kernel method for the two-sample-problem. Advances in neural information processing systems, 19: 513-520, 2006. +Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2006. +Moritz Hardt, Eric Price, and Nathan Srebro. Equality of opportunity in supervised learning, 2016. + +Ben Harwood, BG Kumar, Gustavo Carneiro, Ian Reid, Tom Drummond, et al. Smart mining for deep metric learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2821-2829, 2017. +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. +Elad Hoffer and Nir Ailon. Deep metric learning using triplet network, 2018. +J. Hu, J. Lu, and Y. Tan. Discriminative deep metric learning for face verification in the wild. In 2014 IEEE Conference on Computer Vision and Pattern Recognition, 2014. +Gary B. Huang, Vidit Jain, and Erik Learned-Miller. Unsupervised joint alignment of complex images. In ICCV, 2007. +Christina Ilvento. Metric learning for individual fairness, 2020. +Pierre Jacob, David Picard, Aymeric Histace, and Edouard Klein. Metric learning with horde: High-order regularizer for deep embeddings. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +Ayush Jaiswal, Rob Brekelmans, Daniel Moyer, Greg Ver Steeg, Wael AbdAlmageed, and Premkumar Natarajan. Discovery and separation of features for invariant representation learning. arXiv preprint arXiv:1912.00646, 2019. +Herve Jegou, Matthijs Douze, and Cordelia Schmid. Product quantization for nearest neighbor search. IEEE transactions on pattern analysis and machine intelligence, 33(1):117-128, 2011. +Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning, 2020. +Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, pp. 2649-2658. PMLR, 2018. +Sungyeon Kim, Dongwon Kim, Minsu Cho, and Suha Kwak. Proxy anchor loss for deep metric learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +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, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980. +Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. +Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pp. 554-561, 2013. +Neeraj Kumar, Alexander C. Berg, Peter N. Belhumeur, and Shree K. Nayar. Attribute and simile classifiers for face verification. In 2009 IEEE 12th International Conference on Computer Vision, pp. 365-372, 2009. doi: 10.1109/ICCV.2009.5459250. +Preethi Lahoti, Alex Beutel, Jilin Chen, Kang Lee, Flavien Prost, Nithum Thain, Xuezhi Wang, and Ed H. Chi. Fairness without demographics through adversarially reweighted learning, 2020. +Hui Li, Maryellen L. Giger, Benjamin Q. Huynh, and Natalia O. Antropova. Deep learning in breast cancer risk assessment: evaluation of convolutional neural networks on a clinical dataset of full-field digital mammograms. Journal of medical imaging (Bellingham, Wash.), 4(4):041304-041304, Oct 2017. ISSN 2329-4302. doi: 10.1117/1.JMI.4.4.041304. URL https://pubmed.ncbi.nlm.nih.gov/28924576. + +Yujia Li, Kevin Swersky, and Richard Zemel. Learning unbiased features. arXiv preprint arXiv:1412.5244, 2014. +Xudong Lin, Yueqi Duan, Qiyuan Dong, Jiwen Lu, and Jie Zhou. Deep variational metric learning. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.), Computer Vision - ECCV 2018, pp. 714-729, Cham, 2018. Springer International Publishing. ISBN 978-3-030-01267-0. +Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Spherface: Deep hypersphere embedding for face recognition. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. +Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015. +Stuart P. Lloyd. Least squares quantization in pcm. IEEE Trans. Information Theory, 28:129-136, 1982. +Francesco Locatello, Gabriele Abbati, Tom Rainforth, Stefan Bauer, Bernhard Scholkopf, and Olivier Bachem. On the fairness of disentangled representations. arXiv preprint arXiv:1905.13662, 2019a. +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, pp. 4114-4124. PMLR, 2019b. +Christos Louizos, Kevin Swersky, Yujia Li, Max Welling, and Richard Zemel. The variational fair autoencoder. arXiv preprint arXiv:1511.00830, 2015. +Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579-2605, 2008. +David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning adversarially fair and transferable representations. In International Conference on Machine Learning, pp. 3384-3393. PMLR, 2018. +Christopher Manning, Prabhakar Raghavan, and Hinrich Schütze. Introduction to information retrieval. Natural Language Engineering, 16(1):100-103, 2010. +Ninareh Mehrabi, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram Galstyan. A survey on bias and fairness in machine learning. arXiv preprint arXiv:1908.09635, 2019. +Timo Milbich, Karsten Roth, Homanga Bharadhwaj, Samarth Sinha, Yoshua Bengio, Björn Ommer, and Joseph Paul Cohen. Diva: Diverse visual feature aggregation for deep metric learning. CoRR, abs/2004.13458, 2020. URL https://arxiv.org/abs/2004.13458. +Timo Milbich, Karsten Roth, Samarth Sinha, Ludwig Schmidt, Marzyeh Ghassemi, and Björn Ommer. Characterizing generalization under out-of-distribution shifts in deep metric learning. CoRR, abs/2107.09562, 2021. URL https://arxiv.org/abs/2107.09562. +Yair Movshovitz-Attias, Alexander Toshev, Thomas K. Leung, Sergey Ioffe, and Saurabh Singh. No fuss distance metric learning using proxies. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Oct 2017. +Daniel Moyer, Shuyang Gao, Rob Brekelmans, Greg Ver Steeg, and Aram Galstyan. Invariant representations without adversarial training. arXiv preprint arXiv:1805.09458, 2018. +Kevin Musgrave, Serge J. Belongie, and Ser-Nam Lim. A metric learning reality check. CoRR, abs/2003.08505, 2020. URL https://arxiv.org/abs/2003.08505. +William Paul and Philippe Burlina. Generalizing fairness: Discovery and mitigation of unknown sensitive attributes. arXiv preprint arXiv:2107.13625, 2021. + +F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830, 2011. +Qi Qian, Lei Shang, Baigui Sun, Juhua Hu, Hao Li, and Rong Jin. Softtriple loss: Deep metric learning without triplet sampling. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), October 2019. +Alexandria Walton Radford and Thomas J Espenshade. No longer separate, not yet equal: race and class in elite college admission and campus life. Princeton University Press, 2014. +Borja Rodríguez-Gálvez, Ragnar Thobaben, and Mikael Skoglund. A variational approach to privacy and fairness. arXiv preprint arXiv:2006.06332, 2020. +Harrison Rosenberg, Brian Tang, Kassem Fawaz, and Somesh Jha. Fairness properties of face recognition and obfuscation systems, 2021. +Karsten Roth and Biagio Brattoli. Deep-metric-learning-baselines. https://github.com/Confusezius/Deep-Metric-Learning-Baselines, 2019. +Karsten Roth, Timo Milbich, and Bjorn Ommer. Pads: Policy-adapted sampling for visual similarity learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020a. +Karsten Roth, Timo Milbich, Björn Ommer, Joseph Paul Cohen, and Marzyeh Ghassemi. S2sd: Simultaneous similarity-based self-distillation for deep metric learning, 2020b. +Karsten Roth, Timo Milbich, Samarth Sinha, Prateek Gupta, Bjorn Ommer, and Joseph Paul Cohen. Revisiting training strategies and generalization performance in deep metric learning. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 8242-8252. PMLR, 13-18 Jul 2020c. URL http://proceedings.mlr.press/v119/roth20a.html. +Samira Samadi, Uthaipon Tantipongpipat, Jamie Morgenstern, Mohit Singh, and Santosh Vempala. The price of fair pca: One extra dimension. arXiv preprint arXiv:1811.00103, 2018. +Mhd Hasan Sarhan, Nassir Navab, Abouzar Eslami, and Shadi Albarqouni. Fairness by learning orthogonal disentangled representations. In European Conference on Computer Vision, pp. 746-761. Springer, 2020. +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 (CVPR), June 2015. +Samarth Sinha, Karsten Roth, Anirudh Goyal, Marzyeh Ghassemi, Hugo Larochelle, and Animesh Garg. Uniform priors for data-efficient transfer, 2020. +Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In Advances in Neural Information Processing Systems, pp. 1857-1865, 2016. +Jiaming Song, Pratyusha Kalluri, Aditya Grover, Shengjia Zhao, and Stefano Ermon. Learning controllable fair representations. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 2164-2173. PMLR, 2019. +Yao-Hung Hubert Tsai, Martin Q Ma, Han Zhao, Kun Zhang, Louis-Philippe Morency, and Ruslan Salakhutdinov. Conditional contrastive learning: Removing undesirable information in self-supervised representations. arXiv preprint arXiv:2106.02866, 2021. +C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The caltech-ucsd birds-200-2011 dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. +Jian Wang, Feng Zhou, Shilei Wen, Xiao Liu, and Yuanqing Lin. Deep metric learning with angular loss. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2593-2601, 2017. + +Jiang Wang, Yang song, Thomas Leung, Chuck Rosenberg, Jinbin Wang, James Philbin, Bo Chen, and Ying Wu. Learning fine-grained image similarity with deep ranking, 2014. +Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere, 2020. +Xun Wang, Xintong Han, Weilin Huang, Dengke Dong, and Matthew R. Scott. Multi-similarity loss with general pair weighting for deep metric learning, 2020a. +Zeyu Wang, Clint Qinami, Ioannis Christos Karakozis, Kyle Genova, Prem Nair, Kenji Hata, and Olga Russakovsky. Towards fairness in visual recognition: Effective strategies for bias mitigation, 2020b. +Kilian Q Weinberger, John Blitzer, and Lawrence K. Saul. Distance metric learning for large margin nearest neighbor classification. In Y. Weiss, B. Scholkopf, and J. C. Platt (eds.), Advances in Neural Information Processing Systems 18, pp. 1473-1480. MIT Press, 2006. URL http://papers.nips.cc/paper/2795-distance-metric-learning-for-large-margin-nearest-neighbor-classification.pdf. +Eric W. Weisstein. Hypersphere, 2002. +Michael Wick, swetasudha panda, and Jean-Baptiste Tristan. Unlocking fairness: a trade-off revisited. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper/2019/file/373e4c5d8edfa8b74fd4b6791d0cf6dc-Paper.pdf. +Chao-Yuan Wu, R. Manmatha, Alexander J. Smola, and Philipp Krahenbuhl. Sampling matters in deep embedding learning, 2018. +Qizhe Xie, Zihang Dai, Yulun Du, Eduard Hovy, and Graham Neubig. Controllable invariance through adversarial feature learning. arXiv preprint arXiv:1705.11122, 2017. +Depeng Xu, Shuhan Yuan, Lu Zhang, and Xintao Wu. Fairgan: Fairness-aware generative adversarial networks. In 2018 IEEE International Conference on Big Data (Big Data), pp. 570-575. IEEE, 2018. +Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rogriguez, and Krishna P Gummadi. Fairness constraints: Mechanisms for fair classification. In Artificial Intelligence and Statistics, pp. 962-970. PMLR, 2017. +Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In International conference on machine learning, pp. 325-333. PMLR, 2013. +Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. Mitigating unwanted biases with adversarial learning. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pp. 335-340, 2018. +Han Zhao and Geoffrey J Gordon. Inherent tradeoffs in learning fair representations. arXiv preprint arXiv:1906.08386, 2019. +Han Zhao, Amanda Coston, Tameem Adel, and Geoffrey J Gordon. Conditional learning of fair representations. arXiv preprint arXiv:1910.07162, 2019. +Wenzhao Zheng, Zhaodong Chen, Jiwen Lu, and Jie Zhou. Hardness-aware deep metric learning. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. + +# SUPPLEMENTAL MATERIAL + +# A ADDITIONAL BACKGROUND + +# A.1 DEEP METRIC LEARNING DEFINITIONS + +Here, we iterate through some common DML criteria and batch mining strategies more formally than in the main paper. Throughout this section, let $X$ denote the input data, $\phi(X)$ the embedded data, $Y$ the class label, and let $Y(x)$ denote the value of the ground truth class label for data instance $x$ . Denote the set of all positive pairs with respect to class label $Y$ as $\mathbb{P} = \{(x_1, x_2) \in X \times X : Y(x_1) = Y(x_2), x_1 \neq x_2\}$ . Denote the set of all negative pairs with respect to class label $Y$ as $\mathbb{N} = \{(x_1, x_2) \in X \times X : Y(x_1) \neq Y(x_2)\}$ . We use the notation $(x_a, x_p, x_n) \in X \times X \times X$ to denote a triplet with an anchor sample $x_a$ , positive sample $x_p$ where $Y(x_a) = Y(x_p)$ , and negative sample $x_n$ where $Y(x_a) \neq Y(x_n)$ . + +Batch Sampling and Mining The batch sampling procedure in deep metric learning methods differ from that of generic deep classifiers in that canonical loss functions require tuples or pairs of samples in order to utilise ranking objectives as training surrogates to learn an appropriate similarity metric. To ensure that tuples with positive and negative examples can be extracted from the batch, the Samples-Per-Class- $n$ (SPC- $n$ ) heuristic (see e.g. Roth et al. (2020c)) is generally used, where commonly $n = 2, 4, 8$ . Given a batch size $b$ , the SPC- $n$ technique randomly selects $b/n$ classes from which $n$ training samples are then drawn randomly to be included in each batch $\mathcal{B}$ . + +After feeding the batch through the network, tuples are mined from the batch to use in the loss function. We refer to mining in this paper either as batch mining or overload the both as batch sampling terminology. The naive solution to tuple mining is random mining, in which all possible tuples of the form $(x_{a}, x_{p}, x_{n})$ are considered and $b$ are randomly chosen from the batch. However, this method lacks the capacity to utilize valuable information about the current embedding space, and is prone to significant redundancy in the training signal Schroff et al. (2015); Wu et al. (2018). + +Definition 4 (Random Mining). Hu et al. (2014) For each $x_{a} \in \mathcal{B}$ , we randomly draw a positive example from $\{x_{p} \in \mathcal{B} : Y(x_{p}) = Y(x_{a}), x_{p} \neq x_{a}\}$ and a negative example from $\{x_{n} \in \mathcal{B} : Y(x_{n}) \neq Y(x_{a})\}$ to form the triplet $(x_{a}, x_{p}, x_{n})$ . + +Intuitively, this could be mitigated by hard mining heuristics searching for negative samples that are closer to the anchor sample in the embedding space than positive samples, thereby always ensuring a significant training signal. Unfortunately, such approaches are prone to heavy overfitting, training instability and large gradient variance, thereby commonly resulting in less-than-optimal solutions (see e.g. Schroff et al. (2015); Harwood et al. (2017); Wu et al. (2018)). Recent approaches thus establish more lenient heuristics, such as through the introduction of slack parameters to the hard mining objective (e.g. semi-hard mining Schroff et al. (2015) or softhard mining Roth & Brattoli (2019)). + +Definition 5 (Semi-hard Mining). For each $x_{a} \in \mathcal{B}$ , we randomly draw a positive example from $\{x_{p} \in \mathcal{B} : Y(x_{p}) = Y(x_{a}), x_{p} \neq x_{a}\}$ , and a negative example from the set + +$$ +\{x _ {n} \in \mathcal {B}: Y (x _ {n}) \neq Y (x _ {a}), \| \phi (x _ {a}) - \phi (x _ {n}) \| _ {2} ^ {2} \| \phi (x _ {a}) - \phi (x _ {p}) + \gamma \| _ {2} ^ {2} \} +$$ + +where $\gamma \in \mathbb{R}$ is a slack parameter, to form the triplet $(x_{a}, x_{p}, x_{n})$ . + +While other adaptive means (e.g. Harwood et al. (2017); Roth et al. (2020a)) have shown strong performance improvements, modern predefined heuristics such as distance-weighted tuple mining Wu et al. (2018) offer a better cost-to-performance tradeoff Roth et al. (2020a). Here, the heuristic leverages the fact that embeddings are commonly normalized to have unit $L_{2}$ norm for regularization purposes Wu et al. (2018). This ensures a distribution over a unit hypersphere, in which explicit pairwise distributions can be established Weisstein (2002); Wu et al. (2018). By inverting this distribution, distance-weighted mining can thus encourage a much more diverse coverage of tuple difficulties, improving generalization performance and reducing gradient variance Wu et al. (2018). + +Definition 6 (Distance-weighted). For embedding spaces normalized to the $(D - 1)$ -dimensional hypersphere $\mathcal{S}^{D - 1}$ , we have Weisstein (2002); Wu et al. (2018) the following pairwise sampling distribution $q(\bullet, \bullet)$ : + +$$ +q \left(d \left(\phi (x _ {i}), \phi (x _ {j})\right)\right) \propto d \left(\phi (x _ {i}), \phi (x _ {j})\right) ^ {D - 2} \left[ 1 - \frac {1}{4} d \left(\phi (x _ {i}), \phi (x _ {j})\right) \right] ^ {\frac {D - 3}{2}} +$$ + +for embedding pairs $(\phi(x_i), \phi(x_j)) \in S^{D-1}$ and Euclidean distance $d(\bullet, \bullet)$ . For each $x_a \in \mathcal{B}$ , we randomly draw a positive example from $\{x_p \in \mathcal{B} : Y(x_p) = Y(x_a), x_p \neq x_a\}$ , and sample a negative example based on an inverse distance distribution w.r.t. $q$ : + +$$ +P (x _ {n} | x _ {a}) \propto \min (\lambda , q ^ {- 1} (d (\phi (x _ {i}), \phi (x _ {j})))) +$$ + +where $\lambda \in \mathbb{R}$ defines a clipping parameter to avoid potentially erroneous training samples. + +Examined Objectives The primary goal of DML loss functions is to provide a training surrogate that implicitly optimizes for desired metric space quantities by narrowing down the expected distance between positive pairs of samples and expanding on the expected distance between negative pairs of samples in the embedding space. Most commonly employed pair Hadsell et al. (2006) and tripled-based Schroff et al. (2015); Hoffer & Ailon (2018) ranking losses penalize close negative pairs and disparate positive pairs up to a predefined margin to avoid overclustering. Using $\mathbb{P}(x)$ to denote all positive pairs containing $x$ + +$$ +\mathbb {P} (x) = \left\{\left(x _ {1}, x _ {2}\right) \in \mathbb {P}: x _ {1} = x \right\} +$$ + +and $\mathbb{N}(x)$ to denote all negative pairs containing $x$ + +$$ +\mathbb {N} (x) = \left\{\left(x _ {1}, x _ {2}\right) \in \mathbb {N}: x _ {1} = x \right\} +$$ + +we define + +Definition 7 (Contrastive). Hadsell et al. (2006) Given a batch $\mathcal{B}$ , and pairs of samples $\mathbb{S}$ over $\mathcal{B} \times \mathcal{B}$ , the contrastive objective is defined as: + +$$ +\mathcal {L} _ {\text {c o n t r}} = \frac {1}{b} \sum_ {(x _ {i}, x _ {j}) \in \mathbb {S}} \mathbb {I} _ {Y (x _ {i}) = Y (x _ {j})} d (\phi (x _ {i}), \phi (x _ {j})) + \mathbb {I} _ {Y (x _ {i}) \neq Y (x _ {j})} [ \gamma - d (\phi (x _ {i}), \phi (x _ {j})) ] _ {+} +$$ + +with margin $\gamma$ + +Definition 8 (Triplet). Hoffer & Ailon (2018) The triplet loss extends the contrastive objective with sample triplets and can be defined as: + +$$ +\mathcal{L}_{tripl} = \frac{1}{b}\sum_{\substack{(x_{a},x_{p},x_{n})\in \mathcal{T}\\ Y(x_{a}) = Y(x_{p})\neq Y(x_{n})}}[d\left(\phi (x_{a}),\phi (x_{p})\right) - d\left(\phi (x_{a}),\phi (x_{n})\right) + \gamma ]_{+} +$$ + +with margin $\gamma$ + +Margin loss extends the triplet objective through the inclusion of a learnable boundary $\beta$ between positive and negative pairs Wu et al. (2018). In our experiments, we utilise $\beta = 1.2$ . These criteria are widely used (see e.g. Roth et al. (2020c); Musgrave et al. (2020)) and require mining to make use of the batch information. + +Definition 9 (Margin). Wu et al. (2018) The margin objective integrates the learnable distance boundary $\beta$ between positive and negative pairs of samples for a relative ordering of pairs with respect to $\beta$ as + +$$ +\mathcal {L} _ {\text {m a r g i n}} = \sum_ {(x _ {i}, x _ {j}) \in \mathbb {S}} \gamma + \mathbb {I} _ {Y (x _ {i}) = Y (x _ {j})} (d (\phi (x _ {i}), \phi (x _ {j})) - \beta) - \mathbb {I} _ {Y (x _ {i}) \neq Y (x _ {j})} (d (\phi (x _ {i}), \phi (x _ {j})) - \beta) +$$ + +Going beyond pairs and triplets, one can also consider the case of more general $n$ -tuples, which was investigated e.g. in the N-Pair objective Sohn (2016) and the Multisimilarity loss Wang et al. (2020a). + +Definition 10 (N-Pair). Sohn (2016) $N$ -Pair loss is a simple augmentation of the triplet framework in which all negatives in the batch $\mathcal{B}$ are incorporated in the objective function as: + +$$ +\begin{array}{l} \mathcal{L}_{npair} = \frac{1}{b}\sum_{\substack{(x_{a},x_{p})\in \mathcal{B}\\ Y(x_{a}) = Y(x_{p}),a\neq p}}\log \left(1 + \sum_{\substack{x_{n}\in \mathcal{B}\\ Y(x_{a})\neq Y(x_{n})}}\exp \big(\phi (x_{a})^{*,T}\phi (x_{n}) - \phi (x_{a})^{*,T}\phi (x_{p})^{*}\big)\right) + \\ \frac {\nu}{b} \cdot \sum_ {i \in \mathcal {B}} \| \phi (x _ {i}) ^ {*} \| _ {2} ^ {2} \tag {6} \\ \end{array} +$$ + +where $\nu$ denotes an embedding regularization parameter due to slow convergence for normalized embeddings stated in Sohn (2016) + +Definition 11 (Multisimilarity). Wang et al. (2020a) Multisimilarity loss fits into the ranking loss category, but in addition to evaluation of cosine similarity between positive-anchor pairs and negative-anchor pairs, the objective evaluates positive-positive and negative-negative pairs with respect to the anchor: + +$$ +s _ {c} ^ {*} (x _ {i}, x _ {j}) = \left\{ \begin{array}{l l} s _ {c} \left(\phi (x _ {i}), \phi (x _ {j})\right) & s _ {c} \left(\phi (x _ {i}), \phi (x _ {j})\right) > \min _ {x _ {j} \in \mathbb {P} (x _ {i})} s _ {c} \left(\phi (x _ {i}), \phi (x _ {j})\right) - \epsilon \\ s _ {c} \left(\phi (x _ {i}), \phi (x _ {j})\right) & s _ {c} \left(\phi (x _ {i}), \phi (x _ {j})\right) < \max _ {x _ {k} \in \mathbb {N} (x _ {i})} s _ {c} \left(\phi (x _ {i}), \phi (x _ {k})\right) + \epsilon \\ 0 & o t h e r w i s e \end{array} \right. +$$ + +$$ +\begin{array}{l} \mathcal {L} _ {\text {m u l t i s i m}} = \frac {1}{b} \sum_ {x _ {i} \in \mathcal {B}} \frac {1}{\alpha} \log \left[ \right. 1 + \sum_ {x _ {j} \in \mathbb {P} (x _ {i})} \exp \left( \right.- \alpha \left(s _ {c} ^ {*} (\phi (x _ {i}), \phi (x _ {j})) - \lambda)\right)\left. \right] + \\ \frac {1}{\beta} \log \left[ 1 + \sum_ {k \in \mathbb {N} (x _ {i})} \exp \left(\beta \left(s _ {c} ^ {*} (\phi (x _ {i}), \phi (x _ {k})) - \lambda)\right) \right] \right. \tag {7} \\ \end{array} +$$ + +where cosine similarity $s_c(x,y) = x^T y$ for two normalized vectors $x, y \in X$ . + +Notably, the Multisimilarity loss employs a masking process as a stand-in for the lack of batch-mining heuristic. While this proves to be similarly successful in addressing the tuple sampling complexity issue, this can also be addressed through the usage of proxy-samples. These are dummy variables that represent various contextual properties (such as mean class representations) to serve as standing for actual samples, which is found e.g. in the ArcFace Deng et al. (2019) or ProxyNCA loss Movshovitz-Attias et al. (2017). + +Definition 12 (Proxy-NCA). Kim et al. (2020) ProxyNCA learns class proxies, or class centers, which each represent a class in the set of unique classes $\mathcal{V}$ . Then, each anchor from the batch is sampled and a positive or negative proxy $\psi^c \in \mathbb{R}^d$ per class $c \in \mathcal{V}$ is introduced in lieu of a positive or negative sample, respectively, giving: + +$$ +\mathcal {L} _ {p r o x y} = - \frac {1}{b} \sum_ {x _ {i} \in \mathcal {B}} \log \left(\frac {\exp \left(- d \left(\phi (x _ {i}) , \psi_ {Y (x _ {i})}\right)\right)}{\sum_ {c \in \mathcal {Y} \setminus \{Y (x _ {i}) \}} \exp \left(- d \left(\phi (x _ {i}) , \psi_ {c}\right)\right)}\right) +$$ + +Definition 13 (Arcface). Deng et al. (2019) Arcface combines proxy and angular loss methods (e.g. in Wang et al. (2017)) to enforce an angular margin between the embeddings $\phi$ and a proxy (or approximate center) $W\in \mathbb{R}^{c\times d}$ for each class, giving the following: + +$$ +\mathcal{L}_{arc} = -\frac{1}{b}\sum_{x_{i}\in \mathcal{B}}\log \frac{\exp\left(s\cdot\cos\left(W^{T}_{Y(x_{i})}\phi(x_{i}) + \gamma = 0.5\right)\right)}{\exp\left(s\cdot\cos\left(W^{T}_{Y(x_{i})}\phi(x_{i}) + \gamma = 0.5\right)\right) + \sum_{\substack{x_{j}\in \mathcal{B}\\ Y(x_{i})\neq Y(x_{j})}}\exp \left(s\cdot \cos \left(W^{T}_{Y(x_{j})}\phi (x_{i})\right)\right)} +$$ + +where the angular component is encoded in additive angular margin penalty $\gamma$ , and $s$ is a scaling parameter, which denotes the radius of the effective utilized hypersphere $S$ . + +Standard Performance Metrics Performance metrics in deep metric learning aim to capture the quality of the similarity metric learned by the deep embedding model. Therefore, standard performance metrics in DML reflect the closeness between samples of the same class, the separability + +of samples of different classes, the clustering quality of embedding, and the uniformity over the hypersphere embedding space, which has been linked to zero-shot generalization capability Wang & Isola (2020), as discussed in Section 2. In our experiments, we utilize recall@1 Jegou et al. (2011), normalized mutual information Manning et al. (2010) between cluster labels assigned by the well-known K-Means Lloyd (1982) algorithm and ground-truth class labels, and $U_{\mathrm{KL}}$ to measure the closeness between samples of same class, cluster quality of the embedding (and hence, the separability of distinct classes) and uniformity, respectively. Here, we define these metrics formally, but we note that there exist multitudinous performance metrics for DML that we do not define here or use explicitly for our results, including f1 score, mean average precision (mAP), and recall@k for $k > 1$ Jegou et al. (2011). + +Definition 14 (Recall@k). Jegou et al. (2011) Given $k \in \{1, \dots, |X|\}$ , denote $NN_{k}$ as defined in Definition 1. Then, Recall@ $k$ is measured as: + +$$ +\text {R e c a l l} @ k = \frac {1}{| X |} \sum_ {x \in X} \left\{ \begin{array}{l l} 1 & \exists \tilde {x} \in N N _ {k} (x): Y (\tilde {x}) = Y (x) \\ 0 & \text {e l s e} \end{array} \right. +$$ + +Definition 15 (Normalized Mutual Information Score on Clusters). Manning et al. (2010) Let $C$ a clustering algorithm, such as $K$ -Means Lloyd (1982) with the number of clusters set to $|Y|$ , such that $C(x)$ indicates the cluster label for data point $x \in X$ . The normalized mutual information score between the target labels $Y$ and the cluster labels $C$ is measured as: + +$$ +N M I = \frac {2 \cdot I (Y (X) ; C (X))}{H (Y (X)) + H (C (X))} +$$ + +where for random variables $X,Y,I(\cdot ,\cdot)$ denotes the mutual information function: + +$$ +I (X; Y) = H (Y) - H (Y | X) +$$ + +and $H(\cdot)$ denotes the entropy function: + +$$ +H (X) = - \sum_ {x \in X} \Pr (x) \log (\Pr (x)) +$$ + +The performance metric $U_{\mathrm{KL}}$ , used to measure feature uniformity for our empirical evaluations, is defined in Section 3.1. + +# A.2 CLASSIFICATION FAIRNESS DEFINITIONS + +Fairness definitions and criteria in classification are briefly mentioned in Section 2 of the main paper. Here, we provide explicit formulas for the most common fairness definitions, including demographic parity, equalized odds, and equality of opportunity Hardt et al. (2016), and provide some additional context on fairness definition evolution. + +Definition 16 (Demographic Parity). The predictor $\hat{Y}$ satisfies demographic parity with respect to attribute $A$ and class $Y$ if the predictor is independent of $A$ : + +$$ +\operatorname * {P r} [ \hat {Y} = 1 | A = a ] = \operatorname * {P r} [ \hat {Y} = 1 | A = b ] \qquad \forall a, b \in A +$$ + +Specifically, demographic parity has largely been used over the years as a simple and intuitive definition of fairness, in which a classifier is said to satisfy demographic parity if the sensitive attribute is independent of the output of the classifier. While demographic parity provides a simple fairness definition, the measure cannot capture fairness in classification tasks where the ground-truth label is inherently related to a certain attribute value Li et al. (2017). + +Definition 17 (Equalized Odds). The predictor $\hat{Y}$ satisfies demographic parity with respect to attribute $A$ and class $Y$ if the predictor is independent of $A$ conditional on $Y$ : + +$$ +\operatorname * {P r} [ \hat {Y} = 1 | A = a, Y = y ] = \operatorname * {P r} [ \hat {Y} = 1 | A = b, Y = y ] \qquad \forall a, b \in A, \forall y \in \{0, 1 \} +$$ + +from Hardt et al. (2016). + +Definition 18 (Equality of Opportunity). The predictor $\hat{Y}$ satisfies demographic parity with respect to attribute $A$ and class $Y$ if the predictor is independent of $A$ conditional on positively labelled $Y$ : + +$$ +\operatorname * {P r} [ \hat {Y} = 1 | A = a, Y = 1 ] = \operatorname * {P r} [ \hat {Y} = 1 | A = b, Y = 1 ] \qquad \forall a, b \in A +$$ + +from Hardt et al. (2016). + +This lead to the introduction of other fairness definitions that capture such nuances, the most well-known of which are probably equalized odds and equality of opportunity Hardt et al. (2016). However, fairness metrics overall have been criticized due to the choice of protected attribute over which to measure, and the inability of these metrics to capture bias with respect to certain attributes which are not known at test-time. We discuss this to a limited extent in Section 7. + +# B DATASET SUMMARY STATISTICS + +![](images/9ced839bfae6647b7b1d36c27521e3ffa0c267bcf8938ab338907e0470eb5409.jpg) +Figure 4: Class distribution in CARS196. Histograms visualizing the distribution over number of samples per class in the train (left) and test (right) datasets in CARS196. + +![](images/56888face516129a49454cb8144c0412dddc7a5ead6b5c0b8f8804aaaf66268b.jpg) + +![](images/1edf07a5db69944386aab8f5c0adb06448a4936564af3dc2674f1bbd76474aad.jpg) +Figure 5: Class distribution in CUB200. Histograms visualizing the distribution over number of samples per class in the train (left) and test (right) datasets in CUB200. + +![](images/8b3781aecc8976f88efac247b9285ff7eb00c8e5e3982bfed683f72a320dcae9.jpg) + +
BlackBlueBrownBuffGreenGreyIridescentOliveOrangeRedWhiteYellow
Train21.205.5818.083.010.3719.200.510.491.023.5213.3513.65
Test21.175.5618.113.040.3919.210.510.511.013.5213.2913.68
+ +Table 3: Summary statistics for CUB200 bird color The percentage of the dataset constituted by each bird color in CUB200, in the train dataset and test dataset, respectively. + +# C ADDITIONAL RESULTS + +# C.1 CARS196 + +Additional results for all loss and batch mining strategies for the manually class imbalanced experiments and balanced controls for CARS196 are located in Tables 6 and 7. K-Means was also + +![](images/3e087ecf30fe1a2c3249ecf8a1ad6f8b71737356a34cd0b77abe6132270805d1.jpg) +Figure 6: Class distribution in CelebA. Histograms visualizing the distribution over number of samples per class in the train (left) and test (right) datasets in CelebA. + +![](images/e01075d5a916dbd3b1c72290872412c0fa11c73dfbe3e6b9a5e7fae2eaa82999.jpg) + +
IIIIIIIVVVI
Train1.1032.0447.9215.123.200.61
Test1.2432.0948.0914.813.220.55
+ +![](images/dd9a677e890bdbddd231f974fb634f7963f3372bcdc5b209206393752235ae35.jpg) +Figure 7: Class distribution in LFW. Histograms visualizing the distribution over logarithm of number of samples per class in the train (left) and test (right) datasets in LFW. + +![](images/a3c87290da97d9b3f7232d1a56d0649e2eb4938ed819052878eb53c5a69e1a83.jpg) + +Table 4: Summary statistics for CelebA Fitzpatrick Skintone. The percentage of the dataset constituted by each Fitzpatrick Skintone in CelebA, in the train dataset and test dataset, respectively. + +
AsianBlackIndianWhite
Train8.434.171.7185.70
Test6.274.611.7987.33
+ +Table 5: Summary statistics for LFW Race The percentage of the dataset constituted by each Race in LFW, in the train dataset and test dataset, respectively. + +tested as a downstream classifier but showed poor performance. The impact of varying imbalance in the manually class imbalanced CARS196 experiments with all tested downstream classifiers is displayed in Table 8. Additional results for benchmarking of further fairness improvement methods in downstream classification of "imbanced" embeddings (aside from naive use of balanced datasets) are shown in Table 8. + +
Contrastive \(\cdot\)DistanceOverall
BalancedImbalancedBalancedImbalancedBalancedImbalanced
UPSTREAM EMBEDDINGRecall@10.861±0.0030.83±0.0050.854±0.0020.819±0.0080.83±0.0020.811±0.006
NMI0.909±0.0030.879±0.0030.894±0.0030.867±0.0050.876±0.0040.861±0.007
\(U_{KL}\)0.433±0.0040.457±0.0080.096±0.0020.091±0.0020.133±0.0040.133±0.003
DOWNSTREAM CLASSIFICATIONLRAccuracy0.878±0.0020.848±0.0060.88±0.0020.861±0.0040.858±0.0050.853±0.005
Precision0.877±0.0020.848±0.0070.883±0.0020.864±0.0040.86±0.0050.856±0.005
Recall0.876±0.0020.846±0.0060.879±0.0020.86±0.0040.856±0.0050.852±0.005
RFAccuracy0.855±0.0020.832±0.0060.816±0.0030.758±0.0110.819±0.0050.79±0.006
Precision0.859±0.0030.835±0.0060.82±0.0030.763±0.010.822±0.0050.794±0.006
Recall0.855±0.0030.831±0.0060.815±0.0030.757±0.0110.817±0.0050.788±0.005
SVMAccuracy0.876±0.0020.852±0.0060.882±0.0020.863±0.0040.863±0.0050.86±0.004
Precision0.875±0.0020.855±0.0070.888±0.0020.875±0.0030.867±0.0050.867±0.004
Recall0.874±0.0020.85±0.0060.881±0.0020.863±0.0040.863±0.0050.86±0.004
Overall
MultisimilarityProxy-NCATriplet \(\cdot\) DistanceTriplet \(\cdot\) Semi-hard
BalancedImbalancedBalancedImbalancedBalancedImbalancedBalanced
UPSTREAM EMBEDDINGRecall@10.858±0.0020.839±0.0050.887±0.0010.858±0.0050.866±0.0030.848±0.0060.794±0.003
NMI0.898±0.0030.881±0.0040.915±0.0030.89±0.0050.903±0.0010.884±0.0050.849±0.001
\(U_{KL}\)0.151±0.0020.155±0.0030.083±0.0010.094±0.0030.304±0.0030.293±0.0030.397±0.009
DOWNSTREAM CLASSIFICATIONLRAccuracy0.886±0.0010.875±0.0050.898±0.0030.877±0.0050.885±0.0020.872±0.0040.828±0.004
Precision0.889±0.0010.878±0.0040.901±0.0020.879±0.0050.888±0.0020.874±0.0030.829±0.003
Recall0.885±0.0010.873±0.0050.898±0.0030.876±0.0050.883±0.0020.87±0.0040.825±0.003
RFAccuracy0.825±0.0040.794±0.0050.852±0.0030.823±0.0070.858±0.0030.836±0.0040.808±0.004
Precision0.831±0.0040.797±0.0060.857±0.0030.825±0.0080.861±0.0030.838±0.0040.811±0.004
Recall0.824±0.0040.793±0.0050.852±0.0030.823±0.0080.857±0.0030.835±0.0040.807±0.004
SVMAccuracy0.888±0.0010.876±0.0040.894±0.0020.871±0.0030.887±0.0020.878±0.0040.835±0.003
Precision0.893±0.0010.886±0.0040.902±0.0010.887±0.0030.892±0.0020.884±0.0040.839±0.003
Recall0.887±0.0010.876±0.0040.894±0.0020.871±0.0030.886±0.0030.877±0.0030.834±0.003
+ +Table 6: Overall results on CARS196. Metrics over entire test dataset in representation space and downstream classification (LR, RF, and SVM) over 10 seed in manually class imbalanced experiments (Imbalanced) and control experiments (Balanced) for CARS196. + +
Contrastive \(\cdot\)DistanceSubgroup Gap
BalancedImbalancedBalancedImbalancedBalancedImbalancedBalanced
UPSTREAM EMBEDDINGRecall@10.861±0.0030.83±0.0050.854±0.0020.819±0.0080.83±0.002
NMI-0.013±0.0040.106±0.013-0.016±0.0050.124±0.014-0.018±0.0060.11±0.016
\(U_{KL}\)-0.093±0.0040.011±0.011-0.033±0.0020.01±0.003-0.038±0.0060.012±0.005
DOWNSTREAM CLASSIFICATIONLRAccuracy0.002±0.0030.147±0.0230.003±0.0030.12±0.0130.004±0.0070.115±0.018
Precision0.336±0.0040.407±0.0130.355±0.0080.402±0.0130.353±0.0080.403±0.013
Recall0.351±0.0040.439±0.0160.368±0.0080.426±0.0150.367±0.0080.431±0.014
RFAccuracy0.001±0.0060.115±0.0210.002±0.0040.315±0.0220.002±0.0080.231±0.024
Precision0.358±0.0050.396±0.0130.374±0.0060.441±0.0130.362±0.0070.429±0.014
Recall0.373±0.0050.409±0.0150.387±0.0060.502±0.0130.376±0.0080.481±0.016
SVMAccuracy0.003±0.0040.086±0.0220.002±0.0030.039±0.0130.002±0.0060.055±0.018
Precision0.33±0.0060.332±0.0230.35±0.0080.283±0.0240.347±0.0110.328±0.018
Recall0.347±0.0040.338±0.0270.363±0.0080.27±0.0270.361±0.0110.327±0.018
MultisimilarityProxy-NCATriplet\(\cdot\)DistanceTriplet\(\cdot\)Semi-hard
BalancedImbalancedBalancedImbalancedBalancedImbalancedBalanced
UPSTREAM EMBEDDINGRecall@10.858±0.0020.839±0.0050.887±0.0010.858±0.0050.866±0.0030.848±0.0060.794±0.0030.778±0.006
NMI-0.014±0.0040.116±0.014-0.011±0.0040.148±0.014-0.013±0.0010.109±0.016-0.018±0.0020.083±0.015
\(U_{KL}\)-0.03±0.0030.005±0.004-0.129±0.0020.005±0.005-0.047±0.0050.011±0.006-0.034±0.0130.023±0.011
DOWNSTREAM CLASSIFICATIONLRAccuracy0.002±0.0020.117±0.0180.003±0.0050.155±0.0190.001±0.0040.004±0.0050.12±0.016
Precision0.352±0.0060.396±0.0140.334±0.0060.438±0.0120.343±0.0050.357±0.0040.392±0.009
Recall0.365±0.0060.418±0.0180.347±0.0060.46±0.0160.356±0.0050.431±0.0130.421±0.01
RFAccuracy0.0±0.0060.26±0.0230.221±0.0220.0±0.0040.168±0.0150.003±0.0050.141±0.02
Precision0.378±0.0050.441±0.0110.379±0.0050.458±0.010.361±0.0060.361±0.0040.393±0.012
Recall0.389±0.0050.485±0.0090.39±0.0050.476±0.0110.375±0.0060.45±0.0090.426±0.012
SVMAccuracy0.002±0.0020.047±0.0150.0±0.0030.076±0.0130.0±0.0040.063±0.0180.073±0.02
Precision0.349±0.0060.267±0.030.335±0.0060.29±0.0260.339±0.0070.297±0.030.364±0.015
Recall0.362±0.0050.258±0.0320.349±0.0060.273±0.0290.353±0.0070.295±0.030.368±0.006
+ +Table 7: Gap study on CARS196. Average gaps in representation space and downstream classification (LR, RF, and SVM) over 10 seeds between minoritized and majoritized classes in manually class imbalanced experiments (Imbalanced) and control experiments (Balanced) for CARS196. + +# C.2 CUB200 + +Additional results for all loss and batch mining strategies for the manually class imbalanced experiments and balanced controls for CUB200 are located in Tables 9 and 10. K-Means was also tested as a downstream classifier but showed poor performance. The impact of varying imbalance in the manually class imbalanced experiments in the upstream embedding, and all tested downstream classifiers is displayed in Table 9. Additional results for benchmarking of further fairness improvement methods + +Table 8: Benchmarking additional fairness improvement methods in downstream classification on CARS196 (Classes). Overall performance and subgroup gaps for Domain-Independent Training and Oversampling (Wang et al., 2020b) on CARS196 in class imbalanced experiments with upstream embedding trained on imbalanced dataset. +(a) Domain-Independent Training + +
METRIC ↓Contr. (D)Margin (D)Margin (Sem.)Msim.ProxyNCATriplet (D)Triplet (S)
Overall
ACCURACY0.812 ± 0.0110.834 ± 0.0090.820 ± 0.0080.842 ± 0.0080.869 ± 0.0050.836 ± 0.0070.742 ± 0.007
PRECISION0.834 ± 0.0090.861 ± 0.0040.847 ± 0.0040.872 ± 0.0040.878 ± 0.0050.865 ± 0.0090.804 ± 0.008
RECALL0.811 ± 0.0110.833 ± 0.0090.818 ± 0.0080.840 ± 0.0080.869 ± 0.0050.834 ± 0.0080.740 ± 0.008
Gap
ACCURACY0.001 ± 0.0270.010 ± 0.0180.017 ± 0.0210.018 ± 0.0180.120 ± 0.0180.022 ± 0.0170.094 ± 0.021
PRECISION0.304 ± 0.0210.275 ± 0.0210.313 ± 0.0190.247 ± 0.0270.398 ± 0.0150.236 ± 0.0220.289 ± 0.016
RECALL0.260 ± 0.0240.218 ± 0.0220.258 ± 0.0180.182 ± 0.0270.398 ± 0.0180.175 ± 0.0220.177 ± 0.016
+ +(b) Oversampling + +
METRIC ↓Contr. (D)Margin (D)Margin (Sem.)Msim.ProxyNCATriplet (D)Triplet (S)
Overall
ACCURACY0.851 ± 0.0070.862 ± 0.0040.853 ± 0.0060.875 ± 0.0040.878 ± 0.0040.875 ± 0.0050.820 ± 0.005
PRECISION0.854 ± 0.0060.864 ± 0.0040.855 ± 0.0060.877 ± 0.0040.880 ± 0.0050.876 ± 0.0040.822 ± 0.005
RECALL0.853 ± 0.0060.862 ± 0.0040.853 ± 0.0060.875 ± 0.0040.878 ± 0.0040.875 ± 0.0040.821 ± 0.005
Gap
ACCURACY0.128 ± 0.0230.099 ± 0.0140.102 ± 0.0200.097 ± 0.0190.136 ± 0.0170.108 ± 0.0180.109 ± 0.019
PRECISION0.398 ± 0.0120.386 ± 0.0170.391 ± 0.0140.383 ± 0.0150.422 ± 0.0140.387 ± 0.0130.387 ± 0.011
RECALL0.423 ± 0.0150.403 ± 0.0170.414 ± 0.0140.396 ± 0.0190.436 ± 0.0170.406 ± 0.0150.413 ± 0.012
+ +![](images/18d30b338812b67f6f9a72b285f00a702008aadc34aca7186578ae572574b129.jpg) +Figure 8: Impact of varying imbalance between the minoritized and majoritized classes on various downstream classifiers (RF, LR and SVM) in the manually class imbalanced CARS196 experiments. (Note: the imbalance percentage $50 - 50$ is equivalent to the balanced setting). Gaps increase for all classifiers downstream with more imbalance introduced to the upstream training data. + +![](images/71f4a1af991a0dd6aaa1fb2a14d26cee00f1d624bcbd0475588fd933e9eac6da.jpg) + +![](images/cf434fdf39d23855154e9adfd9a58f9d985132773fd229e1eb23542288f0a80f.jpg) +metric Precision Recall Accuracy + +in downstream classification of "imbalanced" embeddings (aside from naive use of balanced datasets) are shown in Table 11. Benchmarking of fairness improvement methods in downstream classification for bird color are shown in Table 12. Per-subgroup and overall results for CUB200 color experiments with standard margin-distance and PARADE are displayed in Table 13. + +# C.3 CELEBA + +Additional results for all loss and batch mining strategies for the CelebA dataset are located in Tables 14 and 15. Additional PARADE results for subgroup gaps excluding Fitzpatrick Skintone VI (as mentioned in Section 6.3) are located in Table 16. + +
Overall
Contrastive \(\cdot\)DistanceImbalanced\(\cdot\)DistanceMargin \(\cdot\)DistanceMargin \(\cdot\)Semi-hard
BalancedImbalancedBalancedImbalancedBalancedImbalancedImbalanced
UPSTREAM EMBEDDINGLRRecall@10.79 ± 0.0020.782 ± 0.0050.786 ± 0.0030.78 ± 0.0050.775 ± 0.0060.766 ± 0.006
NMI0.872 ± 0.0020.859 ± 0.0030.861 ± 0.0030.856 ± 0.0040.856 ± 0.0030.85 ± 0.005
\(U_{KL}\)0.397 ± 0.0030.449 ± 0.0070.076 ± 0.0010.076 ± 0.0010.113 ± 0.0030.113 ± 0.002
DOWNSTREAM CLASSIFICATIONRFAccuracy0.815 ± 0.0020.81 ± 0.0050.815 ± 0.0020.827 ± 0.0060.809 ± 0.0040.818 ± 0.005
Precision0.817 ± 0.0020.811 ± 0.0050.822 ± 0.0010.831 ± 0.0060.815 ± 0.0040.822 ± 0.005
Recall0.815 ± 0.0020.81 ± 0.0050.816 ± 0.0020.827 ± 0.0060.81 ± 0.0040.818 ± 0.005
SVMAccuracy0.776 ± 0.0020.787 ± 0.0070.757 ± 0.0030.735 ± 0.0090.768 ± 0.0020.758 ± 0.004
Precision0.785 ± 0.0030.793 ± 0.0060.762 ± 0.0030.737 ± 0.010.774 ± 0.0020.762 ± 0.004
Recall0.776 ± 0.0020.787 ± 0.0070.757 ± 0.0030.735 ± 0.0090.769 ± 0.0020.758 ± 0.004
Accuracy0.813 ± 0.0020.811 ± 0.0070.81 ± 0.0020.82 ± 0.0070.808 ± 0.0040.815 ± 0.004
Precision0.823 ± 0.0030.821 ± 0.0070.827 ± 0.0020.843 ± 0.0050.818 ± 0.0030.829 ± 0.004
Recall0.813 ± 0.0020.811 ± 0.0070.811 ± 0.0020.82 ± 0.0060.808 ± 0.0030.815 ± 0.004
Overall
MultisimilarityProxy-NCATriplet \(\cdot\) DistanceTriplet \(\cdot\) Semi-hard
BalancedImbalancedBalancedImbalancedBalancedImbalancedBalanced
UPSTREAM EMBEDDINGLRRecall@10.779 ± 0.0060.788 ± 0.0050.807 ± 0.0040.8 ± 0.0070.792 ± 0.0030.795 ± 0.0070.761 ± 0.004
NMI0.857 ± 0.0030.857 ± 0.0040.873 ± 0.0030.86 ± 0.0050.866 ± 0.0020.861 ± 0.0050.848 ± 0.005
\(U_{KL}\)0.139 ± 0.0010.146 ± 0.0020.056 ± 0.0010.073 ± 0.0010.274 ± 0.0050.277 ± 0.0050.336 ± 0.004
DOWNSTREAM CLASSIFICATIONAccuracy0.813 ± 0.0040.833 ± 0.0040.824 ± 0.0030.828 ± 0.0050.82 ± 0.0010.828 ± 0.0050.802 ± 0.003
Precision0.82 ± 0.0040.836 ± 0.0040.828 ± 0.0030.833 ± 0.0050.826 ± 0.0010.833 ± 0.0060.808 ± 0.003
Recall0.814 ± 0.0040.833 ± 0.0040.824 ± 0.0030.828 ± 0.0050.82 ± 0.0010.828 ± 0.0050.803 ± 0.003
RFAccuracy0.754 ± 0.0030.754 ± 0.0050.761 ± 0.0060.768 ± 0.0070.786 ± 0.0040.789 ± 0.0080.776 ± 0.003
Precision0.76 ± 0.0040.755 ± 0.0050.768 ± 0.0070.774 ± 0.0060.794 ± 0.0040.792 ± 0.0090.782 ± 0.003
Recall0.754 ± 0.0030.755 ± 0.0050.762 ± 0.0060.768 ± 0.0070.786 ± 0.0040.789 ± 0.0080.777 ± 0.003
SVMAccuracy0.812 ± 0.0020.828 ± 0.0060.818 ± 0.0020.816 ± 0.0050.819 ± 0.0020.83 ± 0.0050.798 ± 0.001
Precision0.825 ± 0.0030.848 ± 0.0050.834 ± 0.0020.852 ± 0.0040.829 ± 0.0030.845 ± 0.0040.806 ± 0.002
Recall0.812 ± 0.0020.828 ± 0.0060.819 ± 0.0020.817 ± 0.0050.819 ± 0.0020.831 ± 0.0050.798 ± 0.001
+ +Table 9: Overall results on CUB200. Metrics over entire test dataset in representation space and downstream classification (LR, RF, and SVM) over 10 seed in manually class imbalanced experiments (Imbalanced) and control experiments (Balanced) for CUB200. + +
Contrastive \(\cdot\)DistanceSubgroup Gap
BalancedImbalancedBalancedImbalancedBalancedImbalancedBalanced
UPSTREAM EMBEDDINGRecall@10.011 ± 0.0040.168 ± 0.0280.008 ± 0.0050.212 ± 0.0290.01 ± 0.0080.187 ± 0.031
NMI-0.009 ± 0.0020.109 ± 0.015-0.008 ± 0.0050.112 ± 0.012-0.009 ± 0.0030.092 ± 0.017
\(U_{KL}\)-0.112 ± 0.0040.004 ± 0.011-0.043 ± 0.0020.0 ± 0.002-0.05 ± 0.0040.002 ± 0.004
DOWNSTREAM CLASSIFICATIONLR Accuracy0.014 ± 0.0040.181 ± 0.0290.008 ± 0.0030.131 ± 0.0270.009 ± 0.0060.131 ± 0.031
Precision0.333 ± 0.0030.417 ± 0.0120.337 ± 0.0050.39 ± 0.0140.331 ± 0.0060.393 ± 0.015
Recall0.354 ± 0.0040.462 ± 0.0160.356 ± 0.0050.424 ± 0.0180.351 ± 0.0070.43 ± 0.016
RF Accuracy0.013 ± 0.0040.121 ± 0.0260.009 ± 0.0050.325 ± 0.0350.01 ± 0.0060.255 ± 0.031
Precision0.339 ± 0.0070.386 ± 0.0140.347 ± 0.0060.428 ± 0.0110.342 ± 0.0070.418 ± 0.014
Recall0.359 ± 0.0060.391 ± 0.0150.365 ± 0.0060.495 ± 0.010.362 ± 0.0070.478 ± 0.014
SVM Accuracy0.014 ± 0.0030.106 ± 0.0320.009 ± 0.0040.043 ± 0.0280.009 ± 0.0060.058 ± 0.029
Precision0.326 ± 0.0080.36 ± 0.0210.332 ± 0.0080.301 ± 0.0230.329 ± 0.0060.329 ± 0.017
Recall0.345 ± 0.0070.362 ± 0.0240.348 ± 0.0080.278 ± 0.0270.348 ± 0.0060.323 ± 0.02
MultisimilaritySubgroup Gap
BalancedImbalancedProxy-NCATriplet\(\cdot\) DistanceTriplet\(\cdot\) Semi-hard
BalancedImbalancedBalancedImbalancedBalanced
UPSTREAM EMBEDDINGRecall@10.008 ± 0.0090.187 ± 0.0310.01 ± 0.0050.256 ± 0.030.009 ± 0.0040.159 ± 0.0310.009 ± 0.0060.168 ± 0.036
NMI-0.008 ± 0.0040.113 ± 0.016-0.009 ± 0.0040.142 ± 0.015-0.007 ± 0.0030.103 ± 0.016-0.01 ± 0.0060.082 ± 0.016
\(U_{KL}\)-0.036 ± 0.002-0.003 ± 0.003-0.131 ± 0.003-0.012 ± 0.005-0.057 ± 0.006-0.004 ± 0.009-0.051 ± 0.0050.014 ± 0.011
DOWNSTREAM CLASSIFICATIONLR Accuracy0.009 ± 0.0060.141 ± 0.0320.007 ± 0.0050.169 ± 0.0270.011 ± 0.0020.179 ± 0.0310.011 ± 0.0050.134 ± 0.031
Precision0.337 ± 0.0080.391 ± 0.0160.337 ± 0.0050.428 ± 0.0180.335 ± 0.0050.41 ± 0.0140.336 ± 0.0060.384 ± 0.014
Recall0.356 ± 0.0080.427 ± 0.0190.356 ± 0.0060.455 ± 0.0190.355 ± 0.0040.459 ± 0.0160.357 ± 0.0060.426 ± 0.016
RF Accuracy0.009 ± 0.0060.282 ± 0.0340.009 ± 0.0090.214 ± 0.0260.01 ± 0.0050.192 ± 0.0350.011 ± 0.0040.175 ± 0.03
Precision0.348 ± 0.0060.428 ± 0.0110.355 ± 0.010.436 ± 0.0090.347 ± 0.0060.409 ± 0.0140.341 ± 0.0070.393 ± 0.013
Recall0.365 ± 0.0050.48 ± 0.0120.372 ± 0.010.443 ± 0.010.364 ± 0.0070.44 ± 0.0140.36 ± 0.0060.437 ± 0.015
SVM Accuracy0.009 ± 0.0030.048 ± 0.0270.009 ± 0.0030.063 ± 0.0260.011 ± 0.0030.071 ± 0.0270.012 ± 0.0020.082 ± 0.03
Precision0.335 ± 0.0050.307 ± 0.020.33 ± 0.0060.347 ± 0.0220.334 ± 0.0060.324 ± 0.0140.334 ± 0.0050.34 ± 0.012
Recall0.352 ± 0.0040.284 ± 0.0230.347 ± 0.0040.299 ± 0.0220.353 ± 0.0060.315 ± 0.0170.355 ± 0.0050.356 ± 0.014
+ +Table 10: Gap study on CUB200. Average gaps in representation space and downstream classification (LR, RF, and SVM) over 10 seeds between minoritized and majoritized classes in manually class imbalanced experiments (Imbalanced) and control experiments (Balanced) for CUB200. + +# C.4 LFW + +Additional results for all loss and batch mining strategies for the LFW dataset are located in Tables 18 and 19. Per-subgroup results for LFW to demonstrate worst-group performance for the "White" subgroup (as mentioned in Section 6.3) are located in Table 20. Benchmarking of fairness improvement methods in downstream classification for bird color are shown in Table 21. + +Table 11: Benchmarking additional fairness improvement methods in downstream classification on CUB200 (Classes). Overall performance and subgroup gaps for Domain-Independent Training and Oversampling (Wang et al., 2020b) on CUB200-2011 in class imbalanced experiments with upstream embedding trained on imbalanced dataset. +(a) Domain-Independent Training + +
METRIC ↓Contr. (D)Margin (D)Margin (Sem.)Msim.ProxyNCATriplet (D)Triplet (S)
Overall
ACCURACY0.782 ± 0.0080.809 ± 0.0040.794 ± 0.0050.805 ± 0.0040.823 ± 0.0060.798 ± 0.0050.749 ± 0.006
PRECISION0.805 ± 0.0110.840 ± 0.0060.827 ± 0.0050.847 ± 0.0050.836 ± 0.0060.842 ± 0.0050.806 ± 0.006
RECALL0.782 ± 0.0080.809 ± 0.0040.795 ± 0.0050.805 ± 0.0040.823 ± 0.0060.798 ± 0.0040.749 ± 0.005
Gap
ACCURACY0.034 ± 0.0330.003 ± 0.0300.014 ± 0.0310.024 ± 0.0310.140 ± 0.0300.024 ± 0.0300.077 ± 0.031
PRECISION0.340 ± 0.0240.304 ± 0.0310.301 ± 0.0220.264 ± 0.0280.410 ± 0.0220.262 ± 0.0320.270 ± 0.018
RECALL0.308 ± 0.0270.253 ± 0.0350.249 ± 0.0250.189 ± 0.0310.415 ± 0.0240.188 ± 0.0360.177 ± 0.021
+ +(b) Oversampling + +
METRIC ↓Contr. (D)Margin (D)Margin (Sem.)Msim.ProxyNCATriplet (D)Triplet (S)
Overall
ACCURACY0.811 ± 0.0050.828 ± 0.0050.818 ± 0.0040.832 ± 0.0050.828 ± 0.0050.829 ± 0.0060.806 ± 0.005
PRECISION0.814 ± 0.0050.831 ± 0.0050.822 ± 0.0040.835 ± 0.0050.833 ± 0.0050.832 ± 0.0060.811 ± 0.004
RECALL0.812 ± 0.0050.828 ± 0.0050.819 ± 0.0040.833 ± 0.0050.828 ± 0.0050.829 ± 0.0060.807 ± 0.005
Gap
ACCURACY0.182 ± 0.0270.131 ± 0.0280.129 ± 0.0300.142 ± 0.0350.170 ± 0.0260.177 ± 0.0320.135 ± 0.032
PRECISION0.421 ± 0.0110.386 ± 0.0150.391 ± 0.0160.391 ± 0.0160.428 ± 0.0160.409 ± 0.0150.385 ± 0.013
RECALL0.464 ± 0.0150.420 ± 0.0180.428 ± 0.0180.426 ± 0.0200.455 ± 0.0170.457 ± 0.0170.427 ± 0.015
+ +(a) Domain-Independent Training + +
METRIC ↓Margin (D)
Overall
ACCURACY0.490 ± 0.005
PRECISION0.896 ± 0.003
RECALL0.489 ± 0.006
Gap
ACCURACY0.426 ± 0.017
PRECISION0.185 ± 0.108
RECALL0.353 ± 0.108
+ +Table 12: Benchmarking additional fairness improvement methods in downstream classification on CUB200 (Color). Overall performance and subgroup gaps for Domain-Independent Training and Oversampling (Wang et al., 2020b) on CUB200-2011 in bird color experiments. + +
(b) Oversampling
METRIC ↓ | Margin (D)
Overall
ACCURACY0.802 ± 0.002
PRECISION0.816 ± 0.002
RECALL0.802 ± 0.002
Gap
ACCURACY0.143 ± 0.019
PRECISION0.323 ± 0.063
RECALL0.348 ± 0.064
+ +# C.5 EXPLORATION OF FAIRNESS - UTILITY TRADEOFF AND VARYING HYPERPARAMETERS IN PARADE + +We vary $\alpha_{SA}$ and $\rho$ in the PARADE objective to explore the relationship between the overall performance, subgroup gap, and worst-group performance in PARADE. As stated in the main paper, we optimize $\alpha_{SA}$ and $\rho$ via worst-group performance. Results of this analysis are displayed in Figure 12. We use our exploration to expound on how to optimize for $\alpha_{SA}$ and $\rho$ . As seen in Figure 12, a clear trend that inversely relates overall performance, and fairness as measured by subgroup gap and worst-group performance is seen for the uniformity metric, $U_{KL}$ over the grid of $\alpha_{SA}$ and $\rho$ values (Note that higher values of $U_{KL}$ correspond to worse performance). Recall@1 and NMI demonstrate noisier relationships between overall performance and fairness; and several $\alpha_{SA}$ , $\rho$ choices appear to select an optimal tradeoff. In Figure 12, for Recall@1, we observe that at the location $\alpha_{SA} = 0.1$ , $\rho = 500$ . In the optimization grid, PARADE reaches peak overall performance and fairness (measured by low subgroup gap and high performance for the worst-performing subgroup) simultaneously. Thus, we could conclude that this choice of $\alpha_{SA}$ and $\rho$ represents an optimal tradeoff for utility and fairness + +
Coloroveralloverallblackblackbluebluebrownbrown
MethodParadeMargin (D)ParadeMargin (D)ParadeMargin (D)ParadeMargin (D)
Recall@10.785 ± 0.0030.786 ± 0.0030.780 ± 0.0060.777 ± 0.0050.837 ± 0.0160.841 ± 0.0100.773 ± 0.0050.779 ± 0.008
NMI0.860 ± 0.0010.861 ± 0.0030.832 ± 0.0050.837 ± 0.0040.840 ± 0.0250.863 ± 0.0260.831 ± 0.0130.838 ± 0.007
\(U_{KL}\)0.071 ± 0.0020.076 ± 0.0010.164 ± 0.0020.153 ± 0.0030.296 ± 0.0040.275 ± 0.0070.156 ± 0.0040.148 ± 0.003
Precision0.819 ± 0.0030.822 ± 0.0010.403 ± 0.0070.412 ± 0.0160.399 ± 0.0530.401 ± 0.0220.396 ± 0.0050.390 ± 0.016
Recall0.812 ± 0.0030.816 ± 0.0020.375 ± 0.0070.384 ± 0.0140.367 ± 0.0520.366 ± 0.0220.357 ± 0.0080.351 ± 0.016
Accuracy0.812 ± 0.0030.815 ± 0.0020.790 ± 0.0090.798 ± 0.0040.867 ± 0.0090.877 ± 0.0110.804 ± 0.0010.812 ± 0.006
Colorbuffbuffgreengreengreygreyiridescentiridescent
MethodParadeMargin (D)ParadeMargin (D)ParadeMargin (D)ParadeMargin (D)
Recall@10.787 ± 0.0080.792 ± 0.0061.000 ± 0.0001.000 ± 0.0000.751 ± 0.0150.754 ± 0.0101.000 ± 0.0001.000 ± 0.000
NMI0.789 ± 0.0050.808 ± 0.015-0.000 ± 0.000-0.000 ± 0.0000.853 ± 0.0090.849 ± 0.0041.000 ± 0.0000.800 ± 0.447
\(U_{KL}\)0.349 ± 0.0030.343 ± 0.0040.262 ± 0.0240.252 ± 0.0210.142 ± 0.0050.137 ± 0.0020.369 ± 0.0130.318 ± 0.017
Precision0.250 ± 0.0060.253 ± 0.0131.000 ± 0.0001.000 ± 0.0000.337 ± 0.0140.338 ± 0.0221.000 ± 0.0001.000 ± 0.000
Recall0.209 ± 0.0050.212 ± 0.0121.000 ± 0.0001.000 ± 0.0000.292 ± 0.0130.297 ± 0.0211.000 ± 0.0001.000 ± 0.000
Accuracy0.824 ± 0.0030.824 ± 0.0111.000 ± 0.0001.000 ± 0.0000.790 ± 0.0070.796 ± 0.0061.000 ± 0.0001.000 ± 0.000
Coloroliveorangeorangeredredwhitewhiteyellow
MethodMargin (D)ParadeMargin (D)ParadeMargin (D)ParadeMargin (D)Parade
Recall@10.620 ± 0.0870.839 ± 0.0100.863 ± 0.0400.917 ± 0.0180.919 ± 0.0170.729 ± 0.0120.706 ± 0.0110.846 ± 0.003
NMI0.000 ± 0.0000.701 ± 0.0600.657 ± 0.0360.839 ± 0.0320.830 ± 0.0330.792 ± 0.0080.787 ± 0.0100.842 ± 0.011
\(U_{KL}\)0.151 ± 0.0050.295 ± 0.0040.277 ± 0.0090.445 ± 0.0030.411 ± 0.0110.176 ± 0.0030.166 ± 0.0030.215 ± 0.005
Precision0.240 ± 0.0630.302 ± 0.0270.303 ± 0.0790.555 ± 0.0520.559 ± 0.0480.387 ± 0.0180.380 ± 0.0120.530 ± 0.022
Recall0.160 ± 0.0490.261 ± 0.0240.263 ± 0.0760.542 ± 0.0530.544 ± 0.0490.357 ± 0.0180.342 ± 0.0110.481 ± 0.011
Accuracy0.660 ± 0.0600.867 ± 0.0170.860 ± 0.0280.923 ± 0.0170.927 ± 0.0090.752 ± 0.0040.737 ± 0.0020.879 ± 0.001
+ +![](images/005744dbeecdb2c376a44d9de2b748e4dcac22bd6340f1ce0797ef20aba97dfe.jpg) +Figure 9: Impact of varying imbalance between the minoritized and majoritized classes on various downstream classifiers (RF, LR and SVM) in the manually class imbalanced CUB200 experiments. (Note: the imbalance percentage $50 - 50$ is equivalent to the balanced setting). Gaps increase for all classifiers downstream with more imbalance introduced to the upstream training data. + +![](images/8f3850e2e008a933242ba104f5fd438b3b168a2fe5d269f5e8ba729c49133a4b.jpg) + +![](images/703381e53410c6f06f34576a1cdb65be168ca5d5d578a2b0ad9033e98c090c34.jpg) +metric Precision Recall Accuracy + +Table 13: Absolute performance for all CUB200 subgroups. Metrics over each bird color subgroup in the CUB200 test dataset respectively, in representation space and downstream classification (logistic regressor) over 3 seeds for standard methods and PARADE in CUB200. + +
ArcfaceOverallN-Pair · N-Pair
PARADEStandardMargin · Distance
UPSTREAM EMBEDDINGRecall@10.897 ± 0.0020.888 ± 0.0020.885 ± 0.0020.922 ± 0.0010.11 ± 0.002
NMI0.91 ± 0.00.902 ± 0.0010.901 ± 0.0030.929 ± 0.00.61 ± 0.0
\(U_{KL}\)0.019 ± 0.0010.017 ± 0.00.336 ± 0.0130.237 ± 0.0062.595 ± 0.055
DOWNSTREAM CLASSIFICATION LRAccuracy0.891 ± 0.00.89 ± 0.0010.692 ± 0.0040.831 ± 0.0020.017 ± 0.0
Precision0.721 ± 0.00.721 ± 0.0010.55 ± 0.0030.652 ± 0.0030.004 ± 0.0
Recall0.74 ± 0.00.741 ± 0.0010.546 ± 0.0030.674 ± 0.0030.011 ± 0.0
+ +Table 14: Overall results on CelebA. Metrics over entire test dataset in representation space and downstream classification (logistic regressor) over 3 seeds for standard methods and PARADE in CelebA. + +in PARADE as measured by Recall@1. By the other displayed metrics, we see that $\alpha_{SA} = 0.1$ , $\rho = 500$ . demonstrates a reasonable utility-fairness tradeoff. Therefore, the choice of $\alpha_{SA} = 0.1$ , $\rho = 500$ . would be optimal for PARADE in CUB200 bird color setting. Note that the choice of where to operate within this trade-off should depend on the application that is being targeted. For + +
ArcfaceSubgroup GapN-Pair · N-Pair
PARADEStandardMargin · Distance
UPSTREAM EMBEDDINGRecall@10.135 ± 0.0080.128 ± 0.0030.085 ± 0.0090.122 ± 0.005-0.023 ± 0.013
NMI-0.003 ± 0.004-0.01 ± 0.002-0.012 ± 0.003-0.002 ± 0.003-0.102 ± 0.002
\(U_{KL}\)-0.054 ± 0.003-0.052 ± 0.003-0.04 ± 0.011-0.03 ± 0.007-0.015 ± 0.038
DOWNSTREAM CLASSIFICATIONLR Accuracy0.068 ± 0.0020.069 ± 0.0020.131 ± 0.0060.082 ± 0.0050.006 ± 0.002
Precision0.087 ± 0.0030.087 ± 0.0040.146 ± 0.0060.1 ± 0.0070.001 ± 0.001
Recall0.084 ± 0.0020.083 ± 0.0030.141 ± 0.0070.098 ± 0.0070.002 ± 0.001
+ +Table 15: Gap study on CelebA. Average gaps in representation space and downstream classification (logistic regressor) over 3 seeds between minoritized and majoritized classes (Fitzpatrick Skintone) for standard methods and PARADE in CelebA. + +
Margin · Distance
PARADEStandard
UPSTREAMRecall@1-0.035 ± 0.0060.005 ± 0.004
EMBEDDINGNMI-0.004 ± 0.0030.004 ± 0.002
\(U_{KL}\)0.04 ± 0.0110.084 ± 0.006
DOWNSTREAMPrecision0.021 ± 0.0060.039 ± 0.002
CLASSIFICATION (LR)Recall0.018 ± 0.0060.029 ± 0.002
Accuracy0.011 ± 0.0050.018 ± 0.002
+ +Table 16: Gap study on CelebA excluding Fitzpatrick Skintone VI. Average gaps in representation space and downstream classification (logistic regressor) over 3 seeds between minoritized and majoritized classes (Fitzpatrick Skintone) where the darkest skintone (VI) is excluded for standard methods and PARADE in CelebA. + +
SkintonesOverallOverallSkintone 1Skintone 1Skintone 2Skintone 2Skintone 3
MethodParadeMargin (D)ParadeMargin (D)ParadeMargin (D)Parade
Recall@10.885 ± 0.0020.922 ± 0.0010.738 ± 0.0050.858 ± 0.0110.887 ± 0.0040.930 ± 0.0010.907 ± 0.001
NMI@10.901 ± 0.0030.929 ± 0.0000.933 ± 0.0070.961 ± 0.0000.923 ± 0.0040.947 ± 0.0010.927 ± 0.002
\(U_{\text{KL}}\)0.336 ± 0.0130.237 ± 0.0060.436 ± 0.0200.419 ± 0.0020.350 ± 0.0140.260 ± 0.0040.350 ± 0.012
Precision0.550 ± 0.0030.652 ± 0.0030.398 ± 0.0110.639 ± 0.0050.566 ± 0.0030.696 ± 0.0020.558 ± 0.003
Recall0.546 ± 0.0030.674 ± 0.0030.421 ± 0.0140.656 ± 0.0050.604 ± 0.0030.739 ± 0.0030.578 ± 0.003
Accuracy0.692 ± 0.0040.831 ± 0.0020.578 ± 0.0090.783 ± 0.0040.707 ± 0.0040.843 ± 0.0020.716 ± 0.004
SkintonesSkintone 3Skintone 4Skintone 4Skintone 5Skintone 5Skintone 6Skintone 6
MethodMargin (D)ParadeMargin (D)ParadeMargin (D)ParadeMargin (D)
Recall@10.937 ± 0.0030.850 ± 0.0020.893 ± 0.0030.785 ± 0.0170.838 ± 0.0040.642 ± 0.0180.628 ± 0.006
NMI@10.947 ± 0.0010.927 ± 0.0020.946 ± 0.0000.943 ± 0.0020.957 ± 0.0040.948 ± 0.0040.960 ± 0.009
\(U_{\text{KL}}\)0.241 ± 0.0060.339 ± 0.0120.240 ± 0.0080.371 ± 0.0120.288 ± 0.0130.547 ± 0.0100.483 ± 0.014
Precision0.672 ± 0.0030.471 ± 0.0050.644 ± 0.0030.355 ± 0.0110.570 ± 0.0010.258 ± 0.0050.492 ± 0.021
Recall0.708 ± 0.0030.518 ± 0.0050.695 ± 0.0020.386 ± 0.0110.602 ± 0.0010.275 ± 0.0050.511 ± 0.019
Accuracy0.842 ± 0.0030.632 ± 0.0050.798 ± 0.0020.545 ± 0.0090.747 ± 0.0020.430 ± 0.0100.678 ± 0.015
+ +Table 17: Absolute performance for all CelebA subgroups. Metrics over each Fitzpatrick Skintone subgroup in the CelebA test dataset respectively, in representation space and downstream classification (logistic regressor) over 3 seeds for standard methods and PARADE in CelebA. + +example, here we use Recall@1 to determine the optimal choice of hyperparameters and validate with the other two considered metrics. However, for LFW, which has a high population of singleton classes (see Figure 7), NMI would be a better metric to use for selecting optimal point. + +# D IMPLEMENTATION DETAILS + +# D.1 DATASET ATTRIBUT INFORMATION + +Dataset manipulation for the CARS196 and CUB200 manually class imbalanced experiments is explained in Section 3.3. + +![](images/b0a93a5b72fffb8a8af790fae041838bc6baebeca7c6766110d617e298f42715.jpg) +Figure 10: A t-SNE (Maaten & Hinton, 2008) visualization of the two distinct PARADE embeddings for Fitzpatrick Skintone CelebA experiments: the sensitive attribute embedding (left) and the class label embedding (right). + +![](images/6b930f66bac8015f1cfcad12e79d1d9455bf34b3974ce23f73d7a9fcfd7c394c.jpg) + +
ArcfaceOverallN-Pair · N-Pair
PARADEStandardMargin · DistanceStandard
UPSTREAM EMBEDDINGRecall@10.268 ± 0.010.306 ± 0.0080.329 ± 0.0020.381 ± 0.0040.187 ± 0.006
NMI0.849 ± 0.0050.859 ± 0.0020.865 ± 0.0010.869 ± 0.0010.854 ± 0.001
\(U_{KL}\)0.118 ± 0.0210.089 ± 0.0140.129 ± 0.0010.103 ± 0.0011.815 ± 0.011
DOWNSTREAM CLASSIFICATIONRFAccuracy0.8 ± 0.00.804 ± 0.0170.762 ± 0.0020.8 ± 0.003
Precision0.789 ± 0.0030.793 ± 0.0160.767 ± 0.0010.788 ± 0.004
Recall0.827 ± 0.00.831 ± 0.0150.801 ± 0.0030.823 ± 0.003
0.913 ± 0.002
+ +Table 18: Overall results on LFW. Metrics over entire test dataset in representation space and downstream classification (random forest) over 3 seeds for standard methods and PARADE in LFW. Note: Due to the number of singleton classes in LFW, Recall@1 is not considered a good metric of performance for this dataset. + +
ArcfaceSubgroup GapN-Pair · N-Pair
PARADEStandardMargin · Distance
UPSTREAM EMBEDDINGRecall@10.039 ± 0.0170.061 ± 0.0170.075 ± 0.0140.068 ± 0.0130.054 ± 0.01
NMI0.048 ± 0.0110.057 ± 0.0030.041 ± 0.0030.048 ± 0.0030.048 ± 0.003
\(U_{KL}\)0.176 ± 0.0190.157 ± 0.0110.163 ± 0.0030.165 ± 0.0050.357 ± 0.012
DOWNSTREAM CLASSIFICATIONRFAccuracy0.04 ± 0.010.038 ± 0.0120.049 ± 0.0050.038 ± 0.005
Precision0.036 ± 0.0180.041 ± 0.0140.04 ± 0.0050.037 ± 0.007
Recall0.066 ± 0.0170.076 ± 0.0150.066 ± 0.0060.071 ± 0.007
+ +Table 19: Gap study on LFW. Average gaps in representation space and downstream classification (random forest) over 3 seeds between minoritized and majoritized classes (Race) for standard methods and PARADE in LFW. + +
AsianBlackIndianWhite
PARADEStandardPARADEStandardPARADEStandardPARADEStandard
UPSTREAM EMBEDDINGRecall@10.262 ± 0.0280.31 ± 0.0140.289 ± 0.0110.331 ± 0.0160.238 ± 0.0270.325 ± 0.0320.338 ± 0.0040.39 ± 0.004
NMI0.894 ± 0.0030.914 ± 0.0050.858 ± 0.0010.882 ± 0.0050.948 ± 0.0070.951 ± 0.0070.862 ± 0.0010.868 ± 0.0
\( U_{KL} \)0.304 ± 0.0030.265 ± 0.0030.456 ± 0.0090.417 ± 0.0130.141 ± 0.0020.133 ± 0.0050.137 ± 0.0020.107 ± 0.001
DOWNSTREAM CLASSIFICATIONRF Accuracy0.81 ± 0.0070.828 ± 0.0080.827 ± 0.0050.853 ± 0.0070.772 ± 0.0110.814 ± 0.0120.754 ± 0.0020.794 ± 0.003
Precision0.715 ± 0.0120.726 ± 0.0130.743 ± 0.0080.759 ± 0.0140.664 ± 0.0060.711 ± 0.010.747 ± 0.0020.769 ± 0.004
Recall0.713 ± 0.0130.72 ± 0.0140.751 ± 0.0080.758 ± 0.010.657 ± 0.0080.702 ± 0.0110.773 ± 0.0020.798 ± 0.003
+ +Table 20: Absolute performance for all LFW subgroups. Metrics over each Race subgroup in the LFW test dataset respectively, in representation space and downstream classification (random forest) over 3 seeds for standard methods and PARADE in LFW. + +For CUB200 bird color experiments, we utilized the labeled bird color attributes from Wah et al. (2011). Each image can have multiple "primary color" labels. Therefore, we take the mode over + +Table 21: Benchmarking additional fairness improvement methods in downstream classification on LFW. Overall performance and subgroup gaps for Domain-Independent Training and Oversampling (Wang et al., 2020b) on LFW with Race attribute. +(a) Domain-Independent Training + +
METRIC ↓ArcFaceMargin (D)N-Pair
Overall
ACCURACY0.759 ± 0.0170.753 ± 0.0020.861 ± 0.005
PRECISION0.793 ± 0.0100.786 ± 0.0030.872 ± 0.003
RECALL0.799 ± 0.0120.792 ± 0.0030.889 ± 0.003
Gap
ACCURACY0.093 ± 0.0110.095 ± 0.0060.029 ± 0.009
PRECISION0.030 ± 0.0110.020 ± 0.0090.029 ± 0.010
RECALL0.040 ± 0.0120.044 ± 0.0080.026 ± 0.010
+ +(b) Oversampling + +
METRIC ↓ArcFaceMargin (D)N-Pair
Overall
ACCURACY0.775 ± 0.0170.767 ± 0.0040.881 ± 0.004
PRECISION0.771 ± 0.0140.762 ± 0.0020.873 ± 0.005
RECALL0.815 ± 0.0140.807 ± 0.0020.909 ± 0.004
Gap
ACCURACY0.070 ± 0.0120.072 ± 0.0060.032 ± 0.006
PRECISION0.020 ± 0.0130.024 ± 0.0090.027 ± 0.009
RECALL0.023 ± 0.0130.031 ± 0.0110.036 ± 0.008
+ +![](images/7b218475325f6e07f1f7553bb968d27bf32e529557a0e645a168176d201af7ca.jpg) +Figure 11: A t-SNE (Maaten & Hinton, 2008) visualization of the two distinct PARADE embeddings for Race LFW experiments: the sensitive attribute embedding (left) and the class label embedding (right). + +![](images/9f64f77b4b6e531d12858e6b9f92ad1844aad5096b051e060a708a756ff001e0.jpg) + +
DatasetProtected AttributeProtected Attribute Values
CUB200-2011ColorBlack, Blue, Brown, Buff, Green, Grey, Iridescent Olive, Orange, Red, White, Yellow
CelebAFitzpatrick Skintone CategoryI, II, III, IV, V, VI
LFWRaceAsian, Black, Indian, White
+ +Table 22: Summarizing attribute information. Protected attribute examined and associated values taken by the protected attribute in each dataset analyzed w.r.t. a sensitive attribute in the main paper (CUB200, CelebA, LFW). + +all bird colors labeled for each image in order to determine a single bird color associated with the image. For CelebA, we calculate the Fitzpatrick skintone based on the image pixel information for each image. The calculation is described in Section D.2. For LFW, we construct the "Race" attribute from labels of "White", "Black", "Asian," and "Indian" as labelled by Kumar et al. (2009). For each of these attributes, the labelling provided by Kumar et al. (2009) has a float value, which we map to binary values: the image is considered to have the attribute if the value is greater than 0, and the image is considered to not have the attribute if the value is less than 0. Naturally, the labelling is not necessarily correct for each image, as the confidence about the "Race" labelling can be quite low for some images. We remove all images without at least one of these attributes, though we note that these attributes do not encompass all races. Therefore, our analysis may not be relevant for other races not labelled by Kumar et al. (2009). + +![](images/fcf32b09dd131242a91f41422a7b37829ee8183ead95fef0c34cd9ceaed26eb4.jpg) + +![](images/75b80e943b72690ceb9d32f1bca06831d63d0c06718cfc0aa3b2a68fbdeed50f.jpg) + +![](images/16d97f884bba3934cac7ae9043f998c3d6ddf94e767dc64843c9b649e0e10dc3.jpg) + +![](images/eea5a6ec0a1402712789cedbd08a2d9a57b5be22adbdee48e7a7db37cd62306f.jpg) + +![](images/05171ad2267e1eb9bccef6e31183a610e5e4ae875f70942a1a5940a8658db0b3.jpg) + +![](images/01f40f8ce3ce2b11c31346f22e3415d40293269b1f22660153862ed9047cf38a.jpg) + +![](images/e82ec27d6c023f68abf26bb0b22c826a2c2dcf4ed824b678221ff695270c2009.jpg) +Figure 12: Exploring fairness-utility tradeoffs in PARADE on CUB200 over grid of $\alpha_{SA}$ and $\rho$ values. Overall performance (left column), subgroup gap (middle column) and worst-group performance (right column) over metrics Recall@1 (top row), NMI (middle row), and $U_{KL}$ (bottom row) in PARADE on CUB200. $\alpha_{SA}$ and $\rho$ in PARADE objective (Section 4) varied from 0.1 to 0.9, and 1 to 3000, respectively. + +![](images/c29733a814f35f129e33d86d8b6d8fdcceb34ddde75c812270570ed76a6b525e.jpg) + +![](images/fe696eaef56b197100bbf67d07151fc6ade83ac3f663f099c87574baf68a5a8c.jpg) + +# D.2 FITZPATRICK SKINTONE CALCULATION + +We follow the methods from Cheng et al. (2021) for calculation of Fitzpatrick Skintone based on image pixel information. However, we calculate these values for CelebA, as opposed to CelebAHQ. As CelebA-HQ incorporates higher resolution images, but has fewer images, our process of Fitzpatrick Skintone calculation on CelebA is slightly modified to account for lower resolution, and differing image size. + +In Cheng et al. (2021), two sample skin patches are selected from each image of CelebA-HQ to determine the skintone. We select three sample skin patches, as we are forced to reduce the dimensions of the patches to account for the smaller image size of CelebA. Additionally, we leverage facial landmark attributes provided by CelebA Liu et al. (2015) in order to choose our sample patches. Specifically, given the $(x,y)$ landmarks for the left eye, right eye, and nose for each image, we choose to sample square patches of size $20\times 20$ (all 3 color channels are selected) with the following center points: + +$$ +(x _ {\text {l e f t e y}}, y _ {\text {n o s e}}) +$$ + +$$ +(x _ {\text {r i g h t e y}}, y _ {\text {n o s e}}) +$$ + +$$ +(x _ {\text {n o s e}}, y _ {\text {n o s e}}) +$$ + +The first two center points are intended to capture the likely location of the left and right cheeks, respectively, as these are likely located below each eye and adjacent to the nose. The last center point is the nose. We note that this protected attribute generation is not perfect. In some cases, such label generation can accidentally use aspects of the background, if, the individual's face position in the image is not facing forward. Also, extreme lighting can lead to misclassification of skintone. Nonetheless, we believe the procedure provides a good approximation of Fitzpatrick skintone category, but do not recommend these attribute labels for use outside of fairness analysis. + +The selected sample patches are converted to CIELab-space to retrieve the $L$ (luminance) and $b$ (yellow) values. We then calculate the Mean Individual Typology Angle (ITA) value: + +$$ +I T A = \arctan \left(\frac {L - 5 0}{b}\right) \times \frac {1 8 0 ^ {\circ}}{\pi} +$$ + +Table 23: Fitzpatrick Skin Tone Categories corresponding to Mean ITA values, information taken from Cheng et al. (2021) + +
ITA RangeFitzpatrick CategoryDescription
50 ≤ ITAIExtremely Light
40 ≤ ITA < 50IIVery Light
30 ≤ ITA < 40IIILight / Somewhat Light
20 ≤ ITA < 30IVDark / Somewhat Dark
10 ≤ ITA < 20VVery Dark
ITA < 10VIExtremely Dark
+ +Based on the Mean ITA calculation, we classify each image into one of the 6 Fitzpatrick skintone categories, as listed in Table 23. To calculate subgroup gaps, we calculate gaps between the mean value over the 3 lightest Fitzpatrick skintones and the mean value over the 3 darkest Fitzpatrick skintones. + +# D.3 TRAINING PARAMETERS + +For CUB200 and CARS196, we did not perform hyperparameter search but followed reported hyperparameters from Roth et al. (2020c) for best performance with an ImageNet Deng et al. (2009) pretrained ResNet50 He et al. (2016) and frozen batch normalization layers. As detailed in Roth et al. (2020c), we train for 150 epochs with embedding dimension 128, learning rate 0.00001 with no scheduler, and weight decay 0.0004. We train with a batch size of 128, with the Adam optimizer Kingma & Ba (2015) over five seeds inclusive for the balance control datasets, and for CUB200 color experiments; and seeds $0 - 9$ for the manually class imbalanced experiments. For training transforms, we normalize each image using color channel means (0.485, 0.456, 0.406) and standard deviations (0.229, 0.224, 0.225), randomly crop the image and re-size to $224 \times 224$ and horizontally flip with probability 0.5. For testing transforms, we normalize each image with the aforementioned color channel means and standard deviations, resize to $256 \times 256$ , and center crop to $224 \times 224$ . + +For CelebA and LFW, we performed hyperparameter search over the following hyperparameters: architectures: ResNet50 He et al. (2016), and SE-Net50 (both with and without frozen batch normalization layers); number of training epochs; learning rates; last linear layer learning rate (differ from other layer learning rates); learning rate schedulers; embedding dimensions: 64, 128, 256; pre-training; image augmentations. We evaluated hyperparameter sets on a validation set we cut from the typical training set (20% of training set), and chose the set of hyperparameters with best recall@k score for CelebA and best NMI score for LFW. NMI is used for LFW due to the high number of singleton classes present in the dataset (recall@1 is meaningless for singleton classes). + +For CelebA, we train on the ResNet50 He et al. (2016) architecture with frozen batch normalization layers, for 125 epochs with learning rate 0.00001, and no scheduler, weight decay 0.0004, Adam Kingma & Ba (2015) optimizer, and batch size of 128. For training transforms, we normalize each image using color channel means $(0.5, 0.5, 0.5)$ and standard deviations $(0.5, 0.5, 0.5)$ , resize to $256 \times 256$ , center crop to $224 \times 224$ and horizontally flip with probability 0.5. For testing transforms, we normalize each image with the aforementioned color channel means and standard deviations, resize to $256 \times 256$ , and center crop to $224 \times 224$ . We average over runs with seeds $0 - 2$ , inclusive. + +For LFW, we train on the ResNet50 He et al. (2016) architecture with frozen batch normalization layers, for 125 epochs with initial learning rate 0.00001 for all model parameters except the last linear layer, which has initial learning rate 0.0001, and a multi-step learning rate scheduler which reduces the learning rate by a factor of 0.3 at epochs 50 and 100, weight decay 0.0004, Adam Kingma & Ba + +(2015) optimizer, and batch size of 64. For training transforms, we normalize each image using color channel means $(0.5, 0.5, 0.5)$ and standard deviations $(0.5, 0.5, 0.5)$ , resize to $256 \times 256$ , center crop to $224 \times 224$ and horizontally flip with probability 0.5. For testing transforms, we normalize each image with the aforementioned color channel means and standard deviations, resize to $256 \times 256$ , and center crop to $224 \times 224$ . We average over runs with seeds $0 - 2$ , inclusive. + +For each dataset we chose a set of loss and batch mining strategies that have historically been used for the relevant task, encompassing a broad range of methods, and / or achieved good performance. However, for n-pair loss and sampling, good performance was not achieved for the facial datasets despite use in the past for facial recognition Sohn (2016). For manually class imbalanced experiments with CARS196 and CUB200 and the associated balanced controls, we used: margin loss / distance-weighted sampling, margin loss / semi-hard sampling, triplet loss / distance-weighted sampling, triplet loss / semi-hard sampling, contrastive loss / distance-weighted sampling, multisimilarity loss, and proxy-NCA loss. For the color experiments with CUB200, we used: margin loss / distance-weighted sampling. For CelebA and LFW, we used: margin loss / distance-weighted sampling, arcface loss, and n-pair loss and sampling. For all testing and evaluation experiments with PARADE, we used margin loss and distance-weighted sampling, but PARADE can be used with any loss and mining strategy. + +DML-specific parameters Here we list the hyperparameters that we use for each evaluated loss function and batch mining strategy, if applicable. Refer to A for explicit formulas associated with the parameters here. We set $\gamma = 0.2$ in semi-hard mining. For distance-weighted mining, we set $\lambda = 0.5$ and clip the maximum distance to 1.4. In the triplet objective, we use $\gamma = 0.2$ for triplet loss. For margin loss, the learning rate of the boundary $\beta$ is set to 0.0005, with initial value 1.2 and triplet margin $\gamma = 0.2$ . For N-Pair uses embedding regularization parameter $\nu = 0.005$ . In Multisimilarity loss, we use $\alpha = 2$ , $\beta = 40$ , $\lambda = 0.5$ and $\epsilon = 0.1$ . Finally, for ArcFace, additive angular margin penalty is set to $\gamma = 0.5$ , while scaling parameter $s = 16$ and class centers are optimized with learning rate 0.0005. + +The two PARADE parameters, $\alpha_{SA}$ and $\rho$ , as described in Section 4, were optimized via worst-group performance over a grid search. For CUB200, we set $\alpha_{SA} = 0.3$ , $\rho = 1500$ . For CelebA, we set $\alpha_{SA} = 0.1$ , $\rho = 1000$ . For LFW, we set $\alpha_{SA} = 0.3$ , $\rho = 100$ . + +# D.4 FAIRNESS EVALUATION + +For each dataset, we calculate subgroup gaps between the majoritized and minoritized subgroup (CARS196, CUB200 class, CelebA) or between the worst-performing subgroup and other subgroups (LFW). In CUB200 color experiments, due to the large number of subgroups, we calculate the gap between the top 6 performing subgroups and the bottom 6 performing subgroups (there are 12 total subgroups). + +Upstream In the upstream embedding tasks, in which we denote $\phi$ as the embedding function for the learned model, and use $A(x)$ to denote the value of the attribute $A$ for data point $x$ , we calculate recall@1 for data samples in $X$ with associated class label $Y$ and attribute $a \in A$ as: + +$$ +\operatorname {Recall} @ \mathrm {k} = \frac {1}{| \{x \in X : A (x) = a \} |} \sum_ {\{x \in X: A (x) = a \}} \left\{ \begin{array}{l l} 1 & \exists \tilde {x} \in N N _ {k} (x): Y (\tilde {x}) = Y (x) \\ 0 & \text {e l s e} \end{array} \right. +$$ + +Note here that the nearest neighbors function is computed with respect to all $x \in X$ , not exclusively $x \in X$ with attribute $a \in A$ , but the input to the nearest neighbors function is exclusively $\{x \in X : A(x) = a\}$ . To calculate NMI, let $\mathcal{C}$ be the output of a clustering algorithm $C$ on the entire dataset $X$ , i.e. $\mathcal{C} = C(X)$ and let $\mathcal{C}|_{S}$ denote the output of clustering algorithm $C$ restricted to some subset $S \subset X$ . The important note here is that the clustering algorithm is run over the entire dataset, but $\mathcal{C}|_{S}$ expresses the cluster labels only for $S \subset X$ . Then, we measure NMI for data samples in $X$ with associated class label $Y$ and attribute $a \in A$ as: + +$$ +N M I = \frac {I (Y (\{x \in X : A (x) = a \}) ; \mathcal {C} | _ {\{x \in X : A (x) = a \}})}{H (Y (\{x \in X : A (x) = a \})) + H (\mathcal {C} | _ {\{x \in X : A (x) = a \}})} +$$ + +We calculate $U_{\mathrm{KL}}$ for data samples in $X$ with attribute $a \in A$ as: + +$$ +U _ {\mathrm {K L}} (X) = \mathcal {D} _ {\mathrm {K L}} \left(\mathcal {U} _ {\mathrm {D}}, \mathcal {S} _ {\phi (\{x \in X: A (x) = a \})}\right) +$$ + +where $S_{\phi (\{x\in X:A(x) = a\})}$ denotes the singular values over $\phi (\{x\in X:A(x) = a\})$ + +Downstream In the downstream tasks, for data samples in $X$ with class label $Y$ , and predictor $\hat{Y}$ , let $Y(x)$ express the value of the ground-truth label for data sample $x$ and let $\hat{Y}(x)$ express the value of the predicted label. Then, we denote $TP_{a}^{(y)}$ the number of true positives with attribute $a \in A$ : + +$$ +T P _ {a} ^ {(y)} = \{x \in X: A (x) = a, Y (x) = y, \hat {Y} (x) = y \} +$$ + +$FP_{a}^{(y)}$ the number of false positives with attribute $a \in A$ + +$$ +F P _ {a} ^ {(y)} = \{x \in X: A (x) = a, Y (x) = y, \hat {Y} (x) \neq y \} +$$ + +and $FN_{a}^{(y)}$ the number of false negatives with attribute $a \in A$ : + +$$ +F N _ {a} ^ {(y)} = \{x \in X: A (x) = a, Y (x) \neq y, \hat {Y} (x) = y \} +$$ + +for $y\in Y$ + +We calculate macro-averaged recall for data samples in $X$ with associated class label $Y$ and attribute $a \in A$ as: + +$$ +\text {R e c a l l} = \frac {1}{| Y |} \sum_ {y \in Y} \frac {T P _ {a} ^ {(y)}}{T P _ {a} ^ {(y)} + F N _ {a} ^ {(y)}} +$$ + +where $|Y|$ is the number of possible class labels, i.e. the size of the set of all possible values of $Y$ . We calculate macro-averaged precision for data samples in $X$ with associated class label $Y$ and attribute $a \in A$ as: + +$$ +\text {P r e c i s i o n} = \frac {1}{| Y |} \sum_ {y \in Y} \frac {T P _ {a} ^ {(y)}}{T P _ {a} ^ {(y)} + F P _ {a} ^ {(y)}} +$$ + +We calculate accuracy for data samples in $X$ with associated class label $Y$ and attribute $a \in A$ as: + +$$ +\text {A c c u r a c y} = \frac {\left| \left\{x \in X : A (x) = a , Y (x) = \hat {Y} (x) \right\} \right|}{\left| \left\{x \in X : A (x) = a \right\} \right|} +$$ + +The subgroup gaps are then considered to be the difference between the metric value for the majoritized subgroup and the metric value for the minoritized subgroup (CARS196, CUB200, CelebA); or between the metric value for each subgroup with better performance than the worst-performing subgroup and the metric value for the worst-performing subgroup (LFW). As stated in Section D.4, for CUB200 bird color experiments, the subgroup gaps were calculated between the top performing $50\%$ of subgroups and bottom performing 50 of subgroups. \ No newline at end of file diff --git a/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/images.zip b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..77c9eb1d1304198c33981107fa02eb37f6508e77 --- /dev/null +++ b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1810d2a38a03b09012948f0790d5bec04ac31edca35814e03adcb3beb82b15b +size 2691754 diff --git a/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/layout.json b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ea46a9f03f8500ef20ee18f63a2076c839e222f8 --- /dev/null +++ b/isfairnessonlymetricdeepevaluatingandaddressingsubgroupgapsindeepmetriclearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7753c2146c10ee259257f9b8c43bd73a5015a42086dd983494065584d14ba048 +size 1075686 diff --git a/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_content_list.json b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3ae56713ca8a67545fd690aca0d2f520fec21686 --- /dev/null +++ b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1c82052ff13e23204284f0e42c7588609bc62a2554b05756bff20608b5f5ecf +size 144535 diff --git a/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_model.json b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9b2f174e401b77491890f12a1449ff53e41e7e6f --- /dev/null +++ b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae58a73e64c34402c1017d7ecac12daff99d9c7b548a91067b75cafc4697e25c +size 167688 diff --git a/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_origin.pdf b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..541dd2406eb5c7164b7ae3090f33a9d7c206ea54 --- /dev/null +++ b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/da966a35-d265-47da-adef-9f23c58059d6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c297d5f857d27d58255582b11b43aaf8e75d3d33271ad0bb77bdaa198646607 +size 12642076 diff --git a/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/full.md b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/full.md new file mode 100644 index 0000000000000000000000000000000000000000..879115f649b4b3c8044b2cb37d6bfafb20116bb9 --- /dev/null +++ b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/full.md @@ -0,0 +1,480 @@ +# Is HIGH VARIANCE UNAVOIDABLE IN RL? A CASE STUDY IN CONTINUOUS CONTROL + +Johan Bjorck, Carla P. Gomes, Kilian Q. Weinberger + +Cornell University + +# ABSTRACT + +Reinforcement learning (RL) experiments have notoriously high variance, and minor details can have disproportionately large effects on measured outcomes. This is problematic for creating reproducible research and also serves as an obstacle when applying RL to sensitive real-world applications. In this paper, we investigate causes for this perceived instability. To allow for an in-depth analysis, we focus on a specifically popular setup with high variance – continuous control from pixels with an actor-critic agent. In this setting, we demonstrate that poor outlier runs which completely fail to learn are an important source of variance, but that weight initialization and initial exploration are not at fault. We show that one cause for these outliers is unstable network parametrization which leads to saturating nonlinearities. We investigate several fixes to this issue and find that simply normalizing penultimate features is surprisingly effective. For sparse tasks, we also find that partially disabling clipped double Q-learning decreases variance. By combining fixes we significantly decrease variances, lowering the average standard deviation across 21 tasks by a factor $>3$ for a state-of-the-art agent. This demonstrates that the perceived variance is not necessarily inherent to RL. Instead, it may be addressed via simple modifications and we argue that developing low-variance agents is an important goal for the RL community. + +# 1 INTRODUCTION + +With the advent of deep learning, reinforcement learning (RL) with function approximators has become a promising strategy for learning complex behavior (Silver et al., 2017; Mnih et al., 2015). While RL can work remarkably well, deep RL experiments have been observed to exhibit high variance (Chan et al., 2020; Clary et al., 2018; Lynnerup et al., 2020). Specifically, the rewards obtained by RL agents commonly vary significantly depending on the random seeds used for training, even if no other modifications are made. Furthermore, implementation level details (Engstrom et al., 2019) and even hardware scheduling (Henderson et al., 2018) often have an outsized effect on performance. + +High variance is problematic for creating reproducible RL research, and achieving statistically significant results over large RL benchmarks is often prohibitively time-consuming (Colas et al., 2018; Agarwal et al., 2021). Furthermore, high variance provides an obstacle for real-world applications of RL, where safety and predictability can be critical (Garcia & Fernandez, 2015; Srinivasan et al., 2020). Especially relevant RL applications include medical testing (Bastani et al., 2021), autonomous vehicles (Bellemare et al., 2020) and communications infrastructure (Liu et al., 2020). + +In this paper, we investigate causes for high variance in RL. To limit the paper's scope and computational footprint we focus on continuous control from pixels with a state-of-the-art (SOTA) actor-critic algorithm (Lillicrap et al., 2021; Yarats et al., 2021b). This is a popular setup that exhibits high variance, and where actor-critic algorithms often achieve SOTA results (Laskin et al., 2020b;a; Kostrikov et al., 2020). In this setting, we first show that an important cause of variance is outlier runs that fail early and never recover. It is natural to hypothesize that the typical sources of randomness, network initialization, and initial exploration, are to blame. However, we demonstrate that these do in fact have little impact on the final performance. We similarly provide experiments that suggest that neither poor feature representations nor excessive sensitivity of the environment is at fault. We instead demonstrate that unstable network parametrization can drive the variance and lead to excessively large activations that saturate action distributions. We propose several methods to + +avoid such issues and find that they decrease variance. The most effective method is simply setting penultimate features to unit norm – a strategy we call penultimate normalization – which avoids exploding activations by design. We also find that partially disabling double clipped Q-learning (Fujimoto et al., 2018), a strategy we call asymmetrically double clipped $Q$ -learning, reduces variance for many sparse tasks. By combining multiple approaches we increase average rewards while decreasing variance as measured of 21 tasks. The average standard deviation decreases by a factor $>3$ and for some tasks by more than an order of magnitude. Our experiments suggest that high variance is not necessarily inherent to RL. Instead, one can directly optimize for lower variance without hurting the average reward. We argue that developing such low-variance agents is an important goal for the RL community – both for the sake of reproducible research and real-world deployment. + +# 2 BACKGROUND + +We consider continuous control modeled as a Markov decision process (MDP) with a continuous action space $\mathcal{A}$ and state space $S$ . In practice, the action space $\mathcal{A}$ is often bounded to account for physical limitations, e.g., how much force robotic joints can exert. A popular choice is simply $\mathcal{A} = [-1,1]^{dim(\mathcal{A})}$ . Within this setting, Deep Deterministic Policy Gradients (DDPG) (Lillicrap et al., 2021) is a performant algorithm that forms the backbone of many state-of-the-art agents (Laskin et al., 2020b; a; Kostrikov et al., 2020; Yarats et al., 2021b). DDPG uses a neural network (the critic) to predict the Q-value $Q_{\phi}(\mathbf{a}_t,\mathbf{s}_t)$ for each state-action pair. The parameters $\phi$ of the critic are trained by minimizing the soft Bellman residual: + +$$ +\left. \mathbb {E} \left(Q _ {\phi} \left(\mathbf {a} _ {t}, \mathbf {s} _ {t}\right) - \left[ r _ {t} + \gamma \mathbb {E} [ \hat {Q} \left(\mathbf {a} _ {t + 1}, \mathbf {s} _ {t + 1}\right) ] \right]\right) ^ {2} \right. \tag {1} +$$ + +Here, $r_t$ is the reward and $\mathbb{E}[\hat{Q}(\mathbf{a}_{t+1}, \mathbf{s}_{t+1})]$ is the Q-value estimated by the target critic - a network whose weights can e.g. be the exponentially averaged weights of the critic. One can use multi-step returns for the critic target (Sutton, 1988). Another common trick is double clipped q-learning, i.e. using two Q-networks $Q_1, Q_2$ and taking $Q = \min(Q_1, Q_2)$ to decrease Q-value overestimation (Fujimoto et al., 2018). The policy is obtained via an actor-network with parameters $\theta$ , which maps each state $\mathbf{s}_t$ to a distribution $\pi_\theta(\mathbf{s}_t)$ over actions. The action is obtained by calculating $\mathbf{a}_\theta^{pre}(\mathbf{s})$ , the vector output of the actor network. Thereafter a tanh non-linearity is applied elementwise to ensure $\mathbf{a} \in [-1,1]^n$ for $n = dim(\mathcal{A})$ . The policy is then obtained as: + +$$ +\mathbf {a} _ {\theta} (\mathbf {s}) = \tanh \left(\mathbf {a} _ {\theta} ^ {p r e} (\mathbf {s})\right) + \epsilon \tag {2} +$$ + +$\epsilon$ is some additive noise which encourages exploration, e.g. a Gaussian variable with time-dependent variance $\sigma_t^2$ . Various noise types have been employed (Achiam, 2018; Lillicrap et al., 2021; Yarats et al., 2021b). Since the Q-values correspond to the expected discounted rewards, the actions $\mathbf{a}_{\theta}$ should maximize $Q_{\phi}(\mathbf{a}_{\theta},\mathbf{s})$ . Thus, to obtain a gradient update for the actor one uses the gradient $\nabla_{\theta}Q_{\phi}(\mathbf{a}_{\theta},\mathbf{s})$ , effectively calculating gradients through the critic network. In control from pixels, the state $\mathbf{s}$ is typically an image (possibly data augmented) processed by a convolutional network. + +# 3 BENCHMARKING VARIANCE + +Experimental Setup. To limit the paper's scope and computational footprint, we focus on continuous control from pixels with an actor-critic algorithm. This setup is relatively close to real-world robotics, where reliable performance is important. We consider the standard continuous control benchmark deepmind control (dm-control) (Tassa et al., 2020). Within dm-control, a long line of state-of-the-art models relies on the actor-critic setup (Laskin et al., 2020b; a; Kostrikov et al., 2020). We consider the recent data-augmentation based DDPG-type agent DRQv2 (Yarats et al., 2021b) which provides state-of-the-art performance and runs fast. We use the default hyperparameters that Yarats et al. (2021b) uses on the medium benchmark (listed in Appendix A) throughout the paper. We will refer to this agent as the baseline agent. We are interested in using a large number of random seeds to obtain accurate statistics and thus need to limit the number of environments we consider. To select environments we simply rank the dm-control tasks based upon their relative variance as measured by Yarats et al. (2021b). We select the five tasks with the highest relative variance - finger turn hard, walker walk, hopper hop, acrobat swingup, and reacher hard (see Table 4 in Appendix A for details). In Section 4.2 we consider a larger set of tasks. We will refer to these as environments or tasks interchangeably. For each run, we train the agent for one million frames, or equivalently 1,000 + +episodes, and evaluate over ten episodes. We use 10 or 40 seeds for each method we consider, these are not shared between experiments, but we reuse the runs for the baseline agent across figures. + +# 3.1 VERIFYING VARIANCE + +We first aim to verify that the environments indeed exhibit high variance. To this end, we run the baseline agent with 40 random seeds on each task. Figure 1 shows the result of this experiment for three tasks, see Appendix A for the two other tasks. We show both individual runs as well as mean and standard deviations. For some tasks, the variance is dominated by outlier runs that fail to learn early in the training and never recover. E.g. for the walker task, we see several runs which have not improved during the first 500 episodes, and most of these do not improve in the following 500 episodes either. Except for these outliers, the variance of the walker task is relatively small. We also note that these outliers separate themselves relatively early on, suggesting that there are some issues in early training that cause variance. If it was possible to eliminate poor outlier runs, we would expect the variance to go down. Motivated by these observations, and the walker task in particular, we will investigate various potential causes of outlier runs and high variance. + +# 3.2 DOES INITIALIZATION MATTER? + +There are multiple sources of randomness specific to the early training iterations. The agent networks are randomly initialized and the agent is given some initial experience, collected by random actions, to start training on. Could these two initial factors be the cause of the high variance? To study this hypothesis we measure the correlation between two runs that share the same network initialization and initial experience, but otherwise have independent randomness (from e.g. the environment, action sampling, and mini-batch sampling). Across all tasks, we repeat this process for ten combinations of initializations and initial experience, from each such combination we start two runs $A$ , $B$ which do not share other sources of randomness. For each time-step we measure the Pearson correlation between $score(A)$ and $score(B)$ . This correlation, averaged across all timesteps, is shown in Figure 2 (left). We see that the correlation is very small, suggesting that the initialization and initial experience does not have a large effect on the outcome. Specifically, the hypothesis that there are good and bad initializations that leads to good or bad performance is inconsistent with the results of Figure 2 (left). Correlation across time is noisy but centers around zero, see Appendix A. + +![](images/1b1cc88bfb5df48345143819baceb8c280da9bce1b94f438c4f0c570d5586c4e.jpg) +Figure 1: Learning curves over 40 seeds for the baseline agent. The upper row shows the mean reward, with one standard deviation indicated by shading. The bottom row shows individual runs. For some tasks, the variance is dominated by a few outlier runs that completely fail to learn. This is especially clear in the walker task. Removing such outlier runs would decrease the variance. + +![](images/a20f002598ecffcd0ba0ef74e975dc094f18ee32197852e672dad798d4c77d6b.jpg) + +![](images/1eb70bb7ea3385175b5220992aace82bf4c023a7fc9ac30ad048ac3414a26b7a.jpg) +Figure 2: (Left) Correlation between runs that share network initialization and starting experience, but otherwise have independent other sources of randomness (e.g. from mini-batch sampling). Across all tasks, the correlation is small. This suggests that initialization and starting experience have limited effect on the outcomes. (Right) The average reward for the walker task when interpolating between a learned policy (random action probability $= 0$ ) and random policy (random action probability $= 1$ ). The rewards obtained decrease gracefully as we adopt a more random policy. This suggests that the environment is relatively forgiving with respect to actions. + +# 3.3 ARE THE ENVIRONMENTS TOO SENSITIVE? + +Another cause of variance is the environments. Perhaps the environments require very specific policies to yield rewards, and unless the agent stumbles upon a good policy early on, learning fails. To study the sensitivity of the environments we consider gradually exchanging a good learned policy with a random policy. Specifically, at every timestep $t$ , with probability $p$ , we exchange the policy's action with a random action. We use the final policy of a performant run with the baseline agent as the learned policy. The effect of this, for ten final policies learned for the walker environment, is shown in Figure 2 (right). Performance degrades gracefully as we gradually move to a random policy. This suggests that the environment is relatively stable with regard to actions. Results for other environments are similar and are shown in Appendix A. Furthermore, in Appendix E we verify that the variance arising from evaluating the agent on a finite number of episodes is small compared to the inter-run variance. Thus, environment sensitivity and evaluation methodology do not appear to explain the excessive variance. + +# 3.4 IS FEATURE LEARNING TO BLAME? + +In the early stages of training, the image encoder will extract poor features. Without good representations, it is hard to learn a good policy, and without a policy generating interesting behavior it is hard to learn good representations. If such a vicious cycle was causing runs to fail, jump-starting the encoder to extract good features should help to decrease the variance. To test this hypothesis, we consider initializing the weights of the convolutional encoder to some good pretrained values before training as normal. For each task, we pick a run with above-average final performance and use its convolutional weights at episode 500. We refer to this strategy as pretrain. We also consider the same strategy but decrease the learning rate of the pre-trained weights by a factor of $10\mathrm{x}$ . We refer to this strategy as pretrain + small lr. In addition to this fix, we also consider improving the features with self-supervised learning during early training (Jing & Tian, 2020). We use the loss function proposed in Grill et al. (2020) which is useful for smaller batch sizes (we use 256) and has already successfully been applied in RL (Schwarzer et al., 2021). We use standard methods in self-supervised learning: a target network with exponentially moving weights and a head network. See Appendix A for details. We consider adding the self-supervised loss to the first 10,000 and 20,000 steps and refer to these modifications as self-supervised 10k and self-supervised 20k. The results for this experiment are shown in Table 1. For these fixes, the large variance persists even though the performance improves marginally with self-supervised learning. We thus hypothesize that representation learning is not the main bottleneck. Indeed, experiments in later sections of the paper show that one can significantly decrease variance without improving representation learning. + +Table 1: Performance when using self-supervised learning or pretrained weights for the convolutional encoder. Improvements are small and variance remain high. This suggests that poor features might not cause the high variance. Indeed, Table 2 shows that performance can be improved significantly without better representation learning. Metrics are calculated over 10 seeds. + +
metricmethodacrobotfinger turnhopper hopreacherwalkeravg.
μbaseline122.0278.6176.2678.0769.1404.8
μself-supervised 10k141.4456.2176.5671.6677.1424.6
μself-supervised 20k159.4325.3209.5659.6773.8425.5
μpretrain160.0303.7153.3620.8581.4363.8
μpretrain + small lr157.3358.8124.8679.0674.2398.8
σbaseline76.0221.290.3167.3350.1181.0
σself-supervised 10k68.4276.1104.6222.4425.9219.5
σself-supervised 20k67.7191.971.6164.8374.4174.1
σpretrain39.8146.786.8168.7429.1174.2
σpretrain + small lr71.8204.6102.7165.4393.5187.6
+ +# 3.5 STABILITY OF NETWORK PARAMETRIZATION + +We have considered the effects of initialization, feature learning, and environment sensitivity and found that none of these factors satisfactorily explain the observed variance. Another factor to consider is the stability of the network parametrization. Unstable parametrization could make the learning process chaotic and thus cause high variance. To study this hypothesis we investigate the failure modes of individual runs. In Figure 3 we consider some runs that fail as well as some successful runs for the walker task. Plots for all runs are available in Appendix A. We plot three quantities during training: rewards, actor gradient norm $\| \nabla \ell \|$ , and average absolute value of actions $|\mathbf{a}|$ . All agents initially have poor rewards, but once the rewards start to improve, they improve steadily. During this initial period of no or little learning, the gradients of the actor-network (row two in Figure 3) are small. Recall that the actor is optimized via gradients: $\nabla_{\theta}Q_{\phi}(\mathbf{s},\mathbf{a}_{\theta}(\mathbf{s})) =$ + +![](images/c727a7eebaf0008be7ca74848e97bc2f1d82a153e2b4eac877b46bad902d473d.jpg) +Figure 3: Each row shows a different quantity during training for the baseline agent. Row 1 shows rewards, row 2 shows actor gradient norm $\|\nabla \ell \|$ , and row 3 shows average absolute action $|a|$ . Each column corresponds to an independent run of the walker task: run 1 is successful, runs 2 and 3 eventually learn, while run 4 fails to learn. Before learning starts, all runs suffer from small gradients. During this period, the average absolute value of actions is close to 1. This causes small gradients since the gradient of $\tanh(x)$ is small when $|\tanh(x)| \approx 1$ . + +$\sum_{i}\frac{\partial Q_{\phi}}{\partial\mathbf{a}_{i}}\frac{\partial\mathbf{a}_{i}}{\partial\theta}$ . If this gradient is close to zero, we might suspect that $\frac{\partial\mathbf{a}_i}{\partial\theta} \approx 0$ . This could easily happen if the tanh non-linearity in equation 2 is saturated. In row three of Figure 3 we show the average absolute value of the actions, which are all bound to lie in $[-1,1]$ . We indeed see that for the runs that fail the average absolute action stays around 1 throughout training, which implies that the gradients for the actor are small since $|\tanh(x)| \approx 1$ implies $\frac{\partial}{\partial x}\tanh(x) \approx 0$ . The cause of saturating tanh must be excessively large activations, i.e. $\mathbf{a}_{\theta}^{pre}(\mathbf{s})$ in equation 2 becoming too large, which saturates the tanh non-linearity. In fact, all runs seem to initially suffer from saturating tanh, but most runs escape from this poor policy. Somewhat similarly, Wang et al. (2020) has observed that saturating nonlinearities can impede exploration when removing the entropy bonus from SAC agents. However, for the DDPG agent saturation does not harm exploration since the exploration noise is added outside the non-linearity as per eq. (2). Instead, the issue here appears to be vanishing gradients which impedes learning. The Q-values could of course also suffer from exploding activations, but since there are no saturating nonlinearities for the Q-values, such issues are harder to pinpoint. These experiments suggest that avoiding excessively large activations could reduce the number of poor outlier runs, and thus decrease variance. + +# 4 IMPROVING STABILITY + +Motivated by our qualitative observations we now consider a few ideas for improving the stability of learning, hoping that these will decrease the variance. We consider several methods: + +Normalizing activations. As per eq. (2), the actor selects actions using $\mathbf{a}_{\theta}^{pre}(\mathbf{s})$ , where $\mathbf{a}_{\theta}^{pre}(\mathbf{s})$ is a deep neural network. Figure 3 shows that learning can fail due to excessively large activations. To avoid this we propose to parametrize $\mathbf{a}_{\theta}^{pre}(\mathbf{s})$ as a linear function of features with a fixed magnitude. Specifically, let $\Lambda_{\theta}(\mathbf{s})$ be the penultimate features of the actor-network. We propose to simply normalize $\Lambda_{\theta}^{n}(\mathbf{s}) = \Lambda_{\theta}(\mathbf{s}) / \| \Lambda_{\theta}(\mathbf{s})\|$ and let $\mathbf{a}^{pre}$ be a linear function of $\Lambda_{\theta}^{n}$ , i.e. $\mathbf{a}_{\theta}^{pre}(\mathbf{s}) = L\Lambda_{\theta}^{n}(\mathbf{s})$ for a linear function $L$ . Note that no mean subtraction is performed. We refer to this straightforward modification as penultimate normalization or pnorm for short. When applied to the actor, we simply call the strategy actor pnorm. Our motivation has been to stabilize the actor output, but the critic network could also benefit from the stability offered by normalizing penultimate features. We refer to the strategy of normalizing both the actor and the critic as both pnorm. We also consider layer norm (Ba et al., 2016) applied similarly to both the actor and critic. We also consider the normalization scheme of Wang et al. (2020), which directly constrains the output of the actor. We refer to this method as output norm. At last, following Gogianu et al. (2021), we consider adding spectral normalization (Miyato et al., 2018) to the penultimate layer. + +Penalizing saturating actions. Another strategy for avoiding actions with large magnitude is to add a term to the loss function which directly penalizes large actions. One can imagine many such loss functions, we here consider the simple and natural choice of squared loss $\ell(\theta, \mathbf{s}) = \lambda \| \mathbf{a}_{\theta}^{pre}(\mathbf{s}) \|^2$ . We can simply add the square loss times some hyperparameter $\lambda$ to the loss function. By tuning $\lambda$ , one should be able to remove the saturating actions illustrated in Figure 3. We heuristically find that $\lambda = 0.000001$ works well in practice (see Appendix A) and use this value. We refer to this modification as penalty. Since the Adam optimizer is invariant under re-scaling the loss, the specific value of $\lambda$ has a small effect as long as $\nabla_{\theta} Q_{\phi}(\mathbf{s}, \mathbf{a}_{\theta}(\mathbf{s})) \approx 0$ , which happens as per Figure 3. + +Learning rate warmup. One common strategy to improve stability is to start the learning rate at zero and increase it linearly to its top value during early training (Goyal et al., 2017). This can improve numerical stability (Ma & Yarats, 2021). We consider using this strategy and linearly increasing the learning rate from zero over the first 10,000 steps. We refer to this strategy as lr warmup. + +Small weights final layer. Following Andrychowicz et al. (2020), we consider using smaller weights for the final layers of the actor and the critic. Specifically, we downscale these weights by a factor of 100 at initialization time. We refer to this strategy as scale down. + +![](images/8da1c164f86f77819a1bd3350308134543235ed415bc6dad0a0ce919bc170dc6.jpg) +Figure 4: Average Q-value during training. + +Table 2: Performance for various stability improvements. These methods often decrease variance, especially for the walker task where variance decreases by orders of magnitude. Larger stability often leads to higher reward, likely as poor outlier runs are eliminated. Normalizing features give consistent improvements. Metrics are calculated over 10 seeds. + +
metricmethodacrobotfinger turnhopper hopreacherwalkeravg.
μbaseline122.0278.6176.2678.0769.1404.8
μpenalty128.0431.6241.7584.6956.3468.4
μactor pnorm117.8372.7240.5701.7956.7477.9
μboth pnorm192.2605.8188.7892.7961.5568.2
μlayer norm43.5661.2218.6659.7952.4507.1
μlr warmup150.3265.4173.7660.9670.4384.1
μgrad clip 1138.2214.0206.0520.0675.6350.7
μgrad clip 1079.3166.2157.7548.4678.7326.0
μspectral104.0101.0201.0213.6775.6279.1
μscale down127.2258.4111.7508.7386.4278.5
μoutput norm13.3306.3216.9699.4952.1437.6
σbaseline76.0221.290.3167.3350.1181.0
σpenalty42.1160.646.5236.815.4100.3
σactor pnorm39.9227.942.7101.98.084.1
σboth pnorm60.1193.478.4122.57.092.3
σlayer norm57.2228.4112.5297.113.5141.7
σlr warmup53.8133.698.2133.4423.4168.5
σgrad clip 160.6127.192.4231.9425.3187.5
σgrad clip 1056.1143.9113.6243.2426.3196.6
σspectral37.061.475.0224.8128.0105.2
σscale down27.8186.996.6241.3444.0199.3
σoutput norm16.6190.421.4180.417.285.2
+ +Gradient clipping. Another stabilizing strategy is gradient clipping (Zhang et al., 2020). To avoid occasional exploding gradients, one simply clips the norm of gradients that are above some threshold. This strategy is popular in NLP (Gehring et al., 2017; Peters et al., 2018) and is sometimes used in RL (Raffin et al., 2019). We consider clipping the gradient when the norm, calculated independently for the actor, critic, and convolutional encoder, is larger than 1 or 10. We refer to these strategies as grad clip 1 and grad clip 10. + +Results. In Table 2 we evaluate the effects of these ideas. Penultimate normalization has the best performance and lowest variability on average, whereas layer norm can make performance worse. Since normalizing the critic improves performance, the critic might also suffer from instabilities. This instability can be observed by simply plotting the average Q-values during training for various agents, see Figure 4. We study this question in detail in Appendix C. The penalty method improves the performance while many other methods decrease average reward, and lowering variance by using a poor policy is not hard to achieve and not particularly desirable. The output normalization method of Wang et al. (2020) performs worse than actor normalization, and importantly fails completely on the acrobot task. We hypothesize that directly constraining the output space is harmful on the acrobot task. These experiments show that it is possible to significantly decrease the variance of the baseline agent by applying stabilization methods. Additionally, decreasing the variance often increases the average reward – likely as bad outlier runs are eliminated. + +# 4.1 COMBININGFIXES + +We have found that many of the proposed methods can decrease variance and improve average reward. For optimal performance, we now consider combining three orthogonal methods which improve performance individually - actor and critic penultimate normalization, pre-tanh penalty, and self-supervised learning (we apply it to the first 10,000 steps). In Table 3 we compare the performance between the baseline and an agent using these three modifications (which we refer to as combined) over 40 seeds. We see that the variances go down while the average score goes up. In fact, for the walker task, the variance decreases by orders of magnitude. Eliminating poor + +Table 3: Performance when combining three improvements: penultimate normalization, action penalty and early self-supervised learning. The variance decreases and the performance improves across all tasks. This demonstrates that one can substantially decrease variance in RL without hurting average reward. Metrics are calculated over 40 seeds. + +
metricmethodacrobotfinger turnhopper hopreacherwalkeravg.
μbaseline122.0278.6176.2678.0769.1404.8
μcombined227.7653.5231.1893.4964.2594.0
σbaseline76.0221.290.3167.3350.1181.0
σcombined59.0183.140.8120.06.281.8
+ +outlier runs seems to benefit the average performance in addition to decreasing variance. While our methods have mostly been motivated by outlier runs that fail catastrophically, they likely help more normal runs too. Learning curves for the combined agent are given in Appendix A. In Appendix D, we verify that our fixes enable the agent to learn successfully with a larger learning rate. + +# 4.2 ADDITIONAL TASKS + +We now apply the combined agent of Table 3 to additional tasks. Specifically, we consider all 21 tasks identified as easy or medium by Yarats et al. (2021b). Note that the combined agent has been constructed using only 5 of these tasks, so this experiment measures generalization. For computational reasons, the additional 16 tasks only use 10 seeds each. We use the baseline hyperparameters across all tasks without tuning (Yarats et al. (2021b) tunes parameters on a per-task basis). Results are shown in Figure 5. Our methods consistently improve the average reward while the average standard deviation decreases by a factor $>2$ . Furthermore, a few additional tasks (finger spin, hopper stand, walker run, walker stand) have their variance decreased by an order of magnitude or more. The tasks cheetah run and quadruped walk perform worse than the baseline, although this could potentially be alleviated by tuning hyperparameters. Just increasing the learning rate on these tasks improves performance, see Figure 13 in Appendix A. These results demonstrate that our modifications significantly decrease variance and that directly optimizing variance can be feasible and fruitful. Performance profiles (Agarwal et al., 2021) are available in Figure 16 of Appendix A. + +![](images/b901738e023a2d5252d8f91761171423fb4678c13ba3203ce0783aac8ed14796.jpg) + +![](images/f207e09194089bb7620544335a6f9eb22302cb60cd1844ddb2deaeabfb5f2b76.jpg) +Figure 5: Performance for 21 tasks. (Top) Average reward per task. The combined agents improve the average reward, and most tasks benefit from our modifications. (Bottom) Standard deviation of reward, broken up by task. The combined agents have less variability, and for a few tasks the variance decreases by orders of magnitude. Except for measurements in Table 3, we use 10 seeds. + +![](images/3967f767a0b3a6ec3d2ff86e3b237915dc2f51f8610018c8f06555eac119cddb.jpg) +Figure 6: The average absolute value of the actions for the combined agent. We show four representative runs of walker task. Compared to the baseline algorithm in Figure 3, the actions do not saturate early in training despite increasing rapidly, indicating improved stability. + +![](images/a66064a29d9ded6522753221b83efd54077c12b2906fa35913946cc4d40f4eec.jpg) + +![](images/01fda3544e1be25693df1a8c11016b9a5c82556c7588bdf79877248d53f89e73.jpg) + +![](images/dcb826fb3df8b0b82a3558b573f353d02db4eca2e81322ffa9cc729b079322c2.jpg) + +# 4.3 SPARSE TASKS + +Consider the five tasks in Figure 5 where the combined agent has the highest standard deviation. Four out of these have sparse rewards – finger turn hard, reacher hard, pendulum swingup, and cartpole swingup sparse. Once stability has been addressed, sparsity is a major driver of residual variance. Motivated by this, we consider three fixes that could help for sparse tasks. Firstly, not training until at least one non-zero reward has been observed. Secondly, extending the self-supervised training throughout the whole training process. Thirdly, exchanging the clipped double Q-learning $Q = \min(Q_1, Q_2)$ (Fujimoto et al., 2018) with $Q = \mathrm{avg}(Q_1, Q_2)$ , to decrease pessimistic bias. Through ablations (see Appendix B), we find that doing this for the critic loss (eq. (1)) but retaining the clipping $Q = \min(Q_1, Q_2)$ for the actor loss performs the best. We dub this strategy asymmetrically clipped double Q-learning. In Appendix B we present an ablation study over these three modifications, finding that using more self-supervised learning and asymmetrically clipped double Q-learning improves performance. We add these two modifications to our combined agent, which we now call combined++. In Figure 5 we show the performance of this agent (seeds are independent from experiments in Appendix B). Performance improves, especially for sparse tasks, and compared to the baseline agent the average standard deviation decreases by a factor > 3. + +# 5 EPILOGUE + +Related Work. There are multiple papers documenting the high variance of RL (Henderson et al., 2018), focusing on implementation details (Engstrom et al., 2019), continuous control (Mania et al., 2018), Atari games (Clary et al., 2018) and real-world robots (Lynnerup et al., 2020). Given this high variance, there is ample work on how to accurately measure performance in RL (Colas et al., 2019; Chan et al., 2020; Jordan et al., 2020; Agarwal et al., 2021; Islam et al., 2017). Our strategy of simply reducing the variance of RL algorithms is complementary to developing robust metrics. Within Q-learning, there is a large amount of work aiming to improve and stabilize Q-estimates (Fujimoto et al., 2018; Nikishin et al., 2018; Anschel et al., 2017; Jia et al., 2020; Chen et al., 2018). These apply to the discrete DQN setting, distinct from continuous control. There is also work on stabilizing RL for specific architectures (Parisotto et al., 2020) and task types (Kumar et al., 2019; Mao et al., 2019). Normalization in RL have been investigated by Salimans & Kingma (2016); Bjorck et al. (2021b); Gogianu et al. (2021), and Wang et al. (2020). Wang et al. (2020) directly normalizes the output of the actor, which e.g. for a one-dimensional task shrinks the action space to $\left[\tanh(-1), \tanh(1)\right]$ (modulo noise). As per Table 2, this method underperforms our methods. + +Limitations. We have only considered a single SOTA agent (DRQv2 of (Yarats et al., 2021b)) on one popular suite of tasks. Furthermore, we focus on an agent with tanh nonlinearities for the policy. While this is an important agent class, other important agent types (Hafner et al., 2021) and environments (Bellemare et al., 2013) remain. We show that it is possible to decrease variance with simple modifications, although which methods are effective likely depends upon the base algorithm. While many of our fixes can potentially be added to other agents, it remains to be experimentally tested if doing so improves performance. We leave this question for future work. While our fixes typically are only a few lines of code, they nonetheless increase the agent complexity. + +Conclusion. We have investigated variance in a popular continuous control setup and proposed several methods to decrease it. We demonstrate across 21 tasks that these dramatically decrease variance while improving average rewards for a state-of-the-art agent. Our experiments show that directly optimizing for lower variance can be both feasible and fruitful. + +Ethics Statement. There are many positive RL applications – examples include safe autonomous cars, accelerated scientific discovery, and medical testing. Studying causes of high variance, and proposing fixes to this issue, can benefit real-world adoption of RL techniques. Additionally, reducing the variance of RL experiments would aid the research community as reproducibility can be problematic in the field. However, there are also many potentially harmful military applications. Our study is academic in nature and only considers simulated toy environments, but insights from our work could nonetheless be useful in harmful applications. We do not believe that our work differs from other RL work significantly concerning ethics. + +Reproducability Statement. In Appendix A we detail the infrastructure and software used. The perhaps most important component of generating reproducible findings in RL is to use many seeds. To this end, we have focused on five environments but evaluated these thoroughly. The main experiments of the paper (Table 3) use 40 seeds whereas all others use 10 seeds. + +Acknowledgement. This research is supported in part by the grants from the National Science Foundation (III-1618134, III-1526012, IIS1149882, IIS-1724282, and TRIPODS- 1740822), the Office of Naval Research DOD (N00014- 17-1-2175), Bill and Melinda Gates Foundation. We are thankful for generous support by Zillow and SAP America Inc. This material is based upon work supported by the National Science Foundation under Grant Number CCF-1522054. We are also grateful for support through grant AFOSR-MURI (FA9550-18-1-0136). Any opinions, findings, conclusions, or recommendations expressed here are those of the authors and do not necessarily reflect the views of the sponsors. We thank Rich Bernstein, Wenting Zhao, and Ziwei Liu for help with the manuscript. At last, we thank our anonymous reviewers for fruitful interactions. + +# REFERENCES + +Joshua Achiam. Spinning Up in Deep Reinforcement Learning. 2018. +Rishabh Agarwal, Max Schwarzer, Pablo Samuel Castro, Aaron Courville, and Marc G Bellemare. Deep reinforcement learning at the edge of the statistical precipice. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021. +Marcin Andrychowicz, Anton Raichuk, Piotr Stanczyk, Manu Orsini, Sertan Girgin, Raphaël Marinier, Leonard Hussenot, Matthieu Geist, Olivier Pietquin, Marcin Michalski, et al. What matters for on-policy deep actor-critic methods? a large-scale study. In International Conference on Learning Representations, 2020. +Oron Anschel, Nir Baram, and Nahum Shimkin. Averaged-dqn: Variance reduction and stabilization for deep reinforcement learning. In International conference on machine learning, pp. 176-185. PMLR, 2017. +Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. +Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. Advances in neural information processing systems, 2019. +Hamsa Bastani, Kimon Drakopoulos, Vishal Gupta, Jon Vlachogiannis, Christos Hadjicristodoulou, Pagona Lagiou, Gkikas Magiorkinis, Dimitrios Paraskevis, and Sotirios Tsiodras. Efficient and targeted Covid-19 border testing via reinforcement learning, 2021. +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. +Marc G Bellemare, Salvatore Candido, Pablo Samuel Castro, Jun Gong, Marlos C Machado, Subhodeep Moitra, Sameera S Ponda, and Ziyu Wang. Autonomous navigation of stratospheric balloons using reinforcement learning. Nature, 588(7836):77-82, 2020. +Johan Bjorck, Carla Gomes, Bart Selman, and Kilian Q Weinberger. Understanding batch normalization. arXiv preprint arXiv:1806.02375, 2018. + +Johan Bjorck, Xiangyu Chen, Christopher De Sa, Carla P Gomes, and Kilian Q Weinberger. Low-precision reinforcement learning. arXiv preprint arXiv:2102.13565, 2021a. +Nils Bjorck, Carla P Gomes, and Kilian Q Weinberger. Towards deeper deep reinforcement learning with spectral normalization. Advances in Neural Information Processing Systems, 34, 2021b. +Stephanie CY Chan, Samuel Fishman, John Canny, Anoop Korattikara, and Sergio Guadarrama. Measuring the reliability of reinforcement learning algorithms. 2020. +Shi-Yong Chen, Yang Yu, Qing Da, Jun Tan, Hai-Kuan Huang, and Hai-Hong Tang. Stabilizing reinforcement learning in dynamic environment with application to online recommendation. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1187-1196, 2018. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020. +Kaleigh Clary, Emma Tosch, John Foley, and David Jensen. Let's play again: Variability of deep reinforcement learning agents in atari environments. 2018. +Cédric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. How many random seeds? statistical power analysis in deep reinforcement learning experiments. arXiv preprint arXiv:1806.08295, 2018. +Cédric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. A hitchhiker's guide to statistical comparisons of reinforcement learning algorithms. *ICLR 2019 Workshop RML*, 2019. +Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. Implementation matters in deep rl: A case study onppo and trpo. In International conference on learning representations, 2019. +Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In International Conference on Machine Learning, pp. 1587-1596. PMLR, 2018. +Javier Garcia and Fernando Fernandez. A comprehensive survey on safe reinforcement learning. Journal of Machine Learning Research, 16(1):1437-1480, 2015. +Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In International Conference on Machine Learning, pp. 1243-1252. PMLR, 2017. +Florin Gogianu, Tudor Berariu, Mihaela Rosca, Claudia Clopath, Lucian Busoniu, and Razvan Pascanu. Spectral normalisation for deep reinforcement learning: an optimisation perspective. 2021. +Priya Goyal, Piotr Dólar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. +Evan Greensmith, Peter L Bartlett, and Jonathan Baxter. Variance reduction techniques for gradient estimates in reinforcement learning. Journal of Machine Learning Research, 5(9), 2004. +Jean-Bastien Grill, Florian Strub, Florent Alché, 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. Advances in neural information processing systems, 2020. +Danijar Hafner, Timothy Lillicrap, Mohammad Norouzi, and Jimmy Ba. Mastering atari with discrete world models. *ICLR*, 2021. +Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9729-9738, 2020. +Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. In AAAI, 2018. + +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. PMLR, 2015. +Riashat Islam, Peter Henderson, Maziar Gomrokchi, and Doina Precup. Reproducibility of benchmarked deep reinforcement learning tasks for continuous control. ICML 2017 RML Workshop, 2017. +Haonan Jia, Xiao Zhang, Jun Xu, Wei Zeng, Hao Jiang, Xiaohui Yan, and Ji-Rong Wen. Variance reduction for deep q-learning using stochastic recursive gradient. arXiv preprint arXiv:2007.12817, 2020. +Longlong Jing and Yingli Tian. Self-supervised visual feature learning with deep neural networks: A survey. IEEE transactions on pattern analysis and machine intelligence, 2020. +Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. Advances in neural information processing systems, 26:315-323, 2013. +Scott Jordan, Yash Chandak, Daniel Cohen, Mengxue Zhang, and Philip Thomas. Evaluating the performance of reinforcement learning algorithms. In International Conference on Machine Learning, pp. 4962-4973. PMLR, 2020. +Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The International Journal of Robotics Research, 32(11):1238-1274, 2013. +Ilya Kostrikov, Denis Yarats, and Rob Fergus. Image augmentation is all you need: Regularizing deep reinforcement learning from pixels. 2020. +Aviral Kumar, Justin Fu, G. Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In NeurIPS, 2019. +Michael Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data. 2020a. +Michael Laskin, Aravind Srinivas, and Pieter Abbeel. Curl: Contrastive unsupervised representations for reinforcement learning. In Proceedings of the 37th Annual International Conference on Machine Learning (ICML), 2020b. +Yuanzhi Li, Colin Wei, and Tengyu Ma. Towards explaining the regularization effect of initial large learning rate in training neural networks. 2019. +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. *ICLR*, 2021. +Yan Liu, Zhiyuan Jiang, Shunqing Zhang, and Shugong Xu. Deep reinforcement learning-based beam tracking for low-latency services in vehicular networks. In ICC 2020-2020 IEEE International Conference on Communications (ICC), pp. 1-7. IEEE, 2020. +Ziwei Liu, Ban Xuan Dong, Mayank Misra, Yangyang Sun, Joseph Strzalka, Shrayesh N Patel, Fernando A Escobedo, Paul F Nealey, and Christopher K Ober. Self-assembly behavior of an oligothiophene-based conjugated liquid crystal and its implication for ionic conductivity characteristics. Advanced Functional Materials, 29(2):1805220, 2019. +Nicolai A Lynnerup, Laura Nolling, Rasmus Hasle, and John Hallam. A survey on reproducibility by evaluating deep reinforcement learning algorithms on real-world robots. In Conference on Robot Learning, pp. 466-489. PMLR, 2020. +Jerry Ma and Denis Yarats. On the adequacy of untuned warmup for adaptive optimization. In AAAI, 2021. +Horia Mania, Aurelia Guy, and Benjamin Recht. Simple random search of static linear policies is competitive for reinforcement learning. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 1805-1814, 2018. + +Hongzi Mao, Shaileshh Bojja Venkatakrishnan, Malte Schwarzkopf, and Mohammad Alizadeh. Variance reduction for reinforcement learning in input-driven environments. *ICLR*, 2019. +Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. *ICLR*, 2018. +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. +Evgenii Nikishin, Pavel Izmailov, Ben Athiwaratkun, Dmitrii Podoprikhin, Timur Garipov, Pavel Shvechikov, Dmitry Vetrov, and Andrew Gordon Wilson. Improving stability in deep reinforcement learning with weight averaging. In Uncertainty in artificial intelligence workshop on uncertainty in Deep learning, 2018. +Emilio Parisotto, Francis Song, Jack Rae, Razvan Pascanu, Caglar Gulcehre, Siddhant Jayakumar, Max Jaderberg, Raphael Lopez Kaufman, Aidan Clark, Seb Noury, et al. Stabilizing transformers for reinforcement learning. In International Conference on Machine Learning, pp. 7487-7498. PMLR, 2020. +Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In *NAACL*, 2018. +Antonin Raffin, Ashley Hill, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, and Noah Dormann. Stable baselines3. https://github.com/DLR-RM/stable-baselines3, 2019. +Tim Salimans and Durk P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. Advances in neural information processing systems, 29:901-909, 2016. +Max Schwarzer, Ankesh Anand, Rishab Goel, R Devon Hjelm, Aaron Courville, and Philip Bachman. Data-efficient reinforcement learning with momentum predictive representations. *ICLR*, 2021. +David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354-359, 2017. +Krishnan Srinivasan, Benjamin Eysenbach, Sehoon Ha, Jie Tan, and Chelsea Finn. Learning to be safe: Deep rl with a safety critic. arXiv preprint arXiv:2010.14603, 2020. +Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3 (1):9-44, 1988. +Yuval Tassa, Saran Tunyasuvunakool, Alistair Muldal, Yotam Doron, Siqi Liu, Steven Bohez, Josh Merel, Tom Erez, Timothy Lillicrap, and Nicolas Heess. dm control: Software and tasks for continuous control, 2020. +Che Wang, Yanqiu Wu, Quan Vuong, and Keith Ross. Striving for simplicity and performance in off-policy drl: Output normalization and non-uniform sampling. In International Conference on Machine Learning, pp. 10070-10080. PMLR, 2020. +Denis Yarats, Rob Fergus, Alessandro Lazaric, and Lerrel Pinto. Mastering visual continuous control: Improved data-augmented reinforcement learning. arXiv preprint arXiv:2107.09645, 2021a. +Denis Yarats, Rob Fergus, Alessandro Lazaric, and Lerrel Pinto. Mastering visual continuous control: Improved data-augmented reinforcement learning. arXiv preprint arXiv:2107.09645, 2021b. +Jingzhao Zhang, Tianxing He, Suvrit Sra, and Ali Jabbabaie. Why gradient clipping accelerates training: A theoretical justification for adaptivity. *ICLR*, 2020. +Zhenpeng Zhou, Steven Kearnes, Li Li, Richard N Zare, and Patrick Riley. Optimization of molecules via deep reinforcement learning. *Scientific reports*, 9(1):1-10, 2019. + +# A APPENDIX + +Tuning $\lambda$ . For tuning the hyperparameters $\lambda$ we search over the set $\{1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6\}$ . For each value, we run the hopper task for a short amount of time with five different seeds. We found that too large $\lambda$ penalized actions too much, and that even very small values like $1e-6$ sufficed to give improvement. + +Details on self-supervised Learning. We extract features from the convolutional network and the first feedforward layer of the critic, which projects the feature map to 50-dimensions. Feature vectors are normalized to unit norm before being fed into the self-supervised loss (Bachman et al., 2019). We use exponentially moving weights for the target network (He et al., 2020), using the same decay parameters as for the target critic. We use a head for the online network which is simply a two-layer MLP with hidden dimension 512 and final dimension 50 (Chen et al., 2020). The two augmentations we consider are simply two adjacent frames with augmentations that the DDPG agent of Yarats et al. (2021b) considers naturally. We use the square loss as proposed in Grill et al. (2020), which has been shown to be useful in smaller batch sizes. The self-supervised loss is then simply added to the normal loss function for the critic. + +Infrastructure. We run our experiments on Nvidia Tesla V100 GPUs and Intel Xeon CPUs. The GPUs use CUDA 11.1 and CUDA8.0.0.5. We use PyTorch 1.9.0 and python 3.8.10. Our experiments are based upon the open-source DRQv2 implementation of Yarats et al. (2021b). + +Table 4: Variance across tasks as reported by Yarats et al. (2021b). Mean reward and task variance often increase in tandem – to avoid bias towards easy tasks with high mean and thus high variance, we rank tasks based upon relative variance $\sigma / \mu$ . We use the five tasks with the highest relative variance, removing one duplicate: finger turn easy/hard. Used tasks are highlighted. Scores are measured just before 1 million frames (i.e. frame 980000) since not all runs have scores at the 1 million mark. All numbers are rounded to two decimal digits. + +
taskσ/μμσ
finger turn hard0.74268.90198.36
walker walk0.48769.66371.48
hopper hop0.36221.1380.63
finger turn easy0.31558.52174.19
acrobot swingup0.31177.6554.77
reacher hard0.22628.29135.57
walker run0.20538.59110.02
cup catch0.13909.95118.06
finger spin0.12860.30104.18
quadruped run0.12446.4953.51
quadruped walk0.12732.5287.19
cartpole balance sparse0.12962.30113.10
reach duplo0.08202.5116.99
cartpole swingup sparse0.08760.1160.11
cheetah run0.07710.2452.43
reacher easy0.05931.5450.86
pendulum swingup0.04838.4936.38
hopper stand0.02917.8520.45
cartpole swingup0.02864.6815.47
walker stand0.01980.725.21
cartpole balance0.01993.455.00
+ +![](images/d7afe35c310aa8abe9381c146b9ab23b720fef14d1cb53006e5b1a0d1c120e59.jpg) + +![](images/d636a29e7187d3848b343222574e19ee3d01ed547ba53e4ac28069319d6dd880.jpg) + +![](images/2960af33510b972d2906f2010d0c7c924e65f6d4ee9fdf7279005549689eef21.jpg) +Figure 7: Learning curves for the two tasks not shown in Figure 1. The upper row shows the mean reward with one standard deviation indicated by shading. The bottom row show learning curves for individual runs. Although the signal is noisy, several outlier runs fail to learn. + +![](images/0503a6021c86150c70d08a471ce8b3bb137e2a05618b5ed1398218155f5850ed.jpg) + +Table 5: Hyperparameters used throughout the paper. These follow Yarats et al. (2021b) for the medium tasks. + +
parametervalue
learning rate1e-4
soft-update τ1e-2
update frequency2
stddev. schedulelinear(1.0, 0.1, 500000)
stddev. clip0.3
action repeat2
seed frames4e3
batch size256
n-step returns3
discount γ0.99
+ +![](images/200e31811c22865259acf073c5688f0b19f41509ce0e3720fc169a028490b490.jpg) + +![](images/3ab1b45ffcca0f94780729ada349624c77cd1c939bff8ed35c2083341675ead9.jpg) + +![](images/7cb1a10e97f9e33d9539b51e9afc5f2ae967a4569ecc32306a9f6b0ffdf341e0.jpg) + +![](images/68af2d7a3389c271e78da87bc2d5fd55207c67bff9d4470248d7ce5b1ead935c.jpg) +Figure 8: Rewards obtained when gradually replacing a learned policy with a random policy. At every time-step $t$ , the action suggested by the learned policy is replaced with a random action with probability $p$ . We start from a final policy learned by the baseline algorithm and average over ten such policies. Across all tasks, the rewards decrease gracefully with a more random policy, suggesting that the environments are relatively robust to perturbed policies. + +![](images/4e06224f733c62b5a65afe711f25b722b53f5394ace4ccef02483584bfa306ec.jpg) + +![](images/50633292916097ffacfd77fa827cce6f44638cb68f6a00a297f9e395ffd38b61.jpg) + +![](images/a68b2090d9f3736657cae80e92c2518edf96ee81e0b0837e93d7882f67476202.jpg) + +![](images/30650c29ace322dc88178256478eca9a7c0b533db193029e7b10012cf1933864.jpg) + +![](images/db18dc09cf1ae950ab1bb80d7a20ce4f37744f9712b8faa01037cb0eafb5227d.jpg) +Figure 9: Correlation between the evaluation scores of two runs that share network initialization and seed experience, but otherwise have different randomness. Correlation is calculated across ten runs and plotted against time. The correlation is noisy for many environments but oscillates around zero, suggesting that there is little actual correlation and that network initialization and seed experience have a small effect on performance. + +![](images/6604fcc33bed1bf5b2974d8062155b1186d45a350f3f3226986afedc30c44737.jpg) + +![](images/69c958678591a9984904cc474c262b2d4175e4b911a4355cefa3966af3cf1265.jpg) +Figure 10: Four quantities shown during training for the combined agent. We show reward, norm of actor gradient $\|\nabla\ell\|$ , norm of actor weight $\|w\|$ and average absolute action $|\mathbf{a}|$ . The actions never saturate and learning starts quickly. Compare with Figure 3, which shows the same quantities for the baseline algorithm. + +![](images/00ee525faaba7b863855af98286dca96a81ba15d36ddd91236185c31c84a3dd5.jpg) + +![](images/f7c16aef3970595b49882843a5a7c6316b9a6bbbbf69d1bd0cacceedc8e74dcd.jpg) + +![](images/e8eddb4228ba76280ca34fd8ba12c36267c10c7de3ff0823296718999241fe0b.jpg) + +![](images/a7393c8c020ff84fdfdbacabf68dee2322ca8e07b73d29e397aa195457199eac.jpg) + +![](images/2d5527737dc42ab6ec03dedc6b859803d7a0c7c1d703047000832a821530f2ee.jpg) + +![](images/5cdc4f5f3e4c1939aeffc6132ec427a8ee888d042d935ca747e074ad2b15a735.jpg) + +![](images/7b85fff972854aa3c8ec29a337769384c132af70f9ffed9b82258886dd918588.jpg) + +![](images/c5ae50f4e19859f07cdec3888b4c317de8fd6479c2c004d311ddbc7c5759e079.jpg) + +![](images/64ceacdaae856eb37ac7e5c513364d6b5c95abbc0205551c8af57d0c4afc0ce6.jpg) +Figure 11: Learning curves when using the combined agent. We show mean reward with one standard deviation indicated by shading and learning curves for individual runs. + +![](images/17d6bb20a0bf1801221141988eba24a68f32d4c6076e81b9f45b6d7410fe961f.jpg) + +![](images/104cbffbea859834b83f95c8928ae4222251c1260f1b7825839a0e18e5da9763.jpg) +Figure 12: Rewards obtained during training for the runs illustrated in Figure 3. Note that the rewards are nonzero from the start of training. This implies that the agent observes rewards and can train on these. Thus, lack of rewards is not the cause of poor performance. + +![](images/29e65432573bf4394e56d57abf7d34604caf42ff1c3cc40d335a097343ed35ac.jpg) + +![](images/3eefe069cc3a0d455c05a314ecdc6d42214b51c07f40cd2321b33ba2f0f3a1e2.jpg) + +![](images/6259a5e16ff811aedc12d1f75b3cc809c5be94cf8f324a0f121a6b70bd937bc8.jpg) + +![](images/41f06464f43427682c99547651b1a7b9b7a38f0acb95f3875c621ae6c1404751.jpg) +Figure 13: The performance of the combined agents on two tasks when increasing the learning rate by a factor of 10. Performance improves markedly on these tasks. This highlights how hyperparameter tuning could further improve the results of Figure 5. + +![](images/be8edd00d37da818826e6efcc673d7222ead8edb422edd5e58662987a9e759a7.jpg) + +![](images/b26cd93de057c254720daa532b519791c90e528a29c9ac389e17edd1284716c8.jpg) +Figure 14: We repeat Figure 6 for all 10 seeds of the both pnorm agent of Table 2. Note that the action distribution does not saturate. + +![](images/38d6c711fcfeb0460f8b0a45aee1487e8b044e120d5203fa2217982086e39de1.jpg) +Figure 15: We repeat Figure 6 for all 10 seeds of the penalty agent of Table 2. Note that the action distribution does not saturate. + +![](images/cfd03d1db212e861b0e74a7c1e270b36a5433f3e4dba824b4839583420666c7b.jpg) +Figure 16: Performance profiles as computer by the reliable library of Agarwal et al. (2021). (Left) profiles over the original 5 tasks of Table 3, with 10 seeds for combined++ and 40 seeds for the two other methods. (Right) profiles over the additional 16 tasks of Figure 5, with 10 seeds per method. Our combined agents improve performance, especially for the lowest quantiles. The effect is most dramatic for the 5 original tasks, this is natural since we initially selected these as they suffered from high variance. Also note that the baseline is the recent SOTA DRQv2 agent of Yarats et al. (2021b), which is very competitive – so any improvements to it can be very significant. + +![](images/7382e5cbfaab1a27b01fcfe1f0d4d17333b587ed9e40b8a0359e8b97c520eb5f.jpg) + +![](images/b2c917f6ffee546ec29c2fd3015397e34810b82d225a03025589ddd4af1b9513.jpg) + +![](images/7da25e1bb57ffcf2a368135de1b2d4901975168ec2bd0f312a8a9b1d7bfcf3ee.jpg) + +![](images/459f9d9e0c03d7b056665eed831f3d62cd98c6d052bad7244fe42289e4b869e0.jpg) + +![](images/021e83f3b1b0823f5bb07a92e56fb95da14902812faa79f62c8cae1dcd1b1275.jpg) + +![](images/9160be80ee34123039cf1ffdce8410ba2a5ddfd0aca41c52d7aa47527434dfe8.jpg) + +![](images/1f8ccbcb49f256673713c6c530e8297dd906bdf37972ffc781a55df46fd9001e.jpg) +Figure 17: We repeat Figure 3 for all 40 seeds. The plots show five quantities for the baseline agent of the walker task: reward, absolute average action $|a|$ , actor weight norm $\| w\|$ , actor gradient norm $\| \nabla \ell \|$ and the logarithm of the actor gradient norm log $\| \nabla \ell \|$ . We add 1e-10 to the logarithm for numerical stability. Results are similar to Figure 3. + +![](images/ef59fdd021772f9abedadadee5acf7c43b7ed5bc25384851c3c959732d1802e0.jpg) + +# B IMPROVEMENTS FOR SPARSE TASKS + +In Figure 5, consider the five tasks where the combined agent suffers from the highest standard deviation. Four of these tasks have sparse rewards. This suggests that sparsity is a major driver of variance. To further decrease the variance, we now investigate fixes for four sparse tasks – cartpole swingup sparse, pendulum swingup, reacher hard, and finger turn hard. We will consider three additional modifications which aim to specifically combat reward sparsity: + +Avoiding training without rewards. For the sparse tasks, an agent might not see any rewards during e.g. the first 100 episodes. Perhaps training in the absence of any rewards harms the network weights. The fix we consider is simple, do not use any gradient updates before at least one non-zero reward has been observed. + +Increasing self-supervised learning. Since the agent might potentially not observe any rewards for 100 episodes, we consider extending the self-supervised learning to ensure some supervisory signal. We simply extend the self-supervised time from $10\mathrm{k}$ steps to the entire training process. + +Removing clipped double q-learning. The agent of Yarats et al. (2021a) employs clipped double q-learning (Fujimoto et al., 2018) – i.e. the agent uses two critic networks $Q_{1}, Q_{2}$ and takes $Q = \min(Q_{1}, Q_{2})$ to avoid overestimation. We hypothesise that the min-operator causes excessive pessimism in sparse environments where reward often are zero. For example, if $Q_{1} = 0$ and $Q_{2} > 0$ we have $Q = \min(Q_{1}, Q_{2}) = 0$ . Thus, if one Q-network outputs only zeros and the rewards are almost only zeros, the critic target of eq. (1) will be mostly zeros and the other Q-network will be encouraged to output mostly zeros too. Thus, the Q-network could potentially get stuck with mostly outputting zeros, an issue shown in Figure 18. We thus propose to use $Q_{a} = \mathrm{avg}(Q_{1}, Q_{2})$ . Through ablation experiments in Table 6, we find that using $Q_{a} = \mathrm{avg}(Q_{1}, Q_{2})$ only for the critic loss (i.e. eq. (1)) but retaining $Q = \min(Q_{1}, Q_{2})$ for the actor update, works the best. We call this strategy asymmetrically clipped double Q-learning. + +Results for these experiments are shown in Table 7. We see that decreasing pessimism and increasing self-supervised learning help the most. Increasing self-supervised learning helps the most for cart-pole swingup sparse and pendulum swingup. Note that these two tasks were not used in the ablation experiments of Table 2. Additionally, whereas feature learning was not the bottleneck for the baseline agent, it might be the bottleneck for the combined agent. Avoiding training without rewards does not seem to improve performance significantly. We conclude that increased self-supervised learning and asymmetrically clipped double Q-learning improve performance for tasks with sparse rewards. We add these two modifications to the combined agent and call the resulting agent combined++. Its performance across all 21 tasks is shown in Figure 5. It achieves even better results, and its average standard deviation is smaller than the baseline by a factor $>3$ . + +Table 6: Performance for various types of clipped double q-learning (Fujimoto et al., 2018). We compare exchanging $Q = \min(Q_1, Q_2)$ with $\mathrm{avg}(Q_1, Q_2)$ at two locations – when computing the critic loss (as in eq. (1)) and when computing the actor loss. The baseline always uses min, avg both uses avg at both locations, and avg critic/actor uses the avg only when defining the critic/actor loss. Using $Q = \mathrm{avg}(Q_1, Q_2)$ only when defining the critic loss performs the best. We call the resulting strategy asymmetrically clipped double Q-learning. + +
metricmethodcartpole sparsefinger turn hardpendulumreacher hardavg
μbaseline641.8596.5648.0872.6689.7
μavg actor80.9422.2776.0672.6487.9
μavg both393.0432.4647.6548.4505.4
μavg critic761.5811.3639.0939.2787.8
σbaseline321.5292.4283.595.5248.2
σavg actor242.6258.8138.9164.8201.3
σavg both393.3171.9323.1312.0300.1
σavg critic127.589.4318.637.3143.2
+ +Table 7: Performance for three fixes for sparse tasks: asymmetrically clipped double Q-learning (ac), no learning until at least one non-zero reward has been observed (nz) and more self-supervised learning (ssl). We show mean reward and standard deviation of rewards, using ten seeds. Using asymmetrically clipped double Q-learning and more self-supervised learning are the best fixes. Increasing the self-supervised learning helps the most for cartpole swingup sparse and pendulum swingup, two tasks which were not part of the five tasks we consider first. + +
metricmethodcartpole sparsefinger turnpendulumreacher hard
μbaseline641.8596.5648.0872.6
μssl+ac802.5788.0828.0930.2
μssl+nz607.6659.4813.5869.3
μac+nz561.4770.6624.6860.9
μnz618.2663.4657.2882.9
μac761.5811.3639.0939.2
μssl235.0574.6686.7882.7
μssl+nz +ac742.7729.8758.0922.7
σbaseline321.5292.4283.595.5
σssl+ac29.4135.624.247.6
σssl+nz286.1173.429.878.4
σac+nz306.2150.4330.080.3
σnz267.5192.1252.5117.7
σac127.589.4318.637.3
σssl359.7236.7272.580.1
σssl+nz +ac151.2130.9220.845.3
+ +![](images/cf8fa5c6674d7683c29dc60476b85baf9b9ae59576058eeb62bf0d07ed19461a.jpg) +Figure 18: We illustrate three quantities for 10 runs of the pendulum swingup task using the combined agent: the reward, $fnz(Q_t)$ the fraction of non-zero Q-target values obtained over the training batches, and $fnz(reward)$ the fraction of non-zero rewards obtained over the training batches. As shown in the two middle rows, the Q-values frequently "get stuck" at outputting almost only zeros. + +# C NORMALIZATION FOR THE CRITIC + +We now study why penultimate normalization is helpful for the critic network. We consider three agents from Table 2: baseline, actor pnorm, and both pnorm. The both pnorm agent uses penultimate normalization for the critic, whereas the others do not. We plot two additional quantities during early training for the reacher hard task, using 10 new seeds. In Figure 19 we show the average Q-values, measured over training batches, achieved by actions generated by the actor network. We see that the curves are much smoother when normalizing the critic, whereas they oscillate aggressively otherwise. Quickly oscillating Q-values makes it hard for the actor to learn a good policy. We hypothesize that stabilizing the Q-values over time is the primary mechanism by which critic normalization helps. In Figure 20 we show the average absolute difference between Q-values before and after a gradient update, as measured over training batches. We see that normalizing the critic often leads to Q-value changes which are smaller and more stable over time. This in turn likely stabilizes learning as per Figure 19. Whereas the Q-value changes can trivially be made smaller by decreasing the learning rate, changes in Q-values depend non-linearly on the learning rate. Furthermore, too low learning rates often hurt generalization (Li et al., 2019). For increased legibility, the curves are smoothed by averaging with a window of width ten. + +![](images/4a572ffd0bd8053d15c41627de5c6a8b1162dbe54ae74e19cffc09f56c0d494d.jpg) +Figure 19: Average Q-values during early training for three agents on the reacher hard task. The both pnorm agent, which uses penultimate normalization for the critic, has Q-values that grow steadily during training. The other agents have Q-values which often fluctuate wildly during training. This suggests that penultimate normalization for the critic stabilizes Q-values, which provides a less noisy signal to the actor. + +![](images/3a9f4c5455093ca84395e5db1563908eac18754af221c86fb96df0287cd6d242.jpg) +Figure 20: Average absolute difference $\Delta Q$ between Q-values before and after a gradient step. The Q-value changes are generally smaller and more stable over time for the both pnorm agent (which uses penultimate normalization for the critic). This likely stabilizes the Q-values as per Figure 19. + +# D LEARNING RATE STABILITY + +To verify that our fixes increase the stability we now consider changing the learning rate. A high learning rate can cause divergence (Li et al., 2019), and learning rate stability can thus serve as a proxy for learning stability. We consider learning rates in the set $\{1\mathrm{e} - 4,3\mathrm{e} - 4,1\mathrm{e} - 3,3\mathrm{e} - 3\}$ , where $1\mathrm{e} - 4$ is the default learning rate used by Yarats et al. (2021b). Results for the walker task are shown in Table 8. We see that the baseline algorithm fails for large learning rates, the average rewards drop quickly while variance decreases when no effective policy is learned. We show the same experiment for additional tasks, but only one learning rate, in Table 9. Again, we see that the agent can tolerate much higher learning rates when using our modifications. + +Table 8: Performance when changing learning rates. The baseline algorithm fails with larger learning rates whereas the combined agent succeeds. This suggests that our fixes improve the stability. Metrics are calculated over 10 seeds on the walker task. + +
metricmethod1e-43e-41e-33e-3
μbaseline769.1330.226.825.5
μcombined964.2962.2954.9960.1
σbaseline350.1415.33.96.4
σcombined6.24.75.65.1
+ +Table 9: Performance for the combined agent and the baseline when using learning rate of $1\mathrm{e} - 3$ The combined agent works well even with high learning rates, whereas the baseline fails. Statistics are computed over 10 seeds. + +
metricmethodacrobotfinger turnhopper hopreacheravg
μbaseline27.850.10.01.419.8
μcombined137.4618.6227.0727.2427.6
σbaseline35.649.90.02.021.9
σcombined33.9176.624.1151.096.4
+ +# E EVALUATION VARIANCE + +We now consider the variance arising from evaluating RL agents on a finite set of episodes. Similar to the bias-variance decomposition, we will see that the variance here can be divided into one part that depends upon the randomness of the algorithm, and one term that depends on the randomness from the finite set of episodes we evaluate on. We let $R$ be a set of training runs and $S$ be a set of evaluation episodes sampled. The performance is measured by + +$$ +\mathrm {p e r f} = \frac {1}{| R | | S |} \sum_ {i \in R} \sum_ {j \in S} r _ {i j} +$$ + +Let us calculate the variance of this quantity. We will assume that rewards from different runs are independent, and that rewards from the same training run are independent conditioned on that run. We now have + +$$ +\operatorname {V a r} \bigg (\frac {1}{| R | | S |} \sum_ {i \in R} \sum_ {j \in S} r _ {i j} \bigg) +$$ + +The variance of a sum of independent variables is simply the sum of their variances. Thus we have + +$$ +\operatorname {V a r} \left(\frac {1}{| R | | S |} \sum_ {i \in R} \sum_ {j \in S} r _ {i j}\right) = \frac {1}{| R |} \operatorname {V a r} \left(\frac {1}{| S |} \sum_ {j \in S} r _ {i j}\right) +$$ + +Let $\mu = \mathbb{E}[r_{ij}]$ . We then have + +$$ +\mathrm {V a r} \bigg (\frac {1}{| S |} \sum_ {j \in S} r _ {i j} \bigg) = \mathbb {E} _ {a l g, s a m p l e s} \bigg [ \bigg (\frac {1}{| S |} \sum_ {j \in S} r _ {i j} - \mu \bigg) ^ {2} \bigg ] +$$ + +Here we explicitly calculate the expectation over random training runs ( $alg$ ) and the random episodes sampled (samples). We can condition the expectation upon the random training run and then integrate over this expectation. Furthermore, let $\mu_{i} = \mathbb{E}[r_{ij}|i]$ , i.e. the expected value an episode sampled from training run $i$ . We then have + +$$ +\begin{array}{l} \mathrm {V a r} \bigg (\frac {1}{| S |} \sum_ {j \in S} r _ {i j} \bigg) = \mathbb {E} _ {a l g} \bigg [ \mathbb {E} _ {s a m p l e s} \bigg [ \bigg (\frac {1}{| S |} \sum_ {j \in S} r _ {i j} - \mu \bigg) ^ {2} \bigg | i \bigg ] \bigg ] \\ = \mathbb {E} _ {a l g} \left[ \mathbb {E} _ {s a m p l e s} \left[ \left(\frac {1}{| S |} \sum_ {j \in S} r _ {i j} - \mu_ {i} + \mu_ {i} - \mu\right) ^ {2} \Bigg | i \right] \right] \\ = \mathbb {E} _ {a l g} \left[ \mathbb {E} _ {s a m p l e s} \left[ \left(\frac {1}{| S |} \sum_ {j \in S} r _ {i j} - \mu_ {i}\right) ^ {2} \middle | i \right] \right. \\ + 2 \mathbb {E} _ {s a m p l e s} \left[ \left(\frac {1}{| S |} \sum_ {j \in S} r _ {i j} - \mu_ {i}\right) \left(\mu_ {i} - \mu\right) \Bigg | i \right] \\ + \mathbb {E} _ {s a m p l e s} \left[ \left(\mu_ {i} - \mu\right) ^ {2} \Big | i \right] \Biggr ] \\ \end{array} +$$ + +The middle part vanishes since $\mu_{i} = \mathbb{E}[r_{ij}|i]$ . For the first term, given a fixed training run the terms $r_{ij}$ are independent. This gives us + +Table 10: Sample variance and algorithm variance as defined in eq. (3). Some tasks have high variance and others have low. However, sampling more episodes does not decrease variance considerable in the 10 training seeds and 10 episodes setting, see eq. (4). + +
methodwalkerhopper hopfinger turnacrobotreacher
sample1922.1450.6143763.011182.9176211.9
alg80002.69774.055215.65710.935231.7
+ +$$ +\begin{array}{l} \mathbb {E} _ {a l g} \left[ \mathbb {E} _ {s a m p l e s} \left[ \left(\frac {1}{| S |} \sum_ {j \in S} r _ {i j} - \mu_ {i}\right) ^ {2} \right\rvert i \right] = \frac {1}{| S | ^ {2}} \mathbb {E} _ {a l g} \left[ \mathbb {E} _ {s a m p l e s} \left[ \left(\sum_ {j \in S} r _ {i j} - | S | \mu_ {i}\right) ^ {2} \right\rvert i \right] \\ = \frac {1}{| S | ^ {2}} \mathbb {E} _ {a l g} \left[ \right. \mathbb {E} _ {s a m p l e s} \left[ \sum_ {j \in S} \left(r _ {i j} - \mu_ {i}\right) ^ {2} \middle | i \right] = \frac {1}{| S |} \mathbb {E} _ {a l g} \left[ \mathbb {E} _ {s a m p l e s} \left[\left(r _ {i j} - \mu_ {i}\right) ^ {2} \middle | i \right]\right. \\ \end{array} +$$ + +We then have + +$$ +\operatorname {V a r} (\text {p e r f}) = \frac {1}{| R |} \underbrace {\mathbb {E} _ {a l g} [ (\mu_ {a l g} - \mu) ^ {2} ]} _ {\text {a l g o r i t h m v a r i a n c e}} + \frac {1}{| R | | S |} \underbrace {\mathbb {E} _ {a l g} \left[ \mathbb {E} _ {\text {s a m p l e s}} [ (r - \mu_ {a l g}) ^ {2} | i ] \right]} _ {\text {s a m p l e v a r i a n c e}} \tag {3} +$$ + +Here $\mu_{alg} = \mu_i$ . The first term is what we are interested in measuring. The second term can be large if the environment is noisy and we sample too few episodes. The second term is straightforward to estimate: run the algorithm N times and measure the performance over M samples. For each run, calculate the variance over the samples. Then average this variance over all runs. + +In Table 10 we estimate these quantities over ten training runs and ten episodes for the baseline algorithm. As we can see, the environments have very different characteristics. Some have high sample variance and some have very low sample variance. It is common to evaluate with ten training seeds and ten episodes. Can we improve the variance by evaluating on more episodes, say 100? Even for the task with the highest sample noise (reacher), the relative improvement in the standard deviation of the sample variance, i.e., + +$$ +\sqrt {\left(\sigma_ {a l g} ^ {2} + \frac {1}{1 0} \sigma_ {s a m p l e} ^ {2}\right) / \left(\sigma_ {a l g} ^ {2} + \frac {1}{1 0 0} \sigma_ {s a m p l e} ^ {2}\right)} \approx 1. 1 9 5 \tag {4} +$$ + +is no larger than $20\%$ . Thus, we conclude that only minor gains can come from evaluating on more episodes. Other environments outside the five we consider, however, might benefit more from using more samples. + +# F EXTENDED RELATED WORK + +There are plenty of important applications of RL. Examples include RL for medical testing (Bastani et al., 2021), autonomous vehicles (Bellemare et al., 2020), chemistry (Zhou et al., 2019; Liu et al., 2019), robotics (Kober et al., 2013) and communications infrastructure (Liu et al., 2020). Many more applications remain. Many of these applications require a low variance, but low-power inference (BJORck et al., 2021a) can also be important for e.g. autonomous robots. Below we discuss some papers closely related to ours in detail. + +Engstrom et al. (2019) studies how implementation level details affects performance from policy gradient methods. They specifically find that code-level optimizations can have a significant impact on performance, often rivaling that of algorithmic innovations. This insight agrees with our experimental observations that small modifications can significantly influence performance. + +Henderson et al. (2018) presents among the first studies of variability and reproducibility in deep reinforcement learning. They demonstrate that many minor details can have an outsized effect on the outcomes – seeds, environment randomness, and even hardware non-determinism. In our work, we have demonstrated how improved implementations can significantly decrease variance – and our improved agent suffers from much smaller variability between seeds. + +Islam et al. (2017) studies variance and reproducibility for continuous control with policy gradient methods. They discuss what metrics are suitable for comparing algorithms and highlight how hyperparameter tuning significantly affects outcomes and thus fairness of evaluations. Our results show that variance in continuous control can be significantly decreased with minor fixes, but we do not study variance from hyperparameter tuning which is an important direction. + +Mania et al. (2018) demonstrates that random search is in fact a competitive method for finding policies for continuous control tasks. This strategy is computationally cheap, and the authors present a large study of over 100 seeds, demonstrating that the variance is high. RL still suffers from high variance, but it is not clear if random search still is competitive compared to RL agents. + +Clary et al. (2018) studies variability for the Atari benchmark and finds large variability. In light of this, it is proposed that post-training performance should be reported as a distribution rather than as a point estimate. Our paper does not study the Atari suite, but this is an important benchmark that can model discrete tasks rather than continuous robot control problems. + +Lynnerup et al. (2020) presents a study over variance for evaluating RL agents on real-world robots. It is concluded that documenting hyperparameters and performing rigorous statistical analysis of the results is imperative. We only consider simulated tasks which are easy to reproduce as long as source code is available, reproducibility becomes much harder in the real world. + +Colas et al. (2019) discusses hypotheses testing in the context of RL experiments. They make recommendations regarding significance testing and discuss violations of statistical assumptions. Statistical testing has been criticized in later research (Agarwal et al., 2021), and we refrain from using it. + +Chan et al. (2020) proposes multiple metrics to measure notations of reliability in reinforcement learning, and presents an open-sources library to help with this. They discuss the distinction between variability during or after training and the use of significance testing. We have refrained from using hypothesis testing as it suffers from some issues (Agarwal et al., 2021). + +Jordan et al. (2020) shows that hyperparameters significantly affect the outcome of RL experiments, and proposes an evaluation strategy that takes this into account. To limit the computational footprint, we have used fixed hyperparameters. While we do not study it, hyperparameter stability is very important for practical applications, and developing RL agents with such stability is an outstanding challenge. + +Agarwal et al. (2021) studies variance and statistical significance for RL, focusing especially on Atari tasks where they provide experiments over 100 seeds which shows outlier runs. Among other things, they propose using inter-quartile-means and performance profiles for measuring performance. We adopt the use of performance profiles, but since we are especially interested in outliers inter-quartile-mean is not suitable for our purposes. + +Fujimoto et al. (2018) discusses how variance can be harmful to Q-learning, and propose several fixes to it, culminating in the TD3 agent. Some of these fixes have become very popular, especially double clipped Q-values. In Appendix B we revisit double clipped Q-values and find that it can hurt performance for sparse tasks. + +Anschel et al. (2017) shows that averaging Q-values can improve the stability and improve performance for a DQN agent. This strategy increases the computational footprint, and such ensembling is known to often work well for supervised learning. The paper mainly focuses on Atari tasks, in contrast, we consider continuous control tasks which arguably are closer to real-world applications. + +Nikishin et al. (2018), in a similar spirit, demonstrates that averaging weights can improve the stability of learning. The authors demonstrate that this can improve performance on Atari tasks, although only a handful of seeds appears to be used. To the best of our knowledge, this method is not widely adopted in RL, and we do not experimentally study it. + +Jia et al. (2020) considers using classical variance reduction methods such as SVRG (Johnson & Zhang, 2013) to improve deep Q-learning. The authors introduce a recursive framework for computing the stochastic gradient estimate and demonstrate that it can improve the performance of DQN. Again, this method is not widely adopted in RL to the best of our knowledge, and we do not empirically study it. + +Chen et al. (2018) considers RL as applied to a dynamic environment, motivated by applications to online recommendation. They propose stratified sampling replay, which relies on a prior customer distribution to decrease variance and the use of approximate regret. These ideas improve performance for DQN agents for a tip recommendation system, while this is an important setting, it is far from continuous control. + +Greensmith et al. (2004) studies the use of variance reduction methods for policy gradient methods. Specifically, they study the use of baseline methods, which can significantly decrease the variance and often is adopted in deep reinforcement learning. The use of baselines for policy gradient methods is distinct from the setup we consider. + +Parisotto et al. (2020) considers the use of transformers for reinforcement learning and finds that naively using them leads to poor performance. To address this, architectural modifications are proposed that lead to more stable training and improve performance. Studying transformer architectures is important for RL, but in this study, we only consider classical CNN and MLP networks. + +Kumar et al. (2019) considers stability for off-policy reinforcement learning, focusing on a setting where the off-policy data is fixed and there is no further interaction with the environment. In this setting, it is demonstrated that bootstrapping error is a key driver of instability, a method to address this issue is proposed. Off-policy reinforcement learning is very important for practical applications, but not the focus of our work. + +Mao et al. (2019) considers RL where a stochastic exogenous process influences the environment. In such a setting, a gradient policy method with a standard state-dependent baseline suffers from high variance, and the authors consider fixes to this. The setting considered in this work is distinct from the continuous control tasks we use. + +Gogianu et al. (2021) studies the use of spectral normalization (Miyato et al., 2018) for improving the performance of DQN for Atari tasks. They find that this method can stabilize learning when applied to the penultimate layer. Due to the similarity with the normalization methods we consider, we consider this strategy in Table 2. + +Wang et al. (2020) studies the behavior of a SAC agent when the entropy bonus is removed. They find that the tanh activations saturate which effectively eliminates exploration since SAC adds exploration noise inside the tanh non-linearity. This argument does not apply to DDPG which adds the exploration noise outside the non-linearity. We study the proposed method Table 2 and find that it underperforms, especially for the acrobot task. + +Salimans & Kingma (2016) proposes weight normalization, which reparametrizes the weights by decoupling magnitude and direction. They demonstrate that this idea improves performance in DQN and other settings. Despite the paper being well-known, this strategy has not become widely adopted in RL to the best of our knowledge. Similarly, to the best of our knowledge, batch normalization (Ioffe & Szegedy, 2015; Bjorck et al., 2018) is typically preferred in supervised learning. \ No newline at end of file diff --git a/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/images.zip b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..eb3a51bc11c82776a5e963068b45398710f3e139 --- /dev/null +++ b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:258760bcf3e9ce2cb178de52dedb08215475ff83ff262f64b1a6e0300f121b69 +size 1916037 diff --git a/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/layout.json b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c8542e8c4473058c6bca622ad0da2368baeccea9 --- /dev/null +++ b/ishighvarianceunavoidableinrlacasestudyincontinuouscontrol/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:666c14e4222bd25bed4f771655a9f8e9c9ad66b4160e031df92004af5a6e1a7d +size 647657 diff --git a/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_content_list.json b/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7c9fd6e4bb520430ea3472ea8b5418d449384e0f --- /dev/null +++ b/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ce627a5d3194f4f4b933e593e692ab0f1ac4f4bdb95463368a52d6027490958 +size 185950 diff --git a/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_model.json b/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..18b6f8cf5c9b7d31c4fac98cff60d4b55dc12e87 --- /dev/null +++ b/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2c305ac7338a37027ae39bcecb201b7b902e9a5f59fc6b5638afe425c769e0d +size 225561 diff --git a/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_origin.pdf b/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..79adbfa1aa3de591fe8bc21d7eccf155882fa394 --- /dev/null +++ b/ishomophilyanecessityforgraphneuralnetworks/204cf6a4-3c96-407f-a9ed-12af32678cb7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca6147ca63ebc6b6c21c9fc9861f2e378db032fee409673a62fc8e26814b0aa3 +size 1086970 diff --git a/ishomophilyanecessityforgraphneuralnetworks/full.md b/ishomophilyanecessityforgraphneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a5e4e4a33a1b2ead9ddfee43576389ede9fec196 --- /dev/null +++ b/ishomophilyanecessityforgraphneuralnetworks/full.md @@ -0,0 +1,858 @@ +# IS HOMOPHILY A NECESSITY FOR GRAPH NEURAL NETWORKS? + +Yao Ma + +New Jersey Institute of Technology +yao.ma@njit.edu + +Xiaorui Liu + +Michigan State University +xiaorui@msu.edu + +Neil Shah + +Snap Inc. +nshah@snap.com + +Jiliang Tang + +Michigan State University tangjili@msu.edu + +# ABSTRACT + +Graph neural networks (GNNs) have shown great prowess in learning representations suitable for numerous graph-based machine learning tasks. When applied to semi-supervised node classification, GNNs are widely believed to work well due to the homophily assumption ("like attracts like"), and fail to generalize to heterophilous graphs where dissimilar nodes connect. Recent works have designed new architectures to overcome such heterophily-related limitations. However, we empirically find that standard graph convolutional networks (GCNs) can actually achieve strong performance on some commonly used heterophilous graphs. This motivates us to reconsider whether homophily is truly necessary for good GNN performance. We find that this claim is not quite accurate, and certain types of "good" heterophily exist, under which GCNs can achieve strong performance. Our work carefully characterizes the implications of different heterophily conditions, and provides supporting theoretical understanding and empirical observations. Finally, we examine existing heterophilous graphs benchmarks and reconcile how the GCN (under)performs on them based on this understanding. + +# 1 INTRODUCTION + +Graph neural networks (GNNs) are a prominent approach for learning representations for graph structured data. Thanks to their great capacity in jointly leveraging attribute and graph structure information, they have been widely adopted to promote improvements for numerous graph-related learning tasks (Kipf and Welling, 2016; Hamilton et al., 2017; Ying et al., 2018; Fan et al., 2019; Zitnik et al., 2018), especially centered around node representation learning and semi-supervised node classification (SSNC). GNNs learn node representations by a recursive neighborhood aggregation process, where each node aggregates and transforms features from its neighbors. The node representations can then be utilized for downstream node classification or regression tasks. Due to this neighborhood aggregation mechanism, several existing works posit that many GNNs implicitly assume strong homophily and homophily is critical for GNNs to achieve strong performance on SSNC (Zhu et al., 2020b;a; Chien et al., 2021; + +Maurya et al., 2021; Halcrow et al., 2020; Lim et al., 2021). In general, homophily describes the phenomenon that nodes tend to connect with "similar" or "alike" others. Homophily is observed in a wide range of real-world graphs including friendship networks (McPherson et al., 2001), political networks (Gerber et al., 2013; Newman, 2018), citation networks (Ciotti et al., 2016) and more. Under the homophily assumption, through the aggregation process, a node's representation is "smoothed" via its neighbors' representations, since each node is able to receive additional information from neighboring nodes, which are likely to share the same label. Several recent works (Zhu et al., 2020b;a) claim that GNNs are implicitly (or explicitly) designed with homophily in mind, are not suitable for graphs exhibiting heterophily, where connected nodes are prone to have different properties or labels, e.g. dating networks or molecular networks (Zhu et al., 2020b). Such works accordingly design and modify new architectures and demonstrate outperformance over other GNN models on several heterophilous graphs. + +![](images/1914ccfcce6471e342b22f91d696e6902ca537f7509d2229893ec4699d3723d4.jpg) +Figure 1: A heterophilous graph on which GCN achieves perfect performance. + +Present work. In our work, we empirically find that the graph convolutional network (GCN) Kipf and Welling (2016), a fundamental, representative GNN model (which we focus on in this work) is actually able to outperform such heterophily-specific models on some heterophilous graphs after careful hyperparameter tuning. This motivates us to reconsider the popular notion in the literature that GNNs exhibit a homophilous inductive bias, and more specifically that strong homophily is crucial to strong GNN performance. Counter to this idea, we find that GCN model has the potential to work well for heterophilous graphs under suitable conditions. We demonstrate intuition with the following toy example: Consider the perfectly heterophilous graph (with all inter-class edges) shown in Figure 1, where the color indicates the node label. Blue-labeled and orange-labeled nodes are associated with the scalar feature 0 and 1, respectively. If we consider a single-layer GCN by performing an averaging feature aggregation over all neighboring nodes, it is clear that all blue nodes will have a representation of 1, while the orange nodes will have that of 0. Additional layers/aggregations will continue to alternate the features between the two types of nodes. Regardless of the number of layers, the two classes can still be perfectly separated. In this toy example, each blue (orange) node only connects orange (blue) nodes, and all blue (orange) nodes share similar neighborhood patterns in terms of their neighbors' label/feature distributions. + +Our work elucidates this intuition and extends it to a more general case: put simply, given a (homophilous or heterophilous) graph, GCN has the potential to achieve good performance if nodes with the same label share similar neighborhood patterns. We theoretically support this argument by investigating the learned node embeddings from the GCN model. We find that homophilous graphs always satisfy such assumptions, which explains why GCN typically works well for them. On other hand, there exist both "good" and "bad" heterophily, and GCNs can actually achieve strong performance for "good" heterophily settings while they usually fail on "bad" heterophily settings. Our work characterizes these settings, and provides a new perspective and solid step towards deeper understanding for heterophilous graphs. In short: + +Our contributions. (1) We reveal that strong homophily is not a necessary assumption for the GCN model. The GCN model can perform well over some heterophilous graphs under certain conditions. (2) We carefully characterize these conditions and provide theoretical understandings on how GCNs can achieve good SSNC performance under these conditions by investigating their embedding learning process. (3) We carefully investigate commonly used homophilous and heterophilous benchmarks and reason about GCN's performs on them utilizing our theoretical understanding. + +# 2 PRELIMINARIES + +Let $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ denote a graph, where $\mathcal{V}$ and $\mathcal{E}$ are the sets of nodes and edges, respectively. The graph connection information can also be represented as an adjacency matrix $\mathbf{A}\in \{0,1\}^{|\mathcal{V}|\times |\mathcal{V}|}$ , where $|\mathcal{V}|$ is the number of nodes in the graph. The $i,j$ -th element of the adjacency matrix $\mathbf{A}[i,j]$ is equal to 1 if and only if nodes $i$ and $j$ are adjacent to each other, otherwise $\mathbf{A}[i,j] = 0$ . Each node $i$ is associated with a $l$ -dimensional vector of node features $\mathbf{x}_i\in \mathbb{R}^l$ ; the features for all nodes can be summarized as a matrix $\mathbf{X}\in \mathbb{R}^{|\mathcal{V}|\times l}$ . Furthermore, each node $i$ is associated with a label $y_{i}\in \mathcal{C}$ where $\mathcal{C}$ denotes the set of labels. We also denote the set of nodes with a given label $c\in \mathcal{C}$ as $\mathcal{V}_c$ . We assume that labels are only given for a subset of nodes $\mathcal{V}_{label}\subset \mathcal{V}$ . The goal of semi-supervised node classification (SSNC) is to learn a mapping $f:\mathcal{V}\to \mathcal{C}$ utilizing the graph $\mathcal{G}$ , the node features $\mathbf{X}$ and the labels for nodes in $\mathcal{V}_{label}$ . + +# 2.1 HOMOPHILY IN GRAPHS + +In this work, we focus on investigating performance in the context of graph homophily and heterophily properties. Homophily in graphs is typically defined based on similarity between connected node pairs, where two nodes are considered similar if they share the same node label. The homophily ratio is defined based on this intuition following Zhu et al. (2020b). + +Definition 1 (Homophily). Given a graph $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ and node label vector $y$ , the edge homophily ratio is defined as the fraction of edges that connect nodes with the same labels. Formally, we have: + +$$ +h (\mathcal {G}, \{y _ {i}; i \in \mathcal {V} \}) = \frac {1}{| \mathcal {E} |} \sum_ {(j, k) \in \mathcal {E}} \mathbb {1} (y _ {j} = y _ {k}), \tag {1} +$$ + +where $|\mathcal{E}|$ is the number of edges in the graph and $\mathbb{1}(\cdot)$ is the indicator function. + +A graph is typically considered to be highly homophilous when $h(\cdot)$ is large (typically, $0.5 \leq h(\cdot) \leq 1$ ), given suitable label context. On the other hand, a graph with a low edge homophily ratio is considered to be heterophilous. In future discourse, we write $h(\cdot)$ as $h$ when discussing given a fixed graph and label context. + +# 2.2 GRAPH NEURAL NETWORKS + +Graph neural networks learn node representations by aggregating and transforming information over the graph structure. There are different designs and architectures for the aggregation and transformation, which leads to different graph neural network models (Scarselli et al., 2008; Kipf and Welling, 2016; Hamilton et al., 2017; Velicković et al., 2017; Gilmer et al., 2017; Zhou et al., 2020). + +One of the most popular and widely adopted GNN models is the graph convolutional network (GCN). A single GCN operation takes the following form $\mathbf{H}' = \mathbf{D}^{-1}\mathbf{A}\mathbf{H}\mathbf{W}$ , where $\mathbf{H}$ and $\mathbf{H}'$ denote the input and output features of layer, $\mathbf{W}^{(k)}\in \mathbb{R}^{l\times l}$ is a parameter matrix to transform the features, and $\mathbf{D}$ is a diagonal matrix and $\mathbf{D}[i,i] = deg(i)$ with $deg(i)$ denoting the degree of node $i$ . From a local perspective for node $i$ , the process can be written as a feature averaging process $\mathbf{h}_i = \frac{1}{\deg(i)}\sum_{j\in \mathcal{N}(i)}\mathbf{W}\mathbf{x}_j$ , where $\mathcal{N}(i)$ denotes the neighbors of node $i$ . The neighborhood $\mathcal{N}(i)$ may contain the node $i$ itself. Usually, when building GCN model upon GCN operations, nonlinear activation functions are added between consecutive GCN operations. + +# 3 GRAPH CONVOLUTIONAL NETWORKS UNDER HETEROPHILY + +Considerable prior literature posits that graph neural networks (such as GCN) work by assuming and exploiting homophily assumptions in the underlying graph (Maurya et al., 2021; Halcrow et al., 2020; Wu et al., 2018). To this end, researchers have determined that such models are considered to be ill-suited for heterophilous graphs, where the homophily ratio is low (Zhu et al., 2020b;a; Chien et al., 2021). To deal with this limitation, researchers proposed several methods including H2GNN (Zhu et al., 2020b), CPGNN (Zhu et al., 2020a) and GPRGNN (Chien et al., 2021), which are explicitly designed to handle heterophilous graphs via architectural choices (e.g. adding skip- + +connections, carefully choosing aggregators, etc.) + +In this section, we revisit the claim that GCNs have fundamental homophily assumptions and are not suited for heterophilous graphs. To this end, we first observe empirically that the GCN model achieves fairly good performance on some of the commonly used heterophilous graphs; specifically, we present SSNC performance on two commonly used heterophilous graph datasets, Chameleon and Squirrel in Table 1 (see Appendix D for further details about the datasets and models). Both Chameleon and Squirrel are highly + +Table 1: SSNC accuracy on two heterophilous datasets. + +
MethodChameleon (h = 0.23)Squirrel (h = 0.22)
GCN67.96 ± 1.8254.47 ± 1.17
H2GCN-157.11 ± 1.5836.42 ± 1.89
H2GCN-259.39 ± 1.9837.90 ± 2.02
CPGNN-MLP54.53 ± 2.3729.13 ± 1.57
CPGNN-Cheby65.17 ± 3.1729.25 ± 4.17
GPRGNN66.31 ± 2.0550.56 ± 1.51
MLP48.11 ± 2.2331.68 ± 1.90
+ +heterophilous $(h\approx 0.2)$ . We find that with some hyperparameter tuning, GCN can outperform alternative methods uniquely designed to operate on some certain heterophilous graphs. This observation suggests that GCN does not always "underperform" on heterophilous graphs, and it leads us to reconsider the prevalent assumption in literature. Hence, we next examine how GCNs learn representations, and how this information is used in downstream SSNC tasks. + +# 3.1 WHEN DOES GCN LEARN SIMILAR EMBEDDINGS FOR NODES WITH THE SAME LABEL? + +GCN is considered to be unable to tackle heterophilous graphs due to its feature averaging process (Zhu et al., 2020b; Chien et al., 2021). Namely, a node's newly aggregated features are considered "corrupted" by those neighbors that do not share the same label, leading to the intuition that GCN embeddings are noisy and un-ideal for SSNC. However, we find that crucially, for some heterophilous graphs, the features of nodes with the same label are "corrupted in the same way." Hence, the obtained embeddings still contain informative characteristics and thus facilitate SSNC. We next illustrate when GCN learns similar embeddings for nodes with the same label, beginning with a toy example and generalizing to more practical cases. + +GCNs have been shown to be able to capture the local graph topological and structural information (Xu et al., 2019; Morris et al., 2019). Specifically, the aggregation step in the GCN model is able to capture and discriminate neighborhood distribution information, e.g. the mean of the neighborhood features (Xu et al., 2019). Let us con + +sider the two nodes $a$ and $b$ shown in Figure 2, where we use color to indicate the label of each node. If we further assume that all nodes sharing the same label are associated with exactly the same features, then clearly, after 1-step aggregation, the GCN operation will output exactly the same embedding for nodes $a$ and $b$ . Accordingly, Xu et al. (2019) reasons that the GCN model lacks expressiveness due to its inability to differentiate the two nodes in the embedding space. However, in + +![](images/f5d363d69af1a08b260a54c84da5d390429d7de3202178919eb0c3d22cedce20.jpg) +Figure 2: Two nodes share the same neighborhood distribution; GCN learns equivalent embeddings for $a$ and $b$ . + +the SSNC task, mapping $a$ and $b$ to the same location in the embedding space is explicitly desirable. Intuitively, if all nodes with the same label are mapped to the same embedding and embeddings for different labels are distinct, SSNC is effortless (Zhao et al., 2020). + +Such assumptions are hard to meet in practice. Thus, to consider a more practical scenario, we assume that both features and neighborhood patterns for nodes with a certain label are sampled from some fixed distributions. Under these conditions, same-label nodes may not share fixed embeddings, but we can aim to characterize their closeness. Intuitively, if the learned embeddings for same-label nodes are close and embeddings for other-label nodes are far, we expect strong SSNC performance to be good, given class separability (low intra-class variance and high inter-class variance) (Fisher, 1936). We prove that, for graphs meeting suitable conditions the distance between GCN-learned embeddings of any same-label node pair is bounded by a small quantity with high probability. + +Assumptions on Graphs. We consider a graph $\mathcal{G}$ , where each node $i$ has features $\mathbf{x}_i \in \mathbb{R}^l$ and label $y_i$ . We assume that (1) The features of node $i$ are sampled from feature distribution $\mathcal{F}_{y_i}$ , i.e., $\mathbf{x}_i \sim \mathcal{F}_{y_i}$ , with $\mu(\mathcal{F}_{y_i})$ denoting its mean; (2) Dimensions of $\mathbf{x}_i$ are independent to each other; (3) The features in $\mathbf{X}$ are bounded by a positive scalar $B$ , i.e., $\max_{i,j} |\mathbf{X}[i,j]| \leq B$ ; (4) For node $i$ , its neighbor's labels are independently sampled from neighbor distribution $\mathcal{D}_{y_i}$ . The sampling is repeated for $deg(i)$ times to sample the labels for $deg(i)$ neighbors. + +We denote a graph following these assumptions (1)-(4) as $\mathcal{G} = \{\mathcal{V},\mathcal{E},\{\mathcal{F}_c,c\in \mathcal{C}\} ,\{\mathcal{D}_c,c\in \mathcal{C}\} \}$ . Note that we use the subscripts in $\mathcal{F}_{y_i}$ and $\mathcal{D}_{y_i}$ to indicate that these two distributions are shared by all nodes with the same label as node $i$ . Next, we analyze the embeddings obtained after a GCN operation. Following previous works (Li et al., 2018; Chen et al., 2020; Baranwal et al., 2021), we drop the non-linearity in the analysis. + +Theorem 1. Consider a graph $\mathcal{G} = \{\mathcal{V},\mathcal{E},\{\mathcal{F}_c,c\in \mathcal{C}\} ,\{\mathcal{D}_c,c\in \mathcal{C}\} \}$ , which follows Assumptions (1)-(4). For any node $i\in \mathcal{V}$ , the expectation of the pre-activation output of a single GCN operation is given by + +$$ +\mathbb {E} \left[ \mathbf {h} _ {i} \right] = \mathbf {W} \left(\mathbb {E} _ {c \sim \mathcal {D} _ {y _ {i}}, \mathbf {x} \sim \mathcal {F} _ {c}} [ \mathbf {x} ]\right). \tag {2} +$$ + +and for any $t > 0$ , the probability that the distance between the observation $\mathbf{h}_i$ and its expectation is larger than $t$ is bounded by + +$$ +\mathbb {P} \left(\| \mathbf {h} _ {i} - \mathbb {E} [ \mathbf {h} _ {i} ] \| _ {2} \geq t\right) \leq 2 \cdot l \cdot \exp \left(- \frac {\operatorname {d e g} (i) t ^ {2}}{2 \rho^ {2} (\mathbf {W}) B ^ {2} l}\right), \tag {3} +$$ + +where $l$ denotes the feature dimensionality and $\rho (\mathbf{W})$ denotes the largest singular value of $\mathbf{W}$ . + +The detailed proof can be found in Appendix A. Theorem 1 demonstrates two key ideas. First, in expectation, all nodes with the same label have the same embedding (Eq. (2)). Second, the distance between the output embedding of a node and its expectation is small with a high probability. Specifically, this probability is related to the node degree and higher degree nodes have higher probability to be close to the expectation. Together, these results show that the GCN model is able to map nodes with the same label to an area centered around the expectation in the embedding space under given assumptions. Then, the downstream classifier in the GCN model is able to assign these nodes to the same class with high probability. To ensure that the classifier achieves strong performance, the centers (or the expectations) of different classes must be distant from each other; if we assume that $\mu(\mathcal{F}_{y_i})$ are distinct from each other (as is common), then the neighbor distributions $\{\mathcal{D}_c, c \in \mathcal{C}\}$ must be distinguishable to ensure good SSNC performance. Based on these understandings and discussions, we have the following key (informal) observations on GCN's performance for graphs with homophily and heterophily. + +Observation 1 (GCN under Homophily). In homophilous graphs, the neighborhood distribution of nodes with the same label (w.l.o.g. $c$ ) can be approximately regarded as a highly skewed discrete $\mathcal{D}_c$ with most of the mass concentrated on the category $c$ . Thus, different labels clearly have distinct distributions. Hence, the GCN model typically in SSNC on such graph, with high degree nodes benefiting more, which is consistent with previous work (Tang et al., 2020b). + +Observation 2 (GCN under Heterophily). In heterophilous graphs, if the neighborhood distribution of nodes with the same label (w.l.o.g. c) is (approximately) sampled from a fixed distribution $\mathcal{D}_c$ , and different labels have distinguishable distributions, then GCN can excel at SSNC, especially when node degrees are large. Otherwise, GCNs may fail for heterophilous graphs. + +Notably, our findings illustrate that disruptions of certain conditions inhibit GCN performance on heterophilous graphs, but heterophily is not a sufficient condition for poor GCN performance. GCNs are able to achieve reasonable performance for both homophilous and heterophilous graphs if they follow certain assumptions as discussed in the two observations. In Section 3.2, we theoretically + +demonstrate these observations for graphs sampled from the Contextual Stochastic Block Model (CSBM) (Deshpande et al., 2018) with two classes, whose distinguishability of neighborhood distributions can be explicitly characterized. Furthermore, in Section 3.3, we empirically demonstrate these observations on graphs with multiple classes. We note that although our derivations are for GCN, a similar line of analysis can be used for more general message-passing neural networks. + +# 3.2 ANALYSIS BASED ON CSBM MODEL WITH TWO CLASSES + +The CSBM model. To clearly control assumptions, we study the contextual stochastic block model(CSBM), a generative model for random graphs; such models have been previously adopted for benchmarking graph clustering (Fortunato and Hric, 2016) and GNNs (Tsitsulin et al., 2021). Specifically, we consider a CSBM model consisting of two classes $c_{1}$ and $c_{2}$ . In this case, the nodes in the generated graphs consist of two disjoint sets $\mathcal{C}_1$ and $\mathcal{C}_2$ corresponding to the two classes, respectively. Edges are generated according to an intra-class probability $p$ and an inter-class probability $q$ . Specifically, any two nodes in the graph, are connected by an edge with probability $p$ , if they are from the same class, otherwise, the probability is $q$ . For each node $i$ , its initial features $\mathbf{x}_i \in \mathbb{R}^l$ are sampled from a Gaussian distribution $\mathbf{x}_i \sim N(\boldsymbol{\mu}, \mathbf{I})$ , where $\boldsymbol{\mu} = \boldsymbol{\mu}_k \in \mathbb{R}^l$ for $i \in \mathcal{C}_k$ with $k \in \{1, 2\}$ and $\boldsymbol{\mu}_1 \neq \boldsymbol{\mu}_2$ . We denote a graph generated from such an CSBM model as $\mathcal{G} \sim \mathrm{CSBM}(\boldsymbol{\mu}_1, \boldsymbol{\mu}_2, p, q)$ . We denote the features for node $i$ obtained after a GCN operation as $\mathbf{h}_i$ . + +Linear separability under GCN. To better evaluate the effectiveness of GCN operation, we study the linear classifiers with the largest margin based on $\{\mathbf{x}_i,i\in \mathcal{V}\}$ and $\{\mathbf{h}_i,i\in \mathcal{V}\}$ and compare their performance. Since the analysis is based on linear classifiers, we do not consider the linear transformation in the GCN operation as it can be absorbed in the linear model, i.e., we only consider the process $\mathbf{h}_i = \frac{1}{deg(i)}\sum_{j\in \mathcal{N}(i)}\mathbf{x}_j$ . For a graph $\mathcal{G}\sim \mathrm{CSBM}(\pmb {\mu}_1,\pmb {\mu}_2,p,q)$ , we can approximately regard that for each node $i$ , its neighbor's labels are independently sampled from a neighborhood distribution $\mathcal{D}_{y_i}$ , where $y_{i}$ denotes the label of node $i$ . Specifically, the neighborhood distributions corresponding to $c_{1}$ and $c_{2}$ are $\mathcal{D}_{c_1} = [\frac{p}{p + q},\frac{q}{p + q} ]$ and $\mathcal{D}_{c_2} = [\frac{q}{p + q},\frac{p}{p + q} ]$ , respectively. + +Based on the neighborhood distributions, the features obtained from GCN operation follow Gaussian distributions: + +$$ +\mathbf {h} _ {i} \sim N \left(\frac {p \boldsymbol {\mu} _ {1} + q \boldsymbol {\mu} _ {2}}{p + q}, \frac {\mathbf {I}}{\sqrt {\operatorname* {d e g} (i)}}\right), \text {f o r} i \in \mathcal {C} _ {1}; \text {a n d} \mathbf {h} _ {i} \sim N \left(\frac {q \boldsymbol {\mu} _ {1} + p \boldsymbol {\mu} _ {2}}{p + q}, \frac {\mathbf {I}}{\sqrt {\operatorname* {d e g} (i)}}\right), \text {f o r} i \in \mathcal {C} _ {2}. \tag {4} +$$ + +Based on the properties of Gaussian distributions, it is easy to see that Theorem 1 holds. We denote the expectation of the original features for nodes in the two classes as $\mathbb{E}_{c_1}[\mathbf{x}_i]$ and $\mathbb{E}_{c_2}[\mathbf{x}_i]$ . Similarly, we denote the expectation of the features obtained from GCN operation as $\mathbb{E}_{c_1}[\mathbf{h}_i]$ and $\mathbb{E}_{c_2}[\mathbf{h}_i]$ . The following proposition describes their relations. + +Proposition 1. $(\mathbb{E}_{c_1}[\mathbf{x}_i],\mathbb{E}_{c_2}[\mathbf{x}_i])$ and $(\mathbb{E}_{c_1}[\mathbf{h}_i],\mathbb{E}_{c_2}[\mathbf{h}_i])$ share the same middle point. $\mathbb{E}_{c_1}[\mathbf{x}_i] - \mathbb{E}_{c_2}[\mathbf{x}_i]$ and $\mathbb{E}_{c_1}[\mathbf{h}_i] - \mathbb{E}_{c_2}[\mathbf{h}_i]$ share the same direction. Specifically, the middle point $\mathbf{m}$ and the shared direction $\mathbf{w}$ are as follows: $\mathbf{m} = (\pmb {\mu}_1 + \pmb {\mu}_2) / 2$ , and $\mathbf{w} = (\pmb {\mu}_1 - \pmb {\mu}_2) / \| \pmb {\mu}_1 - \pmb {\mu}_2\| _2$ . + +This proposition follows from direct calculations. Given that the feature distributions of these two classes are systematic to each other (for both $\mathbf{x}_i$ and $\mathbf{h}_i$ ), the hyperplane that is orthogonal to $\mathbf{w}$ and goes through $\mathbf{m}$ defines the decision boundary of the optimal linear classifier for both types of features. We denote this decision boundary as $\mathcal{P} = \{\mathbf{x}|\mathbf{w}^\top \mathbf{x} - \mathbf{w}^\top (\pmb {\mu}_1 + \pmb {\mu}_2) / 2\}$ . + +Next, to evaluate how GCN operation affects the classification performance, we compare the probability that this linear classifier misclassifies a certain node based on the features before and after the GCN operation. We summarize the results in the following theorem. + +Theorem 2. Consider a graph $\mathcal{G} \sim CSBM(\pmb{\mu}_1, \pmb{\mu}_2, p, q)$ . For any node $i$ in this graph, the linear classifier defined by the decision boundary $\mathcal{P}$ has a lower probability to misclassify $\mathbf{h}_i$ than $\mathbf{x}_i$ when $\deg(i) > (p + q)^2 / (p - q)^2$ . + +The detailed proof can be found in Appendix B. Note that the Euclidean distance between the two discrete neighborhood distributions $\mathcal{D}_{c_0}$ and $\mathcal{D}_{c_1}$ is $\sqrt{2} \frac{|p - q|}{(p + q)}$ . Hence, Theorem 2 demonstrates that the node degree $deg(i)$ and the distinguishability (measured by the Euclidean distance) of the neighborhood distributions both affect GCN's performance. Specifically, we can make the following conclusions: (1) When $p$ and $q$ are fixed, the GCN operation is more likely to improve the linear separability of the high-degree nodes than low-degree nodes, which is consistent with observations in (Tang et al., 2020b). (2) The more distinguishable the neighborhood distributions are (or the larger the Euclidean distance is), the more nodes can be benefited from the GCN operation. For + +![](images/0c46b0bf8b41e164232e5478ba8d7d3e6e6b57732a3981d3510e37ad4e6d9ded.jpg) +(a) Synthetic graphs generated from Cora + +![](images/2cd3d3e344ccc331492a7e07322c9acf2632481889dfd8bc7a490b818680ae0a.jpg) +(b) Synthetic graphs generated from Citeseer +Figure 3: SSNC accuracy of GCN on synthetic graphs with various homophily ratios. + +example, when $p = 9q$ or $9p = q$ , $(p + q)^2 / (p - q)^2 \approx 1.23$ , thus nodes with degree larger than 1 can benefit from the GCN operation. These two cases correspond to extremely homophily ( $h = 0.9$ ) and extremely heterophily ( $h = 0.1$ ), respectively. However, GCN model behaves similarly on these two cases and is able to improve the performance for most nodes. This clearly demonstrates that heterophily is not a sufficient condition for poor GCN performance. Likewise, when $p \approx q$ , the two neighborhood distributions are hardly distinguishable, and only nodes with extremely large degrees can benefit. In the extreme case, where $p = q$ , the GCN operation cannot help any nodes at all. Note that Theorem 2 and the followed analysis can be extended to a multi-class CSBM scenario as well – see Appendix F for an intuitive explanation and proof sketch. + +# 3.3 EMPIRICAL INVESTIGATIONS ON GRAPHS WITH MULTIPLE CLASSES + +We conduct experiments to substantiate our claims in Observations 1 and 2 in graphs with multiple classes. We evaluate how SSNC performance changes as we make a homophilous graph more and more heterophilous under two settings: (1) different labels have distinct distributions, and (2) different labels' distributions are muddled. + +3.3.1 TARGETED HETEROPHILOUS EDGE ADDITION Graph generation strategy. We start with common, real-world benchmark graphs, and modify their topology by adding synthetic, cross-label edges that connect nodes with different labels. Following our discussion in Observation 2, we construct synthetic graphs that have similar neighborhood distributions for same-label nodes. Specif- + +ically, given a real-world graph $\mathcal{G}$ , we first define a discrete neighborhood target distribution $\mathcal{D}_c$ for each label $c\in \mathcal{C}$ . We then follow these target distributions to add cross-label edges. The process of generating new graphs by adding edges to $\mathcal{G}$ is shown in Algorithm 1. Specifically, we add a total $K$ edges to the given graph $\mathcal{G}$ : to add each edge, we first uniformly sample a node $i$ from $\mathcal{V}$ with label $y_{i}$ , then we sample a label $c$ from $\mathcal{C}$ according to $\mathcal{D}_{y_i}$ , and finally, we uniformly sample a node $j$ from $\mathcal{V}_c$ and add the edge $(i,j)$ to the graph. We generate synthetic graphs based on several real-world graphs. We present the results based on Cora and Citeseer (Sen et al., 2008). The results for other datasets can be found in Appendix C. Both Cora and Citeseer exhibit strong homophily. For both datasets, we fix $\mathcal{D}_c$ for all labels. Although many suitable $\mathcal{D}_c$ could be specified in line with Observation 2, we fix one set for illustration and brevity. For both datasets, we vary $K$ over 11 values and thus generate 11 graphs. Notably, as $K$ increases, the homophily $h$ decreases. More detailed information about the $\{\mathcal{D}_c,c\in \mathcal{C}\}$ and $K$ for both datasets is included in Appendix C. + +Observed results. Figure 3(a-b) show SSNC results (accuracy) on graphs generated based on Cora and CiteSeer, respectively. The black line in both figures shows results for the presented setting (we introduce $\gamma$ in next subsection). Without loss of generality, we use Cora (a) to discuss our findings, since observations are similar over these datasets. Each point on the black line in Figure 3(a) represents the performance of GCN model on a certain generated graph and the corresponding value in $x$ -axis denotes the homophily ratio of this graph. The point with homophily ratio $h = 0.81$ denotes the original Cora graph, i.e., $K = 0$ . We observe that as $K$ increases, $h$ decreases, and while the classification performance first decreases, it eventually begins to increase, showing a $V$ -shape pattern. For instance, when $h = 0.25$ (a rather heterophilous graph), the GCN model achieves an impressive $86\%$ accuracy, even higher than that achieved on the original Cora graph. We note that + +Alg. 1: Hetero. Edge Addition +input: $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ $K,\{\mathcal{D}_c\}_{c = 0}^{|C| - 1}$ and $\{\mathcal{V}_c\}_{c = 0}^{|C| - 1}$ +output: $\mathcal{G}' = \{\mathcal{V},\mathcal{E}'\}$ +Initialize $\mathcal{G}' = \{\mathcal{V},\mathcal{E}\}$ $k = 1$ . +while $1\leq k\leq K$ do Sample node $i\sim$ Uniform(V); Obtain the label, $y_{i}$ of node i; Sample a label $c\sim \mathcal{D}_{y_i}$ Sample node $j\sim$ Uniform $(\mathcal{V}_c)$ Update edge set $\mathcal{E}' = \mathcal{E}'\cup \{(i,j)\}$ $k\gets k + 1$ +return $\mathcal{G}' = \{\mathcal{V},\mathcal{E}'\}$ + +![](images/e1a85e630c9de5bab05b36265931ea947f88db36b1c857f84d0c4fafd33b4b46.jpg) +(a) $\gamma = 0$ Acc: $86\%$ + +![](images/b0cf6e3bef4d99b7b5a77a29a48a1b4fdd063666fa16104bed5639965931026c.jpg) +(b) $\gamma = 0.4$ Acc: $66\%$ +Figure 4: Cross-class neighborhood similarity on synthetic graphs generated from Cora; all graphs have $h = 0.25$ , but with varying neighborhood distributions as per the noise parameter $\gamma$ . + +![](images/8885b0f1a5c2410fe24c2884078a89d1c6b69e9a8f2e20d90b2981ab74b81914.jpg) +(c) $\gamma = 0.8$ , Acc: $44\%$ + +![](images/be8e756b3c80144b61d376f2c168609b527b32cfcc3bbfdc0f0a8f1d2f9b6a3b.jpg) +(d) $\gamma = 1$ , Acc: $41\%$ + +performance continues to increase as $K$ increases further to the right (we censor due to space limitations; see Appendix C for details). This clearly demonstrates that the GCN model can work well on heterophilous graphs under certain conditions. Intuitively, the $V$ -shape arises due to a "phase transition", where the initial topology is overridden by added edges according to the associated $\mathcal{D}_c$ target neighbor distributions. In the original graph, the homophily ratio is quite high ( $h = 0.81$ ), and classification behavior is akin to that discussed in Observation 1, where same-label nodes have similar neighborhood patterns. As we add edges to the graph, the originally evident neighborhood patterns are perturbed by added edges and gradually become less informative, which leads to the performance decrease in the decreasing segment of the $V$ -shape in Figure 3(a). Then, as we keep adding more edges, the neighborhood pattern gradually approaches $\mathcal{D}_c$ for all $c$ , corresponding to the increasing segment of the $V$ -shape. + +# 3.3.2 INTRODUCING NOISE TO NEIGHBORHOOD DISTRIBUTIONS + +Graph generation strategy. In Section 3.3.1, we showed that the GCN model can achieve reasonable performance on heterophilous graphs constructed following distinct, pre-defined neighborhood patterns. As per Observation 2, our theoretical understanding suggests that performance should degrade under heterophily if the distributions of different labels get more and more indistinguishable. Hence, we next demonstrate this empirically by introducing controllable noise levels into our edge addition strategy. We adopt a strategy similar to that described in Algorithm 1, but with the key difference being that we introduce an additional parameter $\gamma$ , which controls the probability that we add cross-label edges randomly rather than following the pre-defined distributions. A detailed description of this approach is demonstrated in Algorithm 2 in Appendix C. For nodes of a given class $c$ (w.l.o.g), compared to the edges added according to $\mathcal{D}_c$ , the randomly added edges can be regarded as noise. Specifically, by increasing the noise parameter $\gamma$ , we increase the similarity between $\mathcal{D}_c, \mathcal{D}_{c'}$ for any pair of labels $c, c'$ . If $\gamma = 1$ , then all neighborhood distributions will be indistinguishable (they will all be approximately $\mathrm{Uniform}(|\mathcal{C}|)$ ). By fixing $K$ and varying $\gamma$ , we can generate graph variants with the same homophily ratio but different similarities between $\mathcal{D}_c$ and $\mathcal{D}_{c'}$ . As in Section 3.3.1, we create graphs by adding edges at various $K$ , but also vary $\gamma \in [0,1]$ in increments of 0.2 on both Cora and Citeseer. + +Observed results. We report the SSNC performance on these graphs in Figure 3. Firstly, we observe that noise affects the performance significantly when the homophily ratio is low. For example, observing Figure 3(a) vertically at homophily ratio $h = 0.25$ , higher $\gamma$ clearly results in worse performance. This indicates that not only the fixed-ness of the neighborhood distributions, but their similarities are important for the SSNC task (aligned with Observation 2. It also indicates that there are "good" and "bad" kinds of heterophily. On the other hand, high $\gamma$ does not too-negatively impact when $K$ is small, since noise is minimal and the original graph topology is yet largely homophilous. At this stage, both "good" (fixed and disparate patterns) and "bad" (randomly added edges) heterophilous edges introduce noise to the dominant homophilous patterns. When the noise level $\gamma$ is not too large, we can still observe the $V$ -shape: e.g. $\gamma = 0.4$ in Figure 3(a) and $\gamma = 0.2$ in Figure 3 (b); this is because the designed pattern is not totally dominated by the noise. However, when $\gamma$ is too high, adding edges will constantly decrease the performance, as nodes of different classes have indistinguishably similar neighborhoods. + +To further demonstrate how $\gamma$ affects the neighborhood distributions in the generated graph, we examine the cross-class neighborhood similarity, which we define as follows: + +Definition 2 (Cross-Class Neighborhood Similarity (CCNS)). Given graph $\mathcal{G}$ and labels $\mathbf{y}$ for all nodes, the CCNS between classes $c, c' \in \mathcal{C}$ is $s(c, c') = \frac{1}{|\mathcal{V}_c||\mathcal{V}_{c'}|} \sum_{i \in \mathcal{V}_c, j \in \mathcal{V}_{c'}} \cos(d(i), d(j))$ where + +$\mathcal{V}_c$ indicates the set of nodes in class $c$ and $d(i)$ denotes the empirical histogram (over $|\mathcal{C}|$ classes) of node $i$ 's neighbors' labels, and the function $\cos(\cdot, \cdot)$ measures the cosine similarity. + +When $c = c'$ , $s(c, c')$ calculates the intra-class similarity, otherwise, it calculates the inter-class similarity from a neighborhood label distribution perspective. Intuitively, if nodes with the same label share the same neighborhood distributions, the intra-class similarity should be high. Likewise, to ensure that the neighborhood patterns for nodes with different labels are distinguishable, the inter-class similarity should be low. To illustrate how various $\gamma$ values affect the neighborhood patterns, we illustrate the intra-class and inter-class similarities in Figure 4 for $\gamma = 0, 0.4, 0.8, 1$ on graphs generated from Cora with homophily ratio $h = 0.25$ . The diagonal cells in each heatmap indicate the intra-class similarity while off-diagonal cells indicate inter-class similarity. Clearly, when $\gamma$ is small, the intra-class similarity is high while the inter-class similarity is low, which demonstrates the existence of strongly discriminative neighborhood patterns in the graph. As $\gamma$ increases, the intra-class and inter-class similarity get closer, becoming more and more indistinguishable, leading to bad performance due to indistinguishable distributions as referenced in Observation 2. + +# 4 REVISITING GCN'S PERFORMANCE ON REAL-WORLD GRAPHS + +In this section, we first give more details on the experiments we run to compare GCN and MLP. We next investigate why the GCN model does or does not work well on certain datasets utilizing the understanding developed in earlier sections. + +# 4.1 QUANTITATIVE ANALYSIS + +Following previous work (Pei et al., 2020; Zhu et al., 2020b), we evaluate the performance of the GCN model on several real-world graphs with different levels of homophily. We include the citation networks Cora, Citeseer and Pubmed (Kipf and Welling, 2016), which are highly homophilous. We also adopt several heterophilous benchmark datasets including Chameleon, Squirrel, Actor, Cornell, Wisconsin and Texas (Rozemberczki et al., 2021; Pei et al., 2020). Appendix D.1 gives descriptions and summary statistics of these datasets. For all datasets, we follow the experimental setting provided in (Pei et al., 2020), which consists of 10 random splits with proportions $48/32/20\%$ corresponding to training/validation/test for each graph. For each split, we use 10 random seeds, and report the average performance and standard deviation across 100 runs. We compare the GCN model with the MLP model, which does not utilize the graph structure. With this comparison, we aim to check whether the GCN model always fails for heterophilous graphs (perform even worse than MLP). We also compare GCN with state-of-the-art methods and their descriptions and performance are included in the Appendix D. The node classification performance (accuracy) of these models is reported in Table 2. Notably, GCN achieves better performance than MLP on graphs with high homophily (Cora, Citeseer, and Pubmed), as expected. For the heterophilous graphs, the results are comparatively mixed. The GCN model outperforms MLP on Squirrel and Chameleon (it even outperforms methods specifically designed for heterophilous graphs as shown in Appendix D.5.), while underperforming on the other datasets (Actor, Cornell, Wisconsin, and Texas). In the next section, we provide explanations for GCN's distinct behaviors on these graphs based on the understanding developed in earlier sections. + +# 4.2 QUALITATIVE ANALYSIS + +Our work so far illustrates that the popular notion of GCNs not being suitable for heterophily, or homophily being a mandate for good GCN performance is not accurate. In this subsection, we aim to use the understanding we developed in Section 3 to explain why GCN does (not) work well on real-world graphs. As in Section 3.3.2, we inspect cross-class neighborhood similarity (Definition 2) for each dataset; due to the space limit, we only include representative ones here (Cora, Chameleon, Actor and Cornell); see Figure 5). Heatmaps for the other datasets can be found in Appendix E. From Figure 5(a), it is clear that the intra-class similarity is much higher than the inter-similarity ones, hence Cora contains distinct neighborhood patterns, consistent with Observation 1. In Figure 5(b), we can observe that in Chameleon, intra-class similarity is generally higher than inter-class similarity, though not as strong as in Figure 5(a). Additionally, there is an apparent gap between labels 0, 1 and 2, 3, 4, which contributes to separating nodes of the former 2 from the latter 3 classes, but potentially increasing misclassification within each of the two groupings. These observations also help substantiate why GCN can achieve reasonable performance (much higher than MLP) on Chameleon. The GCN model underperforms MLP in Actor and we suspect that the graph does not provide useful information. The heatmap for Actor in Figure 5 shows that the intra-class and inter-class similarities are almost equivalent, making the neighborhood + +Table 2: Node classification performance (accuracy) on homophilous and heterophilous graphs. + +
CoraCiteseerPubmedChameleonSquirrelActorCornellWisconsinTexas
GCN87.12 ± 1.3876.50 ± 1.6188.52 ± 0.4167.96 ± 1.8254.47 ± 1.1730.31 ± 0.9859.35 ± 4.1961.76 ± 6.1563.81 ± 5.27
MLP75.04 ± 1.9772.40 ± 1.9787.84 ± 0.3048.11 ± 2.2331.68 ± 1.9036.17 ± 1.0984.86 ± 6.0486.29 ± 4.5083.30 ± 4.54
+ +![](images/0e54e64eb33c5c87691913d029004e94e871646d57169ba600af9bee7b104323.jpg) +(a) Cora + +![](images/11b9b67e0c4daba558c6e5710c0389ee4860c7925da3451cda2bb51180ebef7a.jpg) +(b) Chameleon +Figure 5: Cross-class neighborhood similarity on homophilous graphs and heterophilous graphs. + +![](images/d118d60fd5f24cd13004817d553953b19cb52b6432aa5a914277c2774d740577.jpg) +(c) Actor + +![](images/d6ad1267e5f3aacbee05de92e04e0db3012b9b828a8799463576b10c662ac45f.jpg) +(d) Cornell + +distributions for different classes hard to distinguish and leading to bad GCN performance. Similar observations are made for Cornell. Note that Cornell only consists of 183 nodes and 280 edges, hence, the similarities shown in Figure 5 are impacted significantly (e.g. there is a single node with label 1, leading to perfect intra-class similarity for label 1). + +# 5 RELATED WORK + +Graph neural networks (GNNs) are powerful models for graph representation learning. They have been widely adopted to tackle numerous applications from various domains (Kipf and Welling, 2016; Fan et al., 2019; Bastings et al., 2017; Shi et al., 2019). (Scarselli et al., 2008) proposed the first GNN model, to tackle both node and graph level tasks. Subsequently, Bruna et al. (2013) and Defferrard et al. (2016) generalized convolutional neural networks to graphs from the graph spectral perspective. Kipf and Welling (2016) simplified the spectral GNN model and proposed graph convolutional networks (GCNs). Since then, numerous GNN variants, which follow specific forms of feature transformation (linear layers) and aggregation have been proposed (Velicković et al., 2017; Hamilton et al., 2017; Gilmer et al., 2017; Klicpera et al., 2019). The aggregation process can be usually understood as feature smoothing (Li et al., 2018; Ma et al., 2020; Jia and Benson, 2021; Zhu et al., 2021). Hence, several recent works claim (Zhu et al., 2020b;a; Chien et al., 2021), assume (Halcrow et al., 2020; Wu et al., 2018; Zhao et al., 2020) or remark upon (Abu-El-Haija et al., 2019; Maurya et al., 2021; Hou et al., 2020) GNN models homophily-reliance or unsuitability in capturing heterophily. Several recent works specifically develop GNN models choices to tackle heterophilous graphs by carefully designing or modifying model architectures such as Geom-GCN (Pei et al., 2020), H2GCN (Zhu et al., 2020b), GPR-GNN (Chien et al., 2021), and CPGNN (Zhu et al., 2020a). Some other works aim to modify/construct graphs to be more homophilous (Suresh et al., 2021). There is concurrent work (Luan et al., 2021) also pointing out that GCN can potentially achieve strong performance on heterophilous graphs. A major focus of this paper is to propose a new model to handle heterophilous graphs. However, our work aims to empirically and theoretically understand whether homophily is a necessity for GNNs and how GNNs work for heterophilous graphs. + +# 6 CONCLUSION + +It is widely believed that GNN models inherently assume strong homophily and hence fail to generalize to graphs with heterophily. In this paper, we revisit this popular notion and show it is not quite accurate. We investigate one representative model, GCN, and show empirically that it can achieve good performance on some heterophilous graphs under certain conditions. We analyze theoretically the conditions required for GCNs to learn similar embeddings for same-label nodes, facilitating the SSNC task; put simply, when nodes with the same label share similar neighborhood patterns, and different classes have distinguishable patterns, GCN can achieve strong class separation, regardless of homophily or heterophily properties. Empirical analysis supports our theoretical findings. Finally, we revisit several existing homophilous and heterophilous SSNC benchmark graphs, and investigate GCN's empirical performance in light of our understanding. Note that while there exist graphs with "good heterophily", "bad heterophily" still poses challenges to GNN models, which calls for dedicated efforts. We discuss the limitation of the current work in Appendix I. + +# REFERENCES + +Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. MixHop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 21-29. PMLR, 09-15 Jun 2019. URL http://proceedings.mlr.press/v97/abu-el-haija19a.html. +Aseem Baranwal, Kimon Fountoulakis, and Aukosh Jagannath. Graph convolution for semi-supervised classification: Improved linear separability and out-of-distribution generalization. arXiv preprint arXiv:2102.06966, 2021. +Joost Bastings, Ivan Titov, Wilker Aziz, Diego Marcheggiani, and Khalil Sima'an. Graph convolutional encoders for syntax-aware neural machine translation. arXiv preprint arXiv:1704.04675, 2017. +Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013. +Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. In International Conference on Machine Learning, pages 1725-1735. PMLR, 2020. +Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized pagerank graph neural network. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=n6jl7fLxrP. +Valerio Ciotti, Moreno Bonaventura, Vincenzo Nicosia, Pietro Panzarasa, and Vito Latora. Homophily and missing links in citation networks. EPJ Data Science, 5:1-14, 2016. +Enyan Dai and Suhang Wang. Say no to the discrimination: Learning fair graph neural networks with limited sensitive attribute information. In Proceedings of the 14th ACM International Conference on Web Search and Data Mining, pages 680-688, 2021. +Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. arXiv preprint arXiv:1606.09375, 2016. +Yash Deshpande, Subhabrata Sen, Andrea Montanari, and Elchanan Mossel. Contextual stochastic block models. In NeurIPS, 2018. +Wenqi Fan, Yao Ma, Qing Li, Yuan He, Eric Zhao, Jiliang Tang, and Dawei Yin. Graph neural networks for social recommendation. In The World Wide Web Conference, pages 417-426, 2019. +Ronald A Fisher. The use of multiple measurements in taxonomic problems. Annals of eugenics, 7 (2):179-188, 1936. +Santo Fortunato and Darko Hric. Community detection in networks: A user guide. Physics reports, 659:1-44, 2016. +Elisabeth R Gerber, Adam Douglas Henry, and Mark Lubell. Political homophily and collaboration in regional planning networks. American Journal of Political Science, 57(3):598-610, 2013. +Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pages 1263-1272. PMLR, 2017. +Jonathan Halcrow, Alexandru Mosoi, Sam Ruth, and Bryan Perozzi. Grale: Designing networks for graph learning. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2523-2532, 2020. +William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. arXiv preprint arXiv:1706.02216, 2017. + +Yifan Hou, Jian Zhang, James Cheng, Kaili Ma, Richard T. B. Ma, Hongzhi Chen, and Ming-Chang Yang. Measuring and improving the use of graph information in graph neural networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=rkeIIkHKvS. +Ankit Jain and Piero Molino. Enhancing recommendations onUber eats with graph convolutional networks. +Junteng Jia and Austin R Benson. A unifying generative model for graph learning algorithms: Label propagation, graph convolutions, and combinations. arXiv preprint arXiv:2101.07730, 2021. +Weiwei Jiang and Jiayun Luo. Graph neural network for traffic forecasting: A survey. arXiv preprint arXiv:2101.11174, 2021. +Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. +Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In International Conference on Learning Representations (ICLR), 2019. +Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +Derek Lim, Felix Hohne, Xiuyu Li, Sijia Linda Huang, Vaishnavi Gupta, Omkar Bhalerao, and Ser Nam Lim. Large scale learning on non-homophilous graphs: New benchmarks and strong simple methods. Advances in Neural Information Processing Systems, 34, 2021. +Sitao Luan, Chenqing Hua, Qincheng Lu, Jiaqi Zhu, Mingde Zhao, Shuyuan Zhang, Xiao-Wen Chang, and Doina Precup. Is heterophily a real nightmare for graph neural networks to do node classification? arXiv preprint arXiv:2109.05641, 2021. +Yao Ma, Xiaorui Liu, Tong Zhao, Yozen Liu, Jiliang Tang, and Neil Shah. A unified view on graph neural networks as graph signal denoising. arXiv preprint arXiv:2010.01777, 2020. +Sunil Kumar Maurya, Xin Liu, and Tsuyoshi Murata. Improving graph neural networks with simple architecture design. arXiv preprint arXiv:2105.07634, 2021. +Miller McPherson, Lynn Smith-Lovin, and James M Cook. Birds of a feather: Homophily in social networks. Annual review of sociology, 27(1):415-444, 2001. +Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4602-4609, 2019. +Mark Newman. Networks. Oxford university press, 2018. +Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-gcn: Geometric graph convolutional networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=S1e2agrFvS. +Benedek Rozemberczki, Carl Allen, and Rik Sarkar. Multi-scale attributed node embedding. Journal of Complex Networks, 9(2):cnab014, 2021. +Aravind Sankar, Yozen Liu, Jun Yu, and Neil Shah. Graph neural networks for friend ranking in large-scale social platforms. 2021. +Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE transactions on neural networks, 20(1):61-80, 2008. +Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93-93, 2008. + +Lei Shi, Yifan Zhang, Jian Cheng, and Hanqing Lu. Skeleton-based action recognition with directed graph neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7912-7921, 2019. +Susheel Suresh, Vinith Budde, Jennifer Neville, Pan Li, and Jianzhu Ma. Breaking the limit of graph neural networks by improving the assortativity of graphs with local mixing patterns. arXiv preprint arXiv:2106.06586, 2021. +Xianfeng Tang, Yozen Liu, Neil Shah, Xiaolin Shi, Prasenjit Mitra, and Suhang Wang. Knowing your fate: Friendship, action and temporal explanations for user engagement prediction on social apps. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2269-2279, 2020a. +Xianfeng Tang, Huaxiu Yao, Yiwei Sun, Yiqi Wang, Jiliang Tang, Charu Aggarwal, Prasenjit Mitra, and Suhang Wang. Investigating and mitigating degree-related biases in graph convolutional networks. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, pages 1435-1444, 2020b. +Anton Tsitsulin, Benedek Rozemberczki, John Palowitch, and Bryan Perozzi. Synthetic graph generation to benchmark graph learning. 2021. +Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017. +Xuan Wu, Lingxiao Zhao, and Leman Akoglu. A quest for structure: jointly learning the graph structure and semi-supervised classification. In Proceedings of the 27th ACM international conference on information and knowledge management, pages 87-96, 2018. +Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=ryGs6iA5Km. +Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 974-983, 2018. +Tong Zhao, Yozen Liu, Leonardo Neves, Oliver Woodford, Meng Jiang, and Neil Shah. Data augmentation for graph neural networks. In AAAI, 2020. +Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. Graph neural networks: A review of methods and applications. AI Open, 1:57-81, 2020. +Jiong Zhu, Ryan A Rossi, Anup Rao, Tung Mai, Nedim Lipka, Nesreen K Ahmed, and Danai Koutra. Graph neural networks with heterophily. arXiv preprint arXiv:2009.13566, 2020a. +Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu, and Danai Koutra. Beyond homophily in graph neural networks: Current limitations and effective designs. Advances in Neural Information Processing Systems, 33, 2020b. +Meiqi Zhu, Xiao Wang, Chuan Shi, Houye Ji, and Peng Cui. Interpreting and unifying graph neural networks with an optimization framework. arXiv preprint arXiv:2101.11859, 2021. +Marinka Zitnik, Monica Agrawal, and Jure Leskovec. Modeling polypharmacy side effects with graph convolutional networks. Bioinformatics, 34(13):i457-i466, 2018. + +# A PROOF OF THEOREM 1 + +To prove Theorem 1, we first introduce the celebrated Hoeffding inequality below. + +Lemma 1 (Hoeffding's Inequality). Let $Z_{1},\ldots ,Z_{n}$ be independent bounded random variables with $Z_{i}\in [a,b]$ for all $i$ , where $-\infty < a\leq b < \infty$ . Then + +$$ +\mathbb {P} \left(\frac {1}{n} \sum_ {i = 1} ^ {n} (Z _ {i} - \mathbb {E} [ Z _ {i} ]) \geq t\right) \leq \exp \left(- \frac {2 n t ^ {2}}{(b - a) ^ {2}}\right) +$$ + +and + +$$ +\mathbb {P} \left(\frac {1}{n} \sum_ {i = 1} ^ {n} (Z _ {i} - \mathbb {E} [ Z _ {i} ]) \leq - t\right) \leq \exp \left(- \frac {2 n t ^ {2}}{(b - a) ^ {2}}\right) +$$ + +for all $t \geq 0$ . + +Theorem 1. Consider a graph $\mathcal{G} = \{\mathcal{V},\mathcal{E},\{\mathcal{F}_c,c\in \mathcal{C}\} ,\{\mathcal{D}_c,c\in \mathcal{C}\} \}$ , which follows Assumptions (1)-(4). For any node $i\in \mathcal{V}$ , the expectation of the pre-activation output of a single GCN operation is given by + +$$ +\mathbb {E} \left[ \mathbf {h} _ {i} \right] = \mathbf {W} \left(\mathbb {E} _ {c \sim \mathcal {D} _ {y _ {i}}, \mathbf {x} \sim \mathcal {F} _ {c}} [ \mathbf {x} ]\right). \tag {5} +$$ + +and for any $t > 0$ , the probability that the distance between the observation $\mathbf{h}_i$ and its expectation is larger than $t$ is bounded by + +$$ +\mathbb {P} \left(\| \mathbf {h} _ {i} - \mathbb {E} [ \mathbf {h} _ {i} ] \| _ {2} \geq t\right) \leq 2 \cdot l \cdot \exp \left(- \frac {\operatorname {d e g} (i) t ^ {2}}{2 \rho^ {2} (\mathbf {W}) B ^ {2} l}\right), \tag {6} +$$ + +where $l$ is the feature dimensionality and $\rho (\mathbf{W})$ denotes the largest singular value of $\mathbf{W}$ . + +Proof. The expectation of $\mathbf{h}_i$ can be derived as follows. + +$$ +\begin{array}{l} \mathbb {E} \left[ \mathbf {h} _ {i} \right] = \mathbb {E} \left[ \sum_ {j \in \mathcal {N} (i)} \frac {1}{d e g (i)} \mathbf {W x} _ {j} \right] \\ = \frac {1}{d e g (i)} \sum_ {j \in \mathcal {N} (i)} \mathbf {W} \mathbb {E} _ {c \sim \mathcal {D} _ {y _ {i}}, \mathbf {x} \sim \mathcal {F} _ {c}} [ \mathbf {x} ] \\ = \mathbf {W} \left(\mathbb {E} _ {c \sim \mathcal {D} _ {y _ {i}}, \mathbf {x} \sim \mathcal {F} _ {c}} [ \mathbf {x} ]\right). \\ \end{array} +$$ + +We utilize Hoeffding's Inequality to prove the bound in Eq. (6). Let $\mathbf{x}_i[k], k = 1, \dots, l$ denote the $i$ -th element of $\mathbf{x}$ . Then, for any dimension $k$ , $\{\mathbf{x}_j[k], j \in \mathcal{N}(i)\}$ is a set of independent bounded random variables. Hence, directly applying Hoeffding's inequality, for any $t_1 \geq 0$ , we have the following bound: + +$$ +\mathbb {P} \left(\left| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} [ k ] - \mathbb {E} \left[ \mathbf {x} _ {j} [ k ] \right]\right) \right| \geq t _ {1}\right) \leq 2 \exp \left(- \frac {\left(d e g (i)\right) t _ {1} ^ {2}}{2 B ^ {2}}\right) +$$ + +If $\left\| \sum_{j\in \mathcal{N}(i)}(\mathbf{x}_j - \mathbb{E}[\mathbf{x}_j])\right\| _2\geq \sqrt{lt}_1$ then at least for one $k\in \{1,\ldots ,l\}$ the inequality $\left|\sum_{j\in \mathcal{N}(i)}(\mathbf{x}_j[k] - \mathbb{E}[\mathbf{x}_j[k]])\right|\geq t_1$ holds. Hence, we have + +$$ +\begin{array}{l} \mathbb {P} \left(\left\| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} - \mathbb {E} [ \mathbf {x} _ {j} ]\right) \right\| _ {2} \geq \sqrt {l} t _ {1}\right) \leq \mathbb {P} \left(\bigcup_ {k = 1} ^ {l} \left\{\left| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} [ k ] - \mathbb {E} [ \mathbf {x} _ {j} [ k ] ]\right) \right| \geq t _ {1} \right\}\right) \\ \leq \sum_ {k = 1} ^ {l} \mathbb {P} \left(\left| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} [ k ] - \mathbb {E} \left[ \mathbf {x} _ {j} [ k ] \right]\right) \right| \geq t _ {1}\right) \\ = 2 \cdot l \cdot \exp \left(- \frac {(d e g (i)) t _ {1} ^ {2}}{2 B ^ {2}}\right) \\ \end{array} +$$ + +Let $t_1 = \frac{t_2}{\sqrt{l}}$ , then we have + +$$ +\mathbb {P} \left(\left\| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} - \mathbb {E} [ \mathbf {x} _ {j} ]\right) \right\| _ {2} \geq t _ {2}\right) \leq 2 \cdot l \cdot \exp \left(- \frac {(d e g (i)) t _ {2} ^ {2}}{2 B ^ {2} l}\right) +$$ + +Furthermore, we have + +$$ +\begin{array}{l} \| \mathbf {h} _ {i} - \mathbb {E} [ \mathbf {h} _ {i} ] \| _ {2} = \left\| \mathbf {W} \left(\sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} - \mathbb {E} [ \mathbf {x} _ {j} ]\right)\right) \right\| _ {2} \\ \leq \| \mathbf {W} \| _ {2} \left\| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} - \mathbb {E} \left[ \mathbf {x} _ {j} \right]\right) \right\| _ {2} \\ = \rho (\mathbf {W}) \left\| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} - \mathbb {E} [ \mathbf {x} _ {j} ]\right) \right\| _ {2}, \\ \end{array} +$$ + +where $\| \mathbf{W}\| _2$ is the matrix 2-norm of $\mathbf{W}$ . Note that the last line uses the identity $\| \mathbf{W}\| _2 = \rho (\mathbf{W})$ . + +Then, for any $t > 0$ , we have + +$$ +\begin{array}{l} \mathbb {P} \left(\| \mathbf {h} _ {i} - \mathbb {E} [ \mathbf {h} _ {i} ] \| _ {2} \geq t\right) \leq \mathbb {P} \left(\rho (\mathbf {W}) \left\| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} - \mathbb {E} [ \mathbf {x} _ {j} ]\right) \right\| _ {2} \geq t\right) \\ = \mathbb {P} \left(\left\| \sum_ {j \in \mathcal {N} (i)} \left(\mathbf {x} _ {j} - \mathbb {E} \left[ \mathbf {x} _ {j} \right]\right) \right\| _ {2} \geq \frac {t}{\rho (\mathbf {W})}\right) \\ \leq 2 \cdot l \cdot \exp \left(- \frac {\left(d e g (i)\right) t ^ {2}}{2 \rho^ {2} (\mathbf {W}) B ^ {2} l}\right), \\ \end{array} +$$ + +which completes the proof. + +![](images/b3e999f8d25ba9d50ff0930f01cbed7b214009f0bad8f6bde44e3e4a8ac0b8e6.jpg) + +# B PROOF OF THEOREM 2 + +Theorem 2. Consider a graph $\mathcal{G} \sim CSBM(\pmb{\mu}_1, \pmb{\mu}_2, p, q)$ . For any node $i$ in this graph, the linear classifier defined by the decision boundary $\mathcal{P}$ has a lower probability to mis-classify $\mathbf{h}_i$ than $\mathbf{x}_i$ when $\deg(i) > (p + q)^2 / (p - q)^2$ . + +Proof. We only prove for nodes from classes $c_{0}$ since the case for nodes from classes $c_{1}$ is symmetric and the proof is exactly the same. For a node $i \in \mathcal{C}_0$ , we have the follows + +$$ +\mathbb {P} \left(\mathbf {x} _ {i} \text {i s m i s - c l a s s i f i e d}\right) = \mathbb {P} \left(\mathbf {w} ^ {\top} \mathbf {x} _ {i} + \mathbf {b} \leq 0\right) \text {f o r} i \in \mathcal {C} _ {0} \tag {7} +$$ + +$$ +\mathbb {P} \left(\mathbf {h} _ {i} \text {i s m i s - c l a s s i f i e d}\right) = \mathbb {P} \left(\mathbf {w} ^ {\top} \mathbf {h} _ {i} + \mathbf {b} \leq 0\right) \text {f o r} i \in \mathcal {C} _ {0}, \tag {8} +$$ + +where $\mathbf{w}$ and $\mathbf{b} = -\mathbf{w}^{\top}(\pmb{\mu}_1 + \pmb{\mu}_1) / 2$ is the parameters of the decision boundary $\mathcal{P}$ . we have that + +$$ +\mathbb {P} \left(\mathbf {w} ^ {\top} \mathbf {h} _ {i} + \mathbf {b} \leq 0\right) = \mathbb {P} \left(\mathbf {w} ^ {\top} \sqrt {\operatorname {d e g} (i)} \mathbf {h} _ {i} + \sqrt {\operatorname {d e g} (i)} \mathbf {b} \leq 0\right). \tag {9} +$$ + +We denote the scaled version of $\mathbf{h}_i$ as $\mathbf{h}_i' = \sqrt{\deg(i)}\mathbf{h}_i$ . Then, $\mathbf{h}_i'$ follows + +$$ +\mathbf {h} _ {i} ^ {\prime} = \sqrt {\operatorname {d e g} (i)} \mathbf {h} _ {i} \sim N \left(\frac {\sqrt {\operatorname {d e g} (i)} \left(p \boldsymbol {\mu} _ {0} + q \boldsymbol {\mu} _ {1}\right)}{p + q}, \mathbf {I}\right), \text {f o r} i \in \mathcal {C} _ {0}. \tag {10} +$$ + +Because of the scale in Eq. (9), the decision boundary for $\mathbf{h}_i^{\prime}$ is correspondingly moved to $\mathbf{w}^{\top}\mathbf{h}^{\prime} + \sqrt{\deg(i)}\mathbf{b} = 0$ . Now, since $\mathbf{x}_i$ and $\mathbf{h}_i^{\prime}$ share the same variance, to compare the mis-classification probabilities, we only need to compare the distance from their expected value to their corresponding decision boundary. Specifically, the two distances are as follows: + +$$ +\begin{array}{l} d i s _ {\mathbf {x} _ {i}} = \frac {\| \boldsymbol {\mu} _ {0} - \boldsymbol {\mu} _ {1} \| _ {2}}{2} \\ d i s _ {\mathbf {h} _ {i} ^ {\prime}} = \frac {\sqrt {d e g (i)} | p - q |}{(p + q)} \cdot \frac {\left\| \boldsymbol {\mu} _ {0} - \boldsymbol {\mu} _ {1} \right\| _ {2}}{2}. \tag {11} \\ \end{array} +$$ + +The larger the distance is the smaller the mis-classification probability is. Hence, when $dis_{\mathbf{h}_i'} < dis_{\mathbf{x}_i}$ , $\mathbf{h}_i'$ has a lower probability to be mis-classified than $\mathbf{x}_i$ . Comparing the two distances, we conclude that when $deg(i) > \left(\frac{p + q}{p - q}\right)^2$ , $\mathbf{h}_i'$ has a lower probability to be mis-classified than $\mathbf{x}_i$ . Together with Eq. 9, we have that + +$$ +\mathbb {P} \left(\mathbf {h} _ {i} \text {i s m i s - c l a s s i f i e d}\right) < \mathbb {P} \left(\mathbf {x} _ {i} \text {i s m i s - c l a s s i f i e d}\right) \text {i f} \deg (i) > \left(\frac {p + q}{p - q}\right) ^ {2}, \tag {12} +$$ + +which completes the proof. + +![](images/063120121f6ee18851b28ce430f4146d87781888502aa99027293c27186a2a77.jpg) + +# C ADDITIONAL DETAILS AND RESULTS FOR SECTION 3.3.1 + +# C.1 DETAILS ON THE GENERATED GRAPHS + +In this subsection, we present the details of the graphs that we generate in Section 3.3.1. Specifically, we detail the distributions $\{\mathcal{D}_c, c \in \mathcal{C}\}$ used in the examples, the number of added edges $K$ , and the homophily ratio $h$ . We provide the details for Cora and Citeseer in the following subsections. Note that the choices of distributions shown here are for illustrative purposes, to coincide with Observations 1 and 2. We adapted circulant matrix-like designs due to their simplicity. + +# C.1.1 CORA + +There are 7 labels, which we denote as $\{0,1,2,3,4,5,6\}$ . The distributions $\{\mathcal{D}_c,c\in \mathcal{C}\}$ are listed as follows. The values of $K$ and the homophily ratio of their corresponding generated graphs are shown in Table 3. + +$$ +\mathcal {D} _ {0}: \text {C a t e g o r i c a l} ([ 0, 0. 5, 0, 0, 0, 0, 0. 5 ]), +$$ + +$$ +\mathcal {D} _ {1}: \text {C a t e g o r i c a l} ([ 0. 5, 0, 0. 5, 0, 0, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {2}: \text {C a t e g o r i c a l} ([ 0, 0. 5, 0, 0. 5, 0, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {3}: \text {C a t e g o r i c a l} ([ 0, 0, 0. 5, 0, 0. 5, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {4}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0. 5, 0, 0. 5, 0 ]), +$$ + +$$ +\mathcal {D} _ {5}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0, 0. 5, 0, 0. 5 ]), +$$ + +$$ +\mathcal {D} _ {6}: \text {C a t e g o r i c a l} ([ 0. 5, 0, 0, 0, 0, 0. 5, 0 ]). +$$ + +Table 3: # of added edges $(K)$ and homophily ratio $(h)$ values for generated graphs based on Cora. + +
K1003200630094012601880241003012036160482006024072
h0.7400.6810.6300.5870.5160.4600.4150.3780.3210.2790.247
+ +# C.1.2 CITESEER + +There are 6 labels, which we denote as $\{0,1,2,3,4,5\}$ . The distributions $\{\mathcal{D}_c,c\in \mathcal{C}\}$ are listed as follows. The values of $K$ and the homophily ratio of their corresponding generated graphs are shown in Table 4. + +$$ +\mathcal {D} _ {0}: \text {C a t e g o r i c a l} ([ 0, 0. 5, 0, 0, 0, 0. 5 ]), +$$ + +$$ +\mathcal {D} _ {1}: \text {C a t e g o r i c a l} ([ 0. 5, 0, 0. 5, 0, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {2}: \text {C a t e g o r i c a l} ([ 0, 0. 5, 0, 0. 5, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {3}: \text {C a t e g o r i c a l} ([ 0, 0, 0. 5, 0, 0. 5, 0 ]), +$$ + +$$ +\mathcal {D} _ {4}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0. 5, 0, 0. 5 ]), +$$ + +$$ +\mathcal {D} _ {5}: \text {C a t e g o r i c a l} ([ 0. 5, 0, 0, 0, 0. 5, 0 ]). +$$ + +Table 4: # of added edges $(K)$ and homophily ratio $(h)$ values for generated graphs based on Citeseer + +
K1204240836124816722496321204014448192642408028896
h0.6500.5810.5270.4810.4100.3570.3170.2840.2360.2020.176
+ +# C.2 RESULTS ON MORE DATSETS: CHAMELEON AND SQUIRREL + +We conduct similar experiments as those in Section 3.3.1 based on Chameleon and Squirrel. Note that both Squirrel and Chameleon have 5 labels, which we denote as $\{0,1,2,3,4\}$ . We pre-define the same distributions for them as listed as follows. The values of $K$ and the homophily ratio of their corresponding generated graphs based on Squirrel and Chameleon are shown in Table 5 and Table 6, respectively. + +$\tilde{\mathcal{D}}_0$ : Categorical([0, 0.5, 0, 0, 0.5]), + +$\mathcal{D}_1$ :Categorical([0.5,0,0.5,0,0]), + +$\mathcal{D}_2:$ Categorical([0, 0.5, 0, 0.5, 0]), + +$\mathcal{D}_3$ :Categorical([0,0,0.5,0,0.5]), + +$\mathcal{D}_4$ : Categorical([0.5, 0, 0, 0.5, 0]). + +Table 5: # of added edges $(K)$ and homophily ratio $(h)$ values for generated graphs based on Squirrel. + +
K123432468637030493746171674060864049874611109012434135776
h0.2150.2090.2030.1970.1920.1870.1820.1780.1730.1690.165
+ +Table 6: # of added edges $(K)$ and homophily ratio $(h)$ values for generated graphs based on Chameleon. + +
K19323866579877309964115961352815462173941932621260
h0.2230.2170.2100.2050.1990.1940.1890.1840.1800.1760.172
+ +![](images/728abc13603f5f155de753570eea3083b76d2a38aa31dbfce09c1e2a3a9c1a26.jpg) +(a) Synthetic graphs generated from Squirrel + +![](images/656a72a53995e0d26a4947ea4e8464cc171e86e32fe4b9088cbec538c8fd89dc.jpg) +(b) Synthetic graphs generated from Chameleon +Figure 6: Performance of GCN on synthetic graphs with various homophily ratio. + +The performance of the GCN model on these two sets of graphs (generated from Squirrel and Chameleon) is shown in Figure 6. The observations are similar to what we found for those generated graphs based on Cora and Citeseer in Section 3.3.1. Note that the original Squirrel and Chameleon graphs already have very low homophily, but we still observe a $V$ -shape from the figures. This is because there are some neighborhood patterns in the original graphs, which are distinct from those that we designed for addition. Hence, when we add edges in the early stage, the performance decreases. As we add more edges, the designed pattern starts to mask the original patterns and the performance starts to increase. + +# C.3 GCN'S PERFORMANCE IN THE LIMIT (AS $K\to \infty$ + +In this subsection, we illustrate that as $K \to \infty$ , the accuracy of the GCN model approaches $100\%$ . Specifically, we set $K$ to a set of larger numbers as listed in Table 7. Ideally, when $K \to \infty$ , the homophily ratio will approach 0 and the model performance will approach $100\%$ (for diverse-enough $\mathcal{D}_c$ ). The performance of the GCN model on the graphs described in Table 3 and Table 7 are shown in Figure 7. Clearly, the performance of the GCN model approaches the maximum as we continue to increase $K$ . + +Table 7: Extended # of added edges $(K)$ and homophily ratio $(h)$ values for generated graphs based on Cora. + +
K280843209636108401204413248144521565616880240
h0.2720.2480.2280.2110.1960.1830.1720.1620.120
+ +![](images/c56c2652c092563445330ac2546ddb2dd4d6e0dc779e0072577d33658222b15d.jpg) +Figure 7: As the number of edges approaches $K \to \infty$ , the homophily ratio $h \to 0$ , and GCN's performance approaches $100\%$ . + +# C.4 DETAILS OF ALGORITHM 2 + +The pseudo code to describe the process to generate graphs with a noise level $\gamma$ is shown in Algorithm 2. The only difference from Algorithm 1 is in Line 6-7, we randomly add edges if the generated random number $r$ is smaller than the pre-defined $\gamma$ (with probability $\gamma$ ). + +Alg. 2: Heterophilous Edge Addition with Noise +```txt +input: $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ $K,\{\mathcal{D}_c\}_{c = 0}^{|C| - 1}$ and $\{\mathcal{V}_c\}_{c = 0}^{|C| - 1}$ +output: $\mathcal{G}' = \{\mathcal{V},\mathcal{E}'\}$ +Initialize $\mathcal{G}' = \{\mathcal{V},\mathcal{E}\}$ $k = 1$ . +while $1\leq k\leq K$ do Sample node $i\sim$ Uniform(V); Obtain the label, $y_{i}$ of node i; Sample a number $r\sim$ Uniform(0,1); //Uniform (0,1) denotes the continuous standard uniform distribution if $r\leq \gamma$ then Sample a label $c\sim$ Uniform $(\mathcal{C}\setminus \{y_i\})$ else Sample a label $c\sim \mathcal{D}_{y_i}$ Sample node $j\sim$ Uniform $(\mathcal{V}_c)$ Update edge set $\mathcal{E}' = \mathcal{E}'\cup \{(i,j)\}$ $k\gets k + 1$ +return $\mathcal{G}' = \{\mathcal{V},\mathcal{E}'\}$ +``` + +# D EXPERIMENTAL DETAILS: DATASETS, MODELS, AND RESULTS + +We compare the standard GCN model (Kipf and Welling, 2016) with several recently proposed methods specifically designed for heterophilous graphs including H2GCN (Zhu et al., 2020b), GPRGNN (Chien et al., 2021), and CPGNN (Zhu et al., 2020a). A brief introduction of these methods can be found in Appendix D.2. + +# D.1 DATASETS + +We give the number of nodes, edges, homophily ratios and distinct classes of datasets we used in this paper in Table 8. + +Table 8: Benchmark dataset summary statistics. + +
CoraCiteseerPubmedChameleonSquirrelActorCornellWisconsinTexas
# Nodes (|V|)2708332719717227752017600183251183
# Edges (|E|)52784676443273142119849326752280466295
Homophily Ratio (h)0.810.740.800.230.220.220.30.210.11
# Classes (|C|)763555555
+ +# D.2 MODELS + +- H2GCN (Zhu et al., 2020b) specifically designed several architectures to deal with heterophilous graphs, which include ego- and neighbor-embedding separation (skip connection), aggregation from higher-order neighborhoods, and combination of intermediate representations. We include two variants H2GCN-1 and H2GCN-2 with 1 or 2 steps of aggregations, respectively. We adopt the code published by the authors at https://github.com/GemsLab/H2GCN. +- GPR-GNN (Chien et al., 2021) performs feature aggregation for multiple steps and then linearly combines the features aggregated with different steps. The weights of the linear combination are learned during the model training. Note that it also includes the original features before aggregation in the combination. We adopt the code published by the authors at https://github.com/jianhao2016/GPRGNN. +- CPGNN (Zhu et al., 2020a) incorporates the label compatibility matrix to capture the connection information between classes. We adopted two variants of CPGNN that utilize MLP and ChebyNet (Defferrard et al., 2016) as base models to pre-calculate the compatibility matrix, respectively. We use two aggregation layers for both variants. We adopt the code published by the authors at https://github.com/GemsLab/CPGNN. + +# D.3 MLP+GCN + +We implement a simple method to linearly combine the learned features from the GCN model and an MLP model. Let $\mathbf{H}_{GCN}^{(2)} \in \mathbb{R}^{|\mathcal{V}| \times |\mathcal{C}|}$ denote the output features from a 2-layer GCN model, where $|\mathcal{V}|$ and $|\mathcal{C}|$ denote the number of nodes and the number of classes, respectively. Similarly, we use $\mathbf{H}_{MLP}^{(2)} \in \mathbb{R}^{|\mathcal{V}| \times |\mathcal{C}|}$ to denote the features output from a 2-layer MLP model. We then combine them for classification. The process can be described as follows. + +$$ +\mathbf {H} = \alpha \cdot \mathbf {H} _ {G C N} ^ {(2)} + (1 - \alpha) \cdot \mathbf {H} _ {M L P} ^ {(2)}, \tag {13} +$$ + +where $\alpha$ is a hyperparameter balancing the two components. We then apply a row-wise softmax to each row of $\mathbf{H}$ to perform the classification. + +# D.4 PARAMETER TUNING AND RESOURCES USED + +We tune parameters for GCN, GPR-GCN, CPGNN, and MLP+GCN from the following options: + +learning rate: $\{0.002, 0.005, 0.01, 0.05\}$ +weight decay $\{5e - 04,5e - 05,5e - 06,5e - 07,5e - 08,1e - 05,0\}$ +- dropout rate: $\{0, 0.2, 0.5, 0.8\}$ . + +For GPR-GNN, we use the "PPR" as the initialization for the coefficients. For MLP+GCN, we tune $\alpha$ from $\{0.2, 0.4, 0.6, 0.8, 1\}$ . Note that the parameter search range encompasses the range adopted in the original papers to avoid unfairness issues. + +All experiments are run on a cluster equipped with Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz CPUs and NVIDIA Tesla K80 GPUs. + +# D.5 MORE RESULTS + +
CoraCiteseerPubmedChameleonSquirrelActorCornellWisconsinTexas
GCN87.12 ± 1.3876.50 ± 1.6188.52 ± 0.4167.96 ± 1.8254.47 ± 1.1730.31 ± 0.9859.35 ± 4.1961.76 ± 6.1563.81 ± 5.27
MLP75.04 ± 1.9772.40 ± 1.9787.84 ± 0.3048.11 ± 2.2331.68 ± 1.9036.17 ± 1.0984.86 ± 6.0486.29 ± 4.5083.30 ± 4.54
MLP + GCN87.01 ± 1.3576.35 ± 1.8589.77 ± 0.3968.04 ± 1.8654.48 ± 1.1136.24 ± 1.0984.82 ± 4.8786.43 ± 4.0083.60 ± 6.04
H2GCN-186.92 ± 1.3777.07 ± 1.6489.40 ± 0.3457.11 ± 1.5836.42 ± 1.8935.86 ± 1.0382.16 ± 6.0086.67 ± 4.6984.86 ± 6.77
H2GCN-287.81 ± 1.3576.88 ± 1.7789.59 ± 0.3359.39 ± 1.9837.90 ± 2.0235.62 ± 1.3082.16 ± 6.0085.88 ± 4.2282.16 ± 5.28
CPGNN-MLP85.84 ± 1.2074.80 ± 0.9286.58 ± 0.3754.53 ± 2.3729.13 ± 1.5735.76 ± 0.9279.93 ± 6.1284.58 ± 2.7282.62 ± 6.88
CPGNN-Cheby87.23 ± 1.3176.64 ± 1.4388.41 ± 0.3365.17 ± 3.1729.25 ± 4.1734.28 ± 0.7775.08 ± 7.5179.19 ± 2.8075.96 ± 5.66
GPR-GNN86.79 ± 1.2775.55 ± 1.5686.79 ± 0.5566.31 ± 2.0550.56 ± 1.5133.94 ± 0.9579.27 ± 6.0383.73 ± 4.0284.43 ± 4.10
+ +# E HEATMAPS FOR OTHER BENCHMARKS + +We provide the heatmaps for Citeseer and Pubmed in Figure 8 and those for Squirrel, Texas, and Wisconsin in Figure 9. For the Citeseer and Pubmed, which have high homophily, the observations are similar to those of Cora as we described in Section 4.2. For Squirrel, there are some patterns; the intra-class similarity is generally higher than inter-class similarities. However, these patterns are not very strong, i.e., the differences between them are not very large, which means that the neighborhood patterns of different labels are not very distinguishable from each other. This substantiates the middling performance of GCN on Squirrel. Both Texas and Wisconsin are very small, with 183 nodes, 295 edges and 251 nodes, 466 edges, respectively. The average degree is extremely small ( $< 2$ ). Hence, the similarities presented in the heatmap may present strong bias. Especially, in Texas, there is only 1 node with label 1. In Wisconsin, there are only 10 nodes with label 0. + +![](images/549e988324c1849bac8bb0261c154afde8aa21c079135cbe24d2898e6d494f3d.jpg) +(a) Citeseer + +![](images/aeb5af3a2e9ebde4623db9da253911cb7154412250c6ec30ef538f16b70cda55.jpg) +(b) Pubmed +Figure 8: Cross-class neighborhood similarity on CiteSeer and Pubmed. On both graphs, the intra-class similarity is clearly higher than the inter-class ones. + +# F EXTENDING THEOREM 2 TO MULTIPLE CLASSES + +Below, we provide a proof sketch and illustration for an extension to Theorem 2's main results in a multi-class context. Specifically, we consider a special case for more tractable analysis. + +Consider a $K$ -class CSBM. The nodes in the generated graphs consist of $K$ disjoint sets of the same size $\mathcal{C}_1, \ldots, \mathcal{C}_K$ corresponding to the $K$ classes, respectively. Edges are generated according to an intra-class probability $p$ and an inter-class probability $q$ . Specifically, for any two nodes in the graph, if they are from the same class, then an edge is generated to connect them with probability $p$ , otherwise, the probability is $q$ . For each node $i$ , its initial associated features $\mathbf{x}_i \in \mathbb{R}^l$ are sampled from a Gaussian distribution $\mathbf{x}_i \sim N(\boldsymbol{\mu}, \mathbf{I})$ , where $\boldsymbol{\mu} = \boldsymbol{\mu}_k \in \mathbb{R}^l$ for $i \in \mathcal{C}_k$ with $k \in \{1, \dots, K\}$ and $\boldsymbol{\mu}_z \neq \boldsymbol{\mu}_w \forall z, w \in \{1, \dots, K\}$ . We further assume that the distance between the mean of distributions corresponding to any two classes is equivalent, i.e., $\| \mathbf{u}_z - \mathbf{u}_w \|_2 = D$ , $\forall z, w \in \{1, \dots, K\}$ , where $D$ is a positive constant. We illustrate the 3-classes case in Figure 10, where we use the dashed circles to demonstrate the standard deviation. Note that the $K$ classes of the CSBM model are symmetric to each other. Hence, the optimal decision boundary of the $K$ classes are defined by a set + +![](images/847dcdba0459a9ef7d11d9c85dbebd63ee97b87b6fe3bd37dc234ca95bca7ca6.jpg) +(a) Squirrel + +![](images/edad79c66ada7583e5cdae1cb9b062056748fca8eac42ba41c3ed5ec3f1f9965.jpg) +(b) Texas +Figure 9: Cross-class neighborhood similarity on Squirrel, Texas and Wisconsin. The interclass similarity on Squirrel is slightly higher than intra-class similarity for most classes, which substantiates the middling performance of GCN. Both Texas and Wisconsin are quite small, hence the cross-class similarity in these two graphs present severe bias and may not provide precise information about these graphs. + +![](images/84d75a9d76888e9e08ee7a248349ea16ca178f7377e5e63e74fd3a071aa0639f.jpg) +(c) Wisconsin + +of $\binom{K}{2}$ hyperplanes (see Figure 10 for an example), where each hyperplane equivalently separates two classes. Similar to the analysis in the binary case (see the description below Proposition 1), for any given two classes $c_{z}$ and $c_{w}$ , the hyperplane is $\mathcal{P} = \{\mathbf{x}|\mathbf{w}^{\top}\mathbf{x} - \mathbf{w}^{\top}(\pmb{\mu}_{z} + \pmb{\mu}_{w}) / 2\}$ with $\mathbf{w} = (\mathbf{u}_z - \mathbf{u}_w) / \| \mathbf{u}_z - \mathbf{u}_w\| _2$ , which is orthogonal to $(\pmb{\mu}_{z} - \pmb{\mu}_{w})$ and going through $(\pmb{\mu}_{z} + \pmb{\mu}_{w}) / 2$ . For example, in Figure 10, the decision boundaries separate the entire space to 3 areas corresponding to the 3 classes. Each decision boundary is defined by a hyperplane equally separating two classes. For example, the descission boundary between $c_{1}$ and $c_{2}$ is orthogonal to $(\pmb{\mu}_{1} - \pmb{\mu}_{2})$ and going through the middle point $(\pmb{\mu}_{1} + \pmb{\mu}_{2}) / 2$ . Clearly, the linear separability is dependent on the distance $D$ between the classes and also the standard deviations of each class' node features. More specifically, linear separability is favored by a larger distance $D$ and smaller standard deviation. + +![](images/3a2152ed5862873819a18863bfdca53867dfa4b1360c0199d1dfb81e3a01b42b.jpg) +Figure 10: 3-class CSBM in 2-dimensional space. The dashed circles demonstrate the standard deviation for each class. The entire space is split to three areas (indicated by different colors) corresponding to the three classes for optimal decision making. The equilateral triangle indicates that the distance between the means of any two classes is the same. + +Next, we discuss how the GCN operation affects the linear separability. Overall, we want to demonstrate the following: (i) after the GCN operation, the classes are still symmetric to each other; (ii) the GCN operation will reduce the distance between the classes (in terms of the expectation of the output embeddings) and reduce the standard deviation of the classes; and (iii) reducing the distance impairs the separability while reducing the standard deviation improves the separability. Hence, we + +analyze the two effect and provide a threshold. We describe these three items in a more detailed way as follows. + +- Preservation of Symmetry. For any class $c_{z}, z \in \{1, \ldots, K\}$ , its neighborhood label distribution $\mathcal{D}_{c_{z}}$ can be described by a vector where only the $z$ -th element equals $\frac{p}{p + (K - 1)q}$ and all other elements equal to $\frac{q}{p + (K - 1)q}$ . We consider the aggression process $\mathbf{h}_i = \frac{1}{\deg(i)} \sum_{j \in \mathcal{N}(i)} \mathbf{x}_j$ . Then, for a node $i$ with label $c_{z}$ , its features obtained after this process follow the following Gaussian distribution. + +$$ +\mathbf {h} _ {i} \sim N \left(\frac {p \boldsymbol {\mu} _ {z} + \sum_ {k \in \{1 , \dots K \} , k \neq z} q \boldsymbol {\mu} _ {k}}{p + (K - 1) q}, \frac {\mathbf {I}}{\sqrt {\operatorname* {d e g} (i)}}\right), \text {f o r} i \in \mathcal {C} _ {z} \tag {14} +$$ + +Specifically, we denote the expectation of class $c_{z}$ after the GCN operation as $\mathbb{E}_{c_z}[\mathbf{h}] = \frac{p\mu_z + \sum_{k\in\{1,\ldots K\},k\neq z}q\mu_k}{p + (K - 1)q}$ . We next show that the distance between any two classes is the same. Specifically, for any two classes $c_{z}$ and $c_{w}$ , after the GCN operation, the distance between their expectation is as follows. + +$$ +\begin{array}{l} \| \mathbb {E} _ {c _ {z}} [ \mathbf {h} ] - \mathbb {E} _ {c _ {k}} [ \mathbf {h} ] \| _ {2} = \left\| \frac {p \boldsymbol {\mu} _ {z} + \sum_ {k \in \{1 , \dots K \} , k \neq z} q \boldsymbol {\mu} _ {k}}{p + (K - 1) q} - \frac {p \boldsymbol {\mu} _ {w} + \sum_ {k \in \{1 , \dots K \} , k \neq w} q \boldsymbol {\mu} _ {k}}{p + (K - 1) q} \right\| _ {2} \\ = \left\| \frac {(p - q) \left(\boldsymbol {\mu} _ {z} - \boldsymbol {\mu} _ {w}\right)}{p + (K - 1) q} \right\| _ {2} = \frac {| p - q |}{p + (K - 1) q} \| \boldsymbol {\mu} _ {z} - \boldsymbol {\mu} _ {w} \| _ {2} \tag {15} \\ \end{array} +$$ + +Note that we have $\| \pmb{\mu}_z - \pmb{\mu}_w\|_2 = D$ for any pair of classes $c_z$ and $c_w$ . Hence, after the GCN operation, the distance between any two classes is still the same. Thus, the classes are symmetric two each other. + +- Reducing inter-class distance and intra-class standard deviation. According to Eq (15), after the graph convolution operation, the distance between any two classes is reduced by a factor of $\frac{|p - q|}{p + (K - 1)q}$ . On the other hand, according to Eq. (14), the standard deviation depends on the degree of nodes. Specifically, for node $i$ with degree $deg(i)$ , its standard deviation is reduced by a factor of $\sqrt{deg(i)}$ . +- Implications for separability. For a node $i$ , the probability of being mis-classified is the probability of its embedding falling out of its corresponding decision area. This probability depends on both the inter-class distance between classes (in terms of means) and the intra-class standard deviation. To compare the linear separability before and after the graph convolution operation, we scale the distance between classes before and after the graph convolution operation to be the same. Specifically, we scale $\mathbf{h}_i$ as $\mathbf{h}_i' = \frac{p + (K - 1)q}{|p - q|} \mathbf{h}_i$ . Note that classifying $\mathbf{h}_i$ is equivalent to classifying $\mathbf{h}_i'$ . Based on $\mathbf{h}'$ , the distance between any two classes $c_z, c_w$ is scaled to $\| \boldsymbol{\mu}_z - \boldsymbol{\mu}_w \|_2 = D$ , which is equivalent to the class distance before the graph convolution operation. Correspondingly, the standard deviation for $\mathbf{h}_i'$ equals to $\frac{p + (K - 1)q}{|p - q|} \cdot \frac{\mathbf{I}}{\sqrt{\deg(i)}}$ . Now, to compare the mis-classification probability before and after the graph convolution, we only need to compare the standard deviations as the distances between classes in these two scenarios has been scaled to the same. More specifically, when $\frac{p + (K - 1)q}{|p - q|} \cdot \frac{\mathbf{I}}{\sqrt{\deg(i)}} < 1$ , the mis-classification probability for node $i$ is reduced after the GCN model, otherwise, the mis-classification probability is increased after the GCN model. In other words, for nodes with degree larger than $\frac{(p + (K - 1)q)^2}{(p - q)^2}$ , the mis-classification rate can be reduced after the graph convolution operation. This thereold is similar to the one we developed in Theorem 2 and similar analysis/discussions as those for Theorem 2 follows for the this multiple-class case. + +# G OTHER METRICS THAN COSINE SIMILARITY + +The choice of similarity measure would not affect the results and conclusions significantly. We empirically demonstrate this argument by investigating two other metrics: Euclidean distance and Hellinger distance. The heatmaps based on these two metrics for Chameleon dataset is shown in Figure 11 in Appendix G. The patterns demonstrated in these two heatmaps are similar to those + +observed in Figure 5(b), where cosine similarity is adopted. Note that larger distance means lower similarity. Hence, the numbers in Figure 11 should be interpreted in the opposite way as those in Figure 5. + +![](images/42aa0368f71cff92ba74fb50b183cf33db70fe40fbfe6f897658e25ab5682345.jpg) +(a) Euclidean Distance + +![](images/4a3bccc991c1c45c3702c9ed64c2bd455cab27b8623566d24e9152396e36d916.jpg) +(b) Hellinger distance +Figure 11: Cross-class neighborhood patterns on Chameleon based on different metrics than cosine similarity metric. + +# H ADDITIONAL EXPERIMENTS WITH DIFFERENT SETTINGS + +In this section, we discuss additional experiments for Section 3.3.1. + +# H.1 GENERATING GRAPHS WITH OTHER NEIGHBORHOOD DISTRIBUTIONS + +In this section, we extend the experiments in Section 3.3.1 by including more patterns for neighborhood distributions. We aim to illustrate if the neighborhood distribution for different classes (labels) are sufficiently distinguishable from each other, we should generally observe similar $V$ -shape curves as in Figure 3 in Section 3.3.1. However, it is impractical to enumerate all possible neighborhood distributions. Hence, in this section, we include two additional neighborhood distribution patterns in Section H.1.1 and two extreme patterns in Section H.1.2. + +# H.1.1 ADDITIONAL PATTERNS + +Here, for both Cora and Citeseer, we adopt two additional sets of neighborhood distributions for adding new edges. For convenience, for Cora, we name the two neighborhood distribution patterns as Cora Neighborhood Distribution Pattern 1 and Cora Neighborhood Distribution Pattern 2. Similarly, for Citeseer, we name the two neighborhood distribution patterns as Citeseer Neighborhood Distribution Pattern 1 and Citeseer Neighborhood Distribution Pattern 2. We follow Algorithm 1 to generate graphs while utilizing these neighborhood distributions as the $\{\mathcal{D}_c\}_{c=0}^{|C|-1}$ for Algorithm 1. + +The two neighborhood distribution patterns for Cora are listed as bellow. Figure 12 and Figure 13 show GCN's performance on graphs generated from Cora following Cora Neighborhood Distribution Pattern 1 and Cora Neighborhood Distribution Pattern 2, respectively. + +Cora Neighborhood Distribution Pattern 1: + +$\mathcal{D}_0:$ Categorical([0, $\frac{1}{3},\frac{1}{3},\frac{1}{3},0,0,0]$ +$\mathcal{D}_1:$ Categorical $([\frac{1}{3},0,0,0,\frac{1}{3},\frac{1}{3},0])$ +$\mathcal{D}_2:$ Categorical $([\frac{1}{3},0,0,0,0,\frac{1}{3},\frac{1}{3}])$ +$\mathcal{D}_3:$ Categorical $([\frac{1}{3},0,0,0,\frac{1}{3},0,\frac{1}{3}])$ +$\mathcal{D}_4:$ Categorical([0, $\frac{1}{3},0,\frac{1}{3},0,\frac{1}{3},0]$ +$\mathcal{D}_5:$ Categorical([0, $\frac{1}{3}$ $\frac{1}{3},0,\frac{1}{3},0,0]$ +$\mathcal{D}_6$ : Categorical([0, 0, $\frac{1}{2}$ , $\frac{1}{2}$ , 0, 0, 0]). + +Cora Neighborhood Distribution Pattern 2: + +$\mathcal{D}_0:$ Categorical $([0,\frac{1}{2},0,\frac{1}{2},0,0,0])$ +$\mathcal{D}_1:$ Categorical $([\frac{1}{2},0,0,\frac{1}{2},0,0,0])$ +$\mathcal{D}_2$ : Categorical([0, 0, 0, 1, 0, 0, 0]), +$\mathcal{D}_3$ : Categorical $([\frac{1}{5},\frac{1}{5},\frac{1}{5},0,\frac{1}{5},\frac{1}{5}],0)$ +$\mathcal{D}_4:$ Categorical([0,0,0, $\frac{1}{2}$ ,0, $\frac{1}{2}$ ,0]), +$\mathcal{D}_5:$ Categorical([0, $\frac{1}{3},\frac{1}{3},0,\frac{1}{3},0,0]$ +$\mathcal{D}_6$ : Categorical([0, 0, 0, 0, 0, 0, 1]). + +![](images/9ef307b15c6be3cddaade816d7d75d779961a3a125180e9d601a2af6b0f7dde5.jpg) +Figure 12: Performance of GCN on synthetic graphs from Cora. Graphs are generated following Cora Neighborhood Distribution Pattern 1 + +![](images/d398fa3a00853352e47538c824b2e9a9fbf384b1950af0fcb0394af3c04e9ce4.jpg) +Figure 13: Performance of GCN on synthetic graphs from Cora. Graphs are generated following Cora Neighborhood Distribution Pattern 2 + +Clearly, the results demonstrated in Figure 12 and Figure 13 are similar to the black curve $(\gamma = 0)$ in 3a. More specifically, they present $V$ -shape curves. + +The two neighborhood distribution patterns for Citeseer are listed as bellow. Figure 14 and Figure 15 show GCN's performance on graphs generated from Citeseer following Citeseer Neighborhood Distribution Pattern 1 and Citeseer Neighborhood Distribution Pattern 2, respectively. + +Citeseer Neighborhood Distribution Pattern 1: + +$\mathcal{D}_0:$ Categorical $([0,\frac{1}{2},\frac{1}{2},0,0,0])$ +$\mathcal{D}_1$ : Categorical $([\frac{1}{3},0,0,0,\frac{1}{3},\frac{1}{3}])$ +$\mathcal{D}_2:$ Categorical $([\frac{1}{2},0,0,0,0,\frac{1}{2}])$ +$\mathcal{D}_3$ :Categorical([0,0,0,0,1,0), +$\mathcal{D}_4$ : Categorical $([0,\frac{1}{3},0,\frac{1}{3},0,\frac{1}{3}])$ +$\mathcal{D}_5$ : Categorical $([0,\frac{1}{3},\frac{1}{3},0,\frac{1}{3},0])$ + +![](images/0d273dd262c28011f59ecdf0da7ddcc85160d8fb3d44d7d1aebd52d258241e43.jpg) +Figure 14: Performance of GCN on synthetic graphs from Citeseer. Graphs are generated following Citeseer Neighborhood Distribution Pattern 1 + +Citeseer Neighborhood Distribution Pattern 2: + +$$ +\mathcal {D} _ {0}: \text {C a t e g o r i c a l} ([ 0, \frac {1}{2}, 0, \frac {1}{2}, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {1}: \text {C a t e g o r i c a l} ([ \frac {1}{2}, 0, 0, \frac {1}{3 2}, 0 ]), +$$ + +$$ +\mathcal {D} _ {2}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 1, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {3}: \text {C a t e g o r i c a l} ([ \frac {1}{5}, \frac {1}{5}, \frac {1}{5}, 0, \frac {1}{5}, \frac {1}{5}), +$$ + +$$ +\mathcal {D} _ {4}: \text {C a t e g o r i c a l} ([ 0, 0, 0, \frac {1}{2}, 0, \frac {1}{2} ]), +$$ + +$$ +\mathcal {D} _ {5}: \text {C a t e g o r i c a l} ([ 0, 0, 0, \frac {1}{2}, \frac {1}{2}, 0 ]), +$$ + +![](images/63a007c818abd2b77973a8bd114efba634d19b560eee268f88b9475414d7dcee.jpg) +Figure 15: Performance of GCN on synthetic graphs from Citeseer. Graphs are generated following Citeseer Neighborhood Distribution Pattern 2 + +Clearly, the results demonstrated in Figure 14 and Figure 15 are similar to the black curve $(\gamma = 0)$ in 3b. More specifically, they present $V$ -shape curves. + +# H.1.2 EXTREME NEIGHBORHOOD DISTRIBUTION PATTERNS + +In this subsection, we further extend the experiments in Section 3.3.1 by investigating "extreme" neighborhood distribution patterns suggested by WXGg. More specifically, these two patterns are "a given label are connected to a single different label" and "a given label are connected to all other labels other excluding its own label". For convenience, we denote these two types of neighborhood distributions as single and all, respectively. We utilize these neighborhood distributions as $\{\mathcal{D}_c\}_{c=0}^{|C|-1}$ for generating synthetic graphs. Next, we first present the results for Cora with analysis for both the single and all neighborhood distribution patterns. Then, we present the results for Citeseer but omit analysis and discussion since the observations are similar to those we make for Cora. + +Note that to ensure "a label is only connected to a single different label", we need to group the labels into pairs and "connect them". Since there are different ways to group labels into pairs, there exists various ways to formulate the single neighborhood distributions. We demonstrate one of the single neighborhood distributions as all the other possible are symmetric to each other. For Cora, the single neighborhood distribution we adopted is as follows. Note that there are 7 labels in Cora, and we could not pair all the labels. Thus, we leave one of labels (label 4 in our setting) untouched, i.e., it is not connect to other labels during the edge addition process. + +$$ +\mathcal {D} _ {0}: \text {C a t e g o r i c a l} ([ 0, 1, 0, 0, 0, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {1}: \text {C a t e g o r i c a l} ([ 1, 0, 0, 0, 0, 0, 0 ], +$$ + +$$ +\mathcal {D} _ {2}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 1, 0, 0, 0 ]), +$$ + +$$ +\mathcal {D} _ {3}: \text {C a t e g o r i c a l} ([ 0, 0, 1, 0, 0, 0, 0 ], +$$ + +$$ +\mathcal {D} _ {4}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0, 0, 0, 0 ], +$$ + +$$ +\mathcal {D} _ {5}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0, 0, 0, 1 ]), +$$ + +$$ +\mathcal {D} _ {6}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0, 0, 1, 0 ]). +$$ + +The GCN's performance on these graphs generated from Cora following the single neighborhood distribution pattern is shown in Figure 16a. It clearly presents a $V$ -shape curve. Almost perfect performance can be achieved when the homophily ratio gets close to 0. This is because the single neighborhood distributions for different labels are clearly distinguishable from each other. We further demonstrate the heatmap of cross-class similarity for the generated graph with homophily ratio 0.07 (the right most point in Figure 16a) in Figure 16b. Clearly, this graph has very high intra-class similarity and very low inter-class similarity, which explains the good performance. + +For Cora, the all neighborhood distribution patterns can be described as follows. + +$$ +\mathcal {D} _ {0}: \text {C a t e g o r i c a l} ([ 0, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6} ]), +$$ + +$$ +\mathcal {D} _ {1}: \text {C a t e g o r i c a l} ([ \frac {1}{6}, 0, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6} ]), +$$ + +$$ +\mathcal {D} _ {2}: \text {C a t e g o r i c a l} ([ \frac {1}{6}, \frac {1}{6}, 0, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6} ]), +$$ + +![](images/337569ca3d8a424dca8e96c710603f39aa370459d5a5266a583561a3d6c175c7.jpg) +(a) Performance of GCN on synthetic graphs from Cora. Graphs are generated following single neighborhood distribution. +(b) Cross-class neighborhood similarity for the graph generated from Cora following single with homophily ratio 0.07 (the right most point in Figure 16a). + +![](images/cea78adc15eb9538dc5f6ea37616ff5fafebb114b4c049423881401edc9a518f.jpg) +Figure 16: Cora: single neighborhood distribution pattern + +$$ +\begin{array}{l} \mathcal {D} _ {3}: \text {C a t e g o r i c a l} ([ \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, 0, \frac {1}{6}, \frac {1}{6}, \frac {1}{6} ]), \\ \mathcal {D} _ {4}: \text {C a t e g o r i c a l} ([ \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, 0, \frac {1}{6}, \frac {1}{6} ]), \\ \mathcal {D} _ {5}: \text {C a t e g o r i c a l} ([ \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, 0, \frac {1}{6} ]), \\ \mathcal {D} _ {6}: \text {C a t e g o r i c a l} ([ \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, \frac {1}{6}, 0 ]). \\ \end{array} +$$ + +The GCN's performance on these graphs generated from Cora following the all neighborhood distribution pattern is shown in Figure 17a. Again, it clearly presents a $V$ -shape curve. However, the performance is not perfectly good even when we add extremely large numbers of edges. For example, for the right most point in Figure 17a, we add almost as 50 times many as edges into the graph and the homophily ratio is reduced to 0.03 while GCN's performance for it is only around $70\%$ . This is because the all neighborhood distributions for different labels are not easily distinguishable from each other. More specifically, any two neighborhood distributions for different labels in all are very similar each other (they share "4 labels"). We further empirically demonstrate this by providing the heatmap of cross-class similarity for the generated graph with homophily ratio 0.03 (the right most point in Figure 17a) in Figure 17b. As per our discussion in Observation 2, this graph is with not such "good" heterophily and GCNs cannot produce perfect performance for it. This observation further demonstrates our key argument that the distinguishability of the distributions for different labels are important for performance. + +For Citeseer, the single neighborhood distribution we adopted is as follows. The GCN's performance on these graphs generated from Citeseer following the single neighborhood distribution pattern is shown in Figure 18a. The heatmap of cross-class similarity for the generated graph with homophily ratio 0.06 (the right most point in Figure 18a) in Figure 18b. + +$$ +\begin{array}{l} \mathcal {D} _ {0}: \text {C a t e g o r i c a l} ([ 0, 1, 0, 0, 0, 0 ]), \\ \mathcal {D} _ {1}: \text {C a t e g o r i c a l} ([ 1, 0, 0, 0, 0, 0 ], \\ \mathcal {D} _ {2}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 1, 0, 0 ]), \\ \mathcal {D} _ {3}: \text {C a t e g o r i c a l} ([ 0, 0, 1, 0, 0, 0 ]), \\ \mathcal {D} _ {4}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0, 0, 1 ]), \\ \mathcal {D} _ {5}: \text {C a t e g o r i c a l} ([ 0, 0, 0, 0, 1, 0 ]). \\ \end{array} +$$ + +For Citeseer, the all neighborhood distribution patterns can be described as follows. The GCN's performance on these graphs generated from Citeseer following the all neighborhood distribution pattern is shown in Figure 19a. The heatmap of cross-class similarity for the generated graph with homophily ratio 0.01 (the right most point in Figure 19a) in Figure 19b. + +$$ +\mathcal {D} _ {0}: \text {C a t e g o r i c a l} ([ 0, 1 / 5, 1 / 5, 1 / 5, 1 / 5, 1 / 5 ]), +$$ + +![](images/148b4a9fe236b79a7b3b7a070697b30855324c8cdf2a0afd1cbbac68f6e3d283.jpg) +(a) Performance of GCN on synthetic graphs from Cora. Graphs are generated following all neighborhood distribution. + +![](images/c67d17f256e7e2effd149054997590d058c19c39213b08ab4c4c40f10df87862.jpg) +(b) Cross-class neighborhood similarity for the graph generated from Cora following all with homophily ratio 0.03 (the right most point in Figure 17a). + +![](images/0368b7c18ae6997900b25ed5027ad94350e8d5de1f490f7abb88e6c7925795f3.jpg) +(a) Performance of GCN on synthetic graphs from CiteSeer. Graphs are generated following single neighborhood distribution. +(b) Cross-class neighborhood similarity for the graph generated from Citeseer following single with homophily ratio 0.06. +Figure 18: CiteSeer: single neighborhood distribution pattern + +![](images/f890bd6f471c7037382bf7109d48972cb39799f93bb1c9454075f6ed5e2a9da3.jpg) +Figure 17: Cora: all neighborhood distribution pattern + +$\mathcal{D}_1$ : Categorical([1/5, 0, 1/5, 1/5, 1/5, 1/5]), +$\mathcal{D}_2$ : Categorical([1/5, 1/5, 0, 1/5, 1/5, 1/5]), +$\mathcal{D}_3$ : Categorical([1/5, 1/5, 1/5, 0, 1/5, 1/5]), +$\mathcal{D}_4$ :Categorical([1/5,1/5,1/5,1/5,0,1/5]), +$\mathcal{D}_5$ : Categorical([1/5, 1/5, 1/5, 1/5, 1/5, 1/5, 0]). + +Similar observations as those we made for Cora can be made for Citeseer, hence we do not repeat the analysis here. + +# I LIMITATION + +Though we provide new perspectives and understandings of GCN's performance on heterophilous graphs, our work has some limitations. To make the theoretical analysis more feasible, we make a few assumptions. We dropped the non-linearity in the analysis since the main focus of this paper is the aggregation part of GCN. While the experiment results empirically demonstrate that our analysis seems to hold with non-linearity, more formal investigation for GCN with non-linearity is valuable. Our analysis in Theorem 2 assumes the independence between features, which limits the generality of the analysis and we would like to conduct further instigation to more general case. We provide theoretical understanding on GCN's performance based on CSBM, which stands for a type of graphs + +![](images/ae14aa4d7c0ed135446c6927f3b2f38f1335f0b48528b16ab1af249d2c0247f0.jpg) +(a) Performance of GCN on synthetic graphs from CiteSeer. Graphs are generated following all neighborhood distribution. +(b) Cross-class neighborhood similarity for the graph generated from Citeseer following all with homophily ratio 0.01. + +![](images/ed33e783bf67389c026c4abb9137227d03a1e3590cc946fb99049b8f73d8d027.jpg) +Figure 19: Citeseer: all neighborhood distribution pattern + +attracting increasing attention in the research community. However, it is not ideal for modeling sparse graphs, which are commonly observed in the real-world. Hence, it is important to devote more efforts to analyzing more general graphs. We believe our results established a solid initial study for further investigation. Finally, our current theoretical analysis majorly focuses on the GCN model; we hope to extend this analysis in the future to more general message-passing neural networks. + +# J BROADER IMPACT + +Graph neural networks (GNNs) are a prominent architecture for modeling and understanding graph-structured data in a variety of practical applications. Most GNNs have a natural inductive bias towards leveraging graph neighborhood information to make inferences, which can exacerbate unfair or biased outcomes during inference, especially when such neighborhoods are formed according to inherently biased upstream processes, e.g. rich-get-richer phenomena and other disparities in the opportunities to "connect" to other nodes: For example, older papers garner more citations than newer ones, and are hence likely to have a higher in-degree in citation networks and hence benefit more from neighborhood information; similar analogs can be drawn for more established webpages attracting more attention in search results. Professional networking ("ability to connect") may be easier for those individuals (nodes) who are at top-tier, well-funded universities compared to those who are not. Such factors influence network formation, sparsity, and thus GNN inference quality simply due to network topology (Tang et al., 2020b). Given these acknowledged issues, GNNs are still used in applications including ranking (Sankar et al., 2021), recommendation(Jain and Molino), engagement prediction (Tang et al., 2020a), traffic modeling(Jiang and Luo, 2021), search and discovery (Ying et al., 2018) and more, and when unchecked, suffer traditional machine learning unfairness issues (Dai and Wang, 2021). + +Despite these practical impacts, the prominent notion in prior literature in this space has been that such methods are inapplicable or perform poorly on heterophilous graphs, and this may have mitigated practitioners' interests in applying such methods for ML problems in those domains conventionally considered heterophily-dominant (e.g. dating networks). Our work shows that this notion is misleading, and that heterophily and homophily are not themselves responsible for good or bad inference performance. We anticipate this finding to be helpful in furthering research into the capacity of GNN models to work in diverse data settings, and emphasize that our work provides an understanding, rather than a new methodology or approach, and thus do not anticipate negative broader impacts from our findings. + +# ACKNOWLEDGEMENTS + +This research is supported by the National Science Foundation (NSF) under grant numbers IIS1714741, CNS1815636, IIS1845081, IIS1907704, IIS1928278, IIS1955285, IOS2107215, and + +IOS2035472, the Army Research Office (ARO) under grant number W911NF-21-1-0198, the Home Depot, Cisco Systems Inc and Snap Inc. \ No newline at end of file diff --git a/ishomophilyanecessityforgraphneuralnetworks/images.zip b/ishomophilyanecessityforgraphneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f8146f386c350d7350620fdb312f3114437cef3a --- /dev/null +++ b/ishomophilyanecessityforgraphneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd8b99500bcc06274850caafe733b79ffa79a0e167e231d3d72bbdfe16714683 +size 1178472 diff --git a/ishomophilyanecessityforgraphneuralnetworks/layout.json b/ishomophilyanecessityforgraphneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f4b1ef1a3e6113b2ebb2013508fb2fd851fabcbd --- /dev/null +++ b/ishomophilyanecessityforgraphneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b4a6c7ae29184ac31bd55a5b113410b62cc88f37c8d34373126aeb533992b42 +size 1179603 diff --git a/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_content_list.json b/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..156415dd3035c88cc1e279f270f4cf6354807229 --- /dev/null +++ b/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6483ac051b37420e6d99b29f5ece662251969d90fca87146fd6cdeb68e9b517b +size 232523 diff --git a/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_model.json b/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ba0cdc8b8680b0de6105b8233f84699a2ce4f117 --- /dev/null +++ b/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1e87b8738883f60f022c2ee12e962f2a6f5813170dc4494763821b37d68dda7 +size 263061 diff --git a/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_origin.pdf b/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4b8e9d1e66393c2de196af4fe9f531ecf5b32f26 --- /dev/null +++ b/isimportanceweightingincompatiblewithinterpolatingclassifiers/63bd0a15-5ed4-4f00-aa6c-0846fc6ca8ac_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7563b4297cab36aadf3510871b0ba962f090555a8b12ccfd44488ad9698324d +size 678309 diff --git a/isimportanceweightingincompatiblewithinterpolatingclassifiers/full.md b/isimportanceweightingincompatiblewithinterpolatingclassifiers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..edc6e64f4fd537cd2e49f29647087113e42bbae5 --- /dev/null +++ b/isimportanceweightingincompatiblewithinterpolatingclassifiers/full.md @@ -0,0 +1,1168 @@ +# IS IMPORTANCE WEIGHTING INCOMPATIBLE WITH INTERPOLATING CLASSIFIERS? + +Ke Alexander Wang*, Niladri S. Chatterji*, Saminul Haque, Tatsunori Hashimoto + +Department of Computer Science + +Stanford University + +{alxwang,niladri}@cs.stanford.edu,{saminulh,thashim}@stanford.edu + +# ABSTRACT + +Importance weighting is a classic technique to handle distribution shifts. However, prior work has presented strong empirical and theoretical evidence demonstrating that importance weights can have little to no effect on overparameterized neural networks. Is importance weighting truly incompatible with the training of overparameterized neural networks? Our paper answers this in the negative. We show that importance weighting fails not because of the overparameterization, but instead, as a result of using exponentially-tailed losses like the logistic or cross-entropy loss. As a remedy, we show that polynomially-tailed losses restore the effects of importance reweighting in correcting distribution shift in overparameterized models. We characterize the behavior of gradient descent on importance weighted polynomially-tailed losses with overparameterized linear models, and theoretically demonstrate the advantage of using polynomially-tailed losses in a label shift setting. Surprisingly, our theory shows that using weights that are obtained by exponentiating the classical unbiased importance weights can improve performance. Finally, we demonstrate the practical value of our analysis with neural network experiments on a subpopulation shift and a label shift dataset. When reweighted, our loss function can outperform reweighted cross-entropy by as much as $9\%$ in test accuracy. Our loss function also gives test accuracies comparable to, or even exceeding, well-tuned state-of-the-art methods for correcting distribution shifts. + +# 1 INTRODUCTION + +Machine learning models are often evaluated on test data which differs from the data that they were trained on. A classic statistical technique to combat such distribution shift is to importance weight the loss function during training (Shimodaira, 2000). This procedure upweights points in the training data that are more likely to appear in the test data and downweights ones that are less likely. The reweighted training loss is an unbiased estimator of the test loss and can be minimized by standard algorithms, resulting in a simple and general procedure to address distribution shift. + +Surprisingly, recent papers (Byrd & Lipton, 2019; Xu et al., 2020) have found that importance weighting is ineffective in the current deep learning paradigm, where overparameterized models interpolate the training data or have vanishingly small train loss. In particular, Byrd & Lipton (2019) empirically showed that when no regularization is used, overparameterized linear and nonlinear models trained with the importance weighted cross-entropy loss ignore the importance weights. Xu et al. (2020) followed up and provided a theoretical justification for this observation in overparameterized linear and non-linear models. + +To build intuition about why importance weighting fails, consider linear classifiers as an example. Given linearly separable data $(x_{1},y_{1}),\ldots ,(x_{n},y_{n})\in \mathbb{R}^{d}\times \{-1,1\}$ , Soudry et al. (2018) showed that if gradient descent is applied to minimize an exponentially-tailed classification loss $\left(\sum_{i\in [n]}\ell_{\mathrm{exp}}(y_i x_i)\right)$ then the iterates converge in direction to the maximum margin classifier $\widehat{\theta}_{\mathsf{MM}}\coloneqq$ arg $\min_{\| \theta \| = 1}\{\gamma :y_i x_i\cdot \theta \geq \gamma ,$ for all $i\in [n]\}$ . Xu et al. (2020) showed that in this same setting, minimizing the importance weighted loss $\left(\sum_{i\in [n]}w_i\ell_{\mathrm{exp}}(y_ix_i)\right)$ with gradient descent also results + +![](images/0d567454190505f774f195899ba0ace1ce619e272408b40cc74bd931273227f0.jpg) +Figure 1: Models trained with gradient descent, with and without importance weights (IW), in the label shift setting where classes are imbalanced in the training set. All models interpolate the training points with $100\%$ accuracy. (Left) Importance weights provably fails to correct for the distribution shift for the cross-entropy loss. The learned boundary is asymptotically the maximum-margin classifier even with reweighting. (Right) Our polynomially-tailed loss restores the effects of importance weights, correctly adjusting for the distribution shift. + +in convergence to the maximum margin classifier, regardless of the weights. To see why, consider the special case where the weights $(w_{1},\ldots ,w_{n})$ are positive integers. This reweighting is equivalent to simply repeating each datapoint $w_{i}$ times, and the maximum margin classifier over this "new dataset" remains unchanged. Thus, invoking the original result by Soudry et al. (2018) proves that the importance weights has no effect in correcting the distribution shift. This result can be seen in Figure 1 where we demonstrate this phenomenon in a simple toy problem. + +Such evidence has led some to wonder if importance weighting is fundamentally incompatible with overparameterized interpolating models. In this paper, we show that this is not the case. We find that the culprit behind the ineffectiveness of importance weighting is the exponential tail of popular losses such as the cross-entropy or the logistic. We propose altering the structure of the loss to have fatter, polynomially decaying tails instead. We theoretically and empirically show that importance weights do correct for distribution shift under such losses even for overparameterized classifiers. + +Our first contribution is to characterize the limiting direction of the iterates of gradient descent (its implicit bias) when minimizing reweighted polynomially-tailed losses with linear classifiers. We show that this limiting direction is a function of both the datapoints as well as the importance weights, unlike the maximum margin classifier that only depends on the data (see the right half of Figure 1). Next, we analyze the generalization behavior of this classifier in a label shift setting. We prove that when the weights are an exponentiation of the unbiased importance weights, the test error decays to zero in the large sample limit, regardless of the level of imbalance in the data. In contrast, we prove that the maximum margin classifier test error in this same setting must be at least $1/8$ . + +Finally, we demonstrate the practical benefits of our framework by applying this approach to experiments with neural networks. In both a label shift dataset (imbalanced binary CIFAR10), and a subpopulation shift dataset with spurious correlations (CelebA (Sagawa et al., 2019)), we find that reweighting polynomially-tailed losses consistently outperforms reweighted cross-entropy loss, as our linear theory suggests. Additionally, poly-tailed loss with biased importance weights can perform comparably to, or better than, state-of-the-art methods distribution shift (Cao et al., 2019; Ye et al., 2020; Menon et al., 2020; Kini et al., 2021) $^{1}$ . + +# 2 RELATED WORK + +Early work (Shimodaira, 2000; Wen et al., 2014) already warned against the potential ineffectiveness of importance weights on interpolating overparameterized models. Shimodaira (2000) showed that when the model is well-specified, importance weights can fail to have an effect, and that the ordinary maximum likelihood estimate is asymptotically optimal. Wen et al. (2014) showed that when there is a zero-loss minimizer of an unweighted convex loss minimization problem, then it is also a minimizer of the (adversarially) reweighted loss as well. Recent work (Byrd & Lipton, 2019; Xu et al., 2020) has shown that importance weighting fails to have an effect on neural networks + +trained with gradient descent, though always in the setting of exponentially-tailed losses. Sagawa et al. (2019) demonstrated that reweighting can fail to have the desired effect when unregularized distributionally robust optimization (DRO) methods are used in conjunction with the cross-entropy loss. They empirically showed that regularization is necessary to reap the benefits of reweighting, also observed by Byrd & Lipton (2019). + +A recent line of work (Cao et al., 2019; Ye et al., 2020; Menon et al., 2020; Kini et al., 2021) has introduced modifications to the logistic and cross-entropy losses to correct for distribution shift. Cao et al. (2019) and Menon et al. (2020) proposed using additive corrections to the logits. However, without regularization or early-stopping these corrections are ineffective since the additive corrections to the logits is analogous to importance weighting exponential-tailed losses. Multiplicative logit corrections (Ye et al., 2020), possibly combined with additive corrections (Kini et al., 2021), have also been proposed. Unlike the additive corrections, these methods do not converge to the max-margin classifier, but they also do not correspond to importance weighting algorithms. In our work, we focus on the question of whether importance weighting alone can correct for distribution shift, and show practical empirical benefits relative to multiplicative logit corrections. + +Our work also connects to literature that has studied the implicit bias of gradient descent (Soudry et al., 2018; Ji & Telgarsky, 2019; Nacson et al., 2019). Especially relevant is the work by Ji et al. (2020) who relate the implicit bias of gradient descent with exponentially and polynomially-tailed losses for linear classifiers to a solution of a regularized loss minimization problem. Finally, our generalization analysis draws from the growing literature focused on finite sample bounds on the test error of the maximum margin classifier in the overparameterized regime (Chatterji & Long, 2021; Muthukumar et al., 2021; Wang & Thrampoulidis, 2021; Cao et al., 2021). + +# 3 SETTING + +We consider a distribution shift setting where the training samples $\{(x_1, y_1), \ldots, (x_n, y_n)\} \in \mathbb{R}^d \times \{-1, 1\}$ are drawn i.i.d. from $\mathsf{P}_{\mathrm{train}}$ , and the test samples are drawn from a different distribution $\mathsf{P}_{\mathrm{test}}$ that is absolutely continuous with respect to $\mathsf{P}_{\mathrm{train}}$ . Let $f_{\theta}$ denote a classifier parameterized by $\theta$ . Given a feature $x$ , a classifier maps this feature to $f_{\theta}(x) \in \mathbb{R}$ . In this paper we shall consider cases where the classifier is either linear (for our theory) or a neural network (for our experiments). + +Our goal is to find a classifier $f_{\theta}$ that minimizes the 0-1 loss with respect to the test distribution: + +$$ +\operatorname {T e s t E r r o r} \left[ f _ {\theta} \right] = \mathbb {P} _ {(x, y) \sim \mathrm {P} _ {\text {t e s t}}} \left[ \operatorname {s i g n} \left(f _ {\theta} (x)\right) \neq y \right]. +$$ + +To handle the mismatch between $\mathsf{P}_{\mathrm{train}}$ and $\mathsf{P}_{\mathrm{test}}$ , we shall study importance weighting algorithms. Given a datapoint $(x,y) \in \mathbb{R}^d \times \{-1,1\}$ , the classical unbiased importance weight at $(x,y)$ is given by the ratio of densities between the test and the train distributions $\frac{\mathsf{P}_{\mathrm{test}}(x,y)}{\mathsf{P}_{\mathrm{train}}(x,y)}$ . Using these unbiased importance weights ensures that the reweighted training loss is an unbiased estimate of the test loss. + +However, as noted above, past work has shown that interpolating classifiers trained with gradient descent on importance weighted exponentially-tailed losses (such as the logistic loss $\ell_{\log}(z) \coloneqq \log(1 + \exp(-z))$ , the exponential loss $\ell_{\exp}(z) \coloneqq \exp(-z)$ , and the cross-entropy loss) ignore the importance weights. For example, consider the case when the classifier is linear $f_{\theta}(x) = x \cdot \theta$ , the weights are $w_1, \ldots, w_n > 0$ , and the reweighted loss function is $\widehat{L}(\theta) = \sum_{i=1}^{n} w_i \ell_{\log}(y_i x_i \cdot \theta)$ . Xu et al. (2020) showed that if the data is linearly separable then the iterates of gradient descent converge in direction to the $\ell_2$ -maximum margin classifier, + +$$ +\widehat {\theta} _ {\mathrm {M M}} := \underset {\theta : \| \theta_ {2} \| = 1} {\arg \max } \left\{\gamma : y _ {i} x _ {i} \cdot \theta \geq \gamma \text {f o r a l l} i \in [ n ] \right\}. \tag {1} +$$ + +Observe that the maximum margin classifier does not depend on the importance weights $(w_{1},\ldots ,w_{n})$ and hence may suffer large test error when there is distribution shift. Xu et al. (2020) further showed that when separability assumptions hold, non-linear classifiers trained with gradient descent on exponentially-tailed losses are also unaffected by importance weights. + +We initiate a study of polynomially-tailed losses in the distribution shift setting and show that they have improved behavior with respect to importance weighting even when the model is overparameterized. Given parameters $\alpha > 0$ and $\beta \in \mathbb{R}$ define the polynomially-tailed loss as follows: + +$$ +\ell_ {\alpha , \beta} (z) := \left\{ \begin{array}{l l} \ell_ {\text {l e f t}} (z) & \text {i f} z < \beta \\ \frac {1}{[ z - (\beta - 1) ] ^ {\alpha}} & \text {i f} z \geq \beta , \end{array} \right. +$$ + +where $\ell_{\mathrm{left}}$ is any loss function such that the overall loss function $\ell_{\alpha,\beta}$ is convex, differentiable and strictly decreasing. Several natural choices for $\ell_{\mathrm{left}}$ include the scaled logistic $(c_1\log(1 + \exp(-c_2z)))$ , exponential $(c_1\exp(-c_2z))$ or linear $(-c_1z + c_2)$ losses. + +Given a training dataset $\{(x_1, y_1), \ldots, (x_n, y_n)\}$ and a set of weights $w_1, \ldots, w_n \geq 0$ we let + +$$ +\widehat {L} _ {\alpha , \beta} (f _ {\theta}) := \sum_ {i = 1} ^ {n} w _ {i} \ell_ {\alpha , \beta} (y _ {i} f _ {\theta} (x _ {i})) +$$ + +be the reweighted empirical loss on this dataset. + +Notation. Given a vector $v$ , let $\| v \|$ denote its Euclidean norm. For any $j \in \mathbb{N}$ , we denote the set $\{1, \ldots, j\}$ by $[j]$ . A random variable $\xi$ is 1-sub-Gaussian if for any $\lambda \in \mathbb{R}$ , $\mathbb{E}\left[e^{\lambda \xi}\right] \leq e^{\lambda^2 / 2}$ . + +# 4 THEORETICAL RESULTS + +In this section, we present several theoretical results that justify the use of polynomially-tailed losses in conjunction with importance weights to handle distribution shifts. Our final result shows a strict separation between the performance of reweighted polynomially- and exponentially-tailed models under label shift. We restrict our theoretical analysis to linear classifiers, $f_{\theta}(x) = x \cdot \theta$ , for some $\theta \in \mathbb{R}^d$ . + +First, in Section 4.1 we shall characterize the limiting direction of gradient descent on reweighted polynomially-tailed losses and show that this direction depends on both the weights as well as the datapoints. Next, in Section 4.2, we upper bound the test error of this limiting solution in a label shift setting. We also show that choosing weights that are obtained by exponentiating the unbiased importance weights helps in reducing the test error. Finally, in this label shift setting, we show that the maximum margin classifier suffers an error that is at least $1/8$ . + +# 4.1 IMPLICIT BIAS OF GRADIENT DESCENT ON POLYNOMIALLY-TAILED LOSSES + +We begin by presenting a result that characterizes the implicit bias of gradient descent on reweighted polynomially-tailed losses for linearly separable classification. Understanding this situation is a key first step, as gradient descent for separable linear classification is often used as a simplified model to theoretically characterize the behavior of overparameterized neural networks (Soudry et al., 2018; Ji & Telgarsky, 2019; Nacson et al., 2019; Lyu & Li, 2019; Ji & Telgarsky, 2020). + +Given a linearly separable dataset $(x_{1},y_{1}),\ldots ,(x_{n},y_{n})$ , we let $z_{i}\coloneqq y_{i}x_{i}$ . We shall analyze the iterates of gradient descent with step-size $\eta >0$ and initial iterate $\theta^{(0)}\in \mathbb{R}^d$ , for all $t\in \{0,1,\dots \}$ : $\theta^{(t + 1)} = \theta^{(t)} - \eta \nabla \widehat{L}_{\alpha ,\beta}(\theta^{(t)})$ . Define the direction + +$$ +\widehat {\theta} _ {\alpha} := \underset {\theta : \| \theta \| = 1} {\arg \min } \left\{\sum_ {i = 1} ^ {n} \frac {w _ {i}}{(z _ {i} \cdot \theta) ^ {\alpha}}, \text {s . t .} z _ {i} \cdot \theta > 0, \quad \text {f o r a l l} i \in [ n ] \right\}. \tag {2} +$$ + +The following proposition characterizes the limiting direction of gradient descent iterates. + +Proposition 4.1. Suppose that the data is linearly separable. For any $\alpha >0$ , $\beta \in \mathbb{R}$ , any initial point $\theta^{(0)}\in \mathbb{R}^d$ , and for all small enough step-sizes $\eta$ the direction of the gradient descent iterates satisfy the following: $\lim_{t\to \infty}\frac{\theta^{(t)}}{\|\theta^{(t)}\|}\rightarrow \widehat{\theta}_{\alpha}$ . + +The proof is presented in Appendix A. This proof relies recent result by Ji et al. (2020) that relates the limiting direction of gradient descent on the unregularized loss to the limiting solution of a norm-constrained loss minimization problem, where the limit is taken with respect to the norm constraint. + +Note that, unlike the maximum margin classifier, it is immediately clear that this limiting direction $\widehat{\theta}_{\alpha}$ depends on the weights $w_{1},\ldots ,w_{n}$ . As one would intuitively expect, the direction $\widehat{\theta}_{\alpha}$ tries to achieve a larger margin $z_{i}\cdot \theta$ on points with larger weights $w_{i}$ . This behavior is also apparent in the simulation in the rightmost panel in Figure 1, where upweighting points in the minority class helps to learn a classifier that is similar in direction to the Bayes optimal classifier for the problem. + +Our limiting direction $\widehat{\theta}_{\alpha}$ has the interesting property that it does not depend on several quantities: the initial point $\theta^{(0)}$ , the properties of $\ell_{\mathrm{left}}$ , and the "swithover" point $\beta$ . Linear separability ensures + +that in the limit, the margin on each point is much larger than $\beta$ , and so the loss of each point is in the polynomial tail of part of $\ell_{\alpha,\beta}$ . + +# 4.2 GENERALIZATION ANALYSIS + +The result in the previous subsection shows that the asymptotic classifier learnt by gradient descent, $\widehat{\theta}_{\alpha}$ respects importance weights. However, this does not demonstrate that using polynomially-tailed losses leads to classifiers with lower test error compared to using exponentially-tailed losses. + +To answer this more fine-grained question, we will need to perform a more refined analysis. To do this we will make sub-Gaussian cluster assumptions on the data, similar to ones considered in the generalization analysis of the overparameterized maximum margin classifiers (Chatterji & Long, 2021; Wang & Thrampoulidis, 2021; Liang & Recht, 2021; Cao et al., 2021). In our setting, the features associated with each label are drawn from two different sub-Gaussian clusters. We shall consider a label shift problem where the training data is such that the number of data points from the positive (majority) cluster will be much larger than the number of datapoints from the negative (minority) cluster. The test datapoints will be drawn uniformly from either cluster. + +Under these assumptions, we derive upper bounds on the error incurred by $\widehat{\theta}_1$ , the limiting direction of gradient descent of polynomially tailed losses with $\alpha = 1$ (Section 4.2.2). We will find that its test error is small when the reweighting weights are set to cubic powers of the unbiased importance weights. (A similar analysis can also be conducted for other $\alpha$ .) In the same setting in Section 4.2.3, we will show that the maximum margin classifier must suffer large test errors. + +# 4.2.1 SETTING FOR GENERALIZATION ANALYSIS + +Here we formally describe the setting of our generalization analysis. We let $C \geq 1$ and $0 < \widetilde{C} \leq 1$ denote positive absolute constants, whose value is fixed throughout the remainder of the paper. We will use $c, c', c_1, \ldots$ to denote "local" positive constants, which may take different values in different contexts. + +The training dataset $\mathcal{S} \coloneqq \{(x_1, y_1), \ldots, (x_n, y_n)\}$ has $n$ independently drawn samples. The conditional distribution of the features given the label is + +$$ +\begin{array}{l} x \mid \{y = 1 \} = \mu_ {1} + U q \\ x \mid \left\{y = - 1 \right\} = \mu_ {2} + U q, \\ \end{array} +$$ + +where $\mu_1 \cdot \mu_2 = 0$ , $\| \mu_1 \| = \| \mu_2 \|$ , $U$ is an arbitrary orthogonal matrix, and $q$ is a random variable such that: its entries are 1-sub-Gaussian and independent, and $\mathbb{E}\left[\| q \|^2\right] \geq \widetilde{C} d$ . + +We note that in past work that studied this setting (Chatterji & Long, 2021; Wang & Thrampoulidis, 2021; Cao et al., 2021), the cluster centers were chosen to be opposite one another $\mu_{1} = -\mu_{2}$ . Here, since our goal here is to study a label shift setting we consider the cluster centers $\mu_{1}$ and $\mu_{2}$ to be orthogonal. This ensures that learning the direction of one of the centers reveals no information about the other center, which makes this problem more challenging in this setting. + +Define $\mathcal{P} := \{i \in [n] : y_i = 1\}$ to be the set of indices corresponding to the positive labels and $\mathcal{N} := \{i \in [n] : y_i = -1\}$ to be the set of indices corresponding to the negative labels. As stated above, we will focus on the case where $|\mathcal{P}| \gg |\mathcal{N}| \geq 1$ . Let $\tau := \frac{|\mathcal{P}|}{|\mathcal{N}|} \geq 1$ be the ratio between the number of positive and negative samples. The test distribution $\mathrm{P}_{\mathrm{test}}$ is balanced. That is, if $(x,y) \sim \mathrm{P}_{\mathrm{test}}$ , then $\mathbb{P}[y = 1] = \mathbb{P}[y = -1] = 1/2$ and $x \mid y$ follows the distribution as described above. We shall study the case where negative examples (which are in the minority) are upweighted. Specifically, set the importance weights as follows: $w_i = 1$ for $i \in \mathcal{P}$ and $w_i = w$ for $i \in \mathcal{N}$ . + +Assumptions. Given a failure probability $0 < \delta < 1 / C$ , we make the following assumptions on the parameters of the problem: + +1. Number of samples $n \geq C \log(1/\delta)$ . +2. Norm of the means $\| \mu \| ^2 \coloneqq \| \mu_1\| ^2 = \| \mu_2\| ^2\geq Cn^2\log (n / \delta)$ +3. Dimension $d \geq Cn\|\mu\|^2$ . + +Our assumptions allow for large overparameterization, where the dimension $d$ scales polynomially with the number of samples $n$ . + +# 4.2.2 UPPER BOUND FOR THE REWEIGHTED POLYNOMIALLY-TAILED LOSS CLASSIFIER + +First, we shall prove an upper bound on the test error of the solution learnt by gradient descent on the reweighted polynomially-tailed loss. Under the choice of weights described above, by equation (2) + +$$ +\widehat {\theta} _ {1} = \underset {\theta : \| \theta \| = 1} {\arg \min } \sum_ {i \in \mathcal {P}} \frac {1}{z _ {i} \cdot \theta} + \sum_ {i \in \mathcal {N}} \frac {w}{z _ {i} \cdot \theta}, \quad \text {s . t .} \quad z _ {i} \cdot \theta > 0, \quad \text {f o r a l l} i \in [ n ], +$$ + +where $z_{i} = y_{i}x_{i}$ as defined previously. The following theorem provides an upper bound on the test error of $\widehat{\theta}_{1}$ and specifies a range of values for the weight $w$ . + +Theorem 4.2. For any $0 < \widetilde{C} \leq 1$ , there is a constant $c$ such that, for all large enough $C$ and for any $0 < \delta < 1 / C$ , under the assumptions of this subsection the following holds. If the weight $\frac{\tau^3}{2} \leq w \leq 2\tau^3$ , then with probability at least $1 - \delta$ , training on $\mathcal{S}$ produces a classifier $\widehat{\theta}_1$ satisfying: + +$$ +\operatorname {T e s t E r r o r} \left[ \widehat {\theta} _ {1} \right] = \mathbb {P} _ {(x, y) \sim \mathrm {P} _ {\text {t e s t}}} \left[ \operatorname {s i g n} \left(\widehat {\theta} _ {1} \cdot x\right) \neq y \right] \leq \exp \left(- \frac {c n}{\tau} \frac {\| \mu \| ^ {4}}{d}\right). +$$ + +This theorem is proved in Appendix B. To prove this theorem, we first show that the data is linearly separable under our assumptions and use the implicit bias results of Proposition 4.1. Then, our upper bound is equivalent to bounding the test error of the limiting iterate of gradient descent on our reweighted loss. Next, we show that the sum of the gradients across each of the two groups remains roughly balanced throughout training under our choice of $w$ . This ensures that the classifier aligns well with both cluster centers $\mu_{1}$ and $-\mu_{2}$ which then proves our bound on the test error via a standard Hoeffding bound. + +If we consider a regime where $d$ and $n$ are growing simultaneously, then the test error goes down to zero if the norm of the cluster means $\|\mu\|$ grows faster than $d^{1/4}$ , regardless of the level of imbalance in the training data as $\tau < n$ . Briefly note that in setting with balanced data ( $\tau = 1$ ), the bound on the test error here matches the bound obtained for the maximum margin classifier in (Chatterji & Long, 2021; Wang & Thrampoulidis, 2021; Cao et al., 2021) (although these bounds are not directly comparable as the setting here is slightly modified for a label shift). The impossibility result by Jin (2009) shows that these previous results guarantee that learning occurs right up until the information theoretic frontier $(\|\mu\|^2 = \omega(\sqrt{d}))$ . + +Finally, it is interesting to note that the theorem requires the weight $w$ to scale with $\tau^3$ instead of $\tau$ (the unbiased importance weight), which would ensure that the reweighted training loss is an unbiased estimate of the test loss. In our proof, we find that in order to suffer low test error it is important to guarantee that the norm of the gradients across the two groups is roughly balanced throughout training. We show that at any training iteration, the ratio of the sum of the derivative of the weighted losses in the majority and minority clusters scales as $\frac{\tau}{w^{1/3}}$ . Thus choosing $w$ to scale with $\tau^3$ ensures that the gradients are balanced across both groups. We verify this in our simulations (Figure 2), and find that $w = \tau^3$ ensures equal test error across both classes, reducing overall error. + +# 4.2.3 LOWER BOUND FOR THE MAXIMUM MARGIN CLASSIFIER + +In the previous section we derived an upper bound to demonstrate that classifiers trained with polynomially-tailed losses achieve low test error. We will now show that classifiers trained with exponentially-tailed losses have their error lower bounded by $1/8$ in the same setting. + +Theorem 4.3. Let $q \sim \mathsf{N}(0, I_{d \times d})$ . There exist constants $c$ and $c'$ such that, for all large enough $C$ and for any $0 < \delta < 1 / C$ , under the assumptions of this subsection the following holds. With probability at least $1 - \delta$ , training on $S$ produces a maximum margin classifier $\widehat{\theta}_{\mathsf{MM}}$ satisfying: + +$$ +\mathsf {T e s t E r r o r} [ \widehat {\theta} _ {\mathsf {M M}} ] = \mathbb {P} _ {(x, y) \sim \mathsf {P} _ {\mathsf {t e s t}}} \left[ \mathrm {s i g n} \left(\widehat {\theta} _ {\mathsf {M M}} \cdot x\right) \neq y \right] \geq \frac {1}{2} \cdot \Phi \left(- \frac {c \sqrt {n}}{\tau} \cdot \frac {\| \mu \| ^ {2}}{\sqrt {d}}\right), +$$ + +where $\Phi$ is the Gaussian cdf. Furthermore, if the imbalance ratio $\tau \geq c' \frac{\sqrt{n} \| \mu \|^2}{\sqrt{d}}$ then with probability at least $1 - \delta$ , TestError $[\widehat{\theta}_{\mathsf{MM}}] \geq \frac{1}{8}$ . + +This theorem is proved in Appendix C. Intuitively, the lower bound holds because when the imbalance is severe, the max-margin classifier essentially ignores the samples in the minority class and + +![](images/96a65f52431dd123ef6474cd82a6d42a579557cc7dd12d4c326cb8a90c3376a0.jpg) +Figure 2: A simulation study with class-conditional Gaussians, with $d = 10^6$ , $\| \mu \| ^2 = d^{0.502}$ and $n = 100$ . The mean $\mu_{1} = \| \mu \| e_{1}$ and $\mu_{2} = \| \mu \| e_{2}$ , and $q\sim \mathsf{N}(0,I_{d\times d})$ . (Left) We plot the test error of $\widehat{\theta}_{1}$ as $\tau$ varies for different choices of $w$ , and also for the maximum margin classifier. The choice $w = \tau^3$ leads to the lowest error throughout, while $w = \tau$ also does well for small $\tau$ . Both the polynomially-tailed classifier with no importance weighting and the maximum margin classifier suffer large test error. (Right) Here we fix the imbalance ratio $\tau = 10.1$ , and study how the error of $\widehat{\theta}_{1}$ varies with $w$ . When $w = \tau^3$ , the error on both the majority and minority classes is almost equal, resulting in low overall test error. + +![](images/8ca05eef41054930a0dcf76b51cb018dd99e89d69ed9d60536f4b16b2380ec2d.jpg) + +overfits to the majority class. Ignoring these negative samples results in a relatively small alignment between the maximum margin classifier and the negative of the minority class center, which leads to high error on this class. + +Together, these two theorems demonstrate that there is a strict gap between the performance of exponentially tailed and polynomially tailed losses under distribution shifts. As a concrete example, consider the scaling where $\| \mu \| ^2 = d^{\frac{1}{2} +\frac{1}{40}}$ , $n = d^{\frac{1}{5}}$ and $\tau = d^{\frac{3}{20}} \leq n$ . For all large enough $d$ , all our assumptions are satisfied. Now since, $\sqrt{n}\| \mu \| ^2 >\sqrt{\tau d}$ , Theorem 4.2 guarantees that the test error of $\widehat{\theta}_1\rightarrow 0$ as $d\to \infty$ . However, as $\tau = d^{\frac{3}{20}}\geq c'\| \mu \| ^2\sqrt{n / d} = c'd^{\frac{5}{40}}$ , for all large enough $d$ , the test error of the maximum margin classifier is guaranteed to be at least $1 / 8$ . This degradation of the test error with $\tau$ is also apparent in our simulations in Figure 2. + +# 5 EMPIRICAL EVALUATION ON DEEP INTERPOLATING CLASSIFIERS + +Inspired by our theoretical results, we use a polynomially-tailed loss with importance weights to train interpolating deep neural networks under distribution shift. We use a polynomially-tailed loss with $\beta = 1$ and $\ell_{\mathrm{left}}(z) = \log (1 + e^{-z}) / \log (1 + e^{-1})$ , ensuring that $\ell_{\alpha,\beta}$ is continuous at transition $z = \beta$ when $\alpha = 1$ . We train models on two image classification datasets, one with label shift and one with subpopulation shift, and include additional experiment details in Appendix E. Though these nonlinear networks violate the assumptions of our theory, polynomially-tailed loss with importance weights consistently improves test accuracy for interpolating neural networks under distribution shift compared to importance-weighted cross-entropy loss. + +Imbalanced binary CIFAR10. We construct our label shift dataset from the full CIFAR10 dataset. Similar to Byrd & Lipton (2019), we create a binary classification dataset out of the "cat" and "dog" classes. We use the official test examples as our label-balanced test set of 1000 cats and 1000 dogs. To form the train and validation sets, we use all 5000 cat examples but only 500 dog examples from the official train set, corresponding to a 10:1 label imbalance. We then use $80\%$ of those examples for training and the rest for validation. We use the same convolutional neural network architecture as Byrd & Lipton (2019) with random initializations for this dataset. + +Subsampled CelebA. For our subpopulation shift dataset, we use the CelebA with spurious correlations dataset constructed by Sagawa et al. (2019). This dataset has two class labels, "blonde hair" and "dark hair". Distinguishing examples by the "male" versus "female" attribute results in four total subpopulations, or groups. The distribution shift in the dataset comes from the change in relative proportions among the groups between the train and test sets. To reduce computation, we train on $2\%$ of the full CelebA training set, resulting in group sizes of 1446, 1308, 468, and 33. We construct our test set by downsampling the original test to get group-balanced representation in + +![](images/6888c1d92109fe239f3c0f485cd65eadfca395b4ce424b529d85527f96b1375a.jpg) +Figure 3: Polynomially-tailed loss versus cross-entropy loss on a label shift dataset and a subpopulation shift dataset for neural networks optimized past \(100\%\) train accuracy without regularization. \(*\) and \(\*\* indicate \(p < 0.05\) and \(p < 0.005\) statistical significance, respectively. Importance weights (IW) consistently leads to gains when used with the polynomially-tailed loss across both datasets. Exponentiating the weights further amplifies these gains for the polynomially-tailed loss. IW has little effect for cross-entropy.\(^2\) + +the test set, resulting in 180 examples for each group. Following Sagawa et al. (2019), we use a ResNet-50 with ImageNet initialization for this dataset. + +# 5.1 ISOLATING THE EFFECTS OF IMPORTANCE WEIGHTS + +Interpolating regime. To understand the impact of polynomial losses in the interpolating regime, we train unregularized neural networks with SGD past $100\%$ train accuracy and report their final accuracies on the test sets. We compare models trained with our polynomially-tailed loss against those trained with the cross-entropy loss which has exponential tails. Let $\overline{w}$ correspond to the unbiased importance weights. We consider three weighting scenarios for both loss functions: no importance weighting at all (No IW) the classical unbiased importance weighting (IW $(\overline{w})$ ), and biased weighting where we exponentiate the weights, (IW $(\overline{w}^c)$ ), increasing the ratio of different weights. The third setting is inspired by our theory in Section 4 that shows biased importance weights can improve performance for polynomially-tailed losses. For these experiments, we fixed $\alpha = 1$ and set the exponents to be the largest value that still allowed for stable optimization. For CelebA, we exponentiate by 2 and for CIFAR10 we exponentiate by $3/2$ . We run 10 seeds for each experiment setting. We compare the two losses via paired one-sided Welch's $t$ -tests, pairing runs with the same random seed. We report the exact numbers in Appendix E. + +Figure 3 shows the mean accuracy and the standard error for each of the three settings. As indicated by our theory, we find that importance weighting with polynomially-tailed losses leads to statistically significant gains over cross-entropy in all cases. Further we find that exponentiating weights boosts the performance of polynomially tailed losses, confirming our claims in Theorem 4.2. However, exponentiating the weights leaves the performance of cross-entropy loss largely unchanged. In the case of CelebA, we find that exponentiated reweighting with poly-tailed losses outperforms all other methods. While in the case of Imbalanced Binary CIFAR10, we find a smaller gap between polynomially-tailed losses and cross-entropy, partially due to a substantially higher run-to-run variability in training. This variability does not affect our main conclusion: exponentiated reweighting with poly-tailed losses still outperforms cross-entropy with significance $p = 0.01$ . + +In Appendix D, we also compare the performance of polynomially-tailed losses with the cross-entropy loss when we regularize training via early-stopping. We find that even with regularization, poly-tailed losses give test accuracies better than or similar to cross-entropy across scenarios. + +# 5.2 COMPARING AGAINST PRIOR DISTRIBUTION SHIFT METHODS + +To place our method's empirical performance in the context of prior works, we extensively compare our method to state-of-the-art distribution shift correction methods. On binary CIFAR10, we com + +![](images/daa6ceff5b14a2922d5f3c00d28841c10612d899662b855e2fa9cac63431dfcc.jpg) +Figure 4: Polynomially-tailed loss with exponentiated importance weights is better than or competitive with state of the art methods that address distribution shift. We tune all methods extensively using the same validation set. We compare to cross entropy with undersampling (CE+US), label-distribution-aware margin loss (LDAM), class-dependent temperatures loss (CDT), logit-adjusted loss (LA), vector-scaling loss (VS), and the use of distributionally robust optimization (DRO). + +pare to label-distribution-aware margin (LDAM) loss (Cao et al., 2019), class-dependent temperatures (CDT) loss (Ye et al., 2020), logit-adjusted (LA) loss (Menon et al., 2020), and vector-scaling (VS) loss (Kini et al., 2021). On CelebA, we compare to VS loss only since it encapsulates CDT loss, LA loss, and LDAM loss. We also evaluate the effects of distributionally robust optimization (DRO) by Sagawa et al. (2019) when combined with poly-tailed loss versus VS loss. We grid search each method exhaustively, and report results over 10 random initialization seeds. See Appendix E for more details on our procedure and the best hyperparameters we found. Unlike in Section 5.1, here we tune both the importance weight exponent and $\alpha$ for our poly-tailed loss. For all methods, including ones that use DRO, we train all models to interpolation without early stopping or strong regularizations, since we are interested in interpolating classifiers. + +Figure 4 shows that when $\alpha$ and the weights' exponent are properly tuned, our poly-tailed loss with exponentiated weights gives accuracies comparable to or even exceeding those by these recently proposed methods. For both datasets, we found that cross entropy (CE) loss with undersampling (US), which discards data from overrepresented groups or classes to form a balanced training set, was a strong baseline. + +On binary CIFAR10, our poly-tailed loss performs comparably to LA loss and is only $2\%$ worse than VS loss in mean test accuracy with overlapping confidence intervals. At first, we grid searched VS loss across the published hyperparameter ranges from Kini et al. (2021), and it performed poorly $(58.6\%$ test accuracy). More thorough grid search for VS loss gave optimal hyperparameters that were similar to those of LA loss, increasing test accuracy by $10\%$ . In sum, our poly-tailed loss matched or exceeded existing data imbalance adjustment methods (under published hyperparameters) and was beaten by $2\%$ only after more extensively tuning the baselines. + +On CelebA, our poly-tailed loss with IW achieves comparable test accuracy to VS loss. When we use both loss functions with DRO, poly loss with DRO is better than VS loss with DRO by $3.5\%$ on test accuracy and $8\%$ better on worst group accuracy. Poly-tailed loss with IW gives the best worst group accuracy out of all loss functions when not using DRO (see Appendix E). Such improved performance is surprising, as we designed polynomially tailed losses to optimize for static importance weights, rather than the worst case weights in DRO. The finding that poly-tailed losses with IW performs well on worst-group accuracy may be an interesting direction for future work + +# 6 CONCLUSION + +Contrary to popular belief, importance weights are in fact compatible with the current paradigm of overparameterized classifiers, provided that the loss function does not decay exponentially. The limiting behavior of an interpolating linear classifier trained with a weighted polynomially-tailed loss provably depends on the importance weights, unlike the maximum-margin classifier recovered by an exponentially decaying loss function. Our theoretical analysis of generalization error further suggested that exponentiating the classic importance weights can be key to accurate distribution shift correction. We empirically corroborated these theoretical intuitions, finding that weighted polynomially-tailed losses are also able to address distribution shift for interpolating neural networks. Our work suggests that heavy-tailed losses together with importance weighting serve as a simple and general candidate for addressing distribution shift in deep learning. + +# ETHICS STATEMENT + +We use publicly available datasets in our paper, and do not foresee any potential harm arising from the use of our methods. + +# REPRODUCIBILITY STATEMENT + +The full proofs of our theoretical results are presented in the appendix. All experimental details and hyperparameters are presented in Appendix E. + +# REFERENCES + +Brian Beavis and Ian Dobbs. Optimisation and stability theory for economic analysis. Cambridge University Press, 1990. +Jonathon Byrd and Zachary Lipton. What is the effect of importance weighting in deep learning? In International Conference on Machine Learning, pp. 872-881, 2019. +Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. Advances in Neural Information Processing Systems, pp. 1567-1578, 2019. +Yuan Cao, Quanquan Gu, and Mikhail Belkin. Risk bounds for over-parameterized maximum margin classification on sub-Gaussian mixtures. arXiv preprint arXiv:2104.13628, 2021. +Niladri S Chatterji and Philip M Long. Finite-sample analysis of interpolating linear classifiers in the overparameterized regime. Journal of Machine Learning Research, 22(129):1-30, 2021. +Ziwei Ji and Matus Telgarsky. The implicit bias of gradient descent on nonseparable data. In Conference on Learning Theory, pp. 1772-1798, 2019. +Ziwei Ji and Matus Telgarsky. Directional convergence and alignment in deep learning. In Advances in Neural Information Processing Systems, pp. 17176-17186, 2020. +Ziwei Ji, Miroslav Dudik, Robert E Schapire, and Matus Telgarsky. Gradient descent follows the regularization path for general losses. In Conference on Learning Theory, pp. 2109-2136, 2020. +Jiashun Jin. Impossibility of successful classification when useful features are rare and weak. Proceedings of the National Academy of Sciences, 106(22):8859-8864, 2009. +Ganesh Ramachandra Kini, Orestis Paraskevas, Samet Oymak, and Christos Thrampoulidis. Label-imbalanced and group-sensitive classification under overparameterization. arXiv preprint arXiv:2103.01550, 2021. +Tengyuan Liang and Benjamin Recht. Interpolating classifiers make few mistakes. arXiv preprint arXiv:2101.11815, 2021. +Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. In International Conference on Learning Representations, 2019. +Aditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Himanshu Jain, Andreas Veit, and Sanjiv Kumar. Long-tail learning via logit adjustment. In International Conference on Learning Representations, 2020. +Vidya Muthukumar, Adhyyan Narang, Vignesh Subramanian, Mikhail Belkin, Daniel Hsu, and Anant Sahai. Classification vs regression in overparameterized regimes: Does the loss function matter? Journal of Machine Learning Research, 22(222):1-69, 2021. +Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro Henrique Pamplona Savarese, Nathan Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. In Conference on Artificial Intelligence and Statistics, pp. 3420-3428, 2019. +Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019. + +Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of Statistical Planning and Inference, 90(2):227-244, 2000. +Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. Journal of Machine Learning Research, 19(1): 2822-2878, 2018. +Roman Vershynin. High-dimensional probability: An introduction with applications in data science. Cambridge University Press, 2018. +Ke Wang and Christos Thrampoulidis. Benign overfitting in binary classification of Gaussian mixtures. In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 4030-4034, 2021. +Junfeng Wen, Chun-Nam Yu, and Russell Greiner. Robust learning under uncertain test distributions: Relating covariate shift to model misspecification. In International Conference on Machine Learning, pp. 631-639, 2014. +Da Xu, Yuting Ye, and Chuanwei Ruan. Understanding the role of importance weighting for deep learning. In International Conference on Learning Representations, 2020. +Han-Jia Ye, Hong-You Chen, De-Chuan Zhan, and Wei-Lun Chao. Identifying and compensating for feature deviation in imbalanced deep learning. arXiv preprint arXiv:2001.01385, 2020. + +# A PROOF OF PROPOSITION 4.1 + +First, we restate the statement of the proposition. + +Proposition 4.1. Suppose that the data is linearly separable. For any $\alpha >0$ , $\beta \in \mathbb{R}$ , any initial point $\theta^{(0)}\in \mathbb{R}^d$ , and for all small enough step-sizes $\eta$ the direction of the gradient descent iterates satisfy the following: $\lim_{t\to \infty}\frac{\theta^{(t)}}{\|\theta^{(t)}\|}\rightarrow \widehat{\theta}_{\alpha}$ . + +Proof Recall that the loss $\ell_{\alpha, \beta}$ is assumed to be convex, strictly decreasing to zero and is differentiable. Define the minimizer of the loss over a ball of radius $R$ as follows + +$$ +\theta_{R} = \operatorname *{arg min}_{\theta :\| \theta \| \leq R}\widehat{L}_{\alpha ,\beta}(\theta). +$$ + +Under the assumptions of this proposition, we can invoke Theorem 1 by Ji et al. (2020) to get that + +$$ +\lim _ {t \rightarrow \infty} \frac {\theta^ {(t)}}{\| \theta^ {(t)} \|} = \lim _ {R \rightarrow \infty} \frac {\theta_ {R}}{R}. +$$ + +We will therefore instead demonstrate that $\lim_{R\to \infty}\frac{\theta_R}{R} = \widehat{\theta}_\alpha$ to establish our claim. + +First, note that the classifier $\theta_R$ is the minimizer of loss in a ball of radius $R$ , so there exists a $R_0$ with + +$$ +\widehat {L} _ {\alpha , \beta} (\theta_ {R _ {0}}) = \sum_ {i \in [ n ]} w _ {i} \ell_ {\alpha , \beta} (z _ {i} \cdot \theta_ {R _ {0}}) \leq (\min _ {i} w _ {i}) \ell_ {\alpha , \beta} (\beta) +$$ + +such that for all $R > R_0$ , each example is classified correctly by $\theta_R$ and the margin $(z_i \cdot \theta_R)$ on each example is at least $\beta$ . Therefore, + +$$ +\widehat {L} _ {\alpha , \beta} (\theta_ {R}) = \sum_ {i = 1} ^ {n} w _ {i} \ell_ {\alpha , \beta} (z _ {i} \cdot \theta_ {R}) = \sum_ {i = 1} ^ {n} \frac {w _ {i}}{[ z _ {i} \cdot \theta_ {R} - (\beta - 1) ] ^ {\alpha}}. +$$ + +Thus, for any radius $R > R_0$ we have + +$$ +\begin{array}{l} \frac{\theta_{R}}{R} = \frac{1}{R}\operatorname *{arg min}_{\theta :\| \theta \| \leq R}\widehat{L}_{\alpha ,\beta}(\theta) \\ = \frac {1}{R} \underset {\theta : \| \theta \| \leq R} {\arg \min } \left\{\sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left[ z _ {i} \cdot \theta - (\beta - 1) \right] ^ {\alpha}}, \quad \text {s . t .}, z _ {i} \cdot \theta \geq \beta \right\} \\ = \frac {1}{R} \underset {\theta : \| \theta \| \leq R} {\arg \min } \left\{\frac {1}{R ^ {\alpha}} \sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left[ z _ {i} \cdot \left(\frac {\theta}{R}\right) - \frac {\beta - 1}{R} \right] ^ {\alpha}}, \quad \text {s . t .}, z _ {i} \cdot \left(\frac {\theta}{R}\right) \geq \frac {\beta}{R} \right\} \\ = \frac {1}{R} \times \left(R \cdot \underset {\theta : \| \theta \| \leq 1} {\arg \min } \left\{\sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left[ z _ {i} \cdot \theta - \frac {\beta - 1}{R} \right] ^ {\alpha}}, \quad \text {s . t .}, z _ {i} \cdot \theta \geq \frac {\beta}{R} \right\}\right). \\ \end{array} +$$ + +Now taking the limit $R\to \infty$ we get that + +$$ +\begin{array}{l} \lim _ {R \to \infty} \frac {\theta_ {R}}{R} = \lim _ {R \to \infty} \underset {\theta : \| \theta \| \leq 1} {\arg \min} \left\{\sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left[ z _ {i} \cdot \theta - \frac {\beta - 1}{R} \right] ^ {\alpha}}, \quad \mathrm {s . t . ,} z _ {i} \cdot \theta \geq \frac {\beta}{R} \right\} \\ \stackrel {(i)} {=} \underset {\theta : \| \theta \| \leq 1} {\arg \min } \left\{\lim _ {R \to \infty} \sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left[ z _ {i} \cdot \theta - \frac {\beta - 1}{R} \right] ^ {\alpha}}, \quad \text {s . t .}, z _ {i} \cdot \theta \geq \frac {\beta}{R} \right\} \\ = \underset {\theta : \| \theta \| \leq 1} {\arg \min } \left\{\sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left(z _ {i} \cdot \theta\right) ^ {\alpha}}, \quad \text {s . t .}, z _ {i} \cdot \theta \geq 0 \right\} \\ \stackrel {(i i)} {=} \underset {\theta : \| \theta \| \leq 1} {\arg \min } \left\{\sum_ {i = 1} ^ {n} \frac {w _ {i}}{(z _ {i} \cdot \theta) ^ {\alpha}}, \quad \text {s . t .}, z _ {i} \cdot \theta > 0 \right\} \\ = \widehat {\theta} _ {\alpha}. \\ \end{array} +$$ + +where $(i)$ follows since for every $R$ the function + +$$ +\sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left[ z _ {i} \cdot \theta - \frac {\beta - 1}{R} \right] ^ {\alpha}} +$$ + +is convex and continuous, and therefore + +$$ +\underset {\theta : \| \theta \| \leq 1} {\arg \min} \left\{\sum_ {i = 1} ^ {n} \frac {w _ {i}}{\left[ z _ {i} \cdot \theta - \frac {\beta - 1}{R} \right] ^ {\alpha}}, \quad \mathrm {s . t . ,} z _ {i} \cdot \theta \geq \frac {\beta}{R} \right\} +$$ + +has a unique minimizer (since the objective function is strictly convex, and the constraint set is convex and compact), and is a continuous map by Berge's maximum theorem (see, e.g., Beavis & Dobbs, 1990, Theorem 3.6). Thus, it is possible to switch the order of the limit and the arg min. Equation $(ii)$ follows since the data is linearly separable, so there exists a $\theta$ such that $z_{i} \cdot \theta > 0$ for all $i$ which has finite objective value. + +Therefore, + +$$ +\lim _ {t \to \infty} \frac {\theta^ {(t)}}{\| \theta^ {(t)} \|} = \lim _ {R \to \infty} \frac {\theta_ {R}}{R} = \widehat {\theta} _ {\alpha}, +$$ + +which finishes our proof. + +# B PROOF OF THEOREM 4.2 + +In this section, we will prove an upper bound on the test error $\widehat{\theta}_1$ , which is the classifier learnt by gradient descent with the importance weighted Polynomials-tailed loss that decays as $1/z$ . By Proposition 4.1, we know the choice of $\ell_{\mathrm{left}}$ and $\beta$ does not affect the implicit bias of gradient descent, hence here, for the sake of convenience, we shall use the specific loss function + +$$ +\ell_ {1, \beta} (z) := \left\{ \begin{array}{l l} - (z - \beta) + 1 & \text {i f} z < \beta \\ \frac {1}{z - (\beta - 1)} & \text {i f} z \geq \beta , \end{array} \right. +$$ + +with $\beta = 1 - wn < 0$ . It can be easily checked that this loss function is convex, differentiable and monotonically decreasing. + +We want to bound the test error of $\widehat{\theta}_{1}$ , however, in light of Proposition 4.1 we will instead bound the test error of the limiting iterate of gradient descent starting from $\theta^{(0)} = 8w^{2 / 3}n\left(\mu_1 - w^{1 / 3}\mu_2\right)$ with step-size $\eta >0$ (again by the implicit bias of gradient descent is not affected by the choice of the initial point): + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \nabla \widehat {L} (\theta^ {(t)}), +$$ + +where + +$$ +\widehat {L} (\theta) = \sum_ {i \in \mathcal {P}} \ell_ {1, \beta} (z _ {i} \cdot \theta) + w \sum_ {i \in \mathcal {N}} \ell_ {1, \beta} (z _ {i} \cdot \theta). +$$ + +Recall that if the step-size is small enough then Proposition 4.1 guarantees that $\lim_{t\to \infty}\frac{\theta^{(t)}}{\|\theta^{(t)}\|} = \widehat{\theta}_1$ . In this section we will simply let $\ell$ denote $\ell_{1,\beta}$ and also use the shorthands $\ell_i^{(t)}\coloneqq \ell (z_i\cdot \theta^{(t)})$ and $\ell_i^{\prime (t)}\coloneqq \ell^{\prime}(z_i\cdot \theta^{(t)})$ . + +With this setup in place let us begin the proof. All of the assumptions made in Section 4.2.1 are in scope here. First we have a lemma that upper bounds the test error using Hoeffding's inequality. + +Lemma B.1. There is a positive absolute constant $c$ such that + +$$ +\mathbb {P} _ {(x, y) \sim \mathsf {P} _ {\mathrm {t e s t}}} \left[ \mathrm {s i g n} (\theta \cdot x) \neq y \right] \leq \frac {1}{2} \left[ \exp \left(- c \frac {(\theta \cdot \mu_ {1}) ^ {2}}{\| \theta \| ^ {2}}\right) + \exp \left(- c \frac {(\theta \cdot \mu_ {2}) ^ {2}}{\| \theta \| ^ {2}}\right) \right]. +$$ + +This lemma follows by mirroring the proof of (Chatterji & Long, 2021, Lemma 9) which in turn follows by a simple application of Hoeffding's inequality (Vershynin, 2018, Theorem 2.6.3). + +Next we have a lemma that proves bounds on the norms of the samples, bounds the inner products between the samples and also shows that with high probability the data is linearly separable. + +Recall that the constants $C \geq 1$ and $0 < \widetilde{C} \leq 1$ were defined above in Section 4.2. + +Lemma B.2. For all $0 < \tilde{C} \leq 1$ , there is a $c \geq 1$ such that, for all large enough $C$ , with probability $1 - \delta$ over the draw of the samples the following events simultaneously occur: + +1. For all $k \in [n]$ + +$$ +\frac {d}{c} \leq \| z _ {k} \| ^ {2} \leq c d. +$$ + +2. For all $i\in \mathcal{P}$ and $j\in \mathcal{N}$ + +$$ +\left| z _ {i} \cdot z _ {j} \right| \leq c \sqrt {d \log (n / \delta)}. +$$ + +3. For all $i \neq j \in [n]$ , + +$$ +\left| z _ {i} \cdot z _ {j} \right| < c \left(\left\| \mu \right\| ^ {2} + \sqrt {d \log (n / \delta)}\right). +$$ + +4. For all $k\in \mathcal{P}$ + +$$ +\left| \mu_ {1} \cdot z _ {k} - \| \mu \| ^ {2} \right| < \| \mu \| ^ {2} / 2. +$$ + +5. For all $k\in \mathcal{N}$ + +$$ +\left| \left(- \mu_ {2}\right) \cdot z _ {k} - \| \mu \| ^ {2} \right| < \| \mu \| ^ {2} / 2. +$$ + +6. For all $k \in \mathcal{N}$ , + +$$ +\left| \mu_ {1} \cdot z _ {k} \right| < c \| \mu \| \sqrt {\log (n / \delta)}. +$$ + +7. For all $k \in \mathcal{P}$ , + +$$ +\left| \mu_ {2} \cdot z _ {k} \right| < c \| \mu \| \sqrt {\log (n / \delta)}. +$$ + +8. The samples are linearly separable. + +Proof We shall prove that each of the ten parts hold with probability at least $1 - \delta / 10$ and take a union bound to prove our lemma. Under the assumptions of this lemma, Parts (1), (3)-(5) and (8) can be shown to hold with the required probability by invoking (Chatterji & Long, 2021, Lemma 13). We will show that Parts (2), (6) and (7) also hold with the required probability to complete the proof. + +Proof of Part (2): Note that for all $i \in \mathcal{P}$ , $z_i = \mu_1 + Uq_i$ , and for all $i \in \mathcal{N}$ , $z_i = \mu_2 + Uq_2$ . Therefore, for any $i \in \mathcal{P}$ and $j \in \mathcal{N}$ , since $\mu_1 \cdot \mu_2 = 0$ , + +$$ +\begin{array}{l} \left| z _ {i} \cdot z _ {j} \right| = \mu_ {1} \cdot \left(U q _ {j}\right) + \mu_ {2} \cdot \left(U q _ {i}\right) + q _ {i} \cdot q _ {j} \\ \leq \left| \mu_ {1} \cdot \left(U q _ {j}\right) \right| + \left| \mu_ {2} \cdot \left(U q _ {i}\right) \right| + \left| q _ {i} \cdot q _ {j} \right| \\ = \left| \left(U ^ {\top} \mu_ {1}\right) \cdot q _ {j} \right| + \left| \left(U ^ {\top} \mu_ {2}\right) \cdot q _ {i} \right| + \left| q _ {i} \cdot q _ {j} \right|. \tag {3} \\ \end{array} +$$ + +We will show that each of these terms is small with high probability for all pairs $i \in \mathcal{P}$ and $j \in \mathcal{N}$ . + +For the first two terms, note that by Hoeffding's inequality (Vershynin, 2018, Theorem 2.6.3) + +$$ +\begin{array}{l} \mathbb {P} \left[ | (U ^ {\top} \mu_ {1}) \cdot q _ {j} | > \frac {c \| \mu \| \sqrt {\log (n / \delta)}}{3} \right] < 2 \exp \left(- \frac {c _ {1} c ^ {3}}{9} \frac {\| \mu \| ^ {2} \log (n / \delta)}{\| \mu \| ^ {2}}\right) \\ = 2 \exp \left(- \frac {c _ {1} c ^ {3}}{9} \log (n / \delta)\right) \\ = 2 \left(\frac {\delta}{n}\right) ^ {c _ {1} c ^ {3} / 9} \\ \leq \frac {\delta}{3 0 n}, \\ \end{array} +$$ + +where the last inequality follows since the constant $c \geq 1$ can be chosen to be large enough and because $\delta < 1 / C$ for a large enough constant $C$ . Therefore, by taking a union bound over all $j \in \mathcal{N}$ + +$$ +\mathbb {P} \left[ \exists j \in \mathcal {N}, | (U ^ {\top} \mu_ {1}) \cdot q _ {j} | > \frac {c \| \mu \| \sqrt {\log (n / \delta)}}{3} \right] < \frac {\delta}{3 0}. \tag {4} +$$ + +Using an analogous argument we can also show that + +$$ +\mathbb {P} \left[ \exists i \in \mathcal {P}, | (U ^ {\top} \mu_ {2}) \cdot q _ {i} | > \frac {c \| \mu \| \sqrt {\log (n / \delta)}}{3} \right] < \frac {\delta}{3 0}. \tag {5} +$$ + +Next, using (Chatterji & Long, 2021, inequality (15)) we get that + +$$ +\mathbb {P} \left[ \exists i \neq j \in [ n ], | q _ {i} \cdot q _ {j} | > \frac {c \sqrt {d \log (n / \delta)}}{3} \right] \leq \frac {\delta}{3 0}. \tag {6} +$$ + +Combining inequalities (3)-(6) we get that for all $i \in \mathcal{P}$ and $j \in \mathcal{N}$ with probability at least $1 - \delta / 10$ + +$$ +\left| z _ {i} \cdot z _ {j} \right| \leq \frac {2 c \| \mu \| \sqrt {\log (n / \delta)}}{3} + \frac {c \sqrt {d \log (n / \delta)}}{3} \leq c \sqrt {d \log (n / \delta)}, +$$ + +where the last inequality follows since by assumption $d \geq C n \| \mu \|^2$ and because $C$ is large enough. This completes the proof of this part. + +Proof of Part (6): For any $k \in \mathcal{N}$ , $z_k = \mu_2 + Uq_k$ . Recall that $\mu_1 \cdot \mu_2 = 0$ , thus + +$$ +\left| \mu_ {1} \cdot z _ {k} \right| = \left| \mu_ {1} \cdot \left(U q _ {k}\right) \right|. +$$ + +Invoking inequality (4) proves that this part holds with probability at least $1 - \delta / 10$ . + +Proof of Part (7): This follows by an analogous argument as in the previous part. + +We continue by defining a good event that we will work under for the rest of the proof. + +Definition B.3. If the training dataset $S$ satisfies all the conditions specified in Lemma B.2 then we call it a good run. + +Going forward in this section we shall assume that a good run occurs. + +The following lemma provides some useful bound on the loss ratio at initialization and guarantees that the loss of example remains in the polynomially-tailed part throughout training. + +Lemma B.4. Recall that $\theta^{(0)} = 8w^{2 / 3}n(\mu_1 - w^{1 / 3}\mu_2)$ , and that $w_{i} = 1$ if $i\in \mathcal{P}$ and $w_{i} = w$ if $i\in \mathcal{N}$ . On a good run, for all $i\neq j\in [n]$ + +$$ +\frac {\ell_ {i} ^ {(0)}}{\ell_ {j} ^ {(0)}} \leq 8 \left(\frac {w _ {j}}{w _ {i}}\right) ^ {1 / 3}. +$$ + +Furthermore, if the step-size $\eta$ is sufficiently small then on a good run, for all $t\in \{0,1,\ldots \}$ and for all $i\in [n]$ + +$$ +\ell_ {i} ^ {(t)} = \frac {1}{z _ {i} \cdot \theta^ {(t)} - (\beta - 1)}. +$$ + +Proof Consider an $i\in \mathcal{P}$ then + +$$ +\begin{array}{l} z _ {i} \cdot \theta^ {(0)} = 8 w ^ {2 / 3} n \left(z _ {i} \cdot \mu_ {1} - w ^ {1 / 3} z _ {i} \cdot \mu_ {2}\right) \stackrel {(i)} {\leq} 8 w ^ {2 / 3} n \left(\frac {3 \| \mu \| ^ {2}}{2} + c _ {1} w ^ {1 / 3} \| \mu \| \sqrt {\log (n / \delta)}\right) \\ \leq 1 2 w ^ {2 / 3} n \| \mu \| ^ {2} \left[ 1 + \frac {2 c _ {1} w ^ {1 / 3} \sqrt {\log (n / \delta)}}{3 \| \mu \|} \right] \\ \stackrel {(i i)} {\leq} 1 6 w ^ {2 / 3} n \| \mu \| ^ {2}, \\ \end{array} +$$ + +where $(i)$ follows by Lemma B.2 and $(ii)$ follows since $\| \mu \| ^2\geq Cn^2\log (n / \delta)\geq C\tau^2\log (n / \delta)\geq$ $\frac{C}{2^{2 / 3}} w^{2 / 3}\log (n / \delta)$ for a large enough constant $C$ . Similarly, we also have the lower bound + +$$ +\begin{array}{l} z _ {i} \cdot \theta^ {(0)} = 8 w ^ {2 / 3} n \left(z _ {i} \cdot \mu_ {1} - w ^ {1 / 3} z _ {i} \cdot \mu_ {2}\right) \\ \geq 8 w ^ {2 / 3} n \left(\frac {\| \mu \| ^ {2}}{2} - c _ {1} w ^ {1 / 3} \| \mu \| \sqrt {\log (n / \delta)}\right) \geq 4 w ^ {2 / 3} n \| \mu \| ^ {2} \left[ 1 - \frac {2 c _ {1} w ^ {1 / 3} \sqrt {\log (n / \delta)}}{\| \mu \|} \right]. \\ \end{array} +$$ + +Recall from the definition of the loss that we set $\beta = 1 - nw$ . Now again since $\| \mu \| ^2 \geq \frac{C}{2^{2 / 3}} w^{2 / 3}\log (n / \delta)$ , and because we choose $\beta = 1 - nw$ , we infer that + +$$ +z _ {i} \cdot \theta^ {(0)} - (\beta - 1) \geq \frac {8 w ^ {2 / 3} n \| \mu \| ^ {2}}{3} - n w \geq 2 w ^ {2 / 3} n \| \mu \| ^ {2}. +$$ + +Since the margin of the point is larger than $(\beta - 1)$ therefore by the definition of the loss function above we have that + +$$ +\ell_ {i} ^ {(0)} = \frac {1}{z _ {i} \cdot \theta^ {(0)} - (\beta - 1)} +$$ + +and hence + +$$ +\frac {1}{1 6 w ^ {2 / 3} n \| \mu \| ^ {2}} \leq \ell_ {i} ^ {(0)} \leq \frac {1}{2 w ^ {2 / 3} n \| \mu \| ^ {2}}. \tag {7} +$$ + +By mirroring the logic we can also prove that for all $j \in \mathcal{N}$ + +$$ +\frac {1}{1 6 w n \| \mu \| ^ {2}} \leq \ell_ {j} ^ {(0)} \leq \frac {1}{2 w n \| \mu \| ^ {2}}. \tag {8} +$$ + +By combining equations (7) and (8) we immediately get that + +$$ +\frac {\ell_ {i} ^ {(0)}}{\ell_ {j} ^ {(0)}} \leq 8 \left(\frac {w _ {j}}{w _ {i}}\right) ^ {1 / 3}. +$$ + +This proves the first part of the lemma. + +To prove the second part we shall prove that the loss on each example remains smaller than $1/2$ , which ensures $\ell_i^{(t)}$ is equal to the polynomial loss function. Note that + +$$ +\widehat {L} \left(\theta^ {(0)}\right) = \sum_ {i \in \mathcal {P}} \ell_ {i} ^ {(0)} + w \sum_ {i \in \mathcal {N}} \ell_ {i} ^ {(0)} \leq \frac {| \mathcal {P} |}{2 w ^ {2 / 3} n \| \mu \| ^ {2}} + \frac {w | \mathcal {N} |}{2 w n \| \mu \| ^ {2}} \leq \frac {w n}{2 w n \| \mu \| ^ {2}} \leq 1 / 2. \tag {9} +$$ + +This proves that $\ell_i^{(0)}\leq 1 / 2$ for all $i\in [n]$ . By (Ji et al., 2020, Lemma 2) we know that if the step-size is small enough then the sequence $\{\widehat{L} (\theta^{(t)})\}$ is non-increasing. Hence, we have that $\ell_i^{(t)}\leq 1 / 2$ for all $t\in \{0,1,\ldots \}$ and for all samples. This wraps up our proof. + +The next lemma lower bounds the inner product between the normalized gradient descent iterates, and $\mu_{1}$ and $\mu_{2}$ . + +Lemma B.5. Let $c$ and $c'$ be absolute constants. Then, on a good run, for any $t \in \{0,1,\ldots\}$ + +$$ +\begin{array}{l} \frac {\mu_ {1} \cdot \theta^ {(t + 1)}}{\| \theta^ {(t + 1)} \|} \geq \frac {\mu_ {1} \cdot \theta^ {(0)}}{\| \theta^ {(t + 1)} \|} + \frac {\| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{2 c \sqrt {d}} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] \times \\ \frac {\sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c ^ {\prime} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right]}{\sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}} \\ \end{array} +$$ + +and + +$$ +\begin{array}{l} \frac {\mu_ {2} \cdot \theta^ {(t + 1)}}{\| \theta^ {(t + 1)} \|} \geq \frac {\mu_ {2} \cdot \theta^ {(0)}}{\| \theta^ {(t + 1)} \|} + \frac {\| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{2 c \sqrt {d}} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] \times \\ \frac {\sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c ^ {\prime} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right]}{\sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}. \\ \end{array} +$$ + +Proof Let us prove the first claim for the inner product with $\mu_{1}$ . The second claim regarding $\mu_{2}$ shall follow analogously. For any $t\in \{0,1,\ldots \}$ , by the definition of the gradient descent step, we have that + +$$ +\mu_ {1} \cdot \theta^ {(t + 1)} = \mu_ {1} \cdot \theta^ {(t)} + \eta \sum_ {i \in \mathcal {P}} w _ {i} \mu_ {1} \cdot z _ {i} \left(- \ell_ {i} ^ {\prime (t)}\right) + \eta \sum_ {i \in \mathcal {N}} w _ {i} \mu_ {1} \cdot z _ {i} \left(- \ell_ {i} ^ {\prime (t)}\right). +$$ + +Note that by the definition of the loss function we have that $-\ell_i^{\prime (t)}\geq 0$ for all $t$ and all $i$ . Thus by Parts (1) and (6) of Lemma B.2 we get that + +$$ +\begin{array}{l} \mu_ {1} \cdot \theta^ {(t + 1)} \geq \mu_ {1} \cdot \theta^ {(t)} + \frac {\eta \| \mu \| ^ {2}}{2} \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (t)} - c _ {1} \eta \| \mu \| \sqrt {\log (n / \delta)} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (t)} \\ = \mu_ {1} \cdot \theta^ {(t)} + \frac {\eta \| \mu \| ^ {2}}{2} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (t)} - \frac {\eta \| \mu \| ^ {2}}{2} \left(1 + \frac {c _ {1} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (t)} \\ = \mu_ {1} \cdot \theta^ {(t)} + \frac {\eta \| \mu \| ^ {2}}{2} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (t)} - \frac {c _ {1} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (t)} \right], \\ \end{array} +$$ + +where $c_{1}$ is the constant from Lemma B.2. Unrolling this inequality over $t$ steps we have that + +$$ +\mu_ {1} \cdot \theta^ {(t + 1)} = \mu_ {1} \cdot \theta^ {(0)} + \frac {\eta \| \mu \| ^ {2}}{2} \sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c _ {1} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right]. \tag {10} +$$ + +On the other hand, by the triangle inequality we know that + +$$ +\begin{array}{l} \left\| \theta^ {(t + 1)} \right\| \leq \left\| \theta^ {(t)} \right\| + \eta \| \nabla \widehat {L} (\theta^ {(t)}) \| \\ = \| \theta^ {(t)} \| + \eta \left\| \sum_ {i \in [ n ]} z _ {i} (- w _ {i} \ell_ {i} ^ {\prime (t)}) \right\| \\ \leq \left\| \theta^ {(t)} \right\| + \eta \left\| \sum_ {i \in \mathcal {P}} z _ {i} \left(- \ell_ {i} ^ {\prime (t)}\right) \right\| + \eta w \left\| \sum_ {i \in \mathcal {N}} z _ {i} \left(- \ell_ {i} ^ {\prime (t)}\right) \right\|. \tag {11} \\ \end{array} +$$ + +Now note that + +$$ +\begin{array}{l} \left\| \sum_ {i \in \mathcal {P}} z _ {i} (- \ell_ {i} ^ {\prime (t)}) \right\| ^ {2} = \sum_ {i \in \mathcal {P}} (\ell_ {i} ^ {\prime (t)}) ^ {2} \| z _ {i} \| ^ {2} + \sum_ {i \neq j \in \mathcal {P}} \ell_ {i} ^ {\prime (t)} \ell_ {j} ^ {\prime (t)} (z _ {i} \cdot z _ {j}) \\ \stackrel {(i)} {\leq} c _ {1} \left[ \sum_ {i \in \mathcal {P}} (- \ell_ {i} ^ {\prime (t)}) ^ {2} d + \sum_ {i \neq j \in \mathcal {P}} \ell_ {i} ^ {\prime (t)} \ell_ {j} ^ {\prime (t)} (\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}) \right] \\ \stackrel {(i i)} {\leq} c _ {1} \left(\max _ {j \in \mathcal {P}} - \ell_ {j} ^ {\prime (t)}\right) \left[ d \sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)} + | \mathcal {P} | (\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}) \sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)} \right] \\ = c _ {1} \left(\max _ {j \in \mathcal {P}} - \ell_ {j} ^ {\prime (t)}\right) \left(d + | \mathcal {P} | \| \mu \| ^ {2} + | \mathcal {P} | \sqrt {d \log (n / \delta)}) \sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)} \right. \\ \stackrel {(i i i)} {\leq} c _ {2} \frac {d}{| \mathcal {P} |} \left(\sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)}\right) ^ {2} \\ \end{array} +$$ + +where $(i)$ follows by using Part (1) and Part (3) of Lemma B.2, $(ii)$ follows since $-\ell_j^{\prime (t)}$ is positive for all $j\in [n]$ , and $(iii)$ follows since by assumption $d\geq Cn\| \mu \| ^2$ and $\| \mu \| ^2\geq Cn^2\log (n / \delta)$ for a large enough constant $C$ . Hence we have that + +$$ +\left\| \sum_ {i \in \mathcal {P}} z _ {i} (- \ell_ {i} ^ {\prime (t)}) \right\| \leq \sqrt {c _ {2} \frac {d}{| \mathcal {P} |}} \sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)}. +$$ + +Similarly, one can also show that + +$$ +\left\| \sum_ {i \in \mathcal {N}} z _ {i} (- \ell_ {i} ^ {\prime (t)}) \right\| \leq \sqrt {c _ {2} \frac {d}{| \mathcal {N} |}} \sum_ {i \in \mathcal {N}} - \ell_ {i} ^ {\prime (t)}. +$$ + +Applying these bounds in inequality (11) we get that + +$$ +\begin{array}{l} \| \theta^ {(t + 1)} \| \leq \| \theta^ {(t)} \| + \eta \left[ \sqrt {c _ {2} \frac {d}{| \mathcal {P} |}} \sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)} + w \sqrt {c _ {2} \frac {d}{| \mathcal {N} |}} \sum_ {i \in \mathcal {N}} - \ell_ {i} ^ {\prime (t)} \right] \\ \leq \| \theta^ {(t)} \| + \eta \left[ \sqrt {c _ {2} \frac {d}{| \mathcal {N} |}} \sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)} + w \sqrt {c _ {2} \frac {d}{| \mathcal {N} |}} \sum_ {i \in \mathcal {N}} - \ell_ {i} ^ {\prime (t)} \right] \\ = \| \theta^ {(t)} \| + c _ {3} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (t)}. \\ \end{array} +$$ + +Therefore, unrolling this bound over $t$ steps we find that + +$$ +\begin{array}{l} \left\| \theta^ {(t + 1)} \right\| \leq \left\| \theta^ {(0)} \right\| + c _ {3} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)} \tag {12} \\ = c _ {3} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)} \left[ 1 + \frac {| | \theta^ {(0)} | |}{c _ {3} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}} \right]. \\ \end{array} +$$ + +Thus, combined with inequality (10) we get that, + +$$ +\begin{array}{l} \frac {\mu_ {1} \cdot \theta^ {(t + 1)}}{\| \theta^ {(t + 1)} \|} \geq \frac {\mu_ {1} \cdot \theta^ {(0)}}{\| \theta^ {(t + 1)} \|} + \frac {\| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{2 c _ {3} \sqrt {d}} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c _ {3} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] \times \\ \frac {\sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c _ {1} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right]}{\sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}, \\ \end{array} +$$ + +which completes the proof of the first part of the lemma. The second part follows by an identical argument. + +Next, we prove a lemma that shows that throughout training the ratio between the losses between any two samples remains bounded. + +Lemma B.6. There is a positive absolute constant $c \geq 1$ such that the following holds for all large enough $C$ , and all small enough step-sizes $\eta$ and for any $\frac{\tau^3}{2} \leq w \leq 2\tau^3$ . On a good run, for all $t \in \{1, 2, \ldots\}$ and all $i \neq j \in [n]$ + +$$ +\frac {\ell_ {i} ^ {(t)}}{\ell_ {j} ^ {(t)}} \leq c \left(\frac {w _ {j}}{w _ {i}}\right) ^ {1 / 3}. +$$ + +Proof Let $c_{1} \geq 1$ be the constant $c$ from Lemma B.2 above. We shall show that the choice $c = \max \left\{8, 2(4c_{1}^{2})^{1/3}\right\}$ suffices. + +We shall prove this via an inductive argument. For the base case, at step $t = 0$ , we know that by Lemma B.4 that the ratio between the losses of sample $i$ and $j$ is upper bounded by $8(w_{j} / w_{i})^{1 / 3}$ . Now, we shall assume that the inductive hypothesis holds at an arbitrary step $t > 0$ and prove that it holds at step $t + 1$ . + +Without loss of generality, we shall analyze the ratio between the losses of the samples with indices $i = 1$ and $j = 2$ . A similar analysis shall hold for any other pair. Define $G_{t} \coloneqq \ell_{1}^{(t)}$ , $H_{t} \coloneqq \ell_{2}^{(t)}$ , + +$A_{t}\coloneqq H_{t} / G_{t}$ . Note that, + +$$ +\begin{array}{l} G _ {t + 1} = \frac {1}{\theta^ {(t + 1)} \cdot z _ {1} - (\beta - 1)} \\ = \frac {1}{\theta^ {(t)} \cdot z _ {1} + \eta \sum_ {k \in [ n ]} w _ {k} \left(- \ell_ {k} ^ {\prime (t)}\right) \left(z _ {k} \cdot z _ {1}\right) - (\beta - 1)} \\ \stackrel {(i)} {=} \frac {1}{\theta^ {(t)} \cdot z _ {1} - (\beta - 1) + \eta \sum_ {k \in [ n ]} w _ {k} (z _ {k} \cdot z _ {1}) \left(\ell_ {k} ^ {(t)}\right) ^ {2}} \\ = \frac {\ell_ {1} ^ {(t)}}{1 + \eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {1}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2}} \\ = G _ {t} \cdot \frac {1}{1 + \eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {1}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2}} \\ \end{array} +$$ + +where $(i)$ follows since $-\ell_k^{\prime (t)} = (\ell_k^{(t)})^2$ as the loss of each example is always in the polynomial tail of the loss by Lemma B.4. Therefore, we have that + +$$ +\begin{array}{l} A _ {t + 1} = \frac {H _ {t + 1}}{G _ {t + 1}} = \frac {H _ {t}}{G _ {t}} \cdot \frac {1 + \eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} (z _ {k} \cdot z _ {1}) (\ell_ {k} ^ {(t)}) ^ {2}}{1 + \eta \ell_ {2} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} (z _ {k} \cdot z _ {2}) (\ell_ {k} ^ {(t)}) ^ {2}} \\ = A _ {t} \cdot \frac {1 + \eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} (z _ {k} \cdot z _ {1}) \left(\ell_ {k} ^ {(t)}\right) ^ {2}}{1 + \eta \ell_ {2} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} (z _ {k} \cdot z _ {2}) \left(\ell_ {k} ^ {(t)}\right) ^ {2}}. \\ \end{array} +$$ + +Now since the step-size $\eta$ is chosen to be small enough, $|z_i\cdot z_j|\leq c_1d$ (by Part $(\ref{eq:2})$ of Lemma B.2 and by the assumption on $d$ ) and because the losses are all smaller than a constant by Lemma B.4, the following approximations hold + +$$ +\begin{array}{l} 1 + \eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {1}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2} \leq \exp \left(\eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {1}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right) \\ 1 + \eta \ell_ {2} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} (z _ {k} \cdot z _ {2}) \left(\ell_ {k} ^ {(t)}\right) ^ {2} \geq \exp \left(\frac {\eta \ell_ {2} ^ {(t)}}{2} \sum_ {k \in [ n ]} w _ {k} (z _ {k} \cdot z _ {2}) \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right), \\ \end{array} +$$ + +and thus, + +$$ +A _ {t + 1} \leq A _ {t} \exp \left(\eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {1}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2} - \frac {\eta \ell_ {2} ^ {(t)}}{2} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {2}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right). \tag {13} +$$ + +Let us further upper bound the RHS as follows + +$$ +A _ {t} \exp \left(\eta \ell_ {1} ^ {(t)} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {1}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2} - \frac {\eta \ell_ {2} ^ {(t)}}{2} \sum_ {k \in [ n ]} w _ {k} \left(z _ {k} \cdot z _ {2}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right) +$$ + +$$ +\begin{array}{l} = A _ {t} \exp \left(\eta w _ {1} \left(\ell_ {1} ^ {(t)}\right) ^ {3} \| z _ {1} \| ^ {2} - \frac {1}{2} \eta w _ {2} \left(\ell_ {2} ^ {(t)}\right) ^ {3} \| z _ {2} \| ^ {2}\right) \\ \times \exp \left(\eta \ell_ {1} ^ {(t)} \sum_ {k \neq 1} w _ {k} \left(z _ {k} \cdot z _ {1}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2} - \frac {1}{2} \eta \ell_ {2} ^ {(t)} \sum_ {k \neq 2} w _ {k} \left(z _ {k} \cdot z _ {2}\right) \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right) \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {(i)} {\leq} A _ {t} \exp \left(c _ {1} \eta d w _ {1} \left(\ell_ {1} ^ {(t)}\right) ^ {3} - \frac {1}{2 c _ {1}} \eta d w _ {2} \left(\ell_ {2} ^ {(t)}\right) ^ {3}\right) \\ \times \exp \left(c _ {2} \eta \left(\ell_ {1} ^ {(t)} + \frac {\ell_ {2} ^ {(t)}}{2}\right) \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right) \\ \end{array} +$$ + +where $(i)$ follows since for all $i\in [n]$ , $d / c_{1}\leq \| z_{i}\|^{2}\leq c_{1}d$ and for any $j\neq k$ , $|z_j\cdot z_k|\leq c_1\left(\| \mu \| ^2 +\sqrt{d\log(n / \delta)}\right)$ by Lemma B.2. Continuing we get that, + +$$ +\begin{array}{l} A _ {t + t} \leq A _ {t} \exp \left(c _ {1} \eta d w _ {1} G _ {t} ^ {3} - \frac {1}{2 c _ {1}} \eta d w _ {2} H _ {t} ^ {3}\right) \\ \times \exp \left(c _ {2} \eta \left(G _ {t} + H _ {t}\right) \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right) \\ = A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \\ \times \exp \left(c _ {2} \eta \left(G _ {t} + H _ {t}\right) \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right), \tag {14} \\ \end{array} +$$ + +With this upper bound in place, consider two cases. + +Case 1 $(A_{t}^{3}\leq \frac{4c_{1}^{2}w_{1}}{w_{2}})$ : Using inequality (14) we know that + +$$ +\begin{array}{l} A _ {t + 1} \leq A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \\ \times \exp \left(c _ {2} \eta \left(G _ {t} + H _ {t}\right) \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right) \\ \leq A _ {t} \exp \left(c _ {1} \eta d w _ {1} G _ {t} ^ {3}\right) \exp \left(c _ {2} \eta \left(G _ {t} + H _ {t}\right) \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right). \\ \end{array} +$$ + +Now the loss on each example is less than the total initial loss $1 / 2$ (see equation (9)) and therefore, + +$$ +\begin{array}{l} A _ {t + 1} \leq A _ {t} \exp (c _ {3} \eta d w) \exp \left(c _ {4} \eta \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) w n\right) \\ \stackrel {(i)} {\leq} \left(\frac {4 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right) ^ {1 / 3} \exp (1 / 8) \leq 2 \left(\frac {4 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right) ^ {1 / 3} \stackrel {(i i)} {\leq} c \left(\frac {w _ {1}}{w _ {2}}\right) ^ {1 / 3}, \\ \end{array} +$$ + +where $(i)$ follows by choosing the step-size $\eta$ to be small enough and because $A_{t} \leq \left(\frac{4c_{1}^{2}w_{1}}{w_{2}}\right)^{1 / 3}$ in this case, and $(ii)$ follows by the choice of constant $c \geq 2(4c_{1}^{2})^{1 / 3}$ from above. + +Case 2 $(\frac{4c_1^2w_1}{w_2} < A_t^3 \leq \frac{c^3w_1}{w_2})$ : In this case again by inequality (14) + +$$ +\begin{array}{l} A _ {t + 1} \leq A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \\ \times \exp \left(c _ {2} \eta \left(G _ {t} + H _ {t}\right) \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \left(\ell_ {k} ^ {(t)}\right) ^ {2}\right) \\ = A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \\ \times \exp \left(c _ {2} \eta G _ {t} ^ {3} (A _ {t} + 1) \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \frac {\left(\ell_ {k} ^ {(t)}\right) ^ {2}}{G _ {t} ^ {2}}\right). \\ \end{array} +$$ + +Continuing we find that, + +$$ +A _ {t + 1} \stackrel {(i)} {\leq} A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) +$$ + +$$ +\times \exp \left(c _ {6} \eta G _ {t} ^ {3} \max \left\{\left(\frac {w _ {1}}{w _ {2}}\right) ^ {1 / 3}, 1 \right\} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} w _ {k} \left(\frac {w _ {1}}{w _ {k}}\right) ^ {2 / 3}\right) +$$ + +$$ +\begin{array}{l} = A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \\ \times \exp \left(c _ {6} \eta w _ {1} G _ {t} ^ {3} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} \left(\frac {w _ {k}}{\operatorname* {m i n} \{w _ {1} , w _ {2} \}}\right) ^ {1 / 3}\right) \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {(i i)} {\leq} A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \\ \times \exp \left(c _ {6} \eta w _ {1} G _ {t} ^ {3} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \left(| \mathcal {P} | + w ^ {1 / 3} | \mathcal {N} |\right)\right) \\ = A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \\ \times \exp \left(c _ {6} \eta w _ {1} G _ {t} ^ {3} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) | \mathcal {P} | \left(1 + \frac {w ^ {1 / 3}}{\tau}\right)\right) \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {(i i i)} {\leq} A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \left(A _ {t} ^ {3} - \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right)\right) \exp \left(2 c _ {6} \eta w _ {1} G _ {t} ^ {3} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) n\right) \\ \stackrel {(i v)} {\leq} A _ {t} \exp \left(- \frac {1}{2 c _ {1}} \eta d w _ {2} G _ {t} ^ {3} \cdot \frac {2 c _ {1} ^ {2} w _ {1}}{w _ {2}}\right) \exp \left(2 c _ {6} \eta w _ {1} G _ {t} ^ {3} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) n\right) \\ = A _ {t} \exp \left[ - c _ {1} w _ {1} G _ {t} ^ {3} \left(d - c _ {7} n \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right)\right) \right], \\ \end{array} +$$ + +where $(i)$ follows by the inductive hypothesis which guarantees that $\frac{\ell_k^{(t)}}{\ell_1^{(t)}}\leq c(\frac{w_1}{w_k})^{1 / 3}\leq cw^{1 / 3}$ , $(ii)$ follows since $w_{k} = 1$ if $k\in \mathcal{P}$ and $w_{k} = w$ if $k\in \mathcal{N}$ . Inequality $(iii)$ follows since $w < 2\tau^3$ and since $|\mathcal{P}|\leq n$ , and finally $(iv)$ follows since in this case $A_t^3 >\frac{4c_1^2w_1}{w_2}$ . Now since by assumption the dimension + +$$ +d \geq C n \| \mu \| ^ {2} \geq C ^ {2} n ^ {3} \log (n / \delta) +$$ + +for a large enough constant $C$ . Hence, we have that $A_{t + 1} \leq A_t \leq c\left(\frac{w_1}{w_2}\right)^{1 / 3}$ in this case. + +Recall that since we assumed the inductive hypothesis to hold, the two cases analyzed above are exhaustive. This completes our proof. + +The next lemma uses the loss ratio bound that we established to show that the difference between the gradient of the losses over the positive cluster and the negative cluster is small at any iteration. + +Lemma B.7. For any positive $\tilde{c}$ , there exists a $0 < c < 1$ such that, for all large enough $C$ , if the step-size $\eta$ is sufficiently small and $\frac{\tau^3}{2} \leq w \leq 2\tau^3$ then on a good run, for any $t \in \{0,1,\ldots\}$ + +$$ +\sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (t)} - \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (t)} \geq c \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (t)} +$$ + +and + +$$ +\sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (t)} - \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (t)} \geq c \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (t)}. +$$ + +Proof We begin by proving the first part of the lemma. Note that since $[n] = \mathcal{P} \cup \mathcal{N}$ to prove the first part it suffices to instead show that + +$$ +(1 - c) \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (t)} \geq \left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (t)} +$$ + +$$ +\Longleftrightarrow (1 - c) \sum_ {i \in \mathcal {P}} - \ell_ {i} ^ {\prime (t)} \geq \left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) w \sum_ {i \in \mathcal {N}} - \ell_ {i} ^ {\prime (t)} +$$ + +$$ +\Longleftrightarrow (1 - c) \sum_ {i \in \mathcal {P}} \left(\ell_ {i} ^ {(t)}\right) ^ {2} \geq \left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) w \sum_ {i \in \mathcal {N}} \left(\ell_ {i} ^ {(t)}\right) ^ {2} +$$ + +(since $-\ell_{i}^{\prime (t)} = (\ell_{i}^{(t)})^{2}$ for the polynomial loss) + +$$ +\Leftarrow (1 - c) | \mathcal {P} | \min _ {i \in \mathcal {P}} (\ell_ {i} ^ {(t)}) ^ {2} \geq \left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) w | \mathcal {N} | \max _ {i \in \mathcal {N}} (\ell_ {i} ^ {(t)}) ^ {2} +$$ + +$$ +\Lleftarrow (1 - c)\tau \geq \left(c + \frac{\tilde{c}\sqrt{\log(n / \delta)}}{\|\mu\|}\right)w\frac{\max_{i\in\mathcal{N}}(\ell_{i}^{(t)})^{2}}{\min_{i\in\mathcal{P}}(\ell_{i}^{(t)})^{2}} +$$ + +$$ +\Lleftarrow (1 - c) \tau \geq \left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) w c _ {1} \cdot \frac {1}{w ^ {2 / 3}} +$$ + +(by invoking Lemma B.6; note that $c_{1} \geq 1$ ) + +$$ +\leftarrow \frac {(1 - c)}{c _ {1} \left(c + \frac {\tilde {c}}{\sqrt {C}}\right)} \tau \geq w ^ {1 / 3} +$$ + +(since $\| \mu \| \geq \sqrt{Cn^2\log(n / \delta)}$ , where $C$ is a large enough constant). + +Since $C$ is large enough, we now choose the constant $0 < c < 1$ to be such that $(1 - c) / (c_1(c + \tilde{c} / \sqrt{C}))$ is at least $(2)^{1/3}$ . This proves the first part of the lemma. + +To prove the second part of the lemma, note that again since $[n] = \mathcal{P} \cup \mathcal{N}$ it suffices to show that + +$$ +\begin{array}{l} (1 - c) \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (t)} \geq \left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (t)} \\ \Lleftarrow (1 - c) | \mathcal {N} | w \min _ {i \in \mathcal {N}} (\ell_ {i} ^ {(t)}) ^ {2} \geq \left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right) | \mathcal {P} | \max _ {i \in \mathcal {P}} (\ell_ {i} ^ {(t)}) ^ {2} \\ \Leftarrow w \geq \frac {\left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right)}{(1 - c)} \frac {\operatorname* {m a x} _ {i \in \mathcal {P}} (\ell_ {i} ^ {(t)}) ^ {2}}{\operatorname* {m i n} _ {i \in \mathcal {N}} (\ell_ {i} ^ {(t)}) ^ {2}} \cdot \tau \\ \Lleftarrow w \geq \frac {\left(c + \frac {\tilde {c} \sqrt {\log (n / \delta)}}{\| \mu \|}\right)}{(1 - c)} c _ {1} w ^ {2 / 3} \tau \\ \Leftrightarrow w ^ {1 / 3} \geq \frac {c _ {1} \left(c + \frac {\tilde {c}}{\sqrt {C}}\right)}{(1 - c)} \cdot \tau \\ \Leftarrow w ^ {1 / 3} \geq \frac {\tau}{2 ^ {1 / 3}} \\ \end{array} +$$ + +where the last implication follows by the choice of $c$ from above. This completes the proof. + +We now have all the pieces required to prove our main theorem. Recall its statement. + +Theorem 4.2. For any $0 < \widetilde{C} \leq 1$ , there is a constant $c$ such that, for all large enough $C$ and for any $0 < \delta < 1 / C$ , under the assumptions of this subsection the following holds. If the weight + +$\frac{\tau^3}{2} \leq w \leq 2\tau^3$ , then with probability at least $1 - \delta$ , training on $\mathcal{S}$ produces a classifier $\widehat{\theta}_1$ satisfying: + +$$ +\mathsf {T e s t E r r o r} [ \widehat {\theta} _ {1} ] = \mathbb {P} _ {(x, y) \sim \mathsf {P} _ {\mathrm {t e s t}}} \left[ \operatorname {s i g n} \left(\widehat {\theta} _ {1} \cdot x\right) \neq y \right] \leq \exp \left(- \frac {c n}{\tau} \frac {\| \mu \| ^ {4}}{d}\right). +$$ + +Proof First, by Part (8) of Lemma B.2 we know that the data is linearly separable. Thus, by Proposition 4.1 we know that + +$$ +\widehat {\theta} _ {1} = \lim _ {t \rightarrow \infty} \frac {\theta^ {(t)}}{\| \theta^ {(t)} \|}. +$$ + +Given this equivalence, by Lemma B.1 we know that + +$$ +\begin{array}{l} \mathbb {P} _ {(x, y) \sim \mathsf {P} _ {\mathrm {t e s t}}} \left[ \mathrm {s i g n} \left(\widehat {\theta} _ {1} \cdot x\right) \neq y \right] \\ = \mathbb {P} _ {(x, y) \sim \mathrm {P} _ {\text {t e s t}}} \left[ \operatorname {s i g n} \left(\lim _ {t \rightarrow \infty} \frac {\theta^ {(t)}}{\| \theta^ {(t)} \|} \cdot x\right) \neq y \right] \\ \leq \frac {1}{2} \left[ \exp \left(- c ^ {\prime} \left(\lim _ {t \rightarrow \infty} \frac {\theta^ {(t)} \cdot \mu_ {1}}{\| \theta^ {(t)} \|}\right) ^ {2}\right) + \exp \left(- c ^ {\prime} \left(\lim _ {t \rightarrow \infty} \frac {\theta^ {(t)} \cdot \mu_ {2}}{\| \theta^ {(t)} \|}\right) ^ {2}\right)\right]. \tag {15} \\ \end{array} +$$ + +We shall now establish lower bounds on $\lim_{t\to \infty}\frac{\theta^{(t)}\cdot\mu_1}{\|\theta^{(t)}\|}$ and $\lim_{t\to \infty}\frac{\theta^{(t)}\cdot\mu_2}{\|\theta^{(t)}\|}$ to obtain the desired bound on the test error. Let us lower bound $\lim_{t\to \infty}\frac{\theta^{(t)}\cdot\mu_1}{\|\theta^{(t)}\|}$ . The bound on $\lim_{t\to \infty}\frac{\theta^{(t)}\cdot\mu_2}{\|\theta^{(t)}\|}$ shall follow by exactly the same logic. + +By Lemma B.5 we know that + +$$ +\begin{array}{l} \lim _ {t \rightarrow \infty} \frac {\mu_ {1} \cdot \theta^ {(t + 1)}}{\| \theta^ {(t + 1)} \|} \\ \geq \lim _ {t \rightarrow \infty} \frac {\mu_ {1} \cdot \theta^ {(0)}}{\| \theta^ {(t + 1)} \|} + \lim _ {t \rightarrow \infty} \frac {\| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{2 c _ {1} \sqrt {d}} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c _ {1} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] \times \\ \sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c _ {2} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right] \\ \stackrel {(i)} {\geq} \frac {\| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{2 c _ {1} \sqrt {d}} \cdot \lim _ {t \to \infty} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c _ {1} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] \times \\ \sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c _ {2} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right] \\ = \frac {\| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{2 c _ {1} \sqrt {d}} \cdot \lim _ {t \to \infty} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c _ {1} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] \times \\ \lim _ {t \rightarrow \infty} \sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c _ {2} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right], \tag {16} \\ \end{array} +$$ + +where $(i)$ follows since $\mu_1\cdot \theta^{(0)}$ is bounded and $\| \theta^{(t + 1)}\| \to \infty$ by (Ji et al., 2020, Lemma 2). + +We will now show that the first limit in RHS equals 1. To do this, first note that + +$$ +1 \geq \lim _ {t \to \infty} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c _ {1} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] = \left[ \frac {1}{1 + \lim _ {t \to \infty} \frac {\| \theta^ {(0)} \|}{c _ {1} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right]. +$$ + +Now we will show that + +$$ +\lim _ {t \rightarrow \infty} \frac {\| \theta^ {(0)} \|}{c _ {1} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}} = 0. +$$ + +First note that $\frac{\|\theta^{(0)}\|}{c_1\eta\sqrt{d}\sum_{s = 0}^t\sum_{i\in [n]} - w_i\ell_i^{\prime (s)}}\geq 0$ since $-w_{i}\ell_{i}^{\prime (s)}\geq 0$ , so to show that this limit equals $0$ , it suffices to show that $c_{1}\eta \sqrt{d}\sum_{s = 0}^{t}\sum_{i\in [n]} - w_{i}\ell_{i}^{\prime (s)}$ grows unboundedly as $t\to \infty$ . Using inequality (12) from above we get that, + +$$ +\| \theta^ {(t + 1)} \| \leq \| \theta^ {(0)} \| + c _ {3} \eta \sqrt {\frac {d}{| \mathcal {N} |}} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}. +$$ + +The norm $\| \theta^{(0)}\|$ is finite and we know that $\| \theta^{(t)}\| \to \infty$ by (Ji et al., 2020, Lemma 2), therefore $c_{1}\eta \sqrt{d}\sum_{s = 0}^{t}\sum_{i\in [n]} - w_{i}\ell_{i}^{\prime (s)}$ must grow unboundedly. This proves that + +$$ +\lim _ {t \to \infty} \left[ \frac {1}{1 + \frac {\| \theta^ {(0)} \|}{c _ {1} \eta \sqrt {d} \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}} \right] = 1 +$$ + +as claimed. This combined with inequality (16) yields the bound + +$$ +\begin{array}{l} \lim _ {t \to \infty} \frac {\mu_ {1} \cdot \theta^ {(t + 1)}}{\| \theta^ {(t + 1)} \|} \geq \frac {\| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{2 c _ {1} \sqrt {d}} \lim _ {t \to \infty} \frac {\sum_ {s = 0} ^ {t} \left[ \sum_ {i \in \mathcal {P}} - w _ {i} \ell_ {i} ^ {\prime (s)} - \frac {c _ {2} \sqrt {\log (n / \delta)}}{\| \mu \|} \sum_ {i \in \mathcal {N}} - w _ {i} \ell_ {i} ^ {\prime (s)} \right]}{\sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}} \\ \stackrel {(i)} {\geq} \frac {c _ {3} \| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{\sqrt {d}} \lim _ {t \to \infty} \frac {\sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}}{\sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} - w _ {i} \ell_ {i} ^ {\prime (s)}} \\ = \frac {c _ {3} \| \mu \| ^ {2} \sqrt {| \mathcal {N} |}}{\sqrt {d}} \\ = \frac {c _ {3} \| \mu \| ^ {2} \sqrt {| \mathcal {P} |}}{\sqrt {\tau d}} \\ \stackrel {(i i)} {\geq} \frac {c _ {4} \| \mu \| ^ {2} \sqrt {n}}{\sqrt {\tau d}} \\ \end{array} +$$ + +where $(i)$ follows by invoking Lemma B.7 and $(ii)$ follows since $|\mathcal{P}|\geq n / 2$ . As stated above, using a similar argument we can also show that $\lim_{t\to \infty}\frac{\mu_1\cdot\theta^{(t + 1)}}{\|\theta^{(t + 1)}\|}\geq \frac{c_4\|\mu\|^2\sqrt{n}}{\sqrt{\tau d}}$ . Plugging these lower bounds into inequality (15) completes our proof. + +# C PROOF OF THEOREM 4.3 + +In this section we will prove a lower bound on the test error of the maximum margin linear classifier $\widehat{\theta}_{\mathrm{MM}}$ . Here we will work with the exponential loss + +$$ +\ell (z) = \exp (- z). +$$ + +Define the loss $\widehat{L}(\theta) = \sum_{i \in [n]} \ell(y_i x_i^\top \theta) = \sum_{i \in [n]} \ell(z_i^\top \theta)$ . For a step-size $\eta$ and initial iterate $\theta^{(0)} = 0$ (this choice of initial point is for the sake of convenience, it does not affect the implicit bias of gradient descent) for any $t \in \{0,1,\ldots\}$ + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \nabla \widehat {L} (\theta^ {(t)}) +$$ + +be the iterates of gradient descent. We let $\ell_i^{(t)}$ be shorthand for $\ell (z_{i}\cdot \theta^{(t)})$ and therefore, + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \eta \nabla \widehat {L} (\theta^ {(t)}) = \theta^ {(t)} + \eta \sum_ {i \in [ n ]} z _ {i} \ell_ {i} ^ {(t)}. +$$ + +The results by Soudry et al. (2018) guarantee that for a small enough step-size $\eta$ the direction of the iterates of gradient descent $\lim_{t\to \infty}\frac{\theta^{(t)}}{\|\theta^{(t)}\|} = \widehat{\theta}_{\mathrm{MM}}$ . Therefore, we will instead prove a lower bound on the asymptotic iterates of gradient descent. + +As we did in the proof of Theorem 4.2, going forward we will assume that a good run occurs (see Definition B.3), which guarantees that all of the conditions specified in Lemma B.2 are satisfied by the training dataset $\mathcal{S}$ . + +With the setup in place, we shall now prove this theorem in stages. Throughout this section the assumptions stated in Section 4.2.1 shall remain in force. We begin with a lemma that shows that the margin of the maximum margin classifier scales with $\sqrt{d / n}$ . + +Lemma C.1. There is an absolute constant $c$ such that, on a good run, for all large enough $C$ , for all $i \in [n]$ + +$$ +\widehat {\theta} _ {\mathrm {M M}} \cdot z _ {i} \geq c \sqrt {\frac {d}{n}}. +$$ + +Proof We will prove this result by constructing a unit vector $\phi$ with a margin that scales with $\sqrt{d / n}$ . This immediately implies that the maximum margin classifier must also attain this margin on all of the points. + +Define $\phi$ to be as follows + +$$ +\phi := \frac {\sum_ {i \in [ n ]} z _ {i}}{\| \sum_ {j \in [ n ]} z _ {j} \|}. +$$ + +We will first bound the norm of the denominator as follows + +$$ +\begin{array}{l} \left\| \sum_ {j \in [ n ]} z _ {j} \right\| ^ {2} = \sum_ {j \in [ n ]} \| z _ {j} \| ^ {2} + \sum_ {j \neq k} z _ {j} \cdot z _ {k} \\ \leq \sum_ {j \in [ n ]} \| z _ {j} \| ^ {2} + \sum_ {j \neq k} | z _ {j} \cdot z _ {k} | \\ \stackrel {(i)} {\leq} c _ {1} n d + c _ {1} n ^ {2} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \\ = c _ {1} n d \left(1 + \frac {c _ {1} \| \mu \| ^ {2}}{d} + \frac {n \sqrt {\log (n / \delta)}}{\sqrt {d}}\right) \\ \stackrel {(i i)} {\leq} 2 c _ {1} n d \tag {17} \\ \end{array} +$$ + +where $(i)$ follows by Lemma B.2 and $(ii)$ follows since $d\geq Cn\| \mu \| ^2\geq C^2 n^3\log (n / \delta)$ where recall $C$ is sufficiently large. + +Now we lower bound the margin between numerator of $v$ and $z_{k}$ for any $k \in [n]$ + +$$ +\begin{array}{l} \left(\sum_ {i \in [ n ]} z _ {i}\right) \cdot z _ {k} = \| z _ {i} \| ^ {2} + \sum_ {i \neq k} z _ {i} \cdot z _ {k} \geq \| z _ {i} \| ^ {2} - \sum_ {k \neq i} | z _ {i} \cdot z _ {k} | \\ \stackrel {(i)} {\geq} \frac {d}{c _ {1}} - c _ {1} n (\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}) \\ = \frac {d}{c _ {1}} \left(1 - \frac {c _ {1} ^ {2} n \| \mu \| ^ {2}}{d} - \frac {c _ {1} ^ {2} n \sqrt {\log (n / \delta)}}{\sqrt {d}}\right) \\ \geq \frac {d}{2 c _ {1}}, \tag {18} \\ \end{array} +$$ + +where $(i)$ again follows by invoking Lemma B.2 and by the assumption on $d$ , + +Combining inequalities (17) and (18) yields that for any $k \in [n]$ + +$$ +\phi \cdot z _ {k} \geq \frac {d}{2 c _ {1} \sqrt {2 c _ {1} n d}} = c \sqrt {\frac {d}{n}}. +$$ + +This proves the result. + +The next lemma provides control over the rate at which the norm of iterates $\theta^{(t)}$ grows late in training. + +Lemma C.2. There is an absolute constant $c$ such that, for all large enough $C$ , if the step-size $\eta$ is sufficiently small then on a good run, there exists a $t_0$ such that for all $t \geq t_0$ + +$$ +\left\| \theta^ {(t + 1)} \right\| \geq \left\| \theta^ {(t)} \right\| + c \eta \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}. +$$ + +Proof By the definition of gradient descent + +$$ +\begin{array}{l} \| \theta^ {(t + 1)} \| ^ {2} = \| \theta^ {(t)} + \eta \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} z _ {i} \| ^ {2} \\ = \| \theta^ {(t)} \| ^ {2} + 2 \eta \sum_ {k \in [ n ]} \ell_ {i} ^ {(t)} z _ {i} \cdot \theta^ {(t)} + \eta^ {2} \| \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} z _ {i} \| ^ {2} \\ \geq \left\| \theta^ {(t)} \right\| ^ {2} + 2 \eta \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} z _ {i} \cdot \theta^ {(t)}. \tag {19} \\ \end{array} +$$ + +Now we know that $\frac{\theta^{(t)}}{\|\theta^{(t)}\|} \to \widehat{\theta}_{\mathbb{M}\mathbb{M}}$ . Also note that in the previous lemma (Lemma C.1) we showed that for all $i \in [n]$ + +$$ +\widehat {\theta} _ {\mathrm {M M}} \cdot z _ {i} \geq c _ {1} \sqrt {\frac {d}{n}}. +$$ + +Therefore, there exists a iteration $t_1$ such that for all $t \geq t_1$ and all $i \in [n]$ + +$$ +\frac {\theta^ {(t)} \cdot z _ {i}}{\| \theta^ {(t)} \|} \geq \frac {c _ {1}}{2} \sqrt {\frac {d}{n}}. +$$ + +Continuing from (19), for any $t \geq t_1$ + +$$ +\begin{array}{l} \| \theta^ {(t + 1)} \| ^ {2} \geq \| \theta^ {(t)} \| ^ {2} + 2 \eta \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} z _ {i} \cdot \theta^ {(t)} \\ \geq \| \theta^ {(t)} \| ^ {2} + c _ {1} \eta \| \theta^ {(t)} \| \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} \\ = \| \theta^ {(t)} \| ^ {2} \left[ 1 + \frac {c _ {1} \eta \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}}{\| \theta^ {(t)} \|} \right]. \\ \end{array} +$$ + +Taking square roots we get that for any $t \geq t_1$ + +$$ +\left\| \theta^ {(t + 1)} \right\| \geq \left\| \theta^ {(t)} \right\| \sqrt {1 + \frac {c _ {1} \eta \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}}{\left\| \theta^ {(t)} \right\|}}. \tag {20} +$$ + +Further by (Ji et al., 2020, Lemma 2) we know that $\| \theta^{(t)}\| \to \infty$ , so there exists a $t_2$ such that for all $t\geq t_2$ , $\| \theta^{(t)}\| \geq \frac{c_1\eta\sqrt{nd}}{8}$ . Thus, for $t\geq t_2$ , we have + +$$ +\frac {1}{\left\| \theta^ {(t)} \right\|} \cdot c _ {1} \eta \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} \leq 8 \cdot \frac {\sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}}{n} \leq 8, \tag {21} +$$ + +where the last inequality follows since the initial loss is equal to $n$ , as $\theta^{(0)} = 0$ , and the total loss is decreasing again by (Ji et al., 2020, Lemma 2) if the step-size is small enough. It is easy to check that for any $0 \leq x \leq 8$ + +$$ +\sqrt {1 + x} \geq 1 + \frac {x}{4}. +$$ + +Thus, combining inequalities (20) and (21) we get that for all $t \geq t_0 = \max \{t_1, t_2\}$ + +$$ +\begin{array}{l} \| \theta^ {(t + 1)} \| \geq \| \theta^ {(t)} \| \sqrt {1 + \frac {c _ {1} \eta \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}}{\| \theta^ {(t)} \|}} \geq \| \theta^ {(t)} \| \left(1 + \frac {c _ {1} \eta \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}}{4 \| \theta^ {(t)} \|}\right) \\ = \| \theta^ {(t)} \| + \frac {c _ {1}}{4} \eta \sqrt {\frac {d}{n}} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}, \\ \end{array} +$$ + +which completes our proof. + +Continuing we will show that throughout training the ratio of the losses between the different examples are bounded by a constant. This ensures that each example roughly "influences" the gradient update by the same amount in each step. However, since the number of points from the positive cluster is larger, the gradient update shall overall be more highly correlated with the mean of the majority positive center $\mu_{1}$ than the mean of the minority negative center $\mu_{2}$ . + +The proof is identical to the proof of Lemma 11 by Chatterji & Long (2021). However, since our setting is slightly different to the setting studied in that paper we reprove the result here. + +Lemma C.3. There is an absolute constant $c$ such that, for all large enough $C$ , and all small enough step sizes $\eta$ , on a good run, for all iterations $t \in \{0,1,\ldots\}$ and all $i,j \in [n]$ + +$$ +\frac {\ell_ {i} ^ {(t)}}{\ell_ {j} ^ {(t)}} \leq c. +$$ + +Proof First note that $\widehat{L} (\theta^{(0)}) = \sum_{i\in [n]}\ell_i^{(0)} = n$ and since step-size $\eta$ is small enough training loss is non-increasing by (Ji et al., 2020, Lemma 2). + +Let $c_{1}$ be the constant $c \geq 1$ from Lemma B.2. We will show that $c = 4c_{1}^{2}$ suffices. + +We shall prove this via an inductive argument. For the base case, at step $t = 0$ , we know that $\theta^{(0)} = 0$ , therefore the loss on all of the samples is equal to 1. Now, we shall assume that the inductive hypothesis holds at an arbitrary step $t > 0$ and prove that it holds at step $t + 1$ . + +Without loss of generality, we shall analyze the ratio between the losses of the samples with indices $i = 1$ and $j = 2$ . A similar analysis shall hold for any other pair. Define $G_{t} := \ell_{1}^{(t)}$ , $H_{t} := \ell_{2}^{(t)}$ , $A_{t} := H_{t} / G_{t}$ . The ratio between these losses at step $t + 1$ is + +$$ +\begin{array}{l} A _ {t + 1} = \frac {\exp (- \theta^ {(t + 1)} \cdot z _ {2})}{\exp (- \theta^ {(t + 1)} \cdot z _ {1})} \\ = \frac {\exp (- (\theta^ {(t)} + \eta \sum_ {k \in [ n ]} \ell_ {k} ^ {(t)} z _ {k}) \cdot z _ {2})}{\exp (- (\theta^ {(t)} + \eta \sum_ {k \in [ n ]} \ell_ {k} ^ {(t)} z _ {k}) \cdot z _ {1})} \\ = A _ {t} \cdot \exp \left(- \eta \sum_ {k \in [ n ]} \ell_ {k} ^ {(t)} \left(z _ {k} \cdot z _ {2} - z _ {k} \cdot z _ {1}\right)\right) \\ = A _ {t} \cdot \exp \left(- \eta \left(\ell_ {2} ^ {(t)} \| z _ {2} \| ^ {2} - \ell_ {1} ^ {(t)} \| z _ {1} \| ^ {2} - \sum_ {k \neq 2} \ell_ {k} ^ {(t)} z _ {k} \cdot z _ {2} + \sum_ {k \neq 1} \ell_ {k} ^ {(t)} z _ {k} \cdot z _ {1}\right)\right) \\ = A _ {t} \cdot \exp \left(- \eta \left(H _ {t} \| z _ {2} \| ^ {2} - G _ {t} \| z _ {1} \| ^ {2} - \sum_ {k \neq 2} \ell_ {k} ^ {(t)} z _ {k} \cdot z _ {2} + \sum_ {k \neq 1} \ell_ {k} ^ {(t)} z _ {k} \cdot z _ {1}\right)\right) \\ \leq A _ {t} \cdot \exp \left(- \eta \left(H _ {t} \| z _ {2} \| ^ {2} - G _ {t} \| z _ {1} \| ^ {2} - \sum_ {k \neq 2} \ell_ {k} ^ {(t)} | z _ {k} \cdot z _ {2} | - \sum_ {k \neq 1} \ell_ {k} ^ {(t)} | z _ {k} \cdot z _ {1} |\right)\right). \\ \end{array} +$$ + +Now note that by Lemma B.2, for all $i \neq j \in [n]$ , $d / c_1 \leq \| z_i\|^2 \leq c_1 d$ and $|z_i \cdot z_j| \leq c_1 \left(\|\mu\|^2 + \sqrt{d \log(n / \delta)}\right)$ , and therefore, + +$$ +\begin{array}{l} A _ {t + 1} \leq A _ {t} \cdot \exp \left(- \eta \left(\frac {H _ {t} d}{c _ {1}} - G _ {t} c _ {1} d - 2 c _ {1} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) \sum_ {k \in [ n ]} \ell_ {k} ^ {(t)}\right)\right) \\ = A _ {t} \cdot \exp \left(- \eta \left(\frac {G _ {t} d}{c _ {1}} \left(A _ {t} - c _ {1} ^ {2}\right) - 2 c _ {1} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) G _ {t} \sum_ {k \in [ n ]} \frac {\ell_ {k} ^ {(t)}}{G _ {t}}\right)\right) \\ \stackrel {(i)} {\leq} A _ {t} \cdot \exp \left(- \eta \left(\frac {G _ {t} d}{c _ {1}} \left(A _ {t} - c _ {1} ^ {2}\right) - 8 c _ {1} ^ {3} \left(\| \mu \| ^ {2} + \sqrt {d \log (n / \delta)}\right) G _ {t} n\right)\right) \\ = A _ {t} \cdot \exp \left(- \frac {\eta G _ {t} d}{c _ {1}} \left(A _ {t} - c _ {1} ^ {2} - 8 c _ {1} ^ {4} \left(\frac {\| \mu \| ^ {2} n}{d} + \frac {n \sqrt {\log (n / \delta)}}{\sqrt {d}}\right)\right)\right) \\ \stackrel {(i i)} {\leq} A _ {t} \cdot \exp \left(- \frac {\eta G _ {t} d}{c _ {1}} \left(A _ {t} - c _ {1} ^ {2} - 8 c _ {1} ^ {4} \left(\frac {1}{C} + \frac {1}{C}\right)\right)\right) \\ \stackrel {(i i i)} {\leq} A _ {t} \cdot \exp \left(- \frac {\eta G _ {t} d}{c _ {1}} \left(A _ {t} - 2 c _ {1} ^ {2}\right)\right), \tag {22} \\ \end{array} +$$ + +where $(i)$ follows since by the inductive hypothesis $\ell_k^{(t)} / G_t\leq c = 4c_1^2$ $(ii)$ follows since by assumption $d\geq Cn\| \mu \| ^2\geq C^2 n^3\log (n / \delta)$ , and $(iii)$ follows since $C$ is sufficiently large. + +Now consider two cases. + +Case 1 $(A_{t}\leq 2c_{1}^{2})$ : By inequality (22) + +$$ +\begin{array}{l} A _ {t + 1} \leq A _ {t} \cdot \exp \left(- \frac {\eta G _ {t} d}{c _ {1}} \left(A _ {t} - 2 c _ {1} ^ {2}\right)\right) = A _ {t} \exp \left(\frac {\eta G _ {t} d}{c _ {1}} \left(2 c _ {1} ^ {2} - A _ {t}\right)\right) \leq 2 c _ {1} ^ {2} \exp \left(2 \eta c _ {1} G _ {t} d\right) \\ \leq 2 c _ {1} ^ {2} \exp (2 \eta c _ {1} n d) \\ \leq 4 c _ {1} ^ {2}, \\ \end{array} +$$ + +where the last inequality follows if the step-size $\eta$ is sufficiently small. + +Case 2 $(2c_{1}^{2}\leq A_{t}\leq 4c_{1}^{2} = c)$ : Again by inequality (22) + +$$ +A _ {t + 1} \leq A _ {t} \cdot \exp \left(- \frac {\eta G _ {t} d}{c _ {1}} \left(A _ {t} - 2 c _ {1} ^ {2}\right)\right) \leq A _ {t} \leq 4 c _ {1} ^ {2}. +$$ + +Thus, we have shown that $A_{t + 1} \leq 4c_1^2 = c$ in both cases. Since we assumed the induction hypothesis to hold at step $t$ , these two cases are exhaustive, and hence the induction is complete. + +The next lemma proves an upper bound on the difference between the inner product between $\theta^{(t + 1)}\cdot \mu_2$ and the corresponding inner product at iteration $t$ . Since we start at $\theta^{(0)}$ , unrolling this over $t$ steps gives us an upper bound on inner product $\theta^{(t)}\cdot \mu_2$ for any $t\geq 0$ . + +Lemma C.4. There is an absolute constant $c$ such that, for all large enough $C$ , if the step-size $\eta$ is sufficiently small then on a good run, for all $t \in \{0,1,\ldots\}$ + +$$ +\left(\theta^ {(t + 1)} - \theta^ {(t)}\right) \cdot (- \mu_ {2}) \leq \frac {c \eta \| \mu \| ^ {2}}{\tau} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}. +$$ + +Proof By the definition of a gradient descent step + +$$ +\begin{array}{l} \left(\theta^ {(t + 1)} - \theta^ {(t)}\right) \cdot (- \mu_ {2}) = \eta \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} z _ {i} \cdot (- \mu_ {2}) \\ \stackrel {(i)} {\leq} \frac {3 \eta \| \mu \| ^ {2}}{2} \sum_ {i \in \mathcal {N}} \ell_ {i} ^ {(t)} + c _ {1} \eta \| \mu \| \sqrt {\log (n / \delta)} \sum_ {i \in \mathcal {P}} \ell_ {i} ^ {(t)} \\ \stackrel {(i i)} {\leq} \frac {3 \eta \| \mu \| ^ {2}}{2} \cdot \frac {c _ {2} | \mathcal {N} |}{n} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} + c _ {1} \eta \| \mu \| \sqrt {\log (n / \delta)} \cdot \frac {c _ {2} | \mathcal {P} |}{n} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} \\ = \frac {3 c _ {2} \eta \| \mu \| ^ {2}}{2} \cdot \frac {| \mathcal {P} |}{n} \left(\frac {| \mathcal {N} |}{| \mathcal {P} |} + \frac {\sqrt {\log (n / \delta)}}{\| \mu \|}\right) \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} \\ \leq 3 c _ {2} \eta \| \mu \| ^ {2} \max \left\{\frac {| \mathcal {N} |}{| \mathcal {P} |}, \frac {\sqrt {\log (n / \delta)}}{\| \mu \|} \right\} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}, \\ \end{array} +$$ + +where $(i)$ follows by Lemma B.2 and $(ii)$ follows by the loss ratio bound in Lemma C.3. Since by assumption $\| \mu \| ^2\geq Cn^2\log (n / \delta)$ , we infer that + +$$ +\frac {\sqrt {\log (n / \delta)}}{\| \mu \|} \leq \frac {1}{n} \leq \frac {| \mathcal {N} |}{| \mathcal {P} |} = \frac {1}{\tau}. +$$ + +Thus, + +$$ +(\theta^ {(t + 1)} - \theta^ {(t)}) \cdot (- \mu_ {2}) \leq 3 c _ {2} \eta \| \mu \| ^ {2} \max \left\{\frac {| \mathcal {N} |}{| \mathcal {P} |}, \frac {\sqrt {\log (n / \delta)}}{\| \mu \|} \right\} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)} = \frac {c \eta \| \mu \| ^ {2}}{\tau} \sum_ {i \in [ n ]} \ell_ {i} ^ {(t)}, +$$ + +wrapping up our proof. + +With these lemmas in place we are now ready to prove our result. Let us restate it here. + +Theorem 4.3. Let $q \sim \mathsf{N}(0, I_{d \times d})$ . There exist constants $c$ and $c'$ such that, for all large enough $C$ and for any $0 < \delta < 1 / C$ , under the assumptions of this subsection the following holds. With probability at least $1 - \delta$ , training on $S$ produces a maximum margin classifier $\widehat{\theta}_{\mathbb{M}\mathbb{M}}$ satisfying: + +$$ +\mathsf {T e s t E r r o r} [ \widehat {\theta} _ {\mathsf {M M}} ] = \mathbb {P} _ {(x, y) \sim \mathsf {P} _ {\mathsf {t e s t}}} \left[ \mathsf {s i g n} \left(\widehat {\theta} _ {\mathsf {M M}} \cdot x\right) \neq y \right] \geq \frac {1}{2} \cdot \Phi \left(- \frac {c \sqrt {n}}{\tau} \cdot \frac {\| \mu \| ^ {2}}{\sqrt {d}}\right), +$$ + +where $\Phi$ is the Gaussian cdf. Furthermore, if the imbalance ratio $\tau \geq c' \frac{\sqrt{n} \| \mu \|^2}{\sqrt{d}}$ then with probability at least $1 - \delta$ , TestError $[\widehat{\theta}_{\mathrm{MM}}] \geq \frac{1}{8}$ . + +Proof The test error for $\widehat{\theta}_{\mathrm{MM}}$ is + +$$ +\begin{array}{l} \text {T e s t E r r o r} \left[ \widehat {\theta} _ {\mathrm {M M}} \right] \\ = \mathbb {P} _ {(x, y) \sim \mathrm {P} _ {\text {t e s t}}} \left[ \operatorname {s i g n} \left(\widehat {\theta} _ {\mathrm {M M}} \cdot x\right) \neq y \right] \\ = \frac {1}{2} \mathbb {P} _ {q \sim \mathrm {N} (0, \frac {1}{2} I _ {p \times p})} \left[ \operatorname {s i g n} \left(\widehat {\theta} _ {\mathrm {M M}} \cdot (\mu_ {1} + q)\right) \neq 1 \right] + \frac {1}{2} \mathbb {P} _ {q \sim \mathrm {N} (0, \frac {1}{2} I _ {p \times p})} \left[ \operatorname {s i g n} \left(\widehat {\theta} _ {\mathrm {M M}} \cdot (\mu_ {2} + q)\right) \neq - 1 \right] \\ \geq \frac {1}{2} \mathbb {P} _ {q \sim \mathrm {N} (0, \frac {1}{2} I _ {p \times p})} \left[ \operatorname {s i g n} \left(\widehat {\theta} _ {\mathrm {M M}} \cdot (\mu_ {2} + q)\right) \neq - 1 \right] \\ = \frac {1}{2} \mathbb {P} _ {q \sim \mathrm {N} (0, \frac {1}{2} I _ {p \times p})} \left[ - \widehat {\theta} _ {\mathrm {M M}} \cdot \mu_ {2} - \widehat {\theta} _ {\mathrm {M M}} \cdot q < 0 \right] \\ = \frac {1}{2} \mathbb {P} _ {q \sim \mathrm {N} (0, \frac {1}{2} I _ {p \times p})} \left[ - \widehat {\theta} _ {\mathrm {M M}} \cdot q < - \widehat {\theta} _ {\mathrm {M M}} \cdot (- \mu_ {2}) \right] \\ = \frac {1}{2} \mathbb {P} _ {\xi \sim \mathrm {N} (0, 1)} \left[ \xi < - \widehat {\theta} _ {\mathrm {M M}} \cdot (- \mu_ {2}) \right] \quad (\text {s i n c e} - \widehat {\theta} _ {\mathrm {M M}} \cdot q \sim \mathrm {N} (0, 1)) \\ = \frac {\Phi \left(- \widehat {\theta} _ {\mathrm {M M}} \cdot \left(- \mu_ {2}\right)\right)}{2}, \tag {23} \\ \end{array} +$$ + +where $\Phi$ is the Gaussian cumulative distribution function. + +With this inequality in place, we want to prove an upper bound on $\left(\widehat{\theta}_{\mathsf{MM}}\cdot (-\mu_2)\right)^2$ . Now, since $\frac{\theta^{(t)}}{\|\theta^{(t)}\|}\to \widehat{\theta}_{\mathsf{MM}}$ , it suffices to prove an upper bound on $\left(\lim_{t\to \infty}\frac{\theta^{(t)}\cdot(-\mu_2)}{\|\theta^{(t)}\|}\right)^2$ instead. + +To do this, going forward let us assume that a good run (see Definition B.3) occurs. Lemma B.2 guarantees that this happens with probability at least $1 - \delta$ . + +Let $t_0$ be the constant from Lemma C.2, then by Lemma C.4 we have that for any $t > t_0$ + +$$ +\begin{array}{l} \theta^ {(t)} \cdot (- \mu_ {2}) = \theta^ {(0)} \cdot (- \mu_ {2}) + \sum_ {s = 1} ^ {t _ {0}} (\theta^ {(s)} - \theta^ {(s - 1)}) \cdot (- \mu_ {2}) + \sum_ {s = t _ {0} + 1} ^ {t} \left(\theta^ {(s)} - \theta^ {(s - 1)}\right) \cdot (- \mu_ {2}) \\ \leq \psi + \frac {c _ {1} \eta \| \mu \| ^ {2}}{\tau} \sum_ {s = t _ {0}} ^ {t - 1} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)}, \tag {24} \\ \end{array} +$$ + +where we define $\psi \coloneqq \theta^{(0)}\cdot (-\mu_2) + \sum_{s = 1}^{t_0}\left(\theta^{(s)} - \theta^{(s - 1)}\right)\cdot (-\mu_2).$ + +On the other hand, by repeatedly applying Lemma C.2 we get that + +$$ +\left\| \theta^ {(t)} \right\| \geq \left\| \theta^ {\left(t _ {0}\right)} \right\| + c _ {2} \eta \sqrt {\frac {d}{n}} \sum_ {s = t _ {0}} ^ {t - 1} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)}. \tag {25} +$$ + +Furthermore, since $\| \theta^{(t)}\| \to \infty$ (by Ji et al., 2020, Lemma 2) and + +$$ +\begin{array}{l} \| \theta^ {(t + 1)} \| = \left\| \theta^ {(0)} + \eta \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)} z _ {i} \right\| \leq \eta \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)} \| z _ {i} \| \\ \leq c _ {3} \eta d \sum_ {s = 0} ^ {t} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)} \quad (\text {b y}) \\ = c _ {3} \eta d \sum_ {s = 0} ^ {t _ {0} - 1} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)} + c _ {3} \eta d \sum_ {s = t _ {0}} ^ {t} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)} \\ \end{array} +$$ + +we can conclude that $\sum_{s = t_0}^t\sum_{i\in [n]}\ell_i^{(s)}\to \infty$ + +Thus combining inequalities (24) and (25) we get that + +$$ +\lim _ {t \to \infty} \frac {\theta^ {(t)} \cdot (- \mu_ {2})}{\| \theta^ {(t)} \|} \leq \lim _ {t \to \infty} \frac {\psi + \frac {c _ {1} \eta \| \mu \| ^ {2}}{\tau} \sum_ {s = t _ {0}} ^ {t - 1} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)}}{\| \theta^ {(t _ {0})} \| + c _ {2} \eta \sqrt {\frac {d}{n}} \sum_ {s = t _ {0}} ^ {t - 1} \sum_ {i \in [ n ]} \ell_ {i} ^ {(s)}} = \frac {c _ {4}}{\tau} \sqrt {\frac {n}{d}} \| \mu \| ^ {2}. +$$ + +Plugging this upper bound into inequality (23) completes the proof. + +# D EARLY-STOPPING BEFORE MODELS INTERPOLATE + +Prior works (Sagawa et al., 2019; Byrd & Lipton, 2019) found that adding regularization such as strong L2 regularization and early stopping can partially restore the effects of importance weights at the cost of not interpolating the training set. As such, we compare the performance of our polynomially-tailed loss against cross-entropy when models are early-stopped, using the same settings as before. For each run here, we select the model checkpoint with the best weighted validation accuracy and evaluate the checkpoint on the test set. Figure 5 compares the test accuracies of the early-stopped models (IW-ES $(\overline{w})$ , IW-ES $(\overline{w}^c)$ ) against reweighted models trained past interpolation (IW $(\overline{w})$ ). + +Consistent with prior works, we see that early stopping as a form of regularization improves the test accuracies of both loss functions when used with importance weights. Our polynomially-tailed loss + +![](images/3778a94a67e7de5b536b9ee3e0183280b274ba4fb2a2ab1de8444221e98b1c80.jpg) +Figure 5: Polynomially-tailed loss versus cross-entropy loss on a label shift dataset and a subpopulation shift dataset for neural networks early-stopped according to the best weighted validation accuracy. * and ** indicate $p < 0.05$ and $p < 0.005$ statistical significance, respectively. While early stopping is effective for both losses, our polynomially-tailed loss performs even better on imbalanced binary CIFAR10. + +![](images/eb1d29fefe5a1f1384687080dd868df96cf5682700fdedb33333bbc52d60cec0.jpg) + +gives test accuracies that are better than or similar to cross-entropy in all weighted loss scenarios. The gain over cross-entropy is statistically significant in the binary CIFAR10 runs. On subsampled CelebA, the polynomially-tailed loss with squared weights attains the highest mean test accuracy out of all settings. + +# EXPERIMENTAL DETAILS + +# E.1 HYPERPARAMETERS + +# E.1.1 FOR SECTION 5.1 + +Imbalanced binary CIFAR10 experiments. We use the same convolutional neural network architecture with random initialization as (Byrd & Lipton, 2019). We train for 400 epochs with SGD with a batch size of 64. We chose hyperparameters that resulted in stable training for each setting. We use a constant 0.001 learning rate with 0.9 momentum for "No IW", "IW $(\overline{w})$ ", and "IW-ES $(\overline{w})$ ". We use a constant 0.008 learning rate with no momentum for "IW $(\overline{w}^{3 / 2})$ ", and "IW-ES $(\overline{w}^{3 / 2})$ ". + +Subsampled CelebA experiments. We use a ResNet50 architecture with ImageNet initialization as done in (Sagawa et al., 2019). Due to the large dataset size, we use only $2\%$ of the full training dataset as mentioned in the main text. Reducing the computation requirements allows us to perform statistical evaluations of the results over sufficiently many seeds. We train for 100 epochs with SGD with a batch size of 64. We chose hyperparameters that resulted in stable training for each setting. We use a constant 0.0004 learning rate with 0.9 momentum for all settings. + +# E.1.2 FOR SECTION 5.2 + +To fairly evaluate every method, we grid search the hyperparameters for each method extensively. We kept the same architectural setup as before, but adjust the optimization settings such that the models train until they interpolate the training data. + +# Imbalanced binary CIFAR10 experiments. + +- Cross entropy + Class Undersampling: We use the same hyperparameters as Cross entropy on the full dataset and average results over random undersamplings plus initializations +- LDAM: Following the original paper Cao et al. (2019), we grid search the margin hyperparameter over $[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]$ . We found 1.0 to be the best. +- CDT Loss, LA Loss, VS Loss: Following Kini et al. (2021), we tune $\tau$ and $\gamma$ with $\tau = 0$ being CDT loss and $\gamma = 0$ being LA Loss. We grid search across $(\tau, \gamma) \in [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0] \times [0.0, 0.1, 0.2, 0.3, 0.4, 0.5]$ . We found $\tau = 3$ to be the best for LA loss, $\gamma = 0.5$ to be the best for CDT loss, and $\tau = 3, \gamma = 0.3$ to be the best + +for VS Loss. Unlike the original paper (Kini et al., 2021), we found that the best hyperparameters of VS loss are similar to those of LA Loss. We initially followed the recommendations of Kini et al. (2021) and grid searched over $(\tau, \gamma) \in [0.5, 0.75, 1.0, 1.25, 1.5] \times [0.05, 0.1, 0.15, 0.2]$ , but it gave VS loss poor performance (mean test acc was only $58.6\%$ using the best hyperparameters $\tau = 1, \gamma = 0.05$ ). Hence, we did a more extensive tuning afterwards. + +- Poly-tailed Loss: We grid search over $(\alpha, c) \in [0.25, 0.5, 1.0, 2.0, 4.0] \times [1.0, 1.5, 2.0, 2.5, 3.0]$ . We found $\alpha = 2$ and exponent $c = 3$ to be the best. + +# Subsampled CelebA. + +- Cross entropy + Group Undersampling: We use the same hyperparameters as Cross entropy on the full dataset and average results over random undersamplings plus initializations. +- VS Loss: We follow the tuning procedure in Kini et al. (2021) for group-sensitive VS Loss and grid search over $\gamma \in [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]$ . We found $\gamma = 0.4$ to be the best. +- Poly Loss: We grid search over $(\alpha, c) \in [1, 2, 3] \times [1.0, 1.5, 2.0, 2.5, 3.0]$ . We found $\alpha = 2$ and exponent $c = 2.5$ to be the best. +- Cross entropy + DRO: We tune the adversarial step size $\eta_q$ over [0.0025, 0.005, 0.01, 0.02, 0.03, 0.04, 0.05, 0.1]. We found $\eta_q = 0.05$ to be the best. +- VS Loss + DRO: We used the best $\gamma$ from VS Loss alone and $\eta_q = 0.05$ for DRO. +- Poly Loss + DRO: We used the best $\alpha$ from Poly Loss alone and $\eta_q = 0.05$ for DRO. + +# E.2 IMPORTANCE WEIGHT COMPUTATION. + +Here we explain in greater detail how we compute the importance weights. Note that the scale of the importance weights is important in ensuring stable training. Let there be $G$ groups of subpopulations in the training and testing set. $G = 2$ for binary CIFAR10 and $G = 4$ for CelebA. Let $n_1, \ldots, n_G$ be the counts of each group in the training set. Let $n$ be the total number of training examples. In our case, the test set is balanced across the groups. Our procedure for computing weights is: + +1. For each example $i$ that belongs to group $g$ , compute the unbiased weight: $\overline{w}_i \gets 1 / n_g$ . +2. Exponentiate the weights by $c$ if necessary: $w_{i} \gets \overline{w}_{i}^{c}$ . No importance weighting corresponds to $c = 0$ . Unbiased importance weighting corresponds to $c = 1$ . +3. To adjust for the scale of weights, normalize by the average exponentiated weight across the full training set: $w_{i} \gets w_{i} / \sum_{j=1}^{n} w_{i}$ . Only normalizing across each minibatch can result in unstable training, especially when a minibatch contains no representatives from a group. + +# E.3 EARLY-STOPPING METRIC. + +We use the checkpoint with the highest importance weighted validation accuracy when early stopping. We compute separate importance weights of the validation set with respect to the test set, and reweight the validation accuracy using unbiased weights, even when the training weights are biased. Our procedure allows for the situation where the validation set is not exactly the same distribution as the training set. + +# E.4 EXACT NUMERICAL RESULTS OF OUR EXPERIMENTS + +
DatasetSettingCross EntropyPoly-tailed Lossp-value
meanstd. err.meanstd. err.
Subsampled CelebAEarly-stoppedIW79.3%0.4%80.7%0.6%0.014
IW-ES84.9%0.7%84.0%0.9%0.762
IW-Exp-ES85.1%0.7%85.9%0.8%0.202
InterpolatingIW79.3%0.4%80.7%0.6%0.014
IW-Exp78.7%0.4%82.7%0.4%0.000
No IW79.6%0.4%78.5%0.4%0.999
Binary CIFAR10Early-stoppedIW57.8%0.4%60.4%0.3%0.000
IW-ES62.5%0.7%63.4%0.5%0.022
IW-Exp-ES61.2%0.8%63.5%0.6%0.001
InterpolatingIW57.8%0.4%60.4%0.3%0.000
IW-Exp57.4%0.6%63.0%0.6%0.000
No IW60.5%0.8%56.4%0.4%1.000
+ +Table 1: Numerical results corresponding to Figure 3 and 5. Here "Exp" corresponds to exponentiated weights. We use $3/2$ and 2 as the exponents in Binary CIFAR10 and CelebA respectively. We use $\alpha = 1$ for all of these experiments without tuning $\alpha$ . + +
SettingSummary of methodBest settingsMean test accStd err
Cross EntropyN/A60.5%0.8%
Cross Entropy + IWClassical importance weight-ingN/A57.8%0.4%
Cross Entropy + Class undersamplingBalance the classes by throwing away majority dataN/A58.5%1.4%
LDAMAdd class dependent constants to logitslargest margin=1.058.7%1.6%
CDTMultiply class dependent constants by logitsγ = 0.560.2%1.6%
LA LossAdd class dependent constants to logitsτ = 366.9%2.1%
VS Loss (best setting around range suggested by paper)Multiply by and add class dependent constants to logitsτ = 1, γ = 0.0558.6%1.4%
VS Loss (our own tuning)Multiply by and add class dependent constants to logitsτ = 3, γ = 0.369.3%0.9%
Poly-tailed LossChange loss function and exponentiate importance weightsα = 2, w367.3%0.8%
+ +Table 2: Results on imbalanced binary CIFAR10, corresponding to Figure 4 (left). + +
SettingMethod summaryBest set-tingsMean test accStd errWorst group test accStd err
Cross EntropyN/A79.6%1.2%43.1%2.9%
Cross Entropy + Group undersamplingBalance the groups by throwing away overrepresented dataN/A82.3%3.2%72.1%8.6%
Cross Entropy + IWClassical importance weightingN/A79.3%0.4%43.1%2.9%
VS LossMultiply by and add class dependent constants to logitsγ = 0.482.6%0.7%51.3%1.5%
Poly-tailed LossChange loss function and exponentiate importance weightsα = 2, w2.582.4%0.8%53.3%1.5%
Cross Entropy + DRON/A84.8%0.9%60.4%2.4%
VS Loss + DROChange loss function and use DROγ = 0.483.2%0.9%58.2%2.0%
Poly-tailed Loss + DROChange loss function and use DROα = 286.7%1.1%66.5%1.9%
+ +Table 3: Results on subsampled CelebA, corresponding to Figure 4 (right) \ No newline at end of file diff --git a/isimportanceweightingincompatiblewithinterpolatingclassifiers/images.zip b/isimportanceweightingincompatiblewithinterpolatingclassifiers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7c5a7b61163b82cbf2fdda0f2fce2cbc869b871a --- /dev/null +++ b/isimportanceweightingincompatiblewithinterpolatingclassifiers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25e202b19b4d408e1c16ad71aee1a336efe61e5f2ed5c5a7c7cd6f7d4fd356f8 +size 2215339 diff --git a/isimportanceweightingincompatiblewithinterpolatingclassifiers/layout.json b/isimportanceweightingincompatiblewithinterpolatingclassifiers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ed4912c89128fef05d6d556cb6a65ed6c7b4fa46 --- /dev/null +++ b/isimportanceweightingincompatiblewithinterpolatingclassifiers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf4a6f087b53235f3b2bf0ab1688eec84cfce0fbed1a4f4f3880f6b5258b1a8c +size 1315902 diff --git a/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_content_list.json b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..68ec629fcd6f01cb532d483f2824621003f516f9 --- /dev/null +++ b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80d70e676881e28093ecba7f24199edc1cd18deb532fab7fa69d41cad72be238 +size 192123 diff --git a/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_model.json b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e167ae6345b9b6f834d9117c806972c13fd09519 --- /dev/null +++ b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc48808b84a94ddfa66bc323d1ef94ebb95dad24e0c5126af67bf6d04852cf1d +size 220997 diff --git a/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_origin.pdf b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..273a92a8de21757439920cc6e4e2f5f1eba5e0a4 --- /dev/null +++ b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/aca85920-59e2-4981-bfd5-5181f8c250db_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a08f167a74f8beb7a0b93cac4c1392e76cb77fe1d147f74518a6fa964aaee46 +size 12967343 diff --git a/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/full.md b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2024a54e4220d38089ea3121f51ff0f791cec740 --- /dev/null +++ b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/full.md @@ -0,0 +1,719 @@ +# ITERATED REASONING WITH MUTUAL INFORMATION IN COOPERATIVE AND BYZANTINE DECENTRALIZED TEAMING + +Sachin Konan*, Esmaeil Seraj*, Matthew Gombolay + +Georgia Institute of Technology + +Atlanta, GA 30332, USA + +{skonan, eseraj3}@gatech.edu, matthew.gombolay@cc.gatech.edu + +# ABSTRACT + +Information sharing is key in building team cognition and enables coordination and cooperation. High-performing human teams also benefit from acting strategically with hierarchical levels of iterated communication and rationalizability, meaning a human agent can reason about the actions of their teammates in their decision-making. Yet, the majority of prior work in Multi-Agent Reinforcement Learning (MARL) does not support iterated rationalizability and only encourage inter-agent communication, resulting in a suboptimal equilibrium cooperation strategy. In this work, we show that reformulating an agent's policy to be conditional on the policies of its neighboring teammates inherently maximizes Mutual Information (MI) lower-bound when optimizing under Policy Gradient (PG). Building on the idea of decision-making under bounded rationality and cognitive hierarchy theory, we show that our modified PG approach not only maximizes local agent rewards but also implicitly reasons about MI between agents without the need for any explicit ad-hoc regularization terms. Our approach, InfoPG, outperforms baselines in learning emergent collaborative behaviors and sets the state-of-the-art in decentralized cooperative MARL tasks. Our experiments validate the utility of InfoPG by achieving higher sample efficiency and significantly larger cumulative reward in several complex cooperative multi-agent domains. + +# 1 INTRODUCTION + +Information sharing is key in building team cognition, and enables agents to cooperate and successfully achieve shared goals (Salas et al., 1992). In addition to communication, individuals in high-performing human teams also benefit from the theory of mind (Frith & Frith, 2005) and making strategic decisions by recursively reasoning about the actions (strategies) of other human members (Goodie et al., 2012). Such hierarchical rationalization alongside with communication facilitate meaningful cooperation in human teams (Tokadli & Dorneich, 2019). Similarly, collaborative Multi-agent Reinforcement Learning (MARL) relies on meaningful cooperation among interacting agents in a common environment (Oliehoek & Amato, 2016). Most of the prior works on collaborative MARL are based on the maximum utility theory paradigm which assumes perfectly informed, rational agents (Guan et al., 2021). Nevertheless, even under careful handcrafted or machine learned coordination policies, it is unrealistic and perhaps too strong to assume agents are perfectly rational in their decision-making (Wen et al., 2020; Gilovich et al., 2002; Simon, 1997; Paleja et al., 2021). + +To learn cooperation protocols, prior MARL studies are commonly deployed under Decentralized Partially Observable Markov Decision Processes (Dec-POMDP), in which agents interact to maximize a shared discounted reward. More recently, fully-decentralized (F-Dec) MARL was introduced (Zhang et al., 2018; Yang et al., 2020) to address the credit assignment problem caused by the shared-reward paradigm in conventional Dec-POMDPs (Yang et al., 2020; Sutton, 1985). In an F-Dec MARL setting, agents can have varying reward functions corresponding to different tasks (e.g., in a multi-task RL where an agent solves multiple related MDP problems) which are only known to the corresponding + +agent and the collective goal is to maximize the globally averaged return over all agents. Nevertheless, under an F-Dec setting, agents seek to maximize their own reward, which does not necessarily imply the maximization of the team long-term return since agents do not inherently understand coordination. + +Recently, strong empirical evidence has shown that Mutual Information (MI) is a statistic that correlates with the degree of collaboration between pairs of agents (Trendafilov et al., 2015). Researchers have shown that information redundancy is minimized among agents by maximizing the joint entropy of agents' decisions, which in turn, improves the overall performance in MARL (Malakar et al., 2012). Therefore, recent work in MARL has sought to integrate entropy regularization terms as means of maximizing MI among interacting agents (Kim et al., 2020; Wang et al., 2019; Jaques et al., 2019). The formulaic calculation of MI relies upon the estimation of action-conditional distributions. In most prior work, agents are equipped with conventional state-conditional policies, and researchers employ techniques, such as variational inference, for estimating and optimizing an action-conditional policy distribution to quantify MI (Wen et al., 2019; Kim et al., 2020). However, agents are not explicitly given the ability to reason about their teammates' action-decisions and, instead, have to learn implicitly from sparse rewards or hand-engineered regularization and auxiliary loss terms. + +Contributions - In this work, we propose a novel information-theoretic, fully-distributed cooperative MARL framework, called InfoPG, by reformulating an agent's policy to be directly conditional on the policies of its instantaneous neighbors during Policy Gradient (PG) optimization. We study cooperative MARL under the assumption of bounded rational agents and leverage action-conditional policies into PG objective function to accommodate our assumption. By leveraging the $k$ -level reasoning (Ho & Su, 2013) paradigm from cognitive hierarchy theory, we propose a cooperative MARL framework in which naive, nonstrategic agents are improved to sophisticated agents that iteratively reason about the rationality of their teammates for decision-making. InfoPG implicitly increases MI among agents' $k$ -level action-conditional policies to promote cooperativity. To learn collaborative behavior, we build InfoPG on a communicative fully-decentralized structure where agents learn to achieve consensus in their actions and maximize their shared utility by communicating with their physical neighbors over a potentially time-varying communication graph. We show the effectiveness of InfoPG across multiple, complex cooperative environments by empirically assessing its performance against several baselines. The primary contributions of our work are as follows: + +1. We derive InfoPG, an information-theoretic PG framework that leverages cognitive hierarchy and action-conditional policies for maximizing MI among agents and maximizing agents' individual rewards. We derive an analytical lower-bond for MI estimated during InfoPG and provide mathematical reasoning underlying InfoPG's performance. +2. We propose a fully-decentralized graph-based communication and $k$ -level reasoning structure to enable theory of mind for coordinating agents and maximizing their shared utility. +3. We propose a generalized variant of InfoPG and derive an MI upper-bound to modulate MI among agents depending on cooperativity of agents and environment feedback. We demonstrate the utility of this generalization in solving an instance of the Byzantine Generals Problem (BGP), in a fully decentralized setting. +4. We present quantitative results that show InfoPG sets the SOTA performance in learning emergent cooperative behaviors by converging faster and accumulating higher team rewards. + +# 2 RELATED WORK + +Cooperative MARL studies can be subdivided into two main lines of research, (1) learning direct communication among agents to promote coordination (Foerster et al., 2016; Das et al., 2018; Sukhbaatar et al., 2016; Kim et al., 2019) and, (2) learning to coordinate without direct communication (Foerster et al., 2017; Palmer et al., 2017; Seraj et al., 2021b). Our work can be categorized under the former. Hierarchical approaches are also prevalent for learning coordination in MARL (Seraj & Gombolay, 2020; Ghavamzadeh & Mahadevan, 2004; Amato et al., 2019; Seraj et al., 2021a). We consider MARL problems in which the task in hand is of cooperative nature and agents can directly communicate, when possible. Unlike these studies, however, we improve our interacting agents from coexisting to strategic by enabling the recursive $k$ -level reasoning for decision-making. + +Researchers have shown that maximizing MI among agents leads to maximizing the joint entropy of agents' decisions, which in turn, improves the overall performance in MARL (Malakar et al., + +2012; Kim et al., 2020). As such, prior work has sought to increase MI by introducing auxiliary MI regularization terms to the objective function (Kim et al., 2020; Wang et al., 2019; Jaques et al., 2019). These prior works adopt a centralized paradigm, making them less relevant to our F-Dec setting. Model of Other Agents (MOA) was proposed by Jaques et al. (2019) as a decentralized approach that seeks to locally push the MI lower-bound and promote collaboration among neighboring agents through predicting next-state actions of other agents. In all of the mentioned approaches, the amount of MI maximization objective that should be integrated into the overall policy objective is dictated through a $\beta$ regularization parameter. In our work, however, we reformulate an agent's policy to be directly conditional on the policies of its neighbors and therefore, we seek to reason about MI among agents in our PG update without ad-hoc regularization or reward shaping. + +Among prior work seeking to enable $k$ -level reasoning for MARL, Wen et al. (2019) presented Probabilistic Recursive Reasoning (PR2), an opponent modeling approach to decentralized MARL in which agents create a variational estimate of their opponents' level $k - 1$ actions and optimize a joint Q-function to learn cooperative policies without direct communication. Wen et al. (2020) later extended the PR2 algorithm for generalized recursive depth of reasoning. In InfoPG, we establish the inherent connection between $k$ -level reasoning and MI, a link that has not been explored in prior work. Moreover, we bypass the need for modeling other agents through direct communication and $k$ -level action-conditional policies, and giving InfoPG agents the ability to recursively reason about their teammates' actions through received messages and with any arbitrary rationalization depths. + +# 3 PRELIMINARIES + +Problem Formulation - We formulate our setup as a Multi-Agent Fully Dec-POMDP (MAF-Dec-POMDP), represented by an 8-tuple $\langle \{\mathcal{G}_t\}_{t\geq 0},\mathcal{N},\mathcal{S},\mathcal{A},\Omega ,\{\mathcal{R}^i\}_{i\in \mathcal{N}},\mathcal{P},\gamma \rangle$ . $\mathcal{N}$ is the set of all interacting agents in the environment in which index $i$ represents the index of an agent. $\mathcal{G}_t = \langle \mathcal{N},\mathcal{E}_t\rangle$ is a time-varying, undirected communication graph in which agents $i,j\in \mathcal{N}$ are vertices and $\mathcal{E}_t\subseteq \{(i,j):i,j\in \mathcal{N},i\neq j\}$ is the edge set. The two agents $i$ and $j$ can only share information at time $t$ if $(i,j)\in \mathcal{E}_t$ . State space $\mathcal{S}$ is a discrete set of joint states, $\mathcal{A}$ represents the action space, $\Omega$ is the observation space, and $\gamma \in [0,1)$ is the temporal discount factor for each unit of time. + +At each step, $t$ , an agent, $i$ , receives a partial observation, $o_t^i \in \Omega$ , takes an action, $a_t^i \in \mathcal{A}$ , and receives an immediate individual reward, $r_t^i \in \{\mathcal{R}^i\}_{i \in \mathcal{N}}$ . Taking joint actions, $\bar{a}$ , in the joint states, $\bar{s}$ , leads to changing the joint states to $\bar{s}' \in S$ , according to the state transition probabilities, $\mathcal{P}(\bar{s}'|\bar{s}, \bar{a})$ . Our model is fully decentralized since agents take actions locally and receive individual rewards for their actions according to their own reward function. Moreover, each agent is also equipped with a local optimizer to update its individual policy through its local reward feedback. Accordingly, we can reasonably assume that agents' choices of actions are conditionally independent given the current joint states (Zhang et al., 2018). In other words, if $\bar{\pi}: S \times \mathcal{A} \to [0,1]$ is the joint state-conditional policy, we assume that $\bar{\pi}(\bar{a}|\bar{s}) = \Pi_{i \in \mathcal{N}} \pi^i(a^i|\bar{s})$ . Note that Dec-POMDPs are allowed to facilitate local inter-agent communication (Zhang et al., 2018; Oliehoek & Amato, 2016; Melo et al., 2011). + +Policy Gradient (PG) and Actor-Critic (AC) Methods - The policy gradient methods target at modeling and optimizing the policy $\pi^i$ directly by parametrizing the policy, $\pi_{\theta}^{i}(a_{t}^{i}|s_{t})$ . Actor-Critic (AC) is a policy gradient method in which the goal is to maximize the objective by applying gradient ascent and directly adjusting the parameters of policy, $\pi_{\theta}^{i}$ , through an actor network. The actor, updates the policy distribution in the direction suggested by a critic, which estimates the action-value function $Q^{w}(s_{t},a_{t}^{i})$ (Tesauro, 1995). By the policy gradient theorem (Sutton & Barto, 2018), the gradient by which the objective in AC, $J(\theta)$ , is maximized can be shown as $\nabla_{\theta}J(\theta) = \mathbb{E}_{\pi_{\theta}^{i}}\left[\nabla_{\theta}\log \pi_{\theta}^{i}(a_{t}^{i}|o_{t}^{i})Q^{w}(\bar{s}_{t},a_{t}^{i})\right]$ , where $a_{t}^{i}$ and $o_t^i$ are agent $i$ 's action and observation. + +Mutual Information (MI) - MI is a measure of the reduction in entropy of a probability distribution, $X$ , given another probability distribution $Y$ , where $H(X)$ denotes the entropy of $X$ and $H(X|Y)$ denotes the entropy of the conditional distribution of $X$ given $Y$ (Kraskov et al., 2004; Poole et al., 2019). By expanding the Shannon entropy of $X$ and $X|Y$ , we can compute the MI as in Eq. 1. + +$$ +I (X; Y) = H (X) - H (X | Y) = \sum_ {y \in Y} p _ {Y} (y) \sum_ {x \in X} p _ {X | Y = y} (x) \log \left(\frac {p _ {X | Y = y} (x)}{p _ {X} (x)}\right) \tag {1} +$$ + +In our work, $X$ and $Y$ are distributions over actions given a specific state, for two interacting agents. In an arbitrary Markov game with two agents $i$ and $j$ and with policies $\pi_{i}$ and $\pi_{j}$ , if $\pi_{i}$ gains MI by viewing $\pi_{j}$ , then agent $i$ will make a more informed decision about its sampled action and vice versa. + +![](images/39955988d97f36669de7d86a11ba8278d5217acad890805e8237b3228fcffefe.jpg) +Figure 1: An instance of the information flow in a $k$ -level decision hierarchy between two agents $i$ and $j$ for calculating their level- $k$ strategies. Level-zero actions (e.g., $a^{i,(0)}$ ) represent the naive non-strategic actions. + +# 4 MUTUAL INFORMATION MAXIMIZING POLICY GRADIENT + +In this section, we first present an algorithmic overview of the InfoPG framework and then introduce the InfoPG objective by covering the logistics of building an iterated $k$ -level decision making strategy for agents with bounded rationality. We then explore the relation of InfoPG with MI and derive an analytical lower-bound on the MI between the action-conditional policies of interacting agents. + +# 4.1 ALGROTHMIC OVERVIEW + +Consider an MAF-Dec-POMDP introduced in Section 3, with $N$ agents where each agent is equipped with an encoding and a communicative policy (see Fig. 1). At the beginning of a new rollout, each agent receives a state observation from the environment and produces an initial action (i.e., a guess action) using its encoding policy. Each agent $i$ has a neighborhood of agents it can communicate with, shown with $j \in \Delta_t^i$ where $|\Delta_t^i|$ is the number of agent $i$ 's physical neighbors (i.e., within close proximity). Next, depending on the level of $k$ in the decision hierarchy, agents communicate their action guesses (high-dimensional latent distributions) with their neighbors $k$ times and update their action guess iteratively using their communicative policy. The level- $k$ action is then executed by all agents and a local reward is given to each agent separately. This process continues until either the environment is solved successfully, or some maximum number of cycles has been attained. For each timestep, $t$ , of the policy rollout and for each agent $i$ , the gradient of the log probability is computed, scaled by the instantaneous advantage, $A_t^i$ , and the encoding and communicative policies are updated. This process repeats until convergence of the cumulative discounted rewards across all agents. Please refer to Appendix, Section A.1 for pseudocode and details of our training and execution procedures. + +# 4.2 DEEP REASONING: DECISION-MAKING UNDER $k$ -LEVEL RATIONALIZATION + +We leverage from cognitive hierarchy theory (Camerer et al., 2004) and strategic game theory (Myerson, 2013), wherein each agent has $k$ -levels of conceptualization of the actions its neighbors might take under bounded rationality. $k$ -level reasoning assumes that agents in strategic games are not fully rational and therefore, through hierarchies of iterated rationalizability, each agent bases its decisions on its predictions about the likely actions of other agents (Ho & Su, 2013). According to $k$ -level theory, strategic agents can be categorized by the depth of their strategic thought (Nagel, 1995). For example, consider the two agent case shown in Fig. 1, with $k = 2$ . At $k = 1$ agent $i$ makes decisions based off its own observed state, and a guess of what agent $j$ will do (Agent $i$ will assume agent $j$ is naive and non-strategic). A more sophisticated agent $i$ with a strategy of level $k = 2$ however, makes decisions based off the rationalization that agent $j$ has a level-one guess of $i$ 's strategy. Inductively, this line of reasoning can be extended to any $k$ . Notice that the conditioning of agent $i$ 's policy on agent $j$ 's perceived actions is an action-conditional distribution. In InfoPG, we give agents the ability to communicate with their latent guess-action distributions in $k$ iterated reasoning steps and rationalize their action decisions at level $k$ to best respond to their teammates' level $k - 1$ actions. + +In the following, we represent the level of rationality for an agent by the superscript $(k)$ where $k\in \mathbb{N}$ . Denoting $\pi^{j,(k)}$ as the level- $k$ policy of agent $j$ , it can be shown that under the $k$ -level reasoning, agent $i$ 's policy at level $k + 1$ , $\pi^{i,(k + 1)}$ , is precisely the best response of agent $i$ to agent $j$ 's policy $\pi^{j,(k)}$ (Guan et al., 2021). In other words, $\pi^{i,(k + 1)}\in \mathrm{BestResponse}(\pi^{j,(k)})$ . In theory, this process can iteratively proceed until we obtain $\pi^{i,(k + 2)} = \pi^{i,(k)}$ , which corresponds to reaching the equilibrium strategies. In practice, however, for scenarios with many collaborating agents, the + +level of $k$ is usually set to a reasonably small number for computational efficiency; since, in order to calculate the policy $\pi^{i,(k)}$ , agent $i$ must calculate not only its own policy at level $k$ , but also all policies of all its neighbors for all $k \in \{1,2,3,\dots ,k - 1\}$ at each time-step $t$ . + +# 4.3 INFOPG OBJECTIVE + +Our approach, InfoPG, equips each agent with an action-conditional policy that performs actions based on an iterated $k$ -level rationalization of its immediate neighbors' actions. This process can be graphically described as presented in Figure 1, in which the information flow in a $k$ -level reasoning between two agents $i$ and $j$ is shown. Note that in practice, any number of agents can be applied. Considering agent $i$ as the current agent, we represent $i$ 's decision-making policy as $\pi_{tot}^{i} = [\pi_{enc}^{i}, \pi_{com}^{i}]$ , in which $\pi_{enc}^{i}(a_{t}^{i}|o_{t}^{i})$ is the state-conditional policy that maps $i$ 's observed states to actions. $\pi_{com}^{i}(a_{t}^{i,(k)}|a_{t}^{i,(k-1)}, a^{j,(k-1)})$ is the action-conditional policy that maps agent $i$ 's action at level $(k-1)$ along with the actions of $i$ 's neighbors (in this case agent $j$ ) at level $k-1$ , to an action for agent $i$ in the $(k)$ -th level of decision hierarchy, $a_{t}^{i,(k)}$ . Therefore, pursuant to the general PG objective, we define the basic form of our modified information-based objective, as in Eq. 2, where $\Delta_{t}^{i}$ is the set of $i$ 's immediate neighbors in communication graph at time $t$ and $G_{t}$ is the return. + +$$ +\nabla_ {\theta} ^ {\operatorname {I n f o P G}} J (\theta) = \mathbb {E} _ {\pi_ {t o t} ^ {i}} \left[ G _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) \sum_ {j \in \Delta_ {t} ^ {i}} \nabla_ {\theta} \log \left(\pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {i, (k - 1)}, a _ {t} ^ {j, (k - 1)}, \dots , a _ {t} ^ {i, (0)}, a _ {t} ^ {j, (0)}, o _ {t} ^ {i}\right)\right) \right] \tag {2} +$$ + +Eq. 2 describes the form of InfoPG's objective function. Depending on the use case, we can replace the return, $G_{t}^{i}$ , with action-values, $Q_{t}^{i}$ , shown in Eq. 3, and present the InfoPG as a Monte-Carlo PG method. We can also replace the returns with the advantage function, $A_{t}^{i}$ , as shown in Eq. 4, and present the AC variant of the InfoPG objective (Sutton & Barto, 2018). + +$$ +G _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) = Q _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) \quad \text {s . t .} \quad Q _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) \geq 0 \tag {3} +$$ + +$$ +G _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) = A _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) = Q _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) - V _ {t} ^ {i} \left(o _ {t}\right) \tag {4} +$$ + +Leveraging Eq. 3 and 4, we present two variants of the InfoPG objective. The first variant is the MI maximizing PG objective, which utilizes Eq. 3. The non-negative action-value condition in Eq. 3 implies non-negative rewards from the environment, a common reward paradigm utilized in prior work (Fellows et al., 2019; Liu et al., 2020; Kostrikov et al., 2018). By applying this condition, InfoPG only moves in the direction of maximizing the MI between cooperating agents (see Theorem 2). We refer to the second variant of our InfoPG objective shown in Eq. 4 as Advantage InfoPG (Adv. InfoPG), in which we relax the non-negative rewards condition. Adv. InfoPG modulates the MI among agents depending on cooperativity of agents and environment feedback (see Theorem 3). + +# 4.4 BAYESIAN EXPANSION OF THE POLICY + +The action-conditional policy conditions an agent's action at the $k$ -th level of the decision hierarchy on the actions of other agents at level $k - 1$ ; however, to relate our $k$ -level formulation to MI, we seek to represent an agent's action at a particular level $k$ to be dependent on the actions of other agents at same level $k$ . We present Theorem 1 to introduce the gradient term in the InfoPG objective in Eq. 2 which relates level- $k$ actions of the cooperating agents in their respective decision hierarchies. Please refer to the Appendix, Section A.5 for a detailed proof of Theorem 1. + +Theorem 1. The gradient of the log probability's level- $k$ action-distribution in the InfoPG objective (Eq. 2) for an agent, $i$ , with neighbors $j \in \Delta_t^i$ and policy $\pi_{tot}^i$ that takes the Maximum a Posteriori (MAP) action $a_t^{i,(k)}$ , can be calculated iteratively for each level $k$ of rationalization via Eq. 5. + +$$ +\nabla \log \left(\pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} = M A P \mid a _ {t} ^ {i, (k - 1)}, a _ {t} ^ {j, (k - 1)}, \dots , o _ {t} ^ {i}\right)\right) = \nabla \log \left(\pi_ {c o m} ^ {i} \left(a _ {t} ^ {i, (k)} = M A P \mid a _ {t} ^ {j, (k)} = M A P\right)\right) \tag {5} +$$ + +# 4.5 INFOPG AND MUTUAL INFORMATION LOWER-BOUND + +Using the fact that $\nabla \log (\pi_{tot}^{i}(a_{t}^{i,(k)}|.))$ is directly proportional to $\nabla \log (\pi_{com}^{i}(a_{t}^{i,(k)}|a_{t}^{j,(k)}))$ from Eq. 5, we can show that the gradient of our communicative policy implicitly changes MI. Since MI is empirically hard to estimate, we instead derive a lower-bound for MI which is dependent on the action-conditional policy of an agent. We show that increasing the probability of taking an action from the action-conditional policy will increase the derived lower-bound, and consequently, the MI. + +Theorem 2. Assuming the actions $(a_{t}^{i,(k)})$ and $a_{t}^{j,(k)}$ to be the Maximum a Posteriori (MAP) actions, the lower-bound to MI, $I^{(k)}(i;j)$ , between any pair of agents $i$ and $j$ that exist in the communication graph $\mathcal{G}_t$ can be calculated w.r.t to agent $i$ 's communicative policy as shown in Eq. 6. + +$$ +\pi_ {c o m} ^ {i} \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {j, (k)}\right) \log \left(\pi_ {c o m} ^ {i} \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {j, (k)}\right)\right) \leq I ^ {(k)} (i; j) \tag {6} +$$ + +Proof - Without loss of generality, we consider two agents $i,j\in \mathcal{N}$ with action-conditional policies $\pi^i (a^i |a^j)$ and $\pi^j (a^j |a^i)$ (note that the time, $t$ , and the rationalization level, $(k)$ , indices are removed for notational brevity). We refer to the marginalizations of $i$ 's and $j$ 's action-conditional policies as priors which can be denoted as $p(a^{i}) = \sum_{a^{j}\in \mathcal{A}}\pi^{i}(a^{i}|a^{j})$ and $p(a^{j}) = \sum_{a^{i}\in \mathcal{A}}\pi^{j}(a^{j}|a^{i})$ . We assume uniformity of the priors, as done previously by Prasad (2015), such that $p(a^{i}) = p(a^{j}) = \frac{1}{|\mathcal{A}|}$ where $|\mathcal{A}|$ is the action-space dimension. For a detailed discussion on the validity of the uniformity of priors assumption, please refer to the Appendix, Section A.6. Since MI is a marginalization across all actions in the action-space, a lower-bound exists at a particular $a_{max}^{i}$ , which is the MAP action. As such, starting from the basic definition of MI in Eq. 1, we derive: + +$$ +\begin{array}{l} I (i; j) = \sum_ {a ^ {j} \in \mathcal {A}} p \left(a ^ {j}\right) \sum_ {a ^ {i} \in \mathcal {A}} \pi^ {i} \left(a ^ {i} \mid a ^ {j}\right) \log \left(\frac {\pi^ {i} \left(a ^ {i} \mid a ^ {j}\right)}{p \left(a ^ {i}\right)}\right) = \sum_ {a ^ {j} \in \mathcal {A}} \frac {1}{| \mathcal {A} |} \sum_ {a ^ {i} \in \mathcal {A}} \pi^ {i} \left(a ^ {i} \mid a ^ {j}\right) \log \left(| \mathcal {A} | \pi^ {i} \left(a ^ {i} \mid a ^ {j}\right)\right) \tag {7} \\ \geq | \mathcal {A} | \pi^ {i} \left(a _ {\max } ^ {i} \mid a ^ {j}\right) \left(\log \left(\pi_ {i} \left(a _ {\max } ^ {i} \mid a ^ {j}\right)\right) + \log (| \mathcal {A} |)\right) \geq \pi^ {i} \left(a _ {\max } ^ {i} \mid a ^ {j}\right) \log \left(\pi^ {i} \left(a _ {\max } ^ {i} \mid a ^ {j}\right)\right) \quad \blacksquare (8) \\ \end{array} +$$ + +We now seek to relate the last term in Eq. 8 to the gradient term $\nabla \log (\pi_{com}^{i}(a_{t}^{i,(k)}|a_{t}^{j,(k)}))$ and variation of MI. By monotonicity of log, maximizing $\log (\pi^i (a_{max}^i |a^j))$ is equivalent to maximizing the $\pi^i (a_{max}^i |a^j)$ term. Therefore, according to Theorem 2 and Eq. 8, the gradient updates will raise our lower-bound, which will maximize the MI. Since the sign of environment rewards and therefore, the sign of $Q_{t}(o_{t},a_{t})$ in Eq. 3 is strictly non-negative, the gradient ascent updates will always move $\log (\pi_{com}^{i}(a_{t}^{i,(k)}|a_{t}^{j,(k)})$ either up or not-at-all, which will have a proportional effect on the MI given the lower-bound. Note that we leveraged the non-negative reward condition so that the rationalization of $a_{t}^{i,(k)}$ given $a_{t}^{j,(k)}$ is only non-negatively reinforced. As such, if agent $i$ 's action-conditional policy on agent $j$ 's action does not obtain a positive reward from the environment, the lower-bound of MI stays constant, and thus so does MI. Conversely, if a positive reward is received by the agent, then the lower-bound of MI will strictly increase, leading to lowering the conditional entropy for taking the action that yielded the positive feedback from the environment. + +# 4.6 ADVANTAGE INFOPG AND THE BYZANTINE GENERALSPROBLEM + +While continually maximizing MI among agents is desired for improving the degree of coordination, under some particular collaborative MARL scenarios such MI maximization may be detrimental. We specifically discuss such scenarios in the context of Byzantine Generals Problem (BGP). The BGP describes a decision-making scenario in which involved agents must achieve an optimal collaborative strategy, but where at least one agent is corrupt and disseminates false information or is otherwise unreliable (Lamport et al., 2019). BGP scenarios are highly applicable to cooperative MARL problems where there exists an untrainable fraudulent agent with a bad policy (e.g., random) in the team. Coordinating actions with such a fraudulent agent in a collaborative MARL setting can be detrimental. We note that BGPs are particularly challenging to solve in the fully decentralized settings (Peng et al., 2021; Allen-Zhu et al., 2020). + +Here, we elaborate on our Adv. InfoPG variant introduced in Eq. 4 and show its utility for intelligently modulating MI depending on the cooperativity of agents. Intuitively, the advantage function evaluates how much better it is to take a specific action compared to the average, general action at the given state. Without the non-negative reward condition in InfoPG, the Adv. InfoPG objective in Eq. 4 does not always maximize the MI locally, but, instead, benefits from both positive and negative experiences as measured by the advantage function to increase the MI in the long run. Although instantaneous experiences may result in a negative advantage, $A_{t}^{i}$ , and reducing the MI lower-bound in Eq. 6, we show that Adv. InfoPG in fact regularizes an MI upper-bound, making it suitable for BGP scenarios while also having the benefit of learning from larger numbers of samples. In Adv. InfoPG we equip each agent with an action-conditional policy and show that under $k$ -level reasoning, the tight bounds of MI between agents is regularized (shifted up and down) depending on the sign of the received advantage. We note that despite this local MI regularization, in the long run we expect the MI bounds to increase since policy gradient seeks to maximize local advantages during gradient ascent. + +Upper-Bound of MI - Here, we derive an MI upper-bound dependent on the action-conditional policy of an agent and show that the gradient updates in Adv. InfoPG have a proportional effect on this upper-bound. We show that under $k$ -level rationalization, the tight bound of MI between agents is regularized (shifted up or down) depending on the sign of the received advantage value, $A_{t}^{i}$ . + +Theorem 3. Assuming the same preliminaries as in Theorem 2, the upper-bound to $MI$ , $I^{(k)}(i; j)$ , between agents $i$ and $j$ w.r.t agent $i$ 's level- $k$ action-conditional policy can be calculated as in Eq. 9. + +$$ +I ^ {(k)} (i; j) \leq 2 \log (| \mathcal {A} |) + 2 \log \left(\pi_ {\text {c o m}} ^ {i} \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {j, (k)}\right)\right) \tag {9} +$$ + +Proof - We start from the definition of conditional entropy. The conditional entropy is an expectation across all $a^i$ and considering the fact that the $-\log(.)$ is a convex function, Jensen's inequality (Ruel & Ayres, 1999) can be applied to establish an upper-bound on conditional entropy. We derive: + +$$ +\begin{array}{l} H \left(\pi^ {i} \mid \pi^ {j}\right) = - \sum_ {a ^ {i} \in \mathcal {A}} \pi^ {i} \left(a ^ {i} \mid a ^ {j}\right) \log \left(\pi^ {i} \left(a ^ {i} \mid a ^ {j}\right)\right) = \sum_ {a ^ {i} \in \mathcal {A}} \pi^ {i} \left(a ^ {i} \mid a ^ {j}\right) (- \log \left(\pi^ {i} \left(a ^ {i} \mid a ^ {j}\right)\right)) (10) \\ \xrightarrow {\text {J e s s e n ' s i n e q u a l i t y}} H \left(\pi^ {i} \mid \pi^ {j}\right) \geq - \log \left(\sum_ {a ^ {i} \in \mathcal {A}} \pi^ {i} \left(a ^ {i} \mid a ^ {j}\right) ^ {2}\right) (11) \\ \end{array} +$$ + +Now, we leverage the basic MI definition in Eq. 1. We note that $H(p(a^i))$ has a constant value of $\log (|\mathcal{A}||)$ given the uniform prior assumption. Accordingly, plugging in the bound in Eq. 11 and evaluating at the MAP action results in an upper-bound for MI, as shown below. + +$$ +\begin{array}{l} I (i; j) = H \left(p \left(a ^ {i}\right)\right) - H \left(\pi^ {i} \mid \pi^ {j}\right) = - H \left(\pi^ {i} \mid \pi^ {j}\right) + \log \left(| \mathcal {A} |\right) \leq \log \left(\sum_ {a ^ {i} \in \mathcal {A}} \pi^ {i} \left(a ^ {i} \mid a ^ {j}\right) ^ {2}\right) + \log \left(| \mathcal {A} |\right) (12) \\ \leq \log \left(| \mathcal {A} | \pi^ {i} \left(a _ {\text {m a x}} ^ {i} \mid a ^ {j}\right) ^ {2}\right) + \log (| A |) \leq 2 \log (| \mathcal {A} |) + 2 \log \left(\pi^ {i} \left(a _ {\text {m a x}} ^ {i} \mid a ^ {j}\right)\right) (13) \\ \end{array} +$$ + +Considering the Adv. InfoPG objective in Eq. 4, depending on the sign of $A_{t}^{i}$ , the gradient ascent either increases or decreases $\log (\pi_{\text{com}}^{i}(a_{t}^{i,(k)}|a_{t}^{j,(k)})$ , which will have a proportional regulatory effect on the MI given our bounds in Eq. 6 and 9. Specifically, when agent $i$ receives negative advantage from the environment, it means agent $i$ 's reasoning of $a_{t}^{i,(k)}$ given $a_{t}^{j,(k)}$ , resulted in a negative outcome. Therefore, to reduce agent $j$ 's negative influence, our gradient updates in Eq. 4 will decrease the MI upper-bound between $i$ and $j$ so that the conditional entropy at level $k$ is increased. This bears similarity to Soft actor-critic (Haarnoja et al., 2018), where regularization with entropy allows agents to explore more actions. As such, during Adv. InfoPG updates, the MI constraint becomes adaptive to instantaneous advantage feedback. Such property can be effective in BGP scenarios to reduce the negative effect of misleading information received from a fraudulent agent. + +# 5 EMPIRICAL EVALUATION + +Evaluation Environments – We empirically validate the utility of InfoPG against several baselines in four cooperative MARL domains that require high degrees of coordination and learning collaborative behaviors. Our testing environments include: (1) Cooperative Pong (Co-op Pong) (Terry et al., 2020), (2) Pistonball (Terry et al., 2020), (3) Multiwalker (Gupta et al., 2017; Terry et al., 2020) and, (4) StarCraft II (Vinyals et al., 2017), i.e., the 3M (three marines vs. three marines) challenge. We modified the reward scheme in all four domains to be individualistic such that agents only receive a local reward feedback as per our MAF-Dec-POMDP formulation in Section 3. For environment descriptions and details, please refer to the Appendix, Section A.8. + +Baselines - We benchmark our approach (both InfoPG in Eq. 3 and Adv. InfoPG in Eq. 4) against four fully-decentralized baselines: (1) Non-communicative A2C (NC-A2C) (Sutton & Barto, 2018), (2) Consensus Update (CU) (Zhang et al., 2018), (3) Model of Agents (MOA) (Jaques et al., 2019) and, (4) Probabilistic Recursive Reasoning (PR2) (Wen et al., 2019). In the NC-A2C, each agent is controlled via an individualized actor-critic network without communication. The CU approach shares the graph-based communication among agents with InfoPG but lacks the $k$ -level reasoning in InfoPG's architecture. Thus, the CU baseline is communicative and non-rational. MOA, proposed by Jaques et al. (2019), is a decentralized cooperative MARL method in which agents benefit from action-conditional policies and an MI regularizer dependent on the KL-Divergence between an agent's prediction of its neighbors' actions and their true actions. PR2, proposed by Wen et al. (2019) is an opponent modeling approach to decentralized MARL in which agents create a variational estimate of their opponents' level $k - 1$ actions and optimize a joint Q-function to learn cooperative policies through $k$ -level reasoning without direct communication. + +![](images/f274d527c7410dc5219aa2aea0d6b2e8d1d3af9854317e41a88a30d87bd3afd0.jpg) +Figure 2: (Top Row) Team rewards obtained across episodes as training proceeds. The shaded regions represent standard error. Our Adv. InfoPG continually outperforms all baselines across all domains and in both training and testing (see Table 1). (Bottom Row) The MI ablation study results, comparing the MI variations between InfoPG and MOA (MI-based baseline) where InfoPG demonstrates a higher final average MI estimate across all domains. The shaded blue region represents the area between InfoPG's lower and upper bounds on MI. + +# 6 RESULTS, ABLATION STUDIES, AND DISCUSSION + +In this section, we assess the performance and efficiency of our frameworks in the four introduced domains and against several recent, fully-decentralized cooperative MARL approaches. Following an analysis of performance under $k$ -level reasoning and an MI ablation study, we present a case-study, namely the fraudulent agent experiment, to investigate the utility of our MI-regularizing InfoPG variant (i.e. Adv. InfoPG in Eq. 4) against MI-maximizing baselines, such as MOA (Jaques et al., 2019) and InfoPG, in BGP scenarios. We provide further ablation studies, such as a level- $k$ policy interpretation for InfoPG and a scalability analysis in the Appendix, Section A.7. + +Baseline Comparison – The top row in Fig. 2 depicts the team rewards obtained by each method across episodes as training proceeds. In all four domains, both InfoPG and Adv. InfoPG demonstrate sample-efficiency by converging faster than the baselines and achieving higher cumulative rewards. Table 1 presents the mean (±standard error) cumulative team rewards and steps taken by agents to win the game by each method at convergence. Table 1 shows that InfoPG and Adv. InfoPG set the state-of-the-art for learning challenging emergent cooperative behaviors in both discrete and continuous domains. Note that, while in Pistonball fewer number of taken steps means better performance, in Co-op Pong and Multiwalker more steps shows a superior performance. + +Mutual Information Variation Analysis - The bottom row in Fig. 2 shows our MI study results comparing the MI variations between InfoPG and MOA (the MI-based baseline). The MI for InfoPG is estimated as the average between lower and upper bounds defined in Eqs. 6 and 9. As depicted, InfoPG demonstrates a higher final average MI estimate across all domains. Note the concurrency of InfoPG's increase in MI estimates (bottom row) and agents' performance improvements (Fig. 2, top row). This concurrency supports our claim that our proposed policy gradient, InfoPG, increases MI among agents which results in learning emergent collaborative policies and behavior. + +Deep Reasoning for Decision Making: Evaluating $k$ -Level InfoPG – We evaluate the performance of our method for deeper levels of reasoning $k \in \{2,3\}$ in Co-op Pong, Pistonball and Multiwalker domains. The training results are presented in Fig. 2. As discussed in Section 4.2, in the smaller domain with fewer collaborating agents, the Co-op Pong, agents reach the equilibrium cooperation strategy (i.e., $\pi^{i,(k+2)} = \pi^{i,(k)}$ ) even with one step of reasoning, and increasing the level of $k$ does not significantly change the performance. However, in the more complex domains with more agents, Pistonball and Multiwalker, as the level of rationalization goes deeper in InfoPG (i.e., $k = 2$ and $k = 3$ ), agents can coordinate their actions better and improve the overall performance. + +Table 1: Reported results are Mean (Standard Error) from 100 testing trials. For all tests, the final training policy at convergence is used for each method and for InfoPG and Adv. InfoPG, the best level of $k$ is chosen. + +
DomainInfoPGAdv. InfoPGMOACUNC-A2CPR2-AC
R#StepsR#StepsR#StepsR#StepsR#StepsR#Steps
Co-op Pong0.127(0.00)202.9(1.35)0.25(0.00)212.9(1.24)-0.3(0.00)58.2(0.32)0.13(0.00)152.0(0.96)0.04(0.00)102.925(0.93)-0.84(0.00)36.8(0.34)
Pistonball7.47(0.02)17.44(0.29)7.33(0.02)28.31(0.43)4.10(0.03)91.66(0.76)1.06(0.04)136.3(0.83)0.89(0.04)138.3(0.83)1.90(0.02)140.4(0.68)
Multiwalker3.56(0.20)474.2(1.39)11.81(0.11)500.0(0.80)0.66(0.15)489.3(1.09)-1.7(0.26)490.2(1.30)-66(0.18)80.75(0.20)-84(0.37)94.17(1.40)
StarCraft II4.40(0.01)30.79(0.05)3.73(0.02)44.5(0.13)2.78(0.02)27.7(0.07)0.24(0.00)58.72(0.06)0.00(0.00)60.0(0.00)0.64(0.00)27.4(0.08)
+ +The Fraudulent Agent Experiment: Regularising MI – To assess our Adv. InfoPG's (Eq. 4) regulatory effect based on agents' cooperativity, we perform an experiment, demonstrated in Fig. 3a, which is performed in the Pistonball domain and is intended to simulate an instance of the BGP in which the middle piston is equipped with a fully random policy throughout the training (i.e., the Byzantine piston is not controllable by any InfoPG agent). Maximizing the MI with this fraudulent agent is clearly not desirable and doing such will deteriorate the learning performance. + +Fig. 3b presents the fraudulent agent experiment training results for Adv. InfoPG, InfoPG and MOA. As shown and comparing with Fig. 2, existence of a fraudulent agent significantly deteriorates the learning performance in MOA and InfoPG as these approaches always seek to maximize the MI among agents. This is while InfoPG still outperforms MOA since by only using strictly non-negative rewards, the coordination in InfoPG is only positively reinforced, meaning that InfoPG only increases MI when the reward feedback is positive. Adv. InfoPG shows the most robust performance compared to InfoPG and MOA. Adv. InfoPG modulates the MI depending on the observed short-term coordination performance. As discussed in Section 4.6, if the advantage is negative, the gradient ascent in Adv. InfoPG will decreases the MI upper-bound between agents, leading to increasing the conditional entropy and taking more exploratory (i.e., less coordinated) actions. + +![](images/92810b53d292c6e5eb712d3017d3e7bdf28a243968ae5f26d94fa210f63e48a6.jpg) +Figure 3: The fraudulent agent experiment scenario (Fig. 3a) and training results (Fig. 3b) in the Pistonball domain, comparing the team reward performance for Adv. InfoPG (Eq. 4), InfoPG (Eq.3) and MOA. + +![](images/0babfa3297fe5a8fdc835136d482ec70262c02485f53f9d1c9586ae02b254eff.jpg) + +Limitations and Future Work - Useful MI between agents becomes hard to capture in cases, such as Co-op Pong domain, where an agent's action influences its neighbors with some delay. Moreover, MI maximization by applying the strictly non-negative reward condition in InfoPG objective (Eq. 3) comes at the cost of zeroing out negative experiences which may have an impact on sample-efficiency. + +# 7 CONCLUSION + +We leverage iterated $k$ -level reasoning from cognitive hierarchy theory and present a collaborative, fully-decentralized MARL framework which explicitly maximizes MI among cooperating agents by equipping each agent with an action-conditional policy and facilitating iterated inter-agent communication for hierarchical rationalizability of action-de decisions. We analytically show that the design of our MI-based PG method, increases an MI lower-bound, which coincides with improved cooperativity among agents. We empirically show InfoPG's superior performance against various baselines in learning cooperative policies. Finally, we demonstrate that InfoPG's regulatory effect on MI makes it Byzantine-resilient and capable of solving BGPs in fully-decentralized settings. + +# ACKNOWLEDGMENTS + +This work was sponsored by the Office of Naval Research (ONR) under grant N00014-19-1-2076 and the Naval Research Lab (NRL) under the grant N00173-20-1-G009. + +# ETHICAL STATEMENT + +Our experiments show that theory of mind and cognitive hierarchy theory can be enabled for teams of cooperating robots to assist strategic reasoning. We note that our research could be applied for good or otherwise, particularly in an adversarial setting. Nonetheless, we believe democratizing this knowledge is for the benefit of society. + +# REPRODUCIBILITY STATEMENT + +We have taken several steps to ensure the reproducibility of our empirical results: we submitted, as a supplementary material, our source code for training and testing InfoPG and all the four baselines in all four domains. The source code is accompanied with a README with detailed instructions for running each file. We also publicized our source code in a public repository, available online at https://github.com/CORE-Robotics-Lab/InfoPG. Additionally, we have provided the details of our implementations for training and execution as well as the full hyperparameter lists for all methods, baselines, and experiments in the Appendix, Section A.9. For our theoretical results, we provide explanations of all assumptions made, including the uniformity of priors assumption in Appendix, Section A.6, and the assumptions made for convergence proof in Appendix, Section A.4. Finally, a complete proof of our introduced Theorems 2 and 3, as well as InfoPG's convergence proof and the full proof of Theorem 1, are provided in Sections 4.5-4.6 and, Appendix, Sections A.4-A.5 respectively. + +# REFERENCES + +Zeyuan Allen-Zhu, Faeze Ebrahimianghazani, Jerry Li, and Dan Alistarh. Byzantine-resilient nonconvex stochastic gradient descent. In International Conference on Learning Representations, 2020. +Christopher Amato, George Konidaris, Leslie P Kaelbling, and Jonathan P How. Modeling and planning with macro-actions in decentralized pomdps. Journal of Artificial Intelligence Research, 64:817-859, 2019. +Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pp. 41-48, 2009. +Shalabh Bhatnagar, Richard S Sutton, Mohammad Ghavamzadeh, and Mark Lee. Natural actor-critic algorithms. Automatica, 45(11):2471-2482, 2009. +Vivek S Borkar. Stochastic approximation with two time scales. Systems & Control Letters, 29(5): 291-294, 1997. +Colin F Camerer, Teck-Hua Ho, and Juin-Kuan Chong. A cognitive hierarchy model of games. The Quarterly Journal of Economics, 119(3):861-898, 2004. +Abhishek Das, Théophile Gervet, Joshua Romoff, Dhruv Batra, Devi Parikh, Michael Rabbat, and Joelle Pineau. Tarmac: Targeted multi-agent communication. arXiv, 2018. +Matthew Fellows, Anuj Mahajan, Tim GJ Rudner, and Shimon Whiteson. Virel: A variational inference framework for reinforcement learning. Advances in Neural Information Processing Systems, 32:7122-7136, 2019. +Jakob Foerster, Ioannis Alexandros Assael, Nando De Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In (NeurIPS), pp. 2137-2145, 2016. + +Jakob Foerster, Nantas Nardelli, Gregory Farquhar, Triantafyllos Afouras, Philip HS Torr, Pushmeet Kohli, and Shimon Whiteson. Stabilising experience replay for deep multi-agent reinforcement learning. In (ICML), pp. 1146-1155. PMLR, 2017. +Chris Frith and Uta Frith. Theory of mind. Current biology, 15(17):R644-R645, 2005. +Samuel J Gershman, Eric J Horvitz, and Joshua B Tenenbaum. Computational rationality: A converging paradigm for intelligence in brains, minds, and machines. Science, 349(6245):273-278, 2015. +Mohammad Ghavamzadeh and Sridhar Mahadevan. Learning to communicate and act using hierarchical reinforcement learning. Computer Science Department Faculty Publication Series, pp. 172, 2004. +Thomas Gilovich, Dale Griffin, and Daniel Kahneman. Heuristics and biases: The psychology of intuitive judgment. Cambridge university press, 2002. +Adam S Goodie, Prashant Doshi, and Diana L Young. Levels of theory-of-mind reasoning in competitive games. Journal of Behavioral Decision Making, 25(1):95-108, 2012. +Yue Guan, Dipankar Maity, Christopher M Kroninger, and Panagiotis Tsiotras. Bounded-rational pursuit-evasion games. In 2021 American Control Conference (ACC), pp. 3216-3221. IEEE, 2021. +Jayesh K Gupta, Maxim Egorov, and Mykel Kochenderfer. Cooperative multi-agent control using deep reinforcement learning. In International Conference on Autonomous Agents and Multiagent Systems, pp. 66-83. Springer, 2017. +Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In (ICML), pp. 1861-1870. PMLR, 2018. +Teck-Hua Ho and Xuanming Su. A dynamic level-k model in sequential games. Management Science, 59(2):452-469, 2013. +Natasha Jaques, Angeliki Lazaridou, Edward Hughes, Caglar Gulcehre, Pedro A. Ortega, DJ Strouse, Joel Z. Leibo, and Nando de Freitas. Social influence as intrinsic motivation for multi-agent deep reinforcement learning, 2019. +Daewoo Kim, Sangwoo Moon, David Hostallero, Wan Ju Kang, Taeyoung Lee, Kyunghwan Son, and Yung Yi. Learning to schedule communication in multi-agent reinforcement learning. arXiv, 2019. +Woojun Kim, Whiyoung Jung, Myungsik Cho, and Youngchul Sung. A maximum mutual information framework for multi-agent reinforcement learning. arXiv preprint arXiv:2006.02732, 2020. +Ilya Kostrikov, Kumar Krishna Agrawal, Debidatta Dwibedi, Sergey Levine, and Jonathan Tompson. Discriminator-actor-critic: Addressing sample inefficiency and reward bias in adversarial imitation learning. In International Conference on Learning Representations, 2018. +Alexander Kraskov, Harald Stögbauer, and Peter Grassberger. Estimating mutual information. Physical review E, 69(6):066138, 2004. +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. +Leslie Lamport, Robert Shostak, and Marshall Pease. The byzantine generals problem. In Concurrency: the Works of Leslie Lamport, pp. 203-226. 2019. +Yong Liu, Weixun Wang, Yujing Hu, Jianye Hao, Xingguo Chen, and Yang Gao. Multi-agent game abstraction via graph attention neural network. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 7211-7218, 2020. +NK Malakar, KH Knuth, and DJ Lary. Maximum joint entropy and information-based collaboration of automated learning machines. In AIP Conference Proceedings 31st, volume 1443, pp. 230-237. American Institute of Physics, 2012. + +Francisco S Melo, Matthijs TJ Spaan, and Stefan J Witwicki. Querypomdp: Pomdp-based communication in multiagent systems. In European Workshop on Multi-Agent Systems, pp. 189-204. Springer, 2011. +Roger B Myerson. Game theory. Harvard university press, 2013. +Rosemarie Nagel. Unraveling in guessing games: An experimental study. The American Economic Review, 85(5):1313-1326, 1995. +Frans A Oliehoek and Christopher Amato. A concise introduction to decentralized POMDPs. Springer, 2016. +Rohan Paleja, Muyleng Ghuy, Nadun Ranawaka Arachchige, Reed Jensen, and Matthew Gombolay. The utility of explainable ai in ad hoc human-machine teaming. Advances in Neural Information Processing Systems, 34, 2021. +Gregory Palmer, Karl Tuyls, Daan Bloembergen, and Rahul Savani. Lenient multi-agent deep reinforcement learning. arXiv, 2017. +Jie Peng, Weiyu Li, and Qing Ling. Byzantine-robust decentralized stochastic optimization over static and time-varying networks. Signal Processing, 183:108020, 2021. +Ben Poole, Sherjil Ozair, Aaron van den Oord, Alexander A. Alemi, and George Tucker. On variational bounds of mutual information, 2019. +Sudhakar Prasad. Bayesian error-based sequences of statistical information bounds. IEEE Transactions on Information theory, 61(9):5052-5062, 2015. +Jonathan J Ruel and Matthew P Ayres. Jensen's inequality predicts effects of environmental variation. Trends in Ecology & Evolution, 14(9):361-366, 1999. +E. Salas, T. Dickinson, Sharolyn A. Converse, and S. Tannenbaum. Toward an understanding of team performance and training. 1992. +Esmaeil Seraj and Matthew Gombolay. Coordinated control of uavs for human-centered active sensing of wildfires. In 2020 American Control Conference (ACC), pp. 1845-1852. IEEE, 2020. +Esmaeil Seraj, Andrew Silva, and Matthew Gombolay. Safe coordination of human-robot firefighting teams. arXiv preprint arXiv:1903.06847, 2019. +Esmaeil Seraj, Xiyang Wu, and Matthew Gombolay. *FireCommander: An Interactive, Probabilistic Multi-agent Environment for Joint Perception-Action Tasks-Presentation Slides*. PhD thesis, Georgia Institute of Technology, USA, 2020. +Esmaeil Seraj, Letian Chen, and Matthew C Gombolay. A hierarchical coordination framework for joint perception-action tasks in composite robot teams. IEEE Transactions on Robotics, 2021a. +Esmaeil Seraj, Zheyuan Wang, Rohan Paleja, Matthew Sklar, Anirudh Patel, and Matthew Gombolay. Heterogeneous graph attention networks for learning diverse communication. arXiv preprint arXiv:2108.09568, 2021b. +Herbert Alexander Simon. Models of bounded rationality: Empirically grounded economic reason, volume 3. MIT press, 1997. +Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In (NeurIPS), pp. 2244-2252, 2016. +Richard S Sutton. Temporal credit assignment in reinforcement learning. 1985. +Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. +Justin K Terry, Benjamin Black, Mario Jayakumar, Ananth Hari, Luis Santos, Clemens Dieffendahl, Niall L Williams, Yashas Lokesh, Ryan Sullivan, Caroline Horsch, and Praveen Ravi. Pettingzoo: Gym for multi-agent reinforcement learning. arXiv preprint arXiv:2009.14471, 2020. + +Gerald Tesauro. Temporal difference learning and td-gammon. Communications of the ACM, 38(3): 58-68, 1995. +Guliz Tokadli and Michael C. Dorneich. Interaction paradigms: from human-human teaming to human-autonomy teaming. (DASC), pp. 1-8, 2019. +Dari Trendafilov, Daniel Polani, and Roderick Murray-Smith. Model of coordination flow in remote collaborative interaction. In 2015 17th UKSim-AMSS International Conference on Modelling and Simulation (UKSim), pp. 361-366. IEEE, 2015. +John N Tsitsiklis and Benjamin Van Roy. An analysis of temporal-difference learning with function approximation. IEEE transactions on automatic control, 42(5):674-690, 1997. +Oriol Vinyals, Timo Ewalds, Sergey Bartunov, Petko Georgiev, Alexander Sasha Vezhnevets, Michelle Yeo, Alireza Makhzani, Heinrich Kuttler, John Agapiou, Julian Schrittwieser, et al. Starcraft ii: A new challenge for reinforcement learning. arXiv preprint arXiv:1708.04782, 2017. +Tonghan Wang, Jianhao Wang, Yi Wu, and Chongjie Zhang. Influence-based multi-agent exploration. CoRR, abs/1910.05512, 2019. URL http://arxiv.org/abs/1910.05512. +Ying Wen, Yaodong Yang, Rui Luo, Jun Wang, and Wei Pan. Probabilistic recursive reasoning for multi-agent reinforcement learning. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=rkl6As0cF7. +Ying Wen, Yaodong Yang, and Jun Wang. Modelling bounded rationality in multi-agent interactions by generalized recursive reasoning. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, pp. 414-421. International Joint Conferences on Artificial Intelligence Organization, 2020. +Jiachen Yang, Alireza Nakhaei, David Isele, Kikuo Fujimura, and Hongyuan Zha. Cm3: Cooperative multi-goal multi-stage multi-agent reinforcement learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=S11EX04tPr. +Kaiqing Zhang, Zhuoran Yang, Han Liu, Tong Zhang, and Tamer Basar. Fully decentralized multi-agent reinforcement learning with networked agents. In (ICML), pp. 5872-5881. PMLR, 2018. + +# A APPENDIX + +# A.1 INFOPG PSEUDOCODE + +Here, we provide a pseudocode to train our MI maximizing PG algorithm, InfoPG, in Algorithm 1. + +Algorithm 1: Training the Mutual Information Maximizing Policy Gradient (InfoPG). +1: Input: Number of agents, $\mathcal{N}$ , max_cycles and agents' level of iterated rationalizability, $K$ +2: Initialize: For all agents $\{\pi_{tot}^{1},\pi_{tot}^{2},\dots,\pi_{tot}^{\mathcal{N}}\}$ and $\{V^{1},V^{2},\dots,V^{\mathcal{N}}\}$ +3: while not converged do +4: for $t = 1$ to max_cycles do +5: Reset environment and receive initial observation set: $\{o_t^1,o_t^2,\dots,o_t^\mathcal{N}\}$ +6: for $i = 1$ to $\mathcal{N}$ do +7: Sample initial "guess" action: $a_{t}^{i,(0)}\sim \pi_{enc}^{i}(*|o_{t}^{i})$ , where $\pi_{enc}^{i}\in \pi_{tot}^{i}$ +8: end for +9: for $k = 1$ to $K$ do +10: for $i = 1$ to $\mathcal{N}$ do +11: Identify neighbors by obtaining neighbor list, $j\in \Delta_t^i$ , using the adjacency graph, $\mathcal{G}_t$ +12: Sample MAP: $a_{t}^{i,(k)}\sim \pi_{com}^{i}(*|a_{t}^{i,(k - 1)},\{a_{t}^{j,(k - 1)}|j\in \Delta_t^i\})$ , where $\pi_{com}^{i}\in \pi_{tot}^{i}$ +13: end for +14: end for +15: Step through environment using $\{a_{t}^{1,(k)},a_{t}^{2,(k)},\dots,a_{t}^{\mathcal{N},(k)}\}$ , and receive next states and rewards: $\{o_{t + 1}^{1},o_{t + 1}^{2},\dots,o_{t + 1}^{\mathcal{N}}\}$ , $\{r_t^1,r_t^2,\dots,r_t^\mathcal{N}\}$ +16: for $i = 1$ to $\mathcal{N}$ do +17: $A_{t}^{i} = r_{t}^{i} + V^{i}(o_{t + 1}^{i}) - V^{i}(o_{t}^{i})$ +18: $\nabla \pi_{tot}^{i} = \mathrm{ReLU}(A_{t}^{i})\nabla \log (\pi_{tot}^{i}(a_{t}^{i,(k)}|\dots))$ % For Adv. InfoPG remove the ReLU +19: $\nabla V^{i} = (A_{t}^{i})^{2}$ +20: Update: $\pi_{tot}^{i} = \pi_{tot}^{i} + \eta \nabla \pi_{tot}^{i}$ +21: Update: $V^{i} = V^{i} + \eta \nabla V^{i}$ +22: end for +23: $\{o_t^1,o_t^2,\dots,o_t^\mathcal{N}\} = \{o_{t + 1}^1,o_{t + 1}^2,\dots,o_{t + 1}^\mathcal{N}\}$ +24: end for +25: end while + +Consider a MAF-Dec-POMDP introduced in Section 3, with $N$ agents where each agent is equipped with an encoding and a communicative policy ( $\pi_{enc}$ and $\pi_{com}$ , respectively), such that $\pi_{tot} = [\pi_{enc}, \pi_{com}]$ (lines 1-2). At the beginning of a new rollout, and for each timestep, $t$ , within the allowed maximum number of steps, max_cycles, each agent $i$ receives a state observation $o_t^i$ from the environment and produces an initial "guess" action, $a_t^{i,(0)}$ using its encoding policy (lines 5-8). Each agent $i$ has a neighborhood of agents it can communicate with, shown with $j \in \Delta_t^i$ where $|\Delta_t^i|$ is the number of agent $i$ 's physical neighbors (i.e., within close proximity). Accordingly, agents obtain the list of their neighbors by using the adjacency graph, $\mathcal{G}_t$ (line 11). + +Next, depending on the specified level of iterated rationalizability in the decision hierarchy, $K$ , agents communicate their action guesses as higher-dimensional latent vector distributions with their neighbors $K$ times and update their action guess iteratively using their communicative policy (line 9-14). The level- $k$ action is then executed by all agents and a local reward is given to each agent separately (line 15). This process continues until either the environment is solved successfully, or the allowed maximum number of steps, max_cycles, has been attained. For each timestep, $t$ , of the policy rollout and for each agent $i$ , first the advantage value, $A_{t}^{i}$ , is computed using the critic network (line 17) and then, the gradient of the log probability is computed and scaled by the instantaneous advantage (line 18). Note that the ReLU function in line 18 is proposed to enforce the non-negative reward feedback condition in InfoPG, Eq. 3. However, other mechanisms could achieve the same effect (e.g., shaping the reward function to only include positive values). Line 19 is showing the gradient of our value estimate. The loss for our value estimate $V(s_{t})$ is the cumulative discounted rewards subtracted by the true value of $s_{t}$ , which is the advantage (the TD error). Therefore, the + +gradient in line 19 is the sum of squared individual advantages. Next, the encoding and communicative policies are updated (line 20) and eventually, the critic network is updated (line 21). This process repeats until convergence of the cumulative discounted rewards across all agents. We provide our code at https://github.com/CORE-Robotics-Lab/InfoPG + +# A.2 INFOPG FOR CONTINUOUS ACTION-SPACES + +To deploy InfoPG in continuous action-spaces, we follow common practice for continuous action-space actor-critic methods. Continuous policies are presented as probability distributions with floating values in a certain range (e.g., $(-1, 1)$ ). In this case, in order to facilitate exploration we will sample agents' actions from a normal probability distribution. As such, in continuous action-spaces, the policy network (Actor) will normally have two output heads, instead of one. The two outputs of the policy network are $\mu$ and $\sigma$ , the mean and standard deviation (STD) of the probability distribution, respectively. The sampled actions will be centered around the $\mu$ and the $\sigma$ determines on average, how far from the center the sample values will be. As the network gets more certain, the $\sigma$ gets smaller, meaning that we tend to exploit good actions rather than exploring. + +In discrete action-spaces the loss-function was based on the log-probability (Eq. 3). In continuous action-spaces, the log-probability of a normal distribution is used, as shown in Eq. 14. + +$$ +\log_ {\pi_ {\theta}} (a | s) = - \frac {(x - \mu) ^ {2}}{2 \sigma^ {2}} - \log \sqrt {2 \pi \sigma^ {2}} \tag {14} +$$ + +In Eq. 14, the first and second term are the negative log-probability and the entropy bonus, respectively. By substituting the log-probability of the normal distribution in Eq. 14 back into the original InfoPG objective in Eq. 2, we can directly deploy the InfoPG objectives in continuous domains, such as the introduced Multiwalker (Section 5). Note that, in practice and for simplicity, the policy network can only output the mean value, $\mu$ , while the STD value is fixed to a reasonable constant. Finally, to compute the MAP action for a continuous action-space (Line 12 in Algorithm 1) we note that, theoretically, the MAP action for a continuous space is just the mean action without any standard deviation from the normal distribution. + +# A.3 INFOPG OBJECTIVE FUNCTION DERIVATION (EQ. 2) + +The InfoPG definition as presented in Eq. 2 consists of a summation across all agents within the communication range. This equation is a simplification from the original form which uses the assumption of independence between each agents' $(k - 1)$ -level action probability distributions. To arrive at the InfoPG objective function in Eq. 2, we start from Eq. 15 and convert the log probability of the conditional distributions across all neighbors to a summation of log probability across all neighbors. The process can be shown as in Eq. 15-17. + +$$ +\begin{array}{l} \nabla_ {\theta} ^ {\text {I n f o P G}} J (\theta) = \mathbb {E} _ {\pi_ {t o t} ^ {i}} \left[ G _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) \nabla_ {\theta} \log \left(\pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} \mid \forall_ {0 \rightarrow k} \forall_ {j \in \Delta_ {t} ^ {i}} \left[ a _ {t} ^ {i, (k - 1)}, a _ {t} ^ {j, (k - 1)} \right], o _ {t} ^ {i}\right)\right)\right] (15) \\ = \mathbb {E} _ {\pi_ {t o t} ^ {i}} \left[ G _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) \nabla_ {\theta} \log \left(\prod_ {0 \rightarrow k} \prod_ {j \in \Delta_ {t} ^ {i}} \pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {i, (k - 1)}, a _ {t} ^ {j, (k - 1)}, o _ {t} ^ {i}\right)\right)\right] (16) \\ = \mathbb {E} _ {\pi_ {t o t} ^ {i}} \left[ G _ {t} ^ {i} \left(o _ {t} ^ {i}, a _ {t} ^ {i}\right) \sum_ {j \in \Delta_ {t} ^ {i}} \nabla_ {\theta} \log \left(\pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {i, (k - 1)}, a _ {t} ^ {j, (k - 1)}, \dots , a _ {t} ^ {i, (0)}, a _ {t} ^ {j, (0)}, o _ {t} ^ {i}\right)\right) \right] (17) \\ \end{array} +$$ + +# A.4 CONVERGENCE PROOF SKETCH FOR EQ.2 + +Following the approach in prior work (Bhatnagar et al., 2009; Zhang et al., 2018), we present a convergence proof sketch for InfoPG through the Two-Time-Scale (TTS) stochastic approximation method, proposed by Borkar (1997). We note that the convergence proof for InfoPG closely follows the general Policy Gradients (PG) convergence approach presented in Bhatnagar et al. (2009) and Zhang et al. (2018), and we therefore only focus on presenting the core idea underlying convergence of InfoPG with $k$ -level rationalizability. Herein, we state that since InfoPG and Consensus Update (CU) share the graph-based local communication and the fully-decentralized actor-critic training paradigm, all assumptions made by Zhang et al. (2018) also apply to our work and therefore, we + +directly adopt the set of assumptions (i.e., specifically, assumptions 4.1 - 4.4) presented in Zhang et al. (2018) without restating them. + +For an actor-critic algorithm, e.g. InfoPG, showing convergence of both the actor and critic simultaneously is challenging because the noisy performance of the actor can affect the gradient on the critic and vice versa. As such, we leverage the TTS approach, which states that in PG methods, the actor learns at a slower rate than the critic (Borkar, 1997). Therefore, according to TTS, we can show the convergence of InfoPG in two steps: (1) first, we fix the policy and analyze the convergence of the critic and, (2) with a converged critic, we analyze the convergence of the actor. + +Step 1: Critic Convergence - We use bar notation in the following to denote vectorized quantities across agents in the environment such that, $\bar{\pi}_{\theta} = [\pi_{\theta}^{1},\dots ,\pi_{\theta}^{N}]$ , where $N$ is the number of agents. Moreover, a level- $k$ policy in InfoPG includes two parts: a state-conditional policy at level $k = 0$ and an action-conditional policy for higher levels of $k$ . InfoPG first applies the level zero state-conditional policy to get the initial "guess" action and then recursively applies the action-conditional policy $k$ times to recursively improve the level- $k$ action-decision. We can show this process as $\pi_{\theta}^{i} = \pi_{\theta}^{i,(k\geq 0)}\left(\pi_{\theta}^{i,(k = 0)}(s_{t}^{i})\right)$ . PG seeks to maximize the objective function $\bar{J} (\theta)$ , shown in Eq. 18, where $\bar{d}_{\pi}(\bar{s}_t)$ denotes the stationary distribution of the MDP and $\bar{R}$ denotes the joint reward function, including local rewards for each agent. Additionally, we denote the transition probability of the MDP as $\bar{p} (\bar{s}_{t + 1},\bar{r}_{t + 1}| \bar{s}_t,\bar{a}_t)$ . Since the formulation of PG objective in Eq. 18 is biased, it is commonly replaced with the unbiased estimate of the rewards, or $\bar{Q} (\bar{s}_t,\bar{a}_t) - \bar{V} (\bar{s}_t,\bar{a}_t)$ , as shown in Eq. 19 + +$$ +\begin{array}{l} \bar {J} (\theta) = \sum_ {\bar {s} _ {t} \in \bar {\mathcal {S}}} \bar {d} _ {\pi} (s) \sum_ {\bar {a} _ {t} \in \bar {\mathcal {A}}} \bar {\pi} _ {\theta} \left(\bar {a} _ {t} \mid \bar {s} _ {t}\right) * \bar {R} \left(\bar {s} _ {t}, \bar {a} _ {t}\right) (18) \\ = \sum_ {\bar {s} _ {t} \in \bar {S}} \bar {d} _ {\pi} (s) \sum_ {\bar {a} _ {t} \in \bar {\mathcal {A}}} \bar {\pi} _ {\theta} (\bar {a} _ {t} | \bar {s} _ {t}) * (\bar {Q} (\bar {s} _ {t}, \bar {a} _ {t}) - \bar {V} (\bar {s} _ {t})) (19) \\ \end{array} +$$ + +The unbiased estimator in Eq. 19 can be replaced with the state-value function by using the recursive definition of the action-value function (Sutton & Barto, 2018). This substitution results in a form known as the TD-error (Sutton, 1985), where the bracketed term in Eq. 21 is the TD-error. + +$$ +\bar {Q} \left(\bar {s} _ {t}, \bar {a} _ {t}\right) = \underset {\bar {s} _ {t} \sim \bar {d} _ {\pi} \bar {a} _ {t} \sim \bar {\pi} _ {\theta}} {\mathbb {E}} \left[ \bar {R} \left(\bar {s} _ {t}, \bar {a} _ {t}\right) + \gamma \bar {V} \left(\bar {s} _ {t + 1}\right) \right] \tag {20} +$$ + +$$ +\bar {J} (\theta) = \sum_ {\bar {s} _ {t} \in \mathcal {S}} \bar {d} _ {\pi} (s) \sum_ {\bar {a} _ {t} \in \bar {\mathcal {A}}} \bar {\pi} _ {\theta} (\bar {a} _ {t} | \bar {s} _ {t}) * \left[ \bar {R} (\bar {s} _ {t}, \bar {a} _ {t}) + \gamma \sum_ {\bar {s} _ {t + 1} \in \bar {\mathcal {S}}} \bar {p} (\bar {s} _ {t + 1} | \bar {s} _ {t}, \bar {a} _ {t}) \bar {V} (\bar {s} _ {t + 1}) - \bar {V} (\bar {s} _ {t}) \right] \tag {21} +$$ + +Next, following the prior work (Bhatnagar et al., 2009; Zhang et al., 2018), we assume linear function approximation since the TD-learning-based policy evaluation may fail to converge with nonlinear function approximation (Tsitsiklis & Van Roy, 1997; Zhang et al., 2018). We note that the value function is a mapping of states (of some dimensionality) to $\mathcal{R}$ . Therefore, we define $\bar{V}(\bar{s}_t) = \bar{\omega}^T\phi(\bar{s}_t)$ , where $\bar{\omega}$ is a one-dimensional weight vector and $\phi(\bar{s}_t)$ is a feature map that transforms the state vector to $\mathcal{R}^K$ : $\phi(\bar{s}_t) = [\bar{\phi}_1(\bar{s}_t), \dots, \bar{\phi}_K(\bar{s}_t)]$ . Now, following Bhatnagar et al. (2009), we define the Ordinary Differential Equation (ODE) associated with the recursive update of $\bar{\omega}$ via Eq. 22, which then can be simplified to Eq. 23 using a matrix notation described in the following. + +$$ +\dot {\bar {\omega}} = \sum_ {\bar {s} _ {t} \in \bar {\mathcal {S}}} \bar {d} _ {\pi} (s) \sum_ {\bar {a} _ {t} \in \bar {\mathcal {A}}} \bar {\pi} _ {\theta} (\bar {a} _ {t} | \bar {s} _ {t}) * \left[ \bar {R} (\bar {s} _ {t}, \bar {a} _ {t}) + \gamma \sum_ {\bar {s} _ {t + 1} \in \bar {\mathcal {S}}} \bar {p} (\bar {s} _ {t + 1} | \bar {s} _ {t}, \bar {a} _ {t}) \bar {\omega} ^ {T} \phi (\bar {s} _ {t} + 1) - \bar {\omega} ^ {T} \phi (\bar {s} _ {t}) \right] \tag {22} +$$ + +$$ +\dot {\bar {\omega}} = \Phi^ {T} D [ T (\Phi \bar {\omega}) - \Phi (\bar {\omega}) ] \tag {23} +$$ + +Finding the asymptotic equilibrium of the critic, $\omega$ is equivalent to solving the above equation, when $\dot{\omega} = 0$ , which is simplified when switching to matrix vector notation described below: + +1. $D \in \mathbb{R}^{|\bar{S}| \times |\bar{S}|}$ is a diagonal matrix with $\bar{d}_{\pi}(\bar{s}_t)$ for all $\bar{s}_t \in \bar{S}$ as its elements. +2. $P \in \mathbb{R}^{|S| \times |\bar{S}| |\bar{A}|$ is the probability matrix where $\bar{p}(\bar{s}_{t+1} | \bar{s}_t, \bar{a}_t) \bar{\pi}_\theta(\bar{s}_t | \bar{a}_t)$ represents an individual element. + +3. $\Phi \in \mathbb{R}^{|\bar{S} | \times \bar{K}}$ is the feature map whose rows are $\phi (\bar{s}_t)$ for all $\bar{s}_t \in \bar{S}$ . +4. $R\in \mathbb{R}^{|\bar{S} |\times |\bar{A}|}$ is a matrix where $\bar{R} (\bar{s}_t,\bar{a}_t)$ represents an individual element. +5. $\Omega \in \mathbb{R}^{|\bar{K} | \times |\bar{K} |}$ is a diagonal matrix with discount factor $\gamma$ as its elements. +6. $T: \mathbb{R}^N \to \mathbb{R}^N$ is an operator which is a mapping of the form: $T(\bar{\omega}) = R + P\Omega \bar{\omega}$ . + +Next, following Zhang et al. (2018), we make two assumptions that apply to InfoPG and are essential to the rest of the convergence proof presented in the following. + +Assumption 1 - The update of the policy parameter $\theta$ includes a local projection operator, $\Gamma : \mathbb{R}^N \to \chi \subset \mathbb{R}^N$ , that projects any $\theta$ onto the compact set $\chi$ . Also, we assume that $\chi$ is large enough to include at least one local minimum of $\bar{J}(\theta)$ . + +Assumption 2 - The instantaneous reward $r_t^i$ is uniformly bounded for any $i \in \mathcal{N}$ and $t \geq 0$ . We note that the reward boundedness assumption is rather mild and is in accordance with prior work (Zhang et al., 2018). + +In analogous matrix-vector notation, and under the aforementioned assumptions made above and by Zhang et al. (2018), for a static policy in the TTS convergence setting, the $\lim_{t\to \infty}\bar{\omega} = \bar{\omega}^{\star}$ almost surely, where $\bar{\omega}^{\star}$ satisfies the equilibrium constraint $\dot{\bar{\omega}} = 0$ shown below. We note the solution seen below satisfies a similar convergence equation as seen in Bhatnagar et al. (2009). + +$$ +\begin{array}{l} \dot {\bar {\omega}} = \Phi^ {T} D \left[ T \left(\Phi \bar {\omega} ^ {\star}\right) - \Phi \left(\bar {\omega} ^ {\star}\right) \right] = 0 (24) \\ = \Phi^ {T} D T (\Phi \bar {\omega} ^ {\star}) = \Phi^ {T} D \Phi (\bar {\omega} ^ {\star}) (25) \\ \end{array} +$$ + +The above ODE explains the rate of change of the critic, and when the derivative reaches zero, the critic has reached a stable equilibrium, and therefore, has converged. + +Step 2: Actor Convergence - According to the TTS (Borkar, 1997), for the actor step, we assume a fixed, converged critic and show a stabilized equilibrium of the policy. We assume there exists an operator, $\Gamma$ , which projects any vector $x \in \mathcal{R}^N \to \chi \subset \mathcal{R}^N$ , where $\chi$ represents a compact set bounded by a simplex in $\mathcal{R}^N$ . The use of this projection is critical to the convergence of stochastic TTS algorithms as stated by Bhatnagar et al. (2009); Zhang et al. (2018), since policies that exist outside of the set can cause unstable equilibrium. Empirically, we apply the compactness of the set of policy gradients by defining a maximum gradient norm, as stated in A.8. In Eq. 26, we define the $\Gamma$ operator for the vector field $x(.) \in \theta$ , which is assumed to be a continuous function. + +$$ +\hat {\Gamma} (x (y)) = \lim _ {0 \leq \eta \rightarrow 0} \frac {\Gamma (y + \eta x (y)) - y}{\eta} \tag {26} +$$ + +If the above limit does not converge to a singular value, we state $\hat{\Gamma} (x(y))$ results in a set of convergent points. With this notation we state the ODE of the policy, after being projected onto a compact set, and note that given the assumptions made above and by Zhang et al. (2018), PG almost surely moves $\bar{\theta}$ to an asymptotically stable equilibrium that satisfies the below Eq. 27. This proof analogy closely follows the single-agent convergence proofs presented in Bhatnagar et al. (2009) and Tsitsiklis & Van Roy (1997). Nevertheless, in our work, convergence to a stationary point for all agents is the goal. While the TTS approach assumes the critic to have converged, the critic does not need to be a perfect estimator. With small approximation error, Bhatnagar et al. (2009) proves that the below equation still converges within the neighborhood of the optimal concatenated, joint policies for all agents. The below ODE defines the derivative of the policy over time, and as the derivative approaches zero, the actor reaches a stable equilibrium (or a set of equilibrium points, since in a fully decentralized setting, the actor is a vector of joint policies for all agents, as described in Section 3) and thus, convergence of the actor is achieved. + +$$ +\dot {\bar {\theta}} = \mathbb {E} _ {\bar {s} _ {t} \sim \bar {d} _ {\pi}, \bar {a} _ {t} \sim \bar {\pi} _ {\theta}} \left[ \nabla \log (\bar {\pi} _ {\theta}) * (\bar {Q} (\bar {s} _ {t}, \bar {a} _ {t}) - \bar {V} (\bar {s} _ {t})) \right] = 0 \tag {27} +$$ + +# A.5 FULL PROOF OF THEOREM 1 + +Here, we derive the full proof of the Bayesian expansion of the policy (Theorem 1). As mentioned before, given the Bayesian nature of the $k$ -level hierarchy, actions conceived at similar levels of $k$ can be reasonably assumed to be independent. Without loss of generality, we assume a scenario + +with two cooperating agents $i$ and $j$ both with $k$ levels of rationalization. An important notational difference that will be used here is $p(\cdot)$ . Policies are conventionally considered state-conditional distributions of actions, where the action is the random variable. A specific action is usually either sampled from the distribution or the MAP action is selected. Here, we denote $p(X)$ to refer to the probability distribution of a particular random variable $X$ . Note that, evaluating $p(X = x)$ returns the specific probability that $X = x$ (and not a distribution). In the following, we seek to determine the distribution of actions, for $i$ , at each level $k$ using $p(\cdot)$ notation. This is determined by marginalizing the level- $k$ action of agent $i$ across any specific action that $i$ or $j$ might take, which will be denoted as $x$ and $y$ respectively. Additionally, a specific observation in the observation space will be denoted as $z$ . Accordingly, we can represent the probability of action $a$ for agent $i$ at time $t$ across levels of rationalization, $k \in \{0, 1, \dots, K\}$ as shown in Equations 28-30. + +$$ +p \left(a _ {t} ^ {i, (0)}\right) = \sum_ {z \in \mathcal {S}} p \left(a _ {t} ^ {i, (0)} \mid o _ {t} ^ {i} = z\right) p \left(o _ {t} ^ {i} = z\right) \tag {28} +$$ + +$$ +p \left(a _ {t} ^ {i, (1)}\right) = \sum_ {x \in \mathcal {A}} \sum_ {y \in \mathcal {A}} p \left(a _ {t} ^ {i, (1)} \mid a _ {t} ^ {i, (0)} = x, a _ {t} ^ {j, (0)} = y\right) p \left(a _ {t} ^ {i, (0)} = x, a _ {t} ^ {j, (0)} = y\right) \tag {29} +$$ + +\* + +$$ +p \left(a _ {t} ^ {i, (k)}\right) = \sum_ {x \in \mathcal {A}} \sum_ {y \in \mathcal {A}} p \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y\right) p \left(a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y\right) \tag {30} +$$ + +At each level $k \geq 1$ , the probabilities of actions are directly proportional to the probabilities of $i$ 's and $j$ 's actions at level $k - 1$ actions. Next, we can re-arrange the following Bayes' rule, from Eq.31 to Eq.32, to determine the probability of the joint distribution of the priors $p(a_{t}^{i,(k - 1)}, a_{t}^{j,(k - 1)})$ : + +$$ +p \left(a _ {t} ^ {j, (k)} \mid a _ {t} ^ {i, (k - 1)}, a _ {t} ^ {j, (k - 1)}\right) = \frac {p \left(a _ {t} ^ {i , (k - 1)} , a _ {t} ^ {j , (k - 1)} \mid a _ {t} ^ {j , (k)}\right) p \left(a _ {t} ^ {j , (k)}\right)}{p \left(a _ {t} ^ {i , (k - 1)} , a _ {t} ^ {j , (k - 1)}\right)} \tag {31} +$$ + +$$ +p \left(a _ {t} ^ {i, (k - 1)}, a _ {t} ^ {j, (k - 1)}\right) = \frac {p \left(a _ {t} ^ {i , (k - 1)} , a _ {t} ^ {j , (k - 1)} \mid a _ {t} ^ {j , (k)}\right) p \left(a _ {t} ^ {j , (k)}\right)}{p \left(a _ {t} ^ {j , (k)} \mid a _ {t} ^ {i , (k - 1)} , a _ {t} ^ {j , (k - 1)}\right)} \tag {32} +$$ + +Eq. 32 can be substituted back into the joint probability of the priors, $p(a_{t}^{i,(k-1)}, a_{t}^{j,(k-1)})$ in Eq. 30: + +$$ +p (a _ {t} ^ {i, (k)}) = \sum_ {x \in \mathcal {A}} \sum_ {y \in \mathcal {A}} p (a _ {t} ^ {i, (k)} \mid a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y) p ( +$$ + +$$ +a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y \mid a _ {t} ^ {j, (k)}) \frac {p \left(a _ {t} ^ {j , (k)}\right)}{p \left(a _ {t} ^ {j , (k)} \mid a _ {t} ^ {i , (k - 1)} = x , a _ {t} ^ {j , (k - 1)} = y\right)} \tag {33} +$$ + +Now, we move the term $p(a_{t}^{j,(k)})$ outside the summations, as it does not depend on the marginalization, and multiply both the numerator and denominator in Eq. 33 by the joint probability of the priors, $p(a_{t}^{i,(k-1)} = x, a_{t}^{j,(k-1)} = y)$ , to arrive at Eq. 34: + +$$ +p \left(a _ {t} ^ {i, (k)}\right) = p \left(a _ {t} ^ {j, (k)}\right) \sum_ {x \in \mathcal {A}} \sum_ {y \in \mathcal {A}} p \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y\right) p (\sum_ {x \in \mathcal {A}} \sum_ {y \in \mathcal {A}} p \left(a _ {t} ^ {i, (k)}\right) = x, +$$ + +$$ +a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y \mid a _ {t} ^ {j, (k)}) \frac {p \left(a _ {t} ^ {i , (k - 1)} = x , a _ {t} ^ {j , (k - 1)} = y\right)}{p \left(a _ {t} ^ {j , (k)} \mid a _ {t} ^ {i , (k - 1)} = x , a _ {t} ^ {j , (k - 1)} = y\right) p \left(a _ {t} ^ {i , (k - 1)} = x , a _ {t} ^ {j , (k - 1)} = y\right)} \tag {34} +$$ + +Next, by simplification of the denominator we arrive at: + +$$ +p \left(a _ {t} ^ {i, (k)}\right) = p \left(a _ {t} ^ {j, (k)}\right) \sum_ {x \in \mathcal {A}} \sum_ {y \in \mathcal {A}} p \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y\right) p (\left(a _ {t} ^ {i, (k)}\right) +$$ + +$$ +a _ {t} ^ {i, (k - 1)} = x, a _ {t} ^ {j, (k - 1)} = y \mid a _ {t} ^ {j, (k)}) \frac {p \left(a _ {t} ^ {i , (k - 1)} = x , a _ {t} ^ {j , (k - 1)} = y\right)}{p \left(a _ {t} ^ {j , (k)}, a _ {t} ^ {i , (k - 1)} = x , a _ {t} ^ {j , (k - 1)} = y\right)} \tag {35} +$$ + +To simplify Eq.35, we first consider the transitivity of conditionals for the first two terms inside the summations. Note that, for a specific Bayes' tree in the form of our information graph shown in Fig. 1, we can write $\sum_{x\in \mathcal{A}}\sum_{y\in \mathcal{A}}p(a_t^{i,(k)}\mid a_t^{i,(k - 1)},a_t^{j,(k - 1)})p(a_t^{i,(k - 1)},a_t^{j,(k - 1)}\mid a_t^{j,(k)}) = p(a_t^{i,(k)}\mid a_t^{j,(k)})$ . Next, considering the summations, we marginalize both the numerator and the denominator in Eq. 35 across the joint action space. Accordingly, the numerator will simplify to 1 since we are summing the probabilities for all actions. Also, the marginalization across the joint action space to the denominator is simplified to $p(a_t^{j,(k)},a_t^{i,(k - 1)},a_t^{j,(k - 1)}) = p(a_t^{j,(k)})$ . As such, by substituting these simplifications in Eq. 35, we arrive at Eq. 36. + +$$ +p \left(a _ {t} ^ {i, (k)}\right) = \frac {p \left(a _ {t} ^ {j , (k)}\right)}{p \left(a _ {t} ^ {j , (k)}\right)} p \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {j, (k)}\right) = p \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {j, (k)}\right) \tag {36} +$$ + +In this form, we join parallels between $p(a_{t}^{i,(k)})$ and $\pi_{tot}^i (a_t^{i,(k)}\mid .)$ . The $\pi_{tot}^i (a_t^{i,(k)}\mid .)$ is the probability distribution of the k-level action $a_{t}^{i,(k)}$ , which according to the initial definition, is exactly the same as $p(a_{t}^{i,(k)})$ (same applies for $p(a_{t}^{j,(k)})$ ). Additionally, in the derivation of $p(a_{t}^{i,(k)}\mid a_{t}^{j,(k)})$ , we used $p(a_{t}^{j,(k)}\mid a_{t}^{i,(k-1)},a_{t}^{j,(k-1)})$ ; however, notice that this probability is exactly the same as $\pi_{com}^i (a_t^{j,(k)}\mid a_t^{i,(k-1)},a_t^{j,(k-1)})$ , therefore, we can make the following equivalences and substitutions for both agents $i$ and $j$ . + +$$ +\pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} \mid .\right) = p \left(a _ {t} ^ {i, (k)}\right) = \pi_ {c o m} ^ {i} \left(a _ {t} ^ {i, (k)} \mid a _ {t} ^ {j, (k)}\right) \tag {37} +$$ + +Now, considering that agent $i$ acted on its $k$ -level reasoning and executed the MAP action, the log probability and its gradient of the action-distribution at the $k$ -th level can be described as in Eq. 38-39: + +$$ +\log \left(\pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} = \mathrm {M A P} \mid .\right)\right) = \log \left(\pi_ {c o m} ^ {i} \left(a _ {t} ^ {i, (k)} = \mathrm {M A P} \mid a _ {t} ^ {j, (k)} = \mathrm {M A P}\right)\right) \tag {38} +$$ + +$$ +\nabla \log \left(\pi_ {t o t} ^ {i} \left(a _ {t} ^ {i, (k)} = \operatorname {M A P} \mid .\right)\right) = \nabla \log \left(\pi_ {c o m} ^ {i} \left(a _ {t} ^ {i, (k)} = \operatorname {M A P} \mid a _ {t} ^ {j, (k)} = \operatorname {M A P}\right)\right) \tag {39} +$$ + +As such, we arrive at the conclusion that was arrived upon near the end of Section 4.4: performing gradient ascent on $\pi_{tot}^{i}$ inherently increases $\pi_{com}^{i}(a_{t}^{i,(k)}\mid a_{t}^{j,(k)})$ . This fact is used to support the mutual information bounds derived in Theorems 2 and 3, and is valid for any $k\geq 1$ . + +# A.6 DISCUSSION ON THE UNIFORMITY OF PRIORS ASSUMPTION + +Similar assumption of uniform priors as ours in Section 4.5 have been used previously by Prasad (2015) for the calculation of MI upper-bound. In our work, we defined $p(a_{i})$ as a marginalization of the action-conditional policy, $\pi_{\text{com}}^{i}(a^{i}|a^{j})$ , across any potential $a^{j}$ . The marginal's conceptual meaning here is similar to asking the question, "What should the probability of $a^{i}$ be, if we did not know $a^{j}$ ?" For a given action-conditional policy, we could expect $a^{i}$ to be uniformly random because the action-conditional policy is expected to only change the probability of a selected action based on the $k$ -level reasoning with other agents. If there is no action to reason upon, the agent has no information with which to base its $k$ -th action upon. It is important to note here that $p(a^{i})$ is not a marginalization of both the state-conditional and action-conditional policies. Since $p(a^{i})$ is only a marginalization of the action-conditional policy, we view the uniformly-random prior assumption as a reasonable design choice. + +# A.7 SUPPLEMENTARY RESULTS + +In this section we provide our supplementary results. We start by analysing and interpreting agents' communicative policy in our fraudulent agent experiment in order to understand the effect of $k$ -level rationalization for decision-making in this scenario. Next, we present the agent-level performances for InfoPG and compare with the baselines in all three evaluation environments. Next, we present an scalability analysis in the Pistonball environment to investigate robustness to larger number of agents. Eventually, we conclude this section by presenting a list of takeaways. + +# A.7.1 POLICY INTERPRETATION FOR THE FRAUDULENT AGENT EXPERIMENT + +In this section, we present an analysis and interpretation of agents' communicative policy in our fraudulent agent experiment in order to understand the effect of $k$ -level rationalization for decision-making in this scenario. We test the learnt policy at convergence using Adv. InfoPG in the fraudulent + +![](images/a9107b017a63d0f7af4076e32e124be3426b28c679bba67e775948d04e530f43.jpg) + +![](images/1e54216a59afc6189e7c4a60d8f3a718551fbf7a8fb3dc62b67e40853cfdb408.jpg) +(a) Action distributions for pistons at $t = 0$ + +![](images/a352fddbdd37626487f0296878e8247f3e88d9c617736a993377261cceea8e18.jpg) + +![](images/469054ee1fbc1d60febd56d471260c65031231974d32d402248cb1adbe5d6d2d.jpg) + +![](images/6fd31bea52087327dec155ac93a16f9f3bc0dfa001b7ad163f8892cf1d2c121e.jpg) + +![](images/99ae8599cbd975b6c6e0fb8d37b10e84d2cd4b6f3a28dca0bcb38839194309c2.jpg) + +![](images/58ebc2bdbd44edcb9a7ae8acd7332584885f7db0e81c5bf6a80e6c148a634c4d.jpg) +(b) Action distributions for pistons at $t = 10$ + +![](images/cf81a5b9dfe1ac9d984c93a43e00f71e10fe071fd846a382510ed9c016d058fe.jpg) +(c) Action distributions for pistons at $t = 25$ + +![](images/5568f2e42392354017c89f7eee7cf618c1ce7a1f11b71314d2df54af7e80115a.jpg) + +![](images/f41caa81e080c326a8a330250c97677c36deca0fa6ebbe82c71766b7893bcbe6.jpg) + +![](images/427436d02f284029fbeac80e2da398640bb7b4a6d17f836f75d675445024ba66.jpg) + +![](images/c4c60618d4b41970733a456c57ea958ee8eab2685f1ae59a67c621b66d3c1b0e.jpg) +(d) Action distributions for pistons at $t = 32$ + +![](images/c779bfa7fce5cfde429413e166b6fec2926ccb47f9a9ef8a8eb906b2fb257acd.jpg) + +![](images/277826a3cfa703f014b6f58de15f4107ef8a7714cbb5a9f30822edf2ab7cbdac.jpg) + +![](images/3ec500e2dd78c6c8c7d0114c847c7bdf6502a578a9289dd35dfcce2ca6d8ef16.jpg) + +![](images/4c921d78ca3148c7cdcad5d8f8e992b747bba8f292cbe95b23d928c753ae85d1.jpg) + +![](images/daf0c18dd1f1129155edc3d200a26ffc640ca1a985f6866cc1df09d5eacaef89.jpg) +(e) Action distributions for pistons at $t = 37$ + +![](images/cabee5d44d6ef6a26f39da22f7ed679b0ea3a2026bc5915192e1864a4fc237b4.jpg) + +![](images/63a4871297ef7f68e5c2783f2cc601e90c01d6f5ae2f6145bca734bc6b6b229f.jpg) + +![](images/073158858ee208f37b4aa29beafd1048f524de200cb119a1e2fda65650bf3f5b.jpg) + +![](images/3422c1e72e06967446d6b80e0c8886e0b56b91c9d69b5f5058931dd4cfd3e1c1.jpg) + +![](images/99244b528e73de5cb8170ce982b4d63c3d98a061a893a9901d3d73790afe5d3e.jpg) +Figure 4: Action distributions of piston agents across 37 timesteps for the fraudulent agent experiment introduced in Section 6. Note that Piston 2 (not displayed) is the fraudulent agent with untrainable random policy. + +![](images/e2cf8b358cddbc5a38570bf91dac88b105573b88fb3324afe10702078790d1d3.jpg) + +![](images/1ffc85c0bf17387a5d03cab5211ead540a6e41b5d8211ecf4f902363ef090cef.jpg) + +![](images/8a89b74bc331a9c4fc750f9971cb0247ea8e666686370b1a1518409571e16a89.jpg) + +agent experiment, presented in Section 6. The results are shown in Figure 4 in which, we present the action distributions of agents before and after rationalizing their decisions with their neighbors through $k$ -level reasoning. For each action distribution graph, the Y-axis is the probability of an action and the X-axis represents actions, where $u = \text{move up}$ , $d = \text{move down}$ , and $s = \text{stay constant}$ . + +In Figure 4 we present sample illustrations of a test run in a BGP scenario for $t = 0, 10, 25, 32, 37$ , from start to the end of the episode. At $t = 0$ (Fig. 4a), we can see that the episode starts with the ball on top of the right-most pistons (i.e. pistons 3 and 4). Note that pistons are indexed left to right. With $k = 1$ reasoning, we show piston 3's rationalization for its action decision in three phases: first, $a^{p_3,(k=0)}$ , is the naive $k = 0$ action (blue); second, $a^{p_{2,3},(k=1)}$ , is the $k = 1$ rationalization that incorporates piston 2's random action (orange), and, third, $a^{p_{2,3,4},(k=1)}$ , is the $k = 1$ rationalization that incorporates both piston 2's random action and piston 4's $k = 0$ action into piston 3's $k = 1$ action decision (pink). Using a similar notation convention, $a^{p_{3,4},(k=1)}$ is piston 4's action rationalization given piston 3's $k = 0$ action rationalization. Now, notice that the spread of $a^{p_3,(k=0)}$ at $t = 0$ is relatively uniform (blue), and given that piston 2 is randomly moving, $a^{p_{2,3},(k=1)}$ remains unchanged (orange). This indicates piston 3 has learned to ignore piston 2, which is the fraudulent agent. Additionally, notice that $a^{p_4,(k=0)}$ at $t = 0$ is bimodal and has relatively equal probabilities of moving either up or down; however, we can see for both pistons 3 and 4, after rationalizing their actions with each other at $k = 1$ , both action distributions become unimodal and tend towards moving up, which is the desired action for moving the ball to left. + +This coordination demonstrates an interesting strategy; piston 3 and piston 4 have learned that coordinating actions with the randomly moving piston 2 is not desirable and therefore, they seek to move the ball as high as possible, and toss it over piston 2. Empirical proof of this behavior can be seen by the continuation of the spread of distributions at $t = 10$ . At $t = 25$ a distinct change occurs; piston 3's action distribution, after $k = 1$ rationalization with piston 4, becomes uniform again, while Piston 4 is still unimodal and tending up. We believe this behavior shows that piston 3 and 4 have realized the strategy to bypass piston 2 is to "launch" the ball over piston 2, which can be accomplished by piston 4 moving up, while piston 3 remains stable, effectively creating a leftward force for the ball to move left. At $t = 32$ we can see the "launching" is performed, and here the action distributions of both piston 3 and 4 become relatively uniform again (Note that actions of piston 3 and 4 do not matter at this point since they are not directly located under the ball and therefore, do not receive a reward for their actions). From $t = 32$ to $t = 37$ , the ball traverses over pistons 0 and 1; however, note that piston 0 and 1 will not need to move the ball too much, since the ball already has leftward momentum. Accordingly, piston 0 and 1 only need to coordinate to create a leftward ramp to facilitate ball's movement. As such, both piston 0 and piston 1 follow relatively uniform distributions after $k = 0$ and 1 rationalization. At $t = 37$ , the ball is over piston 0 and has reached the left wall, which denotes winning and end of the episode. + +In summary, we show two key behaviors learnt by agents through our Adv. InfoPG in the fraudulent agent experiment: 1) Piston 2 is untrustworthy and thus, coordinating with this agent is not desired, which leads to unchanged action-distributions for Pistons 3 and 1 after iterated $k$ -level reasoning with this fraudulent agent. 2) Pistons 3 and 4 learn to avoid the fraudulent agent (piston 2) by "launching" the ball over it, giving the ball a leftward momentum to reach the left wall. + +# A.7.2 A QUALITATIVE ANALYSIS FOR BOUNDED RATIONALITY + +The postulate of $k$ -level reasoning is that higher levels of $k$ should allow for deeper decision rationalization and therefore better strategies. In this section, we qualitatively investigate different examples of intelligent behavior induced by varying bounds of rationality. To address this, we specifically further investigate InfoPG's results in the MultiWalker and StarCraft II (SC2) domains due to their complex mechanics and multi-faceted objectives. In the following, we first present our qualitative analysis for SC2 and Multiwalker, respectively. + +SC2 – Our qualitative analysis in SC2 is a demonstration of how bounded rationality and higher levels of iterated reasoning benefits performance. In SC2, agents are positively rewarded for shooting and killing enemy agents, and are negatively penalized for getting shot at. Therefore, a locally optimal strategy is to run away from the enemy team to avoid any negative penalties, while a globally optimal strategy is to kill and eliminate all the enemy agents to achieve high positive rewards. + +![](images/d6dbc1365abb1742ce0d7cb21718afb1965981ea8f96b7c7b0a7fe3b4c4657f2.jpg) +Figure 5: Comparing the learned policies by InfoPG at convergence in the SC2 domain with $k = 0$ and $k = 1$ . With $k = 0$ (Fig. 5.1-5.3), the naive agents disregard other agents' actions and simply learn to run away to avoid the negative penalties of getting shot at. This is while the more sophisticated agents with $k = 1$ (Fig. 5.4-5.6), learn more strategic policies to work together to eliminate the enemy team and achieve high positive rewards. + +![](images/497f9cb2cef5136928375b5a3821c661c53d8c104f1c7e166901524aaecbe885.jpg) + +Fig. 5 shows our qualitative results for analyzing the effects of assuming bounded-rational agents and iterated reasoning in the SC2 domain. We compare the learned policies by InfoPG at convergence in the SC2 domain with $k = 0$ and $k = 1$ . + +At $k = 0$ of the rationalization hierarchy, the fully naive and non-strategic level-0 agents choose actions while completely disregarding other agents' actions (i.e., have zero-order beliefs). As such, for a level-0 policy, we expect to observe that agents simply run away from the enemy to avoid getting shot at, since a single agent does not believe (zero-order belief) it can overcome the enemy team. As seen in Fig. 5.1-5.3, the naive agents expectedly only learn to run away to avoid the negative penalties of getting shot at. This fleeing behavior allows agents to maintain a reward of zero, as shown in Fig. 2, indicating successful escape and convergence to the locally optimum solution. + +At level $k = 1$ , each agent is now more sophisticated and believes that the other agents have a level-0 policy and takes actions according to that. In this case, we observe a vastly different behavior. As shown in Fig. 5.4-5.6, agents here learn more strategic policies to work together to eliminate the enemy team and achieve high positive rewards. The agents begin a triangle-like formation towards the enemy (Fig. 5.4). Enemy agents then begin to shoot the closest opposing player at the front of the triangle formation. The other two agents in the team use this opportunity and start firing at the enemy team while they shoot the front-most agent. As such, the remaining two agents manage to kill and eliminate the enemy team. Through reasoning their level-1 actions based on their teammates level-0 action, InfoPG agents learn a sacrificial technique of exposing one agent as bait, which allows the agents to converge to the globally optimum solution of killing the entire enemy team. This is also reflected in Figure 2, where the $k = 1$ InfoPG achieves the highest cumulative rewards. + +Multiwalker - Our qualitative analysis in Multiwalker is another demonstration of how higher levels of iterated reasoning benefits performance. There are two objectives that the walkers need to satisfy: (1) stabilization (both the package and the walkers) and (2) moving forward. Stabilization of the package and the walkers are the primary goals, since dropping the package, or falling, results in failing the game with a penalty. Walking (i.e., moving forward to the right) is an additional goal, since every forward step yields a small proportional reward. Ultimately, the walkers should aim to achieve both stabilization and walking at the same time, which is the globally optimum solution. + +Fig. 6 shows our qualitative results for analyzing the effects of assuming bounded-rational agents and iterated reasoning in the Multiwalker domain. At level $k = 1$ , each walker believes that the other walker has only a level-0, non-rational policy. We observe in Fig. 6-(a) that, with InfoPG and by + +![](images/6f27baa5fdac264a0549d0fb31c07803defd3b02e664dae3b2f2727508e4d466.jpg) +(a) InfoPG, k=1 + +![](images/13601117a66db3e23b1ee409241422fbeb296b423ef21efed2f54c0094228de5.jpg) +(b) InfoPG, k=2 + +![](images/68644fcfd65c8f48dc3914513eaacae025b8c33bbf7d58ee48e945f2caccd82f.jpg) +(c) InfoPG, $k = 3$ +Figure 6: Comparing the learned policies by InfoPG in the Multiwalker with $k = 1$ , $k = 2$ , and $k = 3$ , Fig. 5a-5c, respectively. With $k = 1$ , agents only learn to perform a split to balance the package on top and avoid falling. This is while with $k = 3$ agents learn to quickly walk forward. The middle stage of rationalization, $k = 2$ , achieves an in-between policy where agents split to balance, but also wiggle forward slowly. + +$k = 1$ , the walkers solve only the stabilization problem by learning to do the "splits", which is a locally optimum solution. The walkers create a wide base with their legs and simply hold the package statically with no forward progress (evidenced by the starting red flag). This technique requires some degree of coordination since the walkers have to do the splits synchronously at the beginning of the experiment; however, this is not nearly a complex enough strategy to achieve any positive rewards. Looking at the reward convergence in Fig. 2, $k = 1$ achieves converges to the locally optimum solution and achieves a reward of 0, since the walkers do not get any positive reward for moving nor do they get any negative reward for dropping the package or falling. + +At level $k = 2$ , each walker now believes that the other walker has a level-1, bounded-rational policy. Intuitively, assuming a more sophisticated policy for a teammate should lead to a better overall strategy, since the best-response solution to such sophisticated policy needs a certain level of sophistication Gershman et al. (2015); Ho & Su (2013). We observe in Fig. 6-(b) that, as expected, the learned policies at level $k = 2$ of rationalization still includes performing the "splits" for balancing while agents also learned to wiggle forward slowly and receive some positive reward. + +As we increase the rationalization depth from $k = 3$ , we see in Fig. 6-(c) that the walkers not only stabilize the package, but also start moving forward (evidenced by the starting red flag out of frame) with much more sophisticated strategies. The left-most walker learns to generate forward momentum and walk more quickly than the front walker, which learns to walk more slowly and maintain the stability of the package. Note that this illustrates the idea of role allocation, which is a relatively complex strategy and indicative of higher levels of intelligence achieved through assuming sophisticated, level-2 teammates. The walkers learn to coordinate their movements, because if the left-most walker makes too jerky of a forward movement, the right-most walker adjusts by staying more static to stabilize the package. In Fig. 2, the collective strategy at $k = 3$ can achieve rewards as high as +10, which is the globally optimum solution. + +# A.7.3 SCALABILITY ANALYSIS: PISTONBALL + +Here, we investigate InfoPG's robustness to larger number of interacting agents in the Pistonball environment. For this experiment, We selected our best-performing model, Adv. InfoPG, and the best-performing baseline, MOA (Jaques et al., 2019), from our primary results in Section 6. We increased the number of agents from five to ten and kept the communication range to be the same (i.e., one piston on each side). The results are presented in Fig. 7. As shown, Adv. InfoPG outperforms MOA in both maximizing average individual and team reward performances during training. + +InfoPG considers two way communication with each of its neighbors (there are $|\Delta|$ neighbors which are communicated with $k$ times). If $\mathcal{D}$ is the dimension of the communicated $k$ -level action-vector, the bandwidth of input and output communication channels is $\Theta(2|\Delta|k\mathcal{D})$ , where each communication channel is $\Theta(|\Delta|k\mathcal{D})$ . We leave the choice of $|\Delta|, k$ , and $\mathcal{D}$ to be hyper-parameters, all of which can be lessened as the number of agents increase to inhibit computational complexity issues. + +# A.7.4 AGENT-WISE PERFORMANCE COMPARISON + +As mentioned, the objective in a fully decentralized domain is to maximize the average return by each individual agent, such that the obtained cumulative team reward is also maximized. We have show in + +![](images/fac0189c9c114c39786ff2e51e9c3cfd12d7f36be9426acafcdf844a45227431.jpg) + +![](images/8573f410d834a350fc63a8b4d318e82e8b83ac5f27605030633211456ce54e1b.jpg) + +![](images/196622a808a1ee4a0aebd83f283a75b9202432105f4423dc3d668461f97f245d.jpg) + +![](images/c90e73fb4f0b931d49e5fe587a983bdf7343000be5142174058dfb886efc04bf.jpg) + +![](images/73bc47c7e40dea5cd27eb98091ff599bc8ebf32e42b7518e63397d774950236d.jpg) + +![](images/6ff5e814c1909b37f1899a4b13cf0cadf046814ad72f7cf6e5d40c12c3f706a2.jpg) + +![](images/50d41ca14ffa2dcc592d005a3679ba57ac3450471cd17b7991df6bea0972489e.jpg) +Figure 7: Scalability comparison between Adv. InfoPG and the best-performing baseline, MOA (Jaques et al., 2019), in the Pistonball domain with ten interacting agents. Adv. InfoPG outperforms MOA in both maximizing average individual and team reward performances. + +![](images/80b6a326c39799e8f517f2c3a9447419d3c0445b0eed65d5685c62f626b1ea97.jpg) + +![](images/b6a96acbc349964757a5f2ec76ac52824304255e54feb2534c9d8c3d2d1287ef.jpg) + +![](images/b3e6d2348921583bce86d99d0316fd1bd3bfbb03beece3082a9d2426662e5ead.jpg) + +![](images/8e400654fc5b8497120059ef0e84384c2b221cf769a8fd420e85a6022fa5b4ef.jpg) + +our primary results in Section 6 that InfoPG outperforms all baselines across all three domains in achieving higher cumulative team reward. Here, we present the agent-level reward performances for InfoPG and compare with the baselines across three domains. The results are presented in Fig. 8, where sub-figures 8a-8d represent the individual agent performances in Co-op Pong, Pistonball, Multiwalker and StarCraft II (3M), respectively. As shown, our InfoPG and its MI-regularizing variant, Adv. InfoPG, continually outperform the other baselines in maximizing achieved individual rewards for agents. Specifically, in all graphs for Adv. InfoPG, all agents maximize individual rewards over time, and Adv. InfoPG achieves SOTA across all baselines. + +# A.8 EVALUATION ENVIRONMENTS: ADDITIONAL DETAILS AND PARAMETERS + +Here we provide additional details regarding the employed evaluation environments for training and testing InfoPG and cover the associated environment parameters related to our experiments. An instance of the four environments are presented in Fig. 9. + +1) Cooperative Pong (Co-op Pong) (Terry et al., 2020) – The objective in this game is to keep apong ball in play for as long as possible between two co-operating paddles. To fit the MAF-DecPOMDP paradigm, agents must receive individualistic rewards. In the Co-op Pong domain, each paddle receives a reward of $+1$ if it hits an incomingpong ball successfully and a penalty of $-1$ if it misses. The game ends either when a paddle misses or if max_cycles = 300 cycles have elapsed. Therefore, in order to continue receiving positive rewards of $+1$ , paddles are implicitly encouraged to cooperate to maximize their accumulated rewards. For an episode of the game, thepong ball was set to move at a velocity of $15[\frac{\text{pixels}}{\text{sec}}]$ while the paddles move slightly slower at $13[\frac{\text{pixels}}{\text{sec}}]$ . Since the ball moves faster than the paddles, the paddles require "forecasting" their intended position when thepong ball comes into their field-of-view (FOV), which is a $280 \times 240$ RGB image. An important facet of this environment is the time-delayed nature of the actions. Consider a scenario when the left-side + +![](images/75e8f70df3b0a9d359f91f5bdc66a5ddca01a5ee4a8488e044917240b45feefa.jpg) +(a) Individual agent performances in Co-op Pong. + +![](images/c96b6debee2c7bc764bb4fd1b64fd211f2bb802e3ea976ac34e3934608e41ebf.jpg) +(b) Individual agent performances in Pistonball. + +![](images/cf2b91d252269887a40efdf2b7cdbc09076422d8e57b1c265fb4be84106f920f.jpg) + +![](images/fb45960dc1fc85037d8e521886932348f496b8dee2b4bcc39e71edaae7bb68b4.jpg) + +![](images/330688181aecc73b64fb58080ab8c05bb79d2c2004157bf8a71344f494d7dde1.jpg) + +![](images/55e73f60c92ad181829d6995fa609b0df56e435bb8c0eb32d7d3eee80635e1c7.jpg) +(c) Individual agent performances in Multiwalker. + +![](images/3e9e9a841f7ed85c2df983aa87bfce282cf6c0d7386a152a3743fd87333d15b3.jpg) +(d) Individual agent performances in StarCraft II (3M). + +![](images/3eda21dd47aa461f5e2f12e81ae3065d178fd830c8b481b1b34198cf13a88395.jpg) + +![](images/edd70fd2a0dfd3420715f97bc1740d4549ecb0f0b92ab6924b553f558c8a9757.jpg) +Figure 8: Individual rewards obtained by each individual agents across episodes as training proceeds in the three evaluation environments. Our Adv. InfoPG continually outperforms all baselines (Wen et al., 2019; Jaques et al., 2019; Zhang et al., 2018; Sutton & Barto, 2018) across all domains. + +![](images/1d1449f24048e472f5b5bf6d0ca9c5de3f5c69f18fefb56dbcf23e3f550548bc.jpg) + +![](images/3bd097298ac6230159187c8c5d4d0615d6b8fd6a4425488ecad5954f3ea2d2a4.jpg) + +![](images/fb485dd3d47eaf4ea15658dec0e408fe341c84f1b4bc5ffadc750c9fcd66f2b5.jpg) +(a) Pistonball + +![](images/a54e7541465dec9d957a13c78152a1f1c99175029e909b07228abe9f2a44475c.jpg) +Figure 9: Instances of the utilized multi-agent cooperative environments. Domains are parts of the PettingZoo (Terry et al., 2020) MARL research library and can be accessed online at https://www.pettingzoo.ml/environments. The StarCraft II (Vinyals et al., 2017), can be accessed from Deepmind's repository available online at https://github.com/deepmind/pysc2. + +![](images/d4b7dbd9312e8d903c478c1b62b95e0d6c74444d961c7130ccca3614fe28df04.jpg) +(b) Co-op Pong + +![](images/9440b2dfec6bc787c512555ad6732d2079e3f093293fc64c2228172996d2d391.jpg) +(c) Multiwalker +(d) StarCraft II + +paddle hits the ball at $t_1$ ; this means that the right-side paddle will receive the ball at minimum, at $t_2 = t_1 + \frac{280}{15}$ . This measure is an underestimation, since the pong ball will not likely move in a straight line drive (i.e. it may hit the sides of the walls) but it illustrates the point that the action of the left-side paddle at $t_1$ is particularly relevant to the action of the right-side paddle at $t_2$ ; however, the action of the left-side paddle at $t_2$ is not particularly relevant to the right-side. + +Therefore, in our experiments, to account for the time-delay in the action information, a "hub" was designed where the action at the time of the last "hit" is shared to the opposing paddle, and a zero-vector otherwise. This procedure was applied for both InfoPG and MOA Jaques et al. (2019) as to fairly evaluate the communicative algorithms. In the case of MOA, the time-delayed action was sought to be "predicted" by the opposing paddle's model of agent. + +2) Pistonball (Terry et al., 2020) - The goal in the this environment is to move a ball from right side of the screen (e.g., right wall) to the left side of the screen (e.g., left wall) by activating/deactivating a team of five vertically moving piston agents. The ball has momentum in motion and is elastic. In order to encourage robustness, the ball was randomly placed on the pistons with a friction factor of 0.3, mass of 0.75, and a relatively high elasticity factor of 1.5. An episode of the game ends if agents move the ball to the left wall or after max_cycles = 200 cycles have elapsed. Each agent's observation is an RGB image of size $457 \times 120$ covering the two pistons (or the wall) around an agent and the space above them. Each piston receives an individual reward which is a combination of how much the corresponding agent directly contributed to moving the ball to left (i.e., with a value of $\mathcal{X}_t^{ball} - \mathcal{X}_{t-1}^{ball}$ , where $\mathcal{X}_t$ represents the center position of the ball along the X-axis at time $t$ ), and a negative time penalty of $-0.007$ per timestep. A piston is considered to be contributing directly to moving the ball to left, if it is directly below any part of the ball. Given the ball's radius of 20 pixels, at each timestep, three pistons can be directly under the ball. Agents win an episode of the game if they can coordinate efficiently to move the ball to the left wall within allowed maximum steps. +3) Multiwalker (Gupta et al., 2017; Terry et al., 2020) - The objective in this continuous-space environment is for a team of two bipedal robots to carry a heavy package cooperatively and walk as far right as possible. The weight of the package depends on its length which is determined by the number of agents. We note that, the two-agent case is the most challenging scenario in Multiwalker. Each robot exerts a variable force on two joints in its two legs, and therefore, the action-space is of dimension four with values in range $(-1,1)$ . The bipedal robots receive local rewards related to individual balance and stability of their hull. The reward function includes a reward of $+1$ for a scaled forward displacement of each bipedal robot's hull. We set the maximum number of allowed steps to max_cycles = 500 cycles, which would terminate at any point if a bipedal or the package falls. If a bipedal robot falls, it will individually receive a penalty of $-10$ , and, if the package falls on the ground, each bipedal receives a penalty of $-100$ . Each agent receives a 31-dimensional observation vector. The first 24 elements of the observation vector represent the bipedal robot's internal kinematics and the rest (i.e., elements 24-31) relate to LIDAR observations of the package position as well as the position of the adjacent bipedals. +4) StarCraft II (Vinyals et al., 2017) (The 3M (three marines vs. three marines) challenge) - The goal in this domain is for a team of three friendly marines to find, shoot, and kill three enemy marines as soon as possible, without dying or getting hit (Seraj et al., 2020; 2019). This domains is more challenging than the previous ones since the state-space is larger and the communication graph is time-varying. In this challenge, marines can move in four primitive directions and shoot an enemy + +marine within distance (i.e., multiple enemy marines can be in vision at once), and therefore, the action-space dimension is also larger than the previous domains. Agents get negatively rewarded when they are shot by enemy marines and are positively rewarded when shooting enemy marines. 3M presents a fundamentally more challenging environment than Pistonball, Multiwalker, and Pong, as the state space is much larger, and agents are allowed to move in 2D over a large gameplay arena. The action space is also larger (size 8) as agents can choose between: no action, moving in 4 directions, and shooting any one out of 3 enemy marines. Additionally, agents have a time-varying communication graph (different from the other domains), because friendly marines move in and out of the line of sight. + +# A.9 TRAINING AND EXECUTION DETAILS + +Under the MAF-Dec-POMDP paradigm, each agent $i \in \mathcal{N}$ is equipped with its own optimizer and policy $\pi_{tot}^{i}$ which consists of an encoding policy $\pi_{enc}^{i}$ and a communicative policy $\pi_{com}^{i}$ (each parameterized by $\theta^{i}$ ). The encoding policy can be represented using a feed-forward neural network, and the communicative policy can be represented by any class of Recurrent Neural Networks (RNNs), such as the Gated Recurrent Unit (GRU) or Long Short-Term Memory (LSTM). For computational efficiency, we chose to use a GRU or simplistic RNN architecture. + +Additionally, while we formally denote actions for level $k$ as $a_{t}^{i,(k-1)}$ , in execution we represent these actions as finite-dimensional vectors to maximize information during inference. The size of these vectors are known as policy latent size in the provided hyperparameter tables. This parameter (also shared by other baselines) refers to the size of the latent vector prior to the final Softmax output layer. During the encoding stage of InfoPG, each agent, $i$ , receives an observed state vector, $o_{i}^{t}$ , and encodes an action vector $a_{t}^{i,(0)}$ , using $\pi_{enc}^{i}$ . During $k$ -level communication, each agent receives the action vectors of neighboring agent $j \in \Delta_{t}^{i}$ from level $k-1$ and performs a forward-pass on the RNN, where the initial cell state is $a_{t}^{i,(k-1)}$ . The action probabilities for the discrete domains (i.e., Co-op Pong and Pistonball) are outputted by the feed-forward network where the last layer size is equal to the size of the action space and a Softmax activation. Note that for our continuous action-space domain, Multiwalker, the final Softmax activation function is replaced with the Tanh activation. Neighboring agents are determined using the adjacency graph $G_{t}$ , and a distance hyper-parameter specifying how "far" agent $i$ can communicate (i.e., communication range). $G_{t}$ is an undirected time-varying graph, and as agents perform actions and change their relative position (depending on the domain), the edges $\mathcal{E}_{t} \subseteq \{(i,j): i,j \in \mathcal{N}, i \neq j\}$ are updated for the next timestep. This process is carried out until convergence of the cumulative rewards of all $N$ agents. + +Specifics for Co-op Pong - The input observation in this domain, a $280 \times 240$ RGB image, contains information about where the pong ball exists in the FOV of each paddle. Since the ball is in motion, we found higher performance could be achieved by setting the observation at time, $t$ , to be the difference between the observation at $t$ and $t - 1$ . As such, we encoded the input observation to represent information about not just the position, but also the velocity of the ball. This procedure was maintained for all baselines. + +Another property we found critical to the performance of InfoPG agents in Co-op Pong was the type of RNN for $\pi_{com}^{i}$ . In Pong, rewards are rather sparse, since paddles only receive feedback when they hit or miss a ball, while in other times and when ball is traversing the screen (which is the majority of the time spent in the game) no feedback is received from the environment. Accordingly, we leveraged curriculum learning (Bengio et al., 2009) such that we let agents first learn the mechanics of hitting the pong ball and then, learn the benefit of communication. We achieved this behavior by using a simple RNN (we distinguish this with VRNN for Vanilla RNN) cell for $\pi_{com}^{i}$ , where the initial weight matrix $W_{ih}$ was set to the identity matrix and all other parameters were set to a small constant. This way, we effectively make the output of the $\pi_{com}^{i} = \pi_{enc}^{i}$ at the beginning episodes of training, while as time elapses, the weight matrix is optimized to incorporate actions from the neighboring paddle. + +Specifics for Pistonball - The agents each receive a $457 \times 120$ RGB image as their observation input. In order to minimize feature size, each observation was first cropped to a size of $224 \times 224$ , normalized and inputted into a pre-trained AlexNet model. AlexNet (Krizhevsky et al., 2012) is a CNN that takes in images and outputs probability scores of classes. In our experiments, we utilized the first four intermediate layers of AlexNet to produce rich feature observations to the input of the encoding policy. This procedure was applied to all baselines. + +Hardware Specifics - All experiments were conducted on an NVIDIA Quadro RTX 8000 with approximately 50 GB of Video Memory Capacity. + +Training Hyperparameters - We present the training hyperparameters in our implementations and experiments across methods and all three environments in Tables 2-6. + +Table 2: Co-op Pong Training Hyperparameters. + +
ExperimentsPong
InfoPGAdv InfoPGNC-A2CCUMOAPR2-AC
Learning Rate4e-44e-44e-44e-44e-44e-4
Size of Latent Vector303030303030
Type of Com. NetworkVRNNVRNN--GRU-
Epochs400040004000400040004000
MOA Loss Weight----0.1-
Discount Factor0.950.950.950.950.950.99
Batch Size161616161616
Max Gradient Norm101010101010
Replay Buffer Size-----1e5
Number of Particles-----16
+ +Table 3: Pistonball Training Hyperparameters. + +
ExperimentsPistonball
InfoPGAdv. InfoPGNC-A2CCUMOAPR2-AC
Learning Rate1e-31e-31e-31e-31e-31e-3
Size of Latent Vector202020202020
Type of Com. NetworkGRUGRU--GRU-
Epochs100010001000100010001000
MOA Loss Weight----1.0-
Discount Factor0.990.990.990.990.990.99
Batch Size444444
Max Gradient Norm0.750.750.750.750.754.0
Replay Buffer Size-----1e5
Number of Particles-----16
+ +Table 4: Multiwalker Training Hyperparameters. + +
ExperimentsMultiwalker
InfoPGAdv. InfoPGNC-A2CCUMOAPR2-AC
Learning Rate4e-44e-44e-44e-44e-44e-4
Size of Latent Vector303030303030
Type of Com. NetworkGRUGRU--GRU-
Epochs100010001000100010001000
MOA Loss Weight----0.1-
Discount Factor0.950.950.950.950.950.95
Batch Size161616161616
Max Gradient Norm555555
Replay Buffer Size-----1e5
Number of Particles-----16
+ +Table 5: StarCraft II Mini-game (The 3M Challenge) Training Hyperparameters. + +
ExperimentsStarCraft II (3M Challenge)
InfoPGAdv. InfoPGNC-A2CCUMOAPR2-AC
Learning Rate1e-41e-41e-41e-41e-41e-4
Size of Latent Vector505050505050
Type of Com. NetworkGRUGRU--GRU-
Epochs100010001000100010001000
MOA Loss Weight----0.1-
Discount Factor0.990.990.990.990.990.99
Batch Size646464646464
Max Gradient Norm666666
Replay Buffer Size-----1e5
Number of Particles-----16
+ +Table 6: Pistonball Training Hyperparameters for the fraudulent agent experiment. + +
ExperimentsFraud Pistonball
InfoPGAdv InfoPGMOA
Learning Rate1e-31e-31e-3
Size of Latent Vector202020
Type of Com. NetworkGRUGRUGRU
Epochs100010001000
MOA Loss Weight--1.0
Discount Factor0.990.990.99
Batch Size222
Max Gradient Norm0.50.50.5
\ No newline at end of file diff --git a/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/images.zip b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..35944d1f2124dda604071a5bdf118fa1b9551d46 --- /dev/null +++ b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc6c797fb0681daad50b2f92f2b45612c440152040f54ecdc7418deea3d42502 +size 1596726 diff --git a/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/layout.json b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a449959a85d69b55fe18e35d13bd69f2b70fa9ba --- /dev/null +++ b/iteratedreasoningwithmutualinformationincooperativeandbyzantinedecentralizedteaming/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7c0c04e2a5e8ba8d17c443288b12733e881a6c8edfc5eb83123b9e33395f5ec +size 1144787 diff --git a/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_content_list.json b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2cd0a5bfce7a19bc0dd53f021e254b87e59ace63 --- /dev/null +++ b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:266a27dfa71d8c1f2f0f0227c74b24e7cb192f2bd68d967c3c25e56379e48ee6 +size 123278 diff --git a/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_model.json b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2982b8a7bd9d77f7c94f572694cf7b404572619d --- /dev/null +++ b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc98655507b38c77d2431c42cb8d58d817b5d0d966803dbac8da10901c778cb8 +size 150739 diff --git a/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_origin.pdf b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..38b843202ee0af2ff3554ef2fe8abc3fb9fda6a4 --- /dev/null +++ b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/8580fe4a-b2fb-4b86-ba81-6309211a2084_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff39d95f389bef8fecd7397858a02b1c3b81e2ad4c6b8e7fd3a545716809594c +size 3585580 diff --git a/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/full.md b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1811385b9afb2cb458a6dc2b870e5d3e9ef26e3e --- /dev/null +++ b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/full.md @@ -0,0 +1,479 @@ +# IT TAKES FOUR TO TANGO: MULTIAGENT SELFPLAY FOR AUTOMATIC CURRICULUM GENERATION + +Yuqing Du + +UC Berkeley + +yuqing_du@berkeley.edu + +Pieter Abbeel + +UC Berkeley + +pabbeel@berkeley.edu + +Aditya Grover + +UCLA + +adityag@cs.ucla.edu + +# ABSTRACT + +We are interested in training general-purpose reinforcement learning agents that can solve a wide variety of goals. Training such agents efficiently requires automatic generation of a goal curriculum. This is challenging as it requires (a) exploring goals of increasing difficulty, while ensuring that the agent (b) is exposed to a diverse set of goals in a sample efficient manner and (c) does not catastrophically forget previously solved goals. We propose Curriculum Self Play (CuSP), an automated goal generation framework that seeks to satisfy these desiderata by virtue of a multi-player game with 4 agents. We extend the asymmetric curricula learning in PAIRED (Dennis et al., 2020) to a symmetrized game that carefully balances cooperation and competition between two off-policy student learners and two regret-maximizing teachers. CuSP additionally introduces entropic goal coverage and accounts for the non-stationary nature of the students, allowing us to automatically induce a curriculum that balances progressive exploration with anticatastrophic exploitation. We demonstrate that our method succeeds at generating an effective curricula of goals for a range of control tasks, outperforming other methods at zero-shot test-time generalization to novel out-of-distribution goals. + +# 1 INTRODUCTION + +Reinforcement learning (RL) has seen great success in a range of applications, from game-playing (Silver et al., 2016; Schrittwieser et al., 2020) to real world robotics tasks (OpenAI et al., 2019). However, these accomplishments are often in the realm of mastering a single specific task. For many applications, we further desire agents who are capable of generalizing to a variety of tasks. This can be achieved via goal-conditioned RL, where an RL agent is trained to solve many goals by specifying a sequence of goals, i.e. a goal curriculum. Manually designing such curricula is tedious and moreover, does not scale due to being environment specific and heuristic-driven. Even when it is easy to engineer a curriculum, we would prefer curricula that can dynamically adapt to the learner's current capabilities. For example, effective human tutors use an understanding of their pupil's current knowledge and learning trajectory to create a curriculum. + +Our work builds on two broad desiderata for curriculum generation (Bengio et al., 2009) that enable sample-efficient learning of goal-conditioned policies: progressive exploration and anti-catastrophic exploitation. Progressive exploration refers to curricula where the agent gradually learns to solve tasks of increasing difficulty and diversity. Anti-catastrophic exploitation ensures that the agent periodically resolves previously attempted goals that could become harder to solve during the course of training a.k.a. catastrophic forgetting (French, 1999; Kirkpatrick et al., 2017). + +Many prior works have attempted to incorporate aspects of these criteria for automatic curriculum generation. One approach is to parameterize a goal generator and pit it against a discriminator that assesses goal difficulty (Florensa et al., 2018) or feasibility (Racaniere et al., 2020) for the current agent. Racaniere et al. (2020) also address desired qualities of validity and diversity by crafting specific losses for these characteristics. However, these approaches rely on learning an accurate discriminator for assessing goal difficulty, which can be challenging. Rather than employing discriminators in the standard adversarial minimax formulation, Dennis et al. (2020) proposes an alternate minimax objective based on the agent's regret. The 'expert' used for computing the regret is another goal-conditioned policy whose utility is maximized by an environment generator. + +![](images/fe67776a012d60002586582c7f447e216df99892947a6aff051da5be0c9ba438.jpg) +(a) Self Play + +![](images/eb4e19d4e8abbd9b0fa1ae48db897d784a02b44c94c30ec117b6a9021b42caac.jpg) +(b) Asymmetric Self Play + +![](images/1b9447dcd9ec15e97e692113ddbdfeeb084ad6747a3192cc499e96fc6319c08b.jpg) +(c) Curriculum Self Play +Figure 1: Interactions between learners $A$ , $B$ and teachers $G_{A}, G_{B}$ in Self Play variations. In (a), $A$ plays against variations of itself in a zero-sum game to automatically generate a curriculum. In (b), $A$ acts as both an agent and a demonstrator by being rewarded for proposing hard goals to $B$ . In (c), we separate the goal generation from the demonstrators and symmetrize the whole system. + +An alternative method for automatic curriculum generation that has seen great success is self-play, where an agent plays against other versions of itself (Silver et al., 2016; Bansal et al., 2018; Baker et al., 2019) (Fig. 1a). Unfortunately, this method does not apply directly to complex tasks where we do not have the structure of a two player, zero-sum game. A promising variation is Asymmetric Self-Play (ASP) (Sukhbaatar et al., 2018b), which involves a minimax game between two similar agents: a goal demonstrator, Alice, and the desired goal-conditioned agent, Bob (Fig. 1b). Bob is asked to solve or reverse tasks demonstrated by Alice in the same environment. To motivate Alice to propose successively challenging goals, Alice is rewarded whenever Bob fails. This method inherently captures an easy-to-hard curriculum, since any goal solved by Alice is achievable by Bob in principle. However, ASP tends to be sample inefficient as it is bottlenecked by Alice's ability to remember earlier goals and explore a diverse goal space. + +Our work aims to bring together the strengths of goal generative methods and ASP while addressing the two desiderata. Our work focuses on the multi-goal setting with the curriculum generator controlling goals Portelas et al. (2020). We propose Curriculum Self Play (CuSP), a symmetric multi-agent setup for automatic curricula generation. CuSP optimizes for two off-policy goal-conditioned students, Alice and Bob, and two regret-maximizing goal generators, $G_{A}$ and $G_{B}$ (Fig. 1c). Drawing inspiration from the minimax regret objective in PAIRED (Dennis et al., 2020), we designate each goal generator as being 'friendly' to one of the students ( $G_{A}$ for Alice, $G_{B}$ for Bob), and optimize each goal generator using the difference in utility between the preferred student and the other student (i.e., $G_{A}$ is rewarded $R^{A} - R^{B}$ , where $R^{A}, R^{B}$ are Alice's and Bob's returns respectively when challenged with the same goal). This encourages proposing goals that are neither too easy nor too hard. With our symmetrized setup, Alice and Bob each have a 'friendly' goal generator that is inclined to propose more feasible goals without being too simple, and an 'unfriendly' goal generator that is inclined to propose more challenging goals. As the tasks increase in difficulty overall, the former's cooperation helps in scaffolding learning while the latter's competition helps push the boundaries of the agent's capabilities. + +We further address goal diversity and sample efficiency by leveraging the off policy entropy-regularized optimization of Soft Actor Critic (SAC) (Haarnoja et al., 2018) for training the goal generators. The goal generators' replay buffers track the regrets for all proposed goals. To account for non-stationary learners, we propose an update rule for the regrets in the goal generators' replay buffers based on the critic networks of Alice and Bob. In doing so, we constantly keep track of the learners' current abilities and can propose increasingly challenging goals. At the same time, using the regret objective also places the current abilities in context. For example, if Bob has forgotten how to achieve a particular goal, the regret $R^{A} - R^{B}$ increases and $G_{A}$ is more inclined to re-propose that goal. Thus the combination of using a replay buffer and the regret objective aids in addressing the twin goals of progressive exploration and anti-catastrophic exploitation. + +Compared to prior methods for goal generation, we demonstrate that CuSP is able to satisfy the desiderata for good curricula. We show that this translates to improved sample efficiency and generalization to novel out-of-distribution goals across a range of robotics tasks, encompassing navigation, manipulation, and locomotion. We highlight some emergent skills that arise via CuSP when generalizing to particularly challenging goals, and find that our method is able to handle cases when portions of the goal space are infeasible. + +# 2 BACKGROUND + +Problem Setup. We model the environment and the goal-conditioned learner using a Markov decision process, $\mathcal{M} = \langle S, \mathcal{A}, \mathcal{T}, \mathcal{R}, \mathcal{G}, \gamma \rangle$ , where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space, $\mathcal{T}: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \to \mathbb{R}$ is the environment transition function, $\mathcal{R}: \mathcal{G} \times \mathcal{S} \to \mathbb{R}$ is the goal-conditioned reward function, $\mathcal{G} \subseteq \mathcal{S}$ is the goal space, and $\gamma$ is a discount factor. We consider both dense and sparse reward functions: $r(s|g) = -d(s,g)$ , where $d$ is a distance metric (e.g. $L_{2}$ norm) between the state $s$ and the goal $g$ for the former, or $r(s|g) = \mathbb{1}\{d(s,g) < \epsilon\}$ for the latter. Our objective is to learn a policy $\pi(a_t | s_t, g)$ that maximizes the success rate of reaching all goals $g \in \mathcal{G}$ . To assess ability to generalize to out-of-distribution goals, we split the goal space into $\mathcal{G}_{id}$ and $\mathcal{G}_{ood}$ where the goal generators can only propose goals $g \in \mathcal{G}_{id}$ , and we evaluate on sampled $g \in \mathcal{G}_{ood}$ . + +Self Play (SP). SP is an approach for automatic curriculum generation in competitive, zero-sum games. In this paradigm, an agent plays against past versions of itself in order to automatically generate a learning curriculum (Figure 1a). That is, we consider Alice and Bob as two versions of the same underlying agent, and each agent's objective is the negative of the others', so $R^{A} = -R^{B}$ . However, this approach is only applicable for symmetric zero-sum games, and does not lend itself to learning curricula for goal-conditioned agents in other setups. + +Asymmetric Self Play (ASP). ASP (Sukhbaatar et al., 2018b) extends self play to non-zero sum games by proposing an asymmetric parametrization of two competing agents. During each episode, Alice's objective is to propose and demonstrate a task for Bob to complete (Figure 1b). In the goal-conditioned paradigm, we take Alice's final state $s_T^A$ as the proposed goal $g$ . Alice and Bob now have different objectives: Bob's return, $R^B = \sum_t \gamma^t r(s_T^B | g)$ , is simply based on reaching the proposed goal, while Alice's reward is based on Bob's inability to reach the goal, $R^A = \mathbb{1}(d(s_T^B, g) \geq \epsilon)$ . While this approach lends itself well to more complex tasks such as robotic manipulation (OpenAI et al., 2021), it has poor sample efficiency. Since we rely on a learning agent, Alice, to propose and solve goals, the generated goals are limited by Alice's own ability to explore and learn challenging yet feasible goals. This can be particularly problematic towards the start of training, where we can waste many episodes proposing simple and redundant goals for Bob. + +# 3 AUTOMATIC CURRICULUM GENERATION VIA CUSP + +Our curriculum generation method consists of four main players: two goal-conditioned learning peers, Alice $\pi_A$ and Bob $\pi_B$ , and two goal generators, $G_{A}$ and $G_{B}$ . $\pi_A(a|s,g)$ and $\pi_B(a|s,g)$ are both optimized to maximize the discounted sum of goal-conditioned rewards $R(g) = \sum_{t}\gamma^{t}r^{t}(g)$ , across proposed goals $g\in \mathcal{G}_{id}$ . Aside from any initial randomness in initializing $\pi_A$ and $\pi_B$ , the two policies are parameterized with the same architecture. $G_{A}(g|s_{0},z)$ and $G_{B}(g|s_{0},z)$ are parametrized as policies that output a goal $g\in \mathcal{G}_{id}$ given an initial observation of the environment $s_0$ and a latent noise variable $z\sim \mathcal{N}(0,1)$ . The inclusion of such a noise variable draws from generative models (e.g. GANs, VAEs) where such a $z$ is the input to the generator, and is also found in prior goal generative methods (Florensa et al., 2018). The goal generators are optimized to maximize the regret of their corresponding agent: $\Re^{G_A} = R^A (g) - R^B (g)$ and $\Re^{G_B} = -\Re^{G_A} = R^B (g) - R^A (g)$ . + +We refer to our overall curriculum generation approach as Curriculum Self Play (CuSP). We present an overview of CuSP in Algorithm 1 and illustrate it in Figure 1c. The algorithm proceeds in rounds. In every round, both goal generators propose a goal, $g_{A}$ from $G_{A}$ and $g_{B}$ from $G_{B}$ . To keep the symmetrization fair and hopefully scaffold learning initially, we first rollout the 'easier' goal for each respective agent (ie. $g_{A}$ for Alice, $g_{B}$ for Bob) and compute the corresponding environment returns and update the learners. Next, we rollout the 'harder' goal for each respective agent (ie. $g_{B}$ for Alice, $g_{A}$ for Bob) and update again. At the end of the round, we update the goal generators. + +Symmetrization. The regret objective $R^{A} - R^{B}$ helps $G_{A}$ propose goals that are challenging for Bob while still being feasible for Alice. However, this can be detrimental when Alice and Bob's performance diverge too quickly. To address this, we propose symmetrizing the multi-agent system by introducing a corresponding goal generator $G_{B}$ whose regret objective is $R^{B} - R^{A}$ , essentially pitting it in a zero-sum game against $G_{A}$ . Having these two goal generators produces two types of goals for each agent: a) a feasible yet not too simple goal from the 'friendly' goal generator ( $G_{A}$ for Alice, $G_{B}$ for Bob), which can help scaffold learning quickly, and b) a challenging yet not too difficult goal from the 'unfriendly' goal generator ( $G_{A}$ for Bob, $G_{B}$ for Alice), which can help push + +Algorithm 1: Curriculum Self Play (CuSP) +Initialize goal-conditioned learners $\pi_A,\pi_B$ , goal generators $G_{A},G_{B}$ while not converged do / generate goals $g_{a}\sim G_{A},g_{b}\sim G_{B};$ // evaluate easier goals first $R_{Easy}^{A}\gets \text{rollout} (\pi_{A},g_{A});R_{Easy}^{B}\gets \text{rollout} (\pi_{B},g_{B});$ // update policies $\pi_A\gets$ train_learner $(\pi_A,R_{Easy}^A);\pi_B\gets$ train_learner $(\pi_B,R_{Easy}^B);$ // evaluate harder goals second $R_{Hard}^{A}\gets \text{rollout} (\pi_{A},g_{B});R_{Hard}^{B}\gets \text{rollout} (\pi_{B},g_{A});$ // update policies $\pi_A\gets$ train_learner $(\pi_A,R_{Hard}^A);\pi_B\gets$ train_learner $(\pi_B,R_{Hard}^B);$ // compute regrets and update generators $G_{A}\gets$ traingenerator $G_{A},\{(R_{Easy}^{A}-R_{Hard}^{B}),g_{A}\},\{(R_{Hard}^{A}-R_{Easy}^{B}),g_{B}\})$ . $G_{B}\gets$ train-generator $G_{B},\{(R_{Easy}^{B}-R_{Hard}^{A}),g_{B}\},\{(R_{Hard}^{B}-R_{Easy}^{A}),g_{A}\})$ ; +end + +![](images/b2ec97ba00a64e0e47f9829c4114333235ca41ffce8007ea9c7210c7fbc41feb.jpg) +Figure 2: Performance of different optimization methods on a toy landscape that is primarily flat except for a single gaussian centered at $(-0.1, 0.1)$ shown by the contours. Red shows most recently proposed points. SAC is able to find the peak while the other methods get stuck in the flat regions. + +![](images/6e0398da3da579ce48962bd31fcee976d976bdff65c6eef3158c12fa45399dc9.jpg) + +![](images/a28be27c417050c4e72f470637d5ea28e8a91b4337287f77becc4dab23d29e19.jpg) + +the boundaries of the agent's abilities. Both of these properties help encourage the generation of goals that are feasible yet progressively challenging. + +Goal Generator Design. We motivate our goal generator design with our proposed desiderata: progressive exploration with anti-catastrophic exploitation. Although the goal generator is not an RL agent in the traditional sense - it only 'acts' in a single timestep by proposing a goal and its 'observation' only changes based on a random noise variable - optimizing such an explore-exploit tradeoff effectively naturally inspires the use of an RL objective, and RL objectives have previously been used for one-step optimization (e.g., one-step Q-learning (Watkins & Dayan, 1992)). + +Thus, to train the goal generators we use an RL learning objective and parameterization inspired by a single-time step variant of Soft-Actor Critic (SAC) (Haarnoja et al., 2018). SAC is an off policy algorithm that optimizes for a trade-off between expected reward and policy entropy $H(\pi)$ with a + +Figure 3: SAC optimizing a non-stationary toy landscape that is primarily flat, but has a gaussian peak starting at $(-0.1, 0.1)$ and moving diagonally to $(0.1, -0.1)$ . Red shows most recently proposed points. Without the regret updates, the optimizer lags and cannot find the optimum. +![](images/4bedbc65b2647bb5ed5d811a2122ad5b50e5692b2d8384f137ff8f70aa35c42d.jpg) +(a) SAC without regret updates at 2500 and 5000 steps. (b) SAC with regret updates at 2500 and 5000 steps. + +![](images/84035543c8d43aaff5499409da46a375041d01c56f98561a81b17f7f87788a9d.jpg) + +![](images/869821c9db3c2d6dd3752af4c386aa2e2b95bb9f44ce9ef6b3f99f928349a8b9.jpg) + +![](images/a47946cd711df13fc254d3befb17d1b0ddf36c74db34fd0930e34dd6d7d487df.jpg) + +coefficient $\alpha$ . In our setup, our goal generator only acts once to propose a goal per episode, so each 'trajectory' is only a single time step consisting of the initial state $s$ (for which we concatenate the initial environment observation $s_0$ with a latent noise variable $z$ ), the proposed goal action $g$ , and we get the corresponding "reward" for the goal generator policy by computing the regret between $\pi_A$ and $\pi_B$ on $g$ . Thus the objective for each goal generator policy $G$ is given by + +$$ +\max _ {G} \mathbb {E} _ {g \sim G} \left[ \underbrace {\Re^ {G} (s , g)} _ {\text {e x p l o i t a t i o n}} + \alpha \underbrace {H (G)} _ {\text {e x p l o r a t i o n}} \right] +$$ + +where the regret term addresses anti-catastrophic exploitation by prioritizing goals where regret has increased, and the entropy term addresses progressive goal space exploration. + +We equip the SAC goal generators with a replay buffer to store all past goals and their regrets. This helps address forgetting and improve the sample efficiency of goal generation compared to prior methods which optimize the generator as another agent using on-policy algorithms such as PPO (Schulman et al., 2017). We further take advantage of SAC's entropy regularization to progressively increase the diversity of the goals, with consideration of Alice and Bob's capabilities using the stored regrets. To empirically motivate the use of SAC, we compare SAC against PPO and Adam (Kingma & Ba, 2015) in optimizing a synthetic landscape. One challenge of the regret objective is that at the beginning of training, the landscape will mostly be flat when $\pi_A$ and $\pi_B$ are similarly unskilled. In Fig. 2, we find that only SAC is proficient at optimizing a primarily flat landscape. + +Dynamic Regret Updates for Non-stationary Agents. However, using an off policy RL algorithm for optimizing such a goal generator requires further modifications. For more typical agents, the received rewards are a stationary property of the environment. In our case this is no longer true - Alice and Bob are continuously learning and part of the multi-agent environment, so the regrets for the same goal will also change over time. To address this issue, we would like to update the non-stationary regret values in the goal generator's replay buffer. However, it is expensive for Alice and Bob to replay all the goals in the environment. As a sample efficient trick, we leverage the observation that the critics of Alice and Bob can provide a current estimate of their performance. Hence, after every round, we update the regrets of previous goals in the replay buffer using the difference between the corresponding value estimates from the critic networks of Alice and Bob. This allows us to keep an updated estimate of feasibility based on Alice and Bob's current skills. + +To empirically validate that updating the replay buffer regrets helps in a non-stationary landscape, we carry out investigations of a SAC goal generator both with and without regret updates in Fig. 3. As hypothesized, updating the replay buffer allows the generator to find the moving optimum. The combination of the replay buffer and dynamic regret updates also strengthens our method by automatically prioritizing goals that have been forgotten. With the non-stationary regret updates, the goal generators always have an updated estimate of each learner's abilities. Thus if Bob performs worse on a past goal, the regret increases for $G^{A}$ and it is more likely to repurpose it, addressing catastrophic forgetting for Bob. Likewise, symmetrization helps to address catastrophic forgetting for Alice. Without the corresponding $G_{B}$ , if Alice performs worse at a goal, the regret $R^{A} - R^{B}$ decreases and $G_{A}$ is less likely to repurpose it unless Bob's performance decreases even further. This can potentially lead to neglecting to propose these challenging goals for Bob. + +Summary. Inspired by Racaniere et al. (2020), we specify desired qualities of a goal generator: + +- Progressive Feasibility - the goals should be incrementally more difficult, accounting for the agent's current skill level and the fact that the agent is a non-stationary learner. +- Progressive Diversity - the goals should encourage increasing exploration of goals. +- Anti-Forgotten – if previous goals are forgotten, they should be reproposed. + +We summarize the contributions of each component of our method to desired qualities of feasibility, diversity, and anti-forgetting in Table 1. We visualize generated goal distributions in Appendix A and ablate over each component of Table 1 in Appendix B.5.1 to illustrate their importance. + +# 4 EXPERIMENTS + +**Environments.** We test our method across a suite of continuous control tasks adapted from the Deepmind Control Suite (Tassa et al., 2020) and OpenAI Gym (Plappert et al., 2018), using the + +Table 1: Contribution of each component of our method to the desired qualities. + +
Progressive FeasibilityProgressive DiversityAnti-Forgotten
Entropy Regularization✓
Regret Replay Buffer✓
Dynamic Regret Updates✓✓
Symmetrization✓✓
+ +![](images/c62605970e327e027f179559e89a09d42afbc279be56d1c0c627ab9cbaab3c4d.jpg) +Figure 4: Illustration of the five environments, $\mathcal{G}_{id}$ showing training goal space and $\mathcal{G}_{ood}$ showing test goal space. The red points indicate what is used to evaluate whether a goal was reached in each environment – the point mass coordinates for Point Mass Obstacle, the torso center location for Walker, the ball location for Reach/Toss, and the block location for Pick and Reach. + +![](images/bd97c82c951d0940fa5d7d5317594af8ba1950e905c0dfd9146ded02c2c9f89f.jpg) +Gid Good + +![](images/0e8b9a83530ad99cc769961e37188735891a500323e87a524e1aa9099910d8b4.jpg) + +![](images/6737e87cf0821dd18b7c2aae23863261adedee4e14e62320ce5a2386c51a3333.jpg) + +![](images/cc45a46a7f40d4a89b95278ea77447d53a0de3eca18335a13ab2566ee2f531c9.jpg) + +MuJoCo simulator (Todorov et al., 2012). We analyze our method across a variety of task types: navigation, locomotion, and manipulation. Point Mass Obstacle is a navigation task with some walls. Walker is a locomotion task with a goal torso position. Reach and Toss are manipulation tasks with a goal ball position. Toss provides an interesting challenge as gravity plays a large role – the robot must learn to aim precisely. Pick and Reach (OpenAI, 2020) is a manipulation task where success is measured by picking up a block and moving it to a target position. Environments and goal spaces are visualized in Figure 4, with details in Appendix B.2. + +Training Setup. For CuSP, we train the goal generators using the SAC implementation from Yarats & Kostrikov (2020) with their default architecture and hyperparameters. Since symmetrization leads to similar performance from Alice and Bob in expectation, we report the results from Bob only for consistency. We compare against a domain randomization Tobin et al. (2017) baseline and two other baselines that use minimax formulations for curriculum generation: the GoalGAN approach (Florensa et al., 2018) and ASP+BC (OpenAI et al., 2021). We train all learner policies with the same architecture and SAC to isolate differences to the goal generation method. + +We aim to answer the following questions with our experiments: + +- Does the CuSP curricula induce agents that can generalize to novel goals from $\mathcal{G}_{\text{odd}}$ ? +- Does the CuSP curricula induce interesting emergent skills for solving harder goals? +- Does the CuSP curricula handle cases where portions of the goal space are poorly specified (e.g. with impossible dimensions)? + +# 4.1 TEST-TIME OUT-OF-DISTRIBUTION GENERALIZATION + +To assess whether our curriculum improves generalizability, we evaluate each method on its ability to reach randomly sampled out-of-distribution goals $g \sim \mathcal{G}_{\text{odd}}$ . In Fig. 5 we see that across environments, generally CuSP matches or outperforms all the baselines for task success. ASP+BC's sample inefficiency due to Alice's limitations leads to poor performance, while GoalGAN does well in environments where the goal space is more symmetrical (e.g. with navigation or the reaching tasks, where most points in the goal space are similarly difficult). That said, we note GoalGAN struggles more in environments where portions of the goal space are more challenging (e.g. walking to the right or aiming and tossing upwards). We hypothesize this is due to the challenges of accurately learning the feasibility of different goals in an asymmetric goal space. Lastly, we find + +![](images/201bc7f41f030cd64cb270faf1b5b77cf03c1d9af6d1ac2040a3e74fc51539bc.jpg) +Figure 5: Success rates across environments on random goals sampled from $\mathcal{G}_{\text{ood}}$ . Results averaged across 3 seeds for each method. Each round corresponds to goal generation, then rollouts, then the respective goal generator updates. Generally we find our method matches or outperforms all baselines in out-of-distribution generalization, especially when tackling the harder locomotion task. + +Figure 6: Success rates for three more challenging goals in Point Mass Obstacle, Walker, and Manipulator, and corresponding sample trajectories. In Point Mass we learn to navigate around walls faster than other methods, in Walker we learn to run quickly (albeit by using its torso) whereas other methods fail to succeed at all, and in Toss we learn to aim upwards accurately. +![](images/550894cf466ee417a259a54c05649b14b44348a4a8eb27b56c9724080cd16fb5.jpg) +CuSP (Ours) ASP+BC GoalGAN Domain Randomization + +that the domain randomization baseline is particularly well suited for this OOD random evaluation. The baseline is trained on good coverage of the in-distribution goal space, which is beneficial for generalization to random goals in the navigation and manipulation tasks, but is less helpful for the more asymmetric goal spaces like Walker and Toss. For ablations on ASP, see Appendix B.5.2. We also ablate over each contribution of our method as detailed in Table 1 in Appendix B.5.1. Specifically, we ablate the regret replay buffer, the dynamic regret updates, entropy regularization, and symmetrization. We find that only using the regret objective from PAIRED (Dennis et al., 2020) is insufficient, even with naively applying symmetrization, and that both entropy regularization and an updated replay buffer are crucial for high evaluation task success. + +# 4.2 TASK-SPECIFIC SKILLS + +Next, we examine if CuSP can induce emergent skills in learners for tackling harder, environment specific goals. Below, we enlist 3 representative examples in the more asymmetric environments where certain goals are clearly more challenging to solve. As seen in Fig. 6, our method is able to improve upon success rates on these goals. + +- Point Mass Obstacle - Behind Obstacles: requires learning to move around the walls to the edge of the training space. Here, we learn to succeed much faster than the other methods. +- Walker - Far Right: requires learning to move forward quickly to reach a goal far out of the training space. Here, we learn to succeed at the task where all other baselines fail, suggesting that our method produces a useful curriculum for learning challenging locomotion tasks while the others cannot, or require many more samples to do so. +- Toss – Upwards: requires learning to toss the ball accurately upwards outside of the training space. Here, we learn to succeed much faster than the other methods. + +![](images/787e52d54ca1d64057692c5052245af63b896feed5c578553d6f04e6c0c01585.jpg) +Rounds $(\times 100)$ + +Figure 7: Success rates for Reach with a third impossible dimension added to the specified goal space. We test on both in distribution and out of distribution randomly sampled goals in the 3D goal space, where the third dimension is not feasible in the environment. Generally we find CuSP is least affected while the baselines generally performs worse with the higher dimensional space. +![](images/18906f85dfa8b2fe0539e485faf59078c9a1f2a1e356eab302e2df83c57f5c40.jpg) +CuSP (Ours) +... GoalGAN +Domain Randomization + +# 4.3 MISSPECIFIED GOAL DIMENSIONS + +Lastly, we investigate if the goal generator methods (CuSP, GoalGAN, and DR) can handle the case where parts of the specified goal space is misspecified. To do this, we append an extra dimension to the goal space, bounded between $[-1, 1]$ , and evaluate performance on $\mathcal{G}_{id}$ and $\mathcal{G}_{ood}$ with randomly sampling the third dimension during evaluation. We use Reach as a case study, and as seen in Fig. 7, agents trained using CuSP's goal curricula are less affected by the increased goal space while the baselines plateau at a lower success rate. In particular, the DR baseline is most adversely affected by the higher dimensionality. This suggests that while random sampling provides good coverage and is amenable to more simple goal spaces, as seen above, the induced curricula degrades in quality with increasingly complex goal spaces. Note that we exclude ASP from these experiments as it does not use a pre-specified goal space and only sets achieved states as goals. + +# 5 RELATED WORK + +We summarize four main thrusts of work within automatic curriculum generation. + +Modeling Goal Distributions. Many previous works have tackled the problem of generating "appropriately" difficult goals for an autocurriculum. In discrete environments, Campero et al. (2021) propose an adversarial goal-generator that is rewarded when the learning agent achieves the goal with a thresholded level of effort. However, they rely on a heuristic time limit hyperparameter to determine 'suitable effort' (i.e. goal feasibility) and hyperparameters for the teacher reward, whereas our approach directly uses regrets from multiagent interactions to automatically gauge feasibility and provide a reward signal to the teacher. In continuous domains, Zhang et al. (2020) samples goals that maximize the uncertainty of the learner's Q-function, and Nair et al. (2018) learn a latent representation to sample 'imagined' goals from. GoalGAN (Florensa et al., 2018) trains a GAN to generate goals of intermediate difficulty for the agent, using a discriminator to predict whether the generated goals would be appropriate by thresholding success rates. These methods use a heuristic measure of challenging goals, while we leverage the multi-agent setting to automatically find interesting goals. Similarly to GoalGAN, the Setter-Solver paradigm (Racaniere et al., 2020) trains a goal setter whose objectives are a balance of goal validity, feasibility, and coverage, as well as a discriminator for predicting goal feasibility. In contrast, our approach does not need to explicitly weigh the contributions of each loss or incorporate discriminators. + +Multi-Agent Curriculum Learning. The idea that interactions between multiple agents can lead to emergent curricula has been proposed in prior works (Leibo et al., 2019; Baker et al., 2019) and relates to the theory of mind (Rabinowitz et al., 2018; Grover et al., 2018a;b) postulating human learning via social interactions. One parametrization of such interactions is through designating another agent(s) as a teacher who aims to select an appropriate curriculum for the student. For task-based curricula, Matiisen et al. (2019) train a teacher policy for selecting sub-tasks for the student, and Graves et al. (2017); Portelas et al. (2019) treat task selection as a bandit problem for the teacher. + +Rather than having an explicit teacher, Asymmetric Self-Play (ASP) (Sukhbaatar et al., 2018b) automatically generates a curriculum for exploration by training a similarly parametrized agent, Alice, to + +demonstrate tasks that the learning agent, Bob, struggles to complete. OpenAI et al. (2021) extend ASP to robotic manipulation tasks by incorporating an imitation learning loss for Bob to imitate Alice on challenging goals. As Alice is no longer setting the goals, we do not make use of behaviour cloning in CuSP. While they demonstrate zero-shot generalization to a diverse set of target tasks, relying on Alice to set the goals can also be incredibly sample inefficient, as we saw in our evaluations. Sodhani & Pahuja (2018) propose a memory-augmented version of ASP by providing the learners an external memory to speed up exploration, which is analogous to our method training with off-policy learners. Sukhbaatar et al. (2018a) extends ASP to a hierarchical learning framework by learning subgoal representations. Competitive Experience Replay (Liu et al., 2018) generates an exploratory competitive curriculum through penalizing Alice if visiting states Bob has visited, but rewards Bob for visiting states found by Alice. + +**Environment Design.** Another method for inducing curricula is through generating a sequence of environments to learn in. Procedural level generation is a common approach for developing games, and can lead to increased generalizability (Justesen et al., 2018). POET (Wang et al., 2019) uses a population of adversaries to generate increasingly challenging environments for a population of learning agents. PAIRED (Dennis et al., 2020) proposes optimizing an adversarial environment designer through minimax regret between two learning agents, inspiring the objective we use for our goal generators. However, this approach does not account for catastrophic forgetting and can suffer from sample inefficiencies from using an on-policy method and in cases where the regret landscape is flat. That said, environment design approaches can be used in a complementary way with our approach, extending it beyond goal generation. + +Skill Discovery. A closely related method for curriculum generation is through unsupervised skill discovery, where an agent explores an environment to automatically discover skills that can be composed to achieve a variety of tasks. Prior methods have used information theoretic objectives to encourage skill acquisition that covers a diverse set of behaviours (Eysenbach et al., 2018) or generate a multi-task distribution (Gupta et al., 2020). For robotics tasks, (Hausman et al., 2018) propose a method for learning a latent skill space that can be composed and is transferable between tasks, DADS (Sharma et al., 2019) proposes a combination of model-based and model-free RL that optimizes for discovering predictable skills that can be composed by a planner, and Play-LMP (Lynch et al., 2020) proposes using self-supervision across play data for skills discovery. Another method for curriculum generation is through using hindsight (Andrychowicz et al., 2017; Li et al., 2020). These works are complementary to ours as our method aims to induce a curriculum through sparse goal generation, which can be augmented with unsupervised skill discovery. + +# 6 CONCLUSION + +We propose a new method, CuSP, for automatic curriculum generation based on symmetric extension of self play approaches for non zero-sum games. Our proposed method aims to address weaknesses of prior approaches by being designed to specifically consider a balance of progressive exploration and anti-catastrophic exploitation. To this end, we make use of two off-policy students and two off-policy regret-maximizing goal generators, each of which is more 'friendly' to one of the students. As a result, we generate goals that are a) challenging yet feasible, b) diverse, and c) revisited to mitigate anti-forgetting. We qualitatively highlight these desired qualities in goal generation compared to prior methods, demonstrate quantitative gains at generalizing to out-of-distribution unseen goals, and find some emergent task-specific skills. + +Limitations and Future Work. While our method shows promise for addressing key components of generating useful curriculum, there is still significant room for improvement. One limitation of our current approach is that it depends on specifying a goal space for the generator to act in, which was not necessary in the original ASP method. That said, specifying a goal space also allows us to imbue the system with human priors for what goals should or should not be valid, whereas ASP may need post-hoc goal filtering if Alice ends up in an undesirable state. + +To further tackle automatic curriculum generation, future work should explore scenarios where goal spaces are not fully pre-specified, as well as extending to high dimensional goal spaces (e.g. images). Furthermore, another interesting avenue would be extrapolating CuSP to a larger number of student and teacher agents, which can potentially provide benefits through better goal space coverage and giving a more accurate estimate of feasibility. + +# ACKNOWLEDGEMENTS + +Thanks to Eugene Vinitsky for helpful discussions, and Hao Liu and Olivia Watkins for feedback on drafts. This work was supported by the Center for Human-Compatible Artificial Intelligence and a FAIR-BAIR collaboration between UC Berkeley and Meta. + +# ETHICS STATEMENT + +Automatic curriculum generation has potential as a method for learning complex agent behaviours in an unsupervised way. Requiring less direct supervision (eg. through hand-tuned, shaped reward functions) can lead to more robust AI systems for real-world applications. At the same time, it is important to consider potential impacts unsupervised reinforcement learning, as it may lead to unintended behaviours. By incorporating human engineering and priors through goal space specification in the goal generative methods, like CuSP, we can help restrict the set of goal spaces to more desirable (e.g. safe) behaviours. While our empirical studies have been done in simulated systems, careful and thorough analysis of learned behaviours should be done before deploying CuSP on real world systems. + +# REPRODUCIIBILITY STATEMENT + +Code is available at https://github.com/yuqingd/cusp. For experimental environment details, see Appendices B.1, B.2. For hyperparameters, see Appendix B.3. For ablations of CuSP and ASP, see Appendices B.5.1 and B.5.2 respectively. + +# REFERENCES + +Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper/2017/file/453fadbd8a1a3af50a9df4df899537b5-Paper.pdf. +Bowen Baker, Ingmar Kanitscheider, Todor Markov, Yi Wu, Glenn Powell, Bob McGrew, and Igor Mordatch. Emergent tool use from multi-agent autocurricula. In International Conference on Learning Representations, 2019. +Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=Sy0GnUxCb. +Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pp. 41-48, 2009. +Andres Campero, Roberta Raileanu, Heinrich Kuttler, Joshua B. Tenenbaum, Tim Rocttäschel, and Edward Grefenstette. Learning with {amig}o: Adversarily motivated intrinsic goals. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=ETBc_MIMgoX. +Michael Dennis, Natasha Jaques, Eugene Vinitsky, Alexandre Bayen, Stuart Russell, Andrew Critch, and Sergey Levine. Emergent complexity and zero-shot transfer via unsupervised environment design. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 13049-13061. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/985e9a46e10005356bbaf194249f6856-Paper.pdf. +Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. In International Conference on Learning Representations, 2018. + +Carlos Florensa, David Held, Xinyang Geng, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1515-1528. PMLR, 10-15 Jul 2018. +Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128-135, 1999. +Irving L Glicksberg. A further generalization of the kakutani fixed point theorem, with application to nash equilibrium points. Proceedings of the American Mathematical Society, 3(1):170-174, 1952. +Alex Graves, Marc G Bellemare, Jacob Menick, Remi Munos, and Koray Kavukcuoglu. Automated curriculum learning for neural networks. In international conference on machine learning, pp. 1311-1320. PMLR, 2017. +Aditya Grover, Maruan Al-Shedivat, Jayesh Gupta, Yuri Burda, and Harrison Edwards. Learning policy representations in multiagent systems. In International conference on machine learning, pp. 1802-1811. PMLR, 2018a. +Aditya Grover, Maruan Al-Shedivat, Jayesh K Gupta, Yuri Burda, and Harrison Edwards. Evaluating generalization in multiagent systems using agent-interaction graphs. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pp. 1944-1946, 2018b. +Abhishek Gupta, Benjamin Eysenbach, Chelsea Finn, and Sergey Levine. Unsupervised meta-learning for reinforcement learning, 2020. +Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 1861-1870. PMLR, 10-15 Jul 2018. +Karol Hausman, Jost Tobias Springenberg, Ziyu Wang, Nicolas Heess, and Martin Riedmiller. Learning an embedding space for transferable robot skills. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rk07ZXZRb. +Niels Justesen, Ruben Rodriguez Torrado, Philip Bontrager, Ahmed Khalifa, Julian Togelius, and Sebastian Risi. Illuminating generalization in deep reinforcement learning through procedural level generation, 2018. +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, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980. +James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521-3526, 2017. +Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https://github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018. +Joel Z. Leibo, Edward Hughes, Marc Lanctot, and Thore Graepel. Autocurricula and the emergence of innovation from social interaction: A manifesto for multi-agent intelligence research, 2019. +Alexander Li, Lerrel Pinto, and Pieter Abbeel. Generalized hindsight for reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020. +Hao Liu, Alexander Trott, Richard Socher, and Caiming Xiong. Competitive experience replay. In International Conference on Learning Representations, 2018. + +Corey Lynch, Mohi Khansari, Ted Xiao, Vikash Kumar, Jonathan Tompson, Sergey Levine, and Pierre Sermanet. Learning latent plans from play. In Leslie Pack Kaelbling, Danica Kragic, and Komei Sugiura (eds.), Proceedings of the Conference on Robot Learning, volume 100 of Proceedings of Machine Learning Research, pp. 1113-1132. PMLR, 30 Oct-01 Nov 2020. URL http://proceedings.mlr.press/v100/lynch20a.html. +Tambet Matiisen, Avital Oliver, Taco Cohen, and John Schulman. Teacher-student curriculum learning. IEEE transactions on neural networks and learning systems, 31(9):3732-3740, 2019. +Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. Advances in Neural Information Processing Systems, 31:9191-9200, 2018. +John Nash. Non-cooperative games. Annals of mathematics, pp. 286-295, 1951. +OpenAI. Robogym. https://github.com/openai/robogym, 2020. +OpenAI, Ilge Akkaya, Marcin Andrychowicz, Maciek Chociej, Mateusz Litwin, Bob McGrew, Arthur Petron, Alex Paino, Matthias Plappert, Glenn Powell, Raphael Ribas, Jonas Schneider, Nikolas Tezak, Jerry Tworek, Peter Welinder, Lilian Weng, Qiming Yuan, Wojciech Zaremba, and Lei Zhang. Solving rubik's cube with a robot hand, 2019. +OpenAI OpenAI, Matthias Plappert, Raul Sampedro, Tao Xu, Ilge Akkaya, Vineet Kosaraju, Peter Welinder, Ruben D'Sa, Arthur Petron, Henrique P. d. O. Pinto, Alex Paino, Hyeonwoo Noh, Lilian Weng, Qiming Yuan, Casey Chu, and Wojciech Zaremba. Asymmetric self-play for automatic goal discovery in robotic manipulation, 2021. +Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, Vikash Kumar, and Wojciech Zaremba. Multi-goal reinforcement learning: Challenging robotics environments and request for research, 2018. +Rémy Portelas, Cédric Colas, Lilian Weng, Katja Hofmann, and Pierre-Yves Oudeyer. Automatic curriculum learning for deep rl: A short survey. arXiv preprint arXiv:2003.04664, 2020. +Rémy Portelas, Cédric Colas, Katja Hofmann, and Pierre-Yves Oudeyer. Teacher algorithms for curriculum learning of deep rl in continuously parameterized environments, 2019. +Neil Rabinowitz, Frank Perbet, Francis Song, Chiyuan Zhang, SM Ali Eslami, and Matthew Botvinick. Machine theory of mind. In International conference on machine learning, pp. 4218-4227. PMLR, 2018. +Sebastien Racaniere, Andrew Lampinen, Adam Santoro, David Reichert, Vlad Firoiu, and Timothy Lillicrap. Automated curriculum generation through setter-solver interactions. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=H1e0Wp4KvH. +Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, and et al. Mastering atari, go, chess and shogi by planning with a learned model. Nature, 588(7839):604-609, Dec 2020. ISSN 1476-4687. doi: 10.1038/s41586-020-03051-4. URL http://dx.doi.org/10.1038/s41586-020-03051-4. +John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017. +John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation, 2018. +Archit Sharma, Shixiang Gu, Sergey Levine, Vikash Kumar, and Karol Hausman. Dynamics-aware unsupervised discovery of skills. In International Conference on Learning Representations, 2019. +David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484-489, 2016. + +Shagun Sodhani and Vardaan Pahuja. Memory augmented self-play, 2018. +Sainbayar Sukhbaatar, Emily Denton, Arthur Szlam, and Rob Fergus. Learning goal embeddings via self-play for hierarchical reinforcement learning, 2018a. +Sainbayar Sukhbaatar, Zeming Lin, Ilya Kostrikov, Gabriel Synnaeve, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. In International Conference on Learning Representations, 2018b. +Yuval Tassa, Saran Tunyasuvunakool, Alistair Muldal, Yotam Doron, Siqi Liu, Steven Bohez, Josh Merel, Tom Erez, Timothy Lillicrap, and Nicolas Heess. dm_control: Software and tasks for continuous control, 2020. +Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In 2017 IEEE/RSJ international conference on intelligent robots and systems (IROS), pp. 23-30. IEEE, 2017. +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, 2012. doi: 10.1109/IROS.2012.6386109. +Andrei Tychonoff. Über die topologische erweiterung von räumen. Mathematische Annalen, 102 (1):544-561, 1930. +Rui Wang, Joel Lehman, Jeff Clune, and Kenneth O. Stanley. Paired open-ended trailblazer (poet): Endlessly generating increasingly complex and diverse learning environments and their solutions, 2019. +Christopher JCH Watkins and Peter Dayan. Q-learning. Machine learning, 8(3-4):279-292, 1992. +Stephen Willard. General topology. Courier Corporation, 2012. +Denis Yarats and Ilya Kostrikov. Soft actor-critic (sac) implementation in pytorch. https://github.com/denisyarats/pytorch_sac, 2020. +Yunzhi Zhang, Pieter Abbeel, and Kerrel Pinto. Automatic curriculum learning through value disagreement. Advances in Neural Information Processing Systems, 33, 2020. + +# A DESIRED GOAL GENERATION QUALITIES + +We begin by qualitatively examining the key properties of the curriculum of goals generated in Point Mass Obstacle. We see that qualitatively our method (Fig. 8a) proposes goals with more progressive exploration than either ASP (Fig. 8d) (which seems to get stuck on the walls, limited by Alice's ability to explore) or GoalGAN (Fig. 8c) (which seems to get stuck more along the borders of the space, only prioritizing difficult goals). The DR generator (Fig. 8b) has the opposite result, having great coverage but without any consideration for feasibility or difficulty. Our method manages to balance the exploration with progressive feasibility, where we see CuSP proposing goals more towards the corners at first, then progressively moving towards the center and covering the space more thoroughly, with slightly more density in the top right where the maze is. We hypothesize there is more concentration in the corners initially when the goal generators are untrained and proposing goals towards the edges of the goal constraints. + +![](images/6e75d2cc9c63f69c458682d5724003916d06f80aae30560a4e01d2b9bdeb5d2f.jpg) +(a) CuSP +(b) Domain Randomization + +![](images/e83cf9f0a05c1357620284e43d81d921727be7551c811689cb8a60be0e80934d.jpg) + +![](images/e7b108886fd3f93a4a1a4ae95b6139664b3fe7edeec6f5f9d9196fd421236e89.jpg) +(c) GoalGAN + +![](images/b9c92ef3356aebe6836a260dbd77110db157b21fc225cdef2502768ecefeb127.jpg) +(d) $\mathrm{ASP + BC}$ + +![](images/d8757b9a57c179a6473e047ff3d06a9c5683fbc052a7907be3d085fedd759f08.jpg) +Figure 8: Progressive goal generation plots for Point Mass Obstacle after 500 rounds across all four methods. We see more progressive diversity from CuSP, whereas GoalGAN mostly stays on the outer border and ASP+BC gets stuck on the environment walls, limited by Alice's abilities. + +# B EXPERIMENTS + +Compute. To train each method in each environment, we use 1 NVIDIA V100 GPU per seed in an internal cluster. This amounts to an approximate total of 400 GPUs for the final evaluations and hyperparameter sweeps. We additionally did extensive prototyping on the Point Mass environment before scaling to the more complex environments, but do not have a reasonable estimate for how much compute was expended in that phase of the project. + +# B.1 TOY EXPERIMENTS + +For the toy evaluations in Figures 2 and 3, we evaluate on the landscape + +$$ +\operatorname {r e g r e t} (x, y) = \left\{ \begin{array}{l l} - ((x + . 1) ^ {2} + (y - . 1) ^ {2}) & \text {i f} (x + . 1) ^ {2} + (y - . 1) ^ {2} < . 0 1 \\ -. 0 1 & \text {o t h e r w i s e} \end{array} \right. +$$ + +For Adam, we use the default configuration from PyTorch (lr=0.001, $\beta_{\mathrm{s}} = (0.9, 0.999)$ , $\epsilon = 1\mathrm{e} - 8$ , no weight decay). For PPO, we use the default configuration from (Kostrikov, 2018). We found our trends to hold robustly for a fairly broad choice of Ir's and both with/without GAE (Schulman et al., 2018). In the toy experiments, we carry out 5000 steps of goal proposal with one gradient update for every method at each step. For the non-stationary experiment in Figure 3, we diagonally perturb the center of the regret landscape from top left quadrant (initialized at (-0.1, 0.1)) to the bottom right quadrant at a constant rate of 2e-4 every round. Hence, at the end of 2500 rounds, the center of the landscape is at the origin and at the end of 5000 rounds, the center of the landscape is at (0.1, -0.1). + +# B.2 ENVIRONMENT SPECIFICS + +Table 2 describes the reward configurations we used in our environments. For the manipulation environments, we also incorporated HER (Andrychowicz et al., 2017). $\epsilon$ is the tolerance for success (i.e. a goal $g$ is successfully achieved at state $s$ if the normed distance $L_{2}(s - g) < \epsilon$ ). We terminate the episode early if successful. + +
EnvRewardUse HER (Andrychowicz et al., 2017)ε
Point Mass Maze-L2.05
Walker-L2.1
Reach-L2✓.1
Toss-L2✓.1
Pick and Reach0 if at goal, -1 otherwise✓.1
+ +We modify the default Point Mass environment by adding in walls to the top right corner and initialize the agent in between the walls $10\%$ of the time to help with exploration. We modify the manipulator environment by always initializing with the ball in the gripper and with the gripper in an upright position. We use an episode length of 1000 steps for Point Mass Obstacle and Walker and an episode length of 100 steps for Reach, Toss, and Pick. + +Specific definitions of in-distribution and out-of-distribution goal spaces for each environment are in Table 3. + +Table 2: Environment Reward Configurations + +
EnvGidGood
Point Mass Maze[-.25, .25] × [-.25, .25][-.3, .3] × [-.3, .3]
Walker[-1, 10] × [-.2, .2][10, 20] × [-.2, .2]
Reach[-.25, .25] × [.2, .6][-.4, .4] × [.1, .8]
Toss[-.5, .5] × [.5, 1.3][-.6, .6] × [.5, 1.4]
Pick and Reach[.5, .9] × [.5, .7][.4, 1] × [.5, .8]
+ +# B.3 HYPERPARAMETERS + +We train the learners and goal generators using the default SAC configuration and implementation from (Yarats & Kostrikov, 2020), as listed in Table 4, with separate networks for the actor and critic. + +Table 3: Goal spaces for each environment. + +
ParameterValue
γ.99
Initial α.1
α LR1e-4
Actor LR1e-4
Critic LR1e-4
Batch size1024
Critic hidden dim1024
Critic hidden depth2
Actor hidden dim1024
Actor hidden depth2
+ +Table 4: SAC Hyperparameters + +To scale the output of the goal generators to the correct action space, we take the Tanh scaled output and rescale each dimension to the goal space. We use Appendix C of (Haarnoja et al., 2018) to modify the log loss for SAC accordingly. To train the goal generator, we update after each round (i.e. per goal proposed) with 100 gradient updates. As the learners are updated once per time-step in the environment (100-1000 updates depending on the environment), we increased the update frequency for the goal-generator to keep pace with the learner updates since the goal generator operates on a single time step per episode. + +# B.4 BASELINES + +We reimplement each baseline by comparing against any available public code and matching each paper's recommended training hyperparameters as closely as possible within our compute limitations. + +Off vs. On Policy Learners In ASP+BC(OpenAI et al., 2021), Alice and Bob are trained using PPO. We also implemented this as a baseline but found that the agents were unable to reach high success at the same rate as our SAC-trained agents. For a comparison that's more favorable to the baselines, we report the success rates from training with the same agent configuration (ie. Bob trained with SAC) in the main paper to isolate learning differences to the goal generation method. + +# B.5 ABLATIONS + +# B.5.1 CUSP ABLATIONS + +SAC Motivation Without symmetrization, the regret-based goal generation objective is the same as the proposed objective in PAIRED Dennis et al. (2020). However, our contribution extends beyond the symmetrized objective as our proposed method reframes the goal generation process into a entropy-regularized agent with a memory buffer – which motivated designing our method around SAC. PAIRED uses PPO to optimize their environment generators, which we found was not sample efficient enough for our tasks (i.e. success rates were too low), as our toy experiment in Figure 2 suggested. + +Here we highlight a case study with the Toss task into why the entropy regularization and replay buffer components are important. Building up from just the regret objective as in PAIRED, we have in Figure 9: + +1. $\beta = 1, \alpha = 0$ , no replay buffer - Regret objective only for a single goal generator, as in PAIRED. +2. $\beta = 1, \alpha = 0$ , no replay buffer, symmetrized - Regret objective with two symmetrized goal generators. Symmetrization seems to improve performance slightly, but is not sufficient alone. +3. $\beta = 1, \alpha = 0 - \text{Regret objective with a replay buffer for the goal generator. Also improves performance slightly, although not as much as symmetrization.}$ +4. $\beta = 1 -$ Regret objective with a replay buffer and entropy regularization. This is particularly helpful for the random OOD evaluation as the greater goal diversity improves multi-goal performance on the multi-goal evaluation task, as expected. +5. $\beta = 1$ symmetrized - Regret objective with a replay buffer and entropy regularization, and symmetrized goal generators. +6. $T = 300$ , $\beta = .1$ , symmetrized (Full CuSP) - Regret objective with a dynamically updated replay buffer and entropy regularization, and symmetrized goal generators. + +![](images/9466d64fedbf5bec472798e0e688918466e07460fd89def8cf0c941b8f253950.jpg) +Figure 9: Full ablations of all components of CuSP from Table 1. Success rates are averaged across 3 seeds. + +Looking at a sample of the generated goals in Figure 10, we find a stark qualitative improvement in goal diversity between the regret-only PAIRED condition and CuSP. In particular, in the baseline the generated goals converge only on the corners. + +![](images/a79ad04d941b69399642845fa73cfb4020ab9ff978ee28c34f5d51a45b240220.jpg) +Figure 10: Goal plots after 2000 rounds for Toss. The left plot shows the goals generated in the $\beta = 1, \alpha = 0$ , No Replay Buffer condition and the right plot shows the goals generated in the $T = 300, \beta = .1$ , Symmetrized condition from Figure 9. Red indicates more recent goals. + +![](images/d980a2e83269345b25d3c689ffeb6fcfd5d49b7a1ceb15d0a33d51fbc9a85517.jpg) + +![](images/8d8cde1b11f2b389cb253255ce7b6dbead3a570d168ad0b7e868b37011591932.jpg) + +Regret update and Symmetrization Ablations As we use the learners' critics for estimating the current regret for a particular goal, we need to be careful about how we use the critic data since it can be inaccurate, especially towards the beginning of training. We introduce two hyperparameters: one for specifying at which episode we begin regret updates $T$ , and a weighting parameter $\beta$ for how much to update the regrets by. We use the update rule + +$$ +\operatorname {r e g r e t} = \beta \cdot \operatorname {o l d} \operatorname {r e g r e t} + (1 - \beta) \cdot \operatorname {n e w} \operatorname {r e g r e t} +$$ + +We sweep across $T = 50, 100, 200$ and $\beta = .1, .5, .9$ to select the best performing hyperparameters based on average performance on the training goal set, $\mathcal{G}_{id}$ . In Figure 11, we ablate over the different components of our method: CuSP+SAC with no entropy regularization $(\beta = 1, \alpha = 0)$ , + +$\mathrm{CuSP + SAC}$ only $(\beta = 1)$ , $\mathrm{CuSP + SAC + Symmetrization}$ $(\beta = 1)$ , and $\mathrm{CuSP + SAC + Regret}$ $\mathrm{Updates + Symmetrization}$ to investigate the effects of each component. In most of the tasks, aside from Reach on random out of distribution goals, symmetrization improves performance. In particular, we see larger gains on tasks where $\beta = 1$ performance is lower to begin with, such as Walker. Further gains from stale regret updates vary from being very small on tasks where $\beta = 1$ performance is already high (eg. for Point Mass Obstacles or Toss on random OOD goals), to larger improvements on the harder skill tasks (eg. Behind Obstacles or Walker Far Right goals). Interestingly, we also note that while entropy regularization is crucial for most of the environments, setting $\alpha = 0$ seems to be helpful for Walker. + +![](images/6f1fd83ea81bece80a1867ad2796a01d1f676773bfe98c5bc96d5650f04e428f.jpg) + +![](images/f07d108198f5d27a3c7bc74a2ea548eb8fef84ea851ee2fa4b906f437b58d24f.jpg) + +![](images/1a190549710acd097ab33e236a8a797aedb7f716029878c4c9e3ef90456162a2.jpg) +Figure 11: Success rates across environments on random goals sampled from $\mathcal{G}_{\text{ood}}$ , ablating for SAC-based goal generators, symmetrization and stale regret updates. We generally find that having both components improve success rates across the tasks, although the gains vary depending on how challenging the environment is to begin with. In particular, having both the regret updates and symmetrization helps most on the more challenging Walker tasks and the skill-specific tasks. + +![](images/bb2b31d2ef15596c8482ba76f1273e8a7d7d7b0c828548be00a288f2f33a26f3.jpg) + +Multiagent Motivation. Here we investigate whether it is sufficient to formulate the CuSP game with only a single learner. Rather than using regret defined as the difference in returns of two agents, we look at the difference in the returns of a single agent across two rollouts to identify if stochasticity in the policy alone is sufficient for providing the goal generator signal. As a case study we look at the Toss task in Figure 12, where we find the success rate increases much more slowly with a single agent. We hypothesize that a challenge with only using a single agent fro defining regret is that the regret landscape is much more flat – i.e. the regret is more likely to be very small and not provide much signal to the goal generators, as the stochasticity of a single agent policy is comparatively lesser than two separate agents. As a result, the goals are less likely to be a useful curriculum for the agent. + +![](images/ac9f395f9293f01a72d16b60ec84d33522eaa18c4ee22b023983b17769477a21.jpg) +Figure 12: Comparison of CuSP with separately initialized and updated Alice and Bob, or a single Alice. Success rates are averaged across 3 seeds. + +![](images/fd816d5201ea6b308ae8d6d9f687076f2aed04c02c7ac66cc0cce4c63cd87b21.jpg) + +# B.5.2 ASP ABLATIONS + +![](images/f4f7f27290c7b6ffc099c03522fa24121512aaf8dac4772f9ce13fa885e62621.jpg) +(a) ASP Sparse + +![](images/aae607f68fab0dcf7783d90fd759f76fa78d75aa505ed3e4e975f7dbc5854a3e.jpg) +(b) ASP Dense + +![](images/2418170dbf7883e51e587d0082f4b89bf05ee9be31eddb6c5781d813e7717e0b.jpg) +(c) ASP Dense with SAC Bob + +![](images/bbf97e9b28999b114c1f9be0e94947f333c61f24c111648f506ff9150fb18abf.jpg) +Figure 13: Progressive goal generation plots for the Point Mass environment after the first 1000 episodes, where each goal is the final position of Alice at the end of the episode and both agents are initialized at the center of the domain. We see that with the sparse version of ASP, the proposed goals converge on a single corner over time and gets stuck, whereas the dense implementation leads to more diverse goals. + +![](images/e5dd8e259b21ee68f4e837e266c3c3ecce9e522d7783fc36a75fec735679ead6.jpg) + +![](images/176fa0536476930c7f666801dc747374b1e2d582d93fadf2b04108aaa15f96ea.jpg) + +![](images/9cb38b7b970a3c6b15a7ba86d03c00cc1741b35fa2d9d51eb421b04b2bb521ef.jpg) +Rounds $(\times 100)$ + +![](images/3b5473839c487e3fbb012704f78c3ba92f5502abce38d03acde18a209605dafc.jpg) +Figure 14: Success rates across environments where ASP achieved $>0$ success rates on random goals sampled from $\mathcal{G}_{\text {ood }}$ across each of the ASP variants. For final results in the paper, we report ASP+BC (Dense, SAC). + +In the original implementation, ASP+BC uses PPO to optimize both Alice and Bob. We find this very suboptimal for the environment setups in this work. For empirical validation, here we report results using 3 variations of ASP+BC: + +- ASP+BC (Sparse): Alice is rewarded $+1$ at the end of an episode of Bob does not succeed, or receives 0 reward otherwise. Both Alice and Bob are optimized using PPO. +- ASP+BC (Dense): Alice is rewarded negative Bob's reward at each transition. Both Alice and Bob are optimized using PPO. +- ASP+BC (Dense, SAC): Alice is rewarded negative Bob's reward at each transition. Alice is optimized with PPO while Bob is optimized with SAC. + +For all cases, we use the behavioural cloning (BC) mechanism proposed in Section 3.2 of (OpenAI et al., 2021), where Bob is updated with the same clipped behavioural cloning loss on trajectories where it does not successfully achieve Alice's proposed goal. + +The results are shown in Figure 14. We observe that with a sparse reward, Alice would tend to get stuck with proposing similar goals in a particular location. While Bob learns to succeed at that single goal, the lack of diversity causes Bob to perform poorly at generalization to novel goals in $\mathcal{G}_{\text{ood}}$ , as seen in the evaluations. To overcome this, we incorporated a dense reward implementation and swapped to optimizing for Bob's policy using SAC. Our results presented in Section 4 use this stronger baseline for comparison against CuSP. + +# C THEORETICAL ANALYSIS + +Our overall framework contains 4 players: two goal-conditioned agents, Alice $\pi_A$ and Bob $\pi_B$ , and their corresponding goal generators, $G_{A}$ and $G_{B}$ . Further, let $\Pi$ and $\mathcal{G}$ denote the space of policies and goal generative models respectively. At any given round, let $g_{A} \sim G_{A}$ and $g_{B} \sim G_{B}$ denote the corresponding goals sampled from $G_{A}$ and $G_{B}$ respectively. Accordingly, we can define two regrets for the sampled goals: + +$$ +\Re^ {G _ {A}} \left(g _ {A}, \pi_ {A}, \pi_ {B}\right) = R \left(g _ {A}, \pi_ {A}\right) - R \left(g _ {A}, \pi_ {B}\right) \tag {1} +$$ + +$$ +\Re^ {G _ {B}} \left(g _ {B}, \pi_ {B}, \pi_ {A}\right) = R \left(g _ {B}, \pi_ {B}\right) - R \left(g _ {B}, \pi_ {A}\right) \tag {2} +$$ + +where $R(g, \pi_A)$ and $R(g, \pi_B)$ denote the empirical discounted sum of rewards for Alice and Bob respectively on a goal $g$ . Now, we define the objective function $f$ below: + +$$ +f \left(g _ {A}, g _ {B}, \pi_ {A}, \pi_ {B}\right) := \Re^ {G _ {A}} \left(g _ {A}, \pi_ {A}, \pi_ {B}\right) - \Re^ {G _ {B}} \left(g _ {B}, \pi_ {B}, \pi_ {A}\right). \tag {3} +$$ + +The overall objective function for CuSP can be written as: + +$$ +\min _ {G _ {B} \in \mathcal {G}, \pi_ {B} \in \Pi} \max _ {G _ {A} \in \mathcal {G}, \pi_ {A} \in \Pi} \mathbb {E} _ {g _ {A} \sim G _ {A}, g _ {B} \sim G _ {B}} [ f (g _ {A}, g _ {B}, \pi_ {A}, \pi_ {B}) ] := F (G _ {A}, G _ {B}, \pi_ {A}, \pi_ {B}). \tag {4} +$$ + +To analyze the above objective, we define coordinating goal generator-solver teams $(G,\pi)$ as a pair of goal generator $G\in \mathcal{G}$ and goal conditioned agent $\pi \in \Pi$ . Accordingly, we can interpret CuSP as a 2 player zero-sum game between two coordinating goal generator-solver teams $(G_{A},\pi_{A})$ and $(G_B,\pi_B)$ defined via goal-conditioned agents $\pi_A\in \Pi$ (Alice) and $\pi_B\in \Pi$ (Bob) along with their corresponding friendly goal generators $G_{A}\in \mathcal{G}$ and $G_{B}\in \mathcal{G}$ respectively. + +Definition C.1. (CuSP game) The CuSP game is a 2 player zero-sum game between two coordinating goal generator-solver teams $(G_A, \pi_A)$ and $(G_B, \pi_B)$ defined via: + +- Alice $\pi_A \in \Pi$ and its friendly goal generator $G_A \in \mathcal{G}$ and +- Bob $\pi_B \in \Pi$ and its friendly goal generator $G_B \in \mathcal{G}$ . + +The game is zero-sum with payoff function given as $F(G_{A}, G_{B}, \pi_{A}, \pi_{B})$ for $(G_{A}, \pi_{A})$ , and as $-F(G_{A}, G_{B}, \pi_{A}, \pi_{B})$ for $(G_{B}, \pi_{B})$ . + +Next, we state conditions under which a Nash Equilibrium exists for coordinating goal generator-solver agents in CuSP. The conditions depend highly on whether the game strategies (given by the product of goal generator space and policy space) are finite or continuous. + +Proposition C.2. (Finite Games) Let $(G_A, \pi_A) \in \mathcal{G} \times \Pi$ and $(G_B, \pi_B) \in \mathcal{G} \times \Pi$ be two coordinating goal generator-solver agents for CuSP defined over finite goal space $\mathcal{G}$ and policy space $\Pi$ . Then, there exists a mixed strategy Nash Equilibrium for the CuSP game. + +Proof. Since $\mathcal{G}$ and $\Pi$ are finite, we know that the product space $\mathcal{G} \times \Pi$ is also finite. The result then follows directly from Nash's Theorem (Nash, 1951). + +Proposition C.3. (Continuous Games) Let $(G_A, \pi_A) \in \mathcal{G} \times \Pi$ and $(G_B, \pi_B) \in \mathcal{G} \times \Pi$ be two coordinating goal generator-solver agents for CuSP defined over continuous goal space $\mathcal{G}$ and policy space $\Pi$ . Further, let $\mathcal{G}$ and $\Pi$ be nonempty compact metric spaces and the payoff function $F$ (Eq. 4) be continuous. Then, there exists a mixed strategy Nash Equilibrium for the CuSP game. + +Proof. Since $\mathcal{G}$ and $\Pi$ are compact, we know by Tychonoff's theorem (Tychonoff, 1930; Willard, 2012) that the product space $\mathcal{G} \times \Pi$ is also compact. Combined with the fact that $F$ is assumed to be continuous, we can apply Glicksberg's Theorem (Glicksberg, 1952) to finish the proof. + +Since we have established conditions for the existence of Nash equilibria for the CuSP game, we know from the minimax theorem that we can recover the Nash equilibrium solution by optimizing Eq. 4. + +Note 1: In practice, our algorithms for optimizing Eq. 4 might not satisfy the necessary assumptions for the theoretical results. For example, we optimize the parameters of generators and policies specified as neural networks as opposed to optimizing in the space of functions directly. Further, we consider a single-sample Monte Carlo estimate for the CuSP objective in Eq. 4 and optimize the goal generators and policy networks sequentially for a fixed number of gradient updates in every round using RL algorithms such as SAC. While these protocols are standard practice even in related works, deriving theoretical guarantees in such scenarios is extremely challenging and an active area of theoretical research with many open questions. + +Note 2: If $\pi_A = \pi_B$ , then $r_A(g) = r_B(g)$ for all $g$ , so all corresponding regrets will also be zero and thus give no signal to the goal generators. The key point to note here is that in practice, the goal generators have an exploration component that can avoid getting stuck, e.g., this can be achieved via $\epsilon$ -greedy or via SAC which has an exploration bonus (as done in CuSP). + +Concretely, let $\pi_A = \pi_B = \pi_{rand}$ be randomly initialized agents. We claim that at initialization, $(G_A,\pi_{rand})$ , $(G_B,\pi_{rand})$ will not be in a Nash Equilibrium except in the case where a random policy is already able to achieve all possible goals. To see why, suppose for the sake of contradiction that the agent teams $(G_A,\pi_{rand})$ , $(G_B,\pi_{rand})$ are at a Nash Equilibrium. That is, the teams have the joint best responses to each other. Let $\mathbb{G}$ be the set of all possible goals and $\mathbb{G}' \subseteq \mathbb{G}$ be the set of goals that $\pi_{rand}$ can solve. + +If $\mathbb{G}' = \mathbb{G}$ , then $\pi_A, \pi_B$ are already maximally competent and are therefore done learning. Note that this is also what we hope to converge to eventually during training, and the two policies matching can correspond to a Nash Equilibrium in such a case. At this point $\Re(g_A, \pi_A, \pi_B) = \Re(g_B, \pi_B, \pi_A) = 0$ for all $g_A, g_B$ so neither $G_A, G_B$ can increase their payoffs, and since $\pi_A, \pi_B$ are parameterized identically, if either policy is able to increase its payoff on some $g$ we can identically update the other policy such that $\pi_A = \pi_B$ until neither policy is able to improve its payoff further either. + +If $\mathbb{G}' \subset \mathbb{G}$ , then for either team we can pick any single goal $g^* \in \mathbb{G} \setminus \mathbb{G}'$ and learn a policy $\pi^*$ capable of achieving $\{g^*\} \cup \mathbb{G}'$ using policy iteration (e.g., with greedy policy improvement assuming no forgetting of past goals). Such a $g^*$ will eventually be proposed as long as the goal generators have an exploratory component. This means there is a strategy $\pi^*$ that acquires equal utility to $\pi_{rand}$ on $\mathbb{G}'$ and higher utility on $g^*$ . Thus there exists a strictly better strategy for either team $(G_A, \pi_{rand})$ , $(G_B, \pi_{rand})$ by switching from $\pi_{rand}$ to $\pi^*$ , which contradicts that the players are already at a Nash Equilibrium to begin with. \ No newline at end of file diff --git a/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/images.zip b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5f5eae80c9295916e4e5557100a6bdc770610626 --- /dev/null +++ b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:436bc1434f8741caaeb4da6d973c25a785599c79d3ba93a928cec36c23afab87 +size 667926 diff --git a/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/layout.json b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e7df272e9e15db6efe662ee5aa732fa0731bf6a2 --- /dev/null +++ b/ittakesfourtotangomultiagentselfplayforautomaticcurriculumgeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f375f927daa93fc7e46ecb900f13c9031211f016adcd0ce7ed042fb70cde264b +size 721063 diff --git a/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_content_list.json b/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8bb027f8e3fead2c2cd03808d7c40120a4584009 --- /dev/null +++ b/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19d21e9801a6869fa650c380642e8362b0ab10be0683ad7051ebb2ed6a8af5ae +size 134027 diff --git a/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_model.json b/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..09aa63e271613ecfefbc6a18851f5f5bed14857a --- /dev/null +++ b/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ae243fb2ad2163ee66ba5effa4d7aa5e9bafc4c8f9985e7995a4319efa6fbbf +size 159596 diff --git a/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_origin.pdf b/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8b527de98b51b3e82b0723d3fd2ac05294183dc3 --- /dev/null +++ b/ittakestwototangomixupfordeepmetriclearning/8227d025-9688-458d-80d6-f92a81fe69f0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea515ba6000d73eb8f02b0c9f1d983cbbfc233749884abf64cce711a70d44ddf +size 31928068 diff --git a/ittakestwototangomixupfordeepmetriclearning/full.md b/ittakestwototangomixupfordeepmetriclearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a2534ae4dbee790de3958d387300983fc09d2b42 --- /dev/null +++ b/ittakestwototangomixupfordeepmetriclearning/full.md @@ -0,0 +1,489 @@ +# IT TAKES TWO TO TANGO: +MIXUP FOR DEEP METRIC LEARNING + +Shashanka Venkataramanan $^{1*}$ Bill Psomas $^{3*}$ Ewa Kijak $^{1}$ Laurent Amsaleg $^{1}$ + +Konstantinos Karantzalos3 Yannis Avrithis2 + +$^{1}$ Inria, Univ Rennes, CNRS, IRISA $^{2}$ Athena RC + +$^{3}$ National Technical University of Athens + +# ABSTRACT + +Metric learning involves learning a discriminative representation such that embeddings of similar classes are encouraged to be close, while embeddings of dissimilar classes are pushed far apart. State-of-the-art methods focus mostly on sophisticated loss functions or mining strategies. On the one hand, metric learning losses consider two or more examples at a time. On the other hand, modern data augmentation methods for classification consider two or more examples at a time. The combination of the two ideas is under-studied. + +In this work, we aim to bridge this gap and improve representations using mixup, which is a powerful data augmentation approach interpolating two or more examples and corresponding target labels at a time. This task is challenging because unlike classification, the loss functions used in metric learning are not additive over examples, so the idea of interpolating target labels is not straightforward. To the best of our knowledge, we are the first to investigate mixing both examples and target labels for deep metric learning. We develop a generalized formulation that encompasses existing metric learning loss functions and modify it to accommodate for mixup, introducing Metric Mix, or Metric. We also introduce a new metric—utilization—to demonstrate that by mixing examples during training, we are exploring areas of the embedding space beyond the training classes, thereby improving representations. To validate the effect of improved representations, we show that mixing inputs, intermediate representations or embeddings along with target labels significantly outperforms state-of-the-art metric learning methods on four benchmark deep metric learning datasets. + +# 1 INTRODUCTION + +Classification is one of the most studied tasks in machine learning and deep learning. It is a common source of pre-trained models for transfer learning to other tasks (Donahue et al., 2014; Kolesnikov et al., 2020). It has been studied under different supervision settings (Caron et al., 2018; Sohn et al., 2020), knowledge transfer (Hinton et al., 2015) and data augmentation (Cubuk et al., 2018), including the recent research on mixup (Zhang et al., 2018; Verma et al., 2019), where embeddings and labels are interpolated. + +Deep metric learning is about learning from pairwise interactions such that inference relies on instance embeddings, e.g. for nearest neighbor classification (Oh Song et al., + +![](images/01126e5ce412755a823e356ebf3e7f675e52a2977447e622e091a62595080ec7.jpg) +Figure 1: Metric $(= \text{Metric Mix})$ allows an anchor to interact with positive (same class), negative (different class) and interpolated examples, which also have interpolated labels. + +2016), instance-level retrieval (Gordo et al., 2016), few-shot learning (Vinyals et al., 2016), face recognition (Schroff et al., 2015) and semantic textual similarity (Reimers & Gurevych, 2019). + +Following (Xing et al., 2003), it is most often fully supervised by one class label per example, like classification. The two most studied problems are loss functions (Musgrave et al., 2020) and hard example mining (Wu et al., 2017; Robinson et al., 2021). Tuple-based losses with example weighting (Wang et al., 2019) can play the role of both. + +Unlike classification, classes (and distributions) at training and inference are different in metric learning. Thus, one might expect interpolation-based data augmentation like mixup to be even more important in metric learning than in classification. Yet, recent attempts are mostly limited to special cases of embedding interpolation and have trouble with label interpolation (Ko & Gu, 2020). This raises the question: what is a proper way to define and interpolate labels for metric learning? + +In this work, we observe that metric learning is not different from classification, where examples are replaced by pairs of examples and class labels by "positive" or "negative", according to whether class labels of individual examples are the same or not. The positive or negative label of an example, or a pair, is determined in relation to a given example which is called an anchor. Then, as shown in Figure 1, a straightforward way is to use a binary (two class) label per pair and interpolate it linearly as in standard mixup. We call our method Metric Mix, or Metrix for short. + +To show that mixing examples improves representation learning, we quantitatively measure the properties of the test distributions using alignment and uniformity (Wang & Isola, 2020). Alignment measures the clustering quality and uniformity measures its distribution over the embedding space; a well clustered and uniformly spread distribution indicates higher representation quality. We also introduce a new metric, utilization, to measure the extent to which a test example, seen as a query, lies near any of the training examples, clean or mixed. By quantitatively measuring these three metrics, we show that interpolation-based data augmentation like mixup is very important in metric learning, given the difference between distributions at training and inference. + +In summary, we make the following contributions: + +1. We define a generic way of representing and interpolating labels, which allows straightforward extension of any kind of mixup to deep metric learning for a large class of loss functions. We develop our method on a generic formulation that encapsulates these functions (section 3). +2. We define the "positivity" of a mixed example and we study precisely how it increases as a function of the interpolation factor, both in theory and empirically (subsection 3.6). +3. We systematically evaluate mixup for deep metric learning under different settings, including mixup at different representation levels (input/manifold), mixup of different pairs of examples (anchors/positives/negatives), loss functions and hard example mining (subsection 4.2). +4. We introduce a new evaluation metric, utilization, validating that a representation more appropriate for test classes is implicitly learned during exploration of the embedding space in the presence of mixup (subsection 4.3). +5. We improve the state of the art on four common metric learning benchmarks (subsection 4.2). + +# 2 RELATED WORK + +Metric learning Metric learning aims to learn a metric such that positive pairs of examples are nearby and negative ones are far away. In deep metric learning, we learn an explicit non-linear mapping from raw input to a low-dimensional embedding space (Oh Song et al., 2016), where the Euclidean distance has the desired properties. Although learning can be unsupervised (Hadsell et al., 2006), deep metric learning has mostly followed the supervised approach, where positive and negative pairs are defined as having the same or different class label, respectively (Xing et al., 2003). + +Loss functions can be distinguished into pair-based and proxy-based (Musgrave et al., 2020). Pair-based losses use pairs of examples (Wu et al., 2017; Hadsell et al., 2006), which can be defined over triplets (Wang et al., 2014; Schroff et al., 2015; Weinberger & Saul, 2009; Hermans et al., 2017), quadruples (Chen et al., 2017) or tuples (Sohn, 2016; Oh Song et al., 2016; Wang et al., 2019). Proxy-based losses use one or more proxies per class, which are learnable parameters in the embedding space (Movshovitz-Attias et al., 2017; Qian et al., 2019; Kim et al., 2020c; Teh et al., + +2020; Zhu et al., 2020b). Pair-based losses capture data-to-data relations, but they are sensitive to noisy labels and outliers. They often involve terms where given constraints are satisfied, which produce zero gradients and do not contribute to training. This necessitates mining of hard examples that violate the constraints, like semi-hard (Schroff et al., 2015) and distance weighted (Wu et al., 2017). By contrast, proxy-based losses use data-to-proxy relations, assuming proxies can capture the global structure of the embedding space. They involve less computations that are more likely to produce nonzero gradient, hence have less or no dependence on mining and converge faster. + +Mixup Input mixup (Zhang et al., 2018) linearly interpolates between two or more examples in the input space for data augmentation. Numerous variants take advantage of the structure of the input space to interpolate non-linearly, e.g. for images (Yun et al., 2019; Kim et al., 2020a; 2021; Hendrycks et al., 2020; DeVries & Taylor, 2017; Qin et al., 2020; Uddin et al., 2021). Manifold mixup (Verma et al., 2019) interpolates intermediate representations instead, where the structure is learned. This can be applied to or assisted by decoding back to the input space (Berthelot et al., 2018; Liu et al., 2018; Beckham et al., 2019; Zhu et al., 2020a; Venkataramanan et al., 2021). In both cases, corresponding labels are linearly interpolated too. Most studies are limited to cross-entropy loss for classification. Pairwise loss functions have been under-studied, as discussed below. + +Interpolation for pairwise loss functions As discussed in subsection 3.3, interpolating target labels is not straightforward in pairwise loss functions. In deep metric learning, embedding expansion (Ko & Gu, 2020), HDML (Zheng et al., 2019) and symmetrical synthesis (Gu & Ko, 2020) interpolate pairs of embeddings in a deterministic way within the same class, applying to pair-based losses, while proxy synthesis (Gu et al., 2021) interpolates between classes, applying to proxy-based losses. None performs label interpolation, which means that (Gu et al., 2021) risks synthesizing false negatives when the interpolation factor $\lambda$ is close to 0 or 1. + +In contrastive representation learning, MoCHi (Kalantidis et al., 2020) interpolates anchor with negative embeddings but not labels and chooses $\lambda \in [0, 0.5]$ to avoid false negatives. This resembles thresholding of $\lambda$ at 0.5 in OptTransMix (Zhu et al., 2020a). Finally, $i$ -mix (Lee et al., 2021) and MixCo (Kim et al., 2020b) interpolate pairs of anchor embeddings as well as their (virtual) class labels linearly. There is only one positive, while all negatives are clean, so it cannot take advantage of interpolation for relative weighting of positives/negatives per anchor (Wang et al., 2019). + +By contrast, Metrix is developed for deep metric learning and applies to a large class of both pair-based and proxy-based losses. It can interpolate inputs, intermediate features or embeddings of anchors, (multiple) positives or negatives and the corresponding two-class (positive/negative) labels per anchor, such that relative weighting of positives/negatives depends on interpolation. + +# 3 MIXUP FOR METRIC LEARNING + +# 3.1 PRELIMINARIES + +Problem formulation We are given a training set $X \subset \mathcal{X}$ , where $\mathcal{X}$ is the input space. For each anchor $a \in X$ , we are also given a set $P(a) \subset X$ of positives and a set $N(a) \subset X$ of negatives. The positives are typically examples that belong to the same class as the anchor, while negatives belong to a different class. The objective is to train the parameters $\theta$ of a model $f: X \to \mathbb{R}^d$ that maps input examples to a $d$ -dimensional embedding, such that positives are close to the anchor and negatives are far away in the embedding space. Given two examples $x, x' \in \mathcal{X}$ , we denote by $s(x, x')$ the similarity between $x, x'$ in the embedding space, typically a decreasing function of Euclidean distance. It is common to $\ell_2$ -normalize embeddings and define $s(x, x') := \langle f(x), f(x') \rangle$ , which is the cosine similarity. To simplify notation, we drop the dependence of $f, s$ on $\theta$ . + +Pair-based losses (Hadsell et al., 2006; Wang et al., 2014; Oh Song et al., 2016; Wang et al., 2019) use both anchors and positives/negatives in $X$ , as discussed above. Proxy-based losses define one or more learnable proxies $\in \mathbb{R}^d$ per class, and only use proxies as anchors (Kim et al., 2020c) or as positives/negatives (Movshovitz-Attias et al., 2017; Qian et al., 2019; Teh et al., 2020). To accommodate for uniform exposition, we extend the definition of similarity as $s(v,x) \coloneqq \langle v, f(x) \rangle$ for $v \in \mathbb{R}^d$ , $x \in \mathcal{X}$ (proxy anchors) and $s(x,v) \coloneqq \langle f(x), v \rangle$ for $x \in \mathcal{X}$ , $v \in \mathbb{R}^d$ (proxy positives/negatives). Finally, to accommodate for mixed embeddings in subsection 3.5, we define $s(v,v') \coloneqq \langle v, v' \rangle$ for $v, v' \in \mathbb{R}^d$ . Thus, we define $s: (\mathcal{X} \cup \mathbb{R}^d)^2 \to \mathbb{R}$ over pairs of either + +inputs in $\mathcal{X}$ or embeddings in $\mathbb{R}^d$ . We discuss a few representative loss functions below, before deriving a generic form. + +Contrastive The contrastive loss (Hadsell et al., 2006) encourages positive examples to be pulled towards the anchor and negative examples to be pushed away by a margin $m \in \mathbb{R}$ . This loss is additive over positives and negatives, defined as: + +$$ +\ell_ {\text {c o n t}} (a; \theta) := \sum_ {p \in P (a)} - s (a, p) + \sum_ {n \in N (a)} [ s (a, n) - m ] _ {+}. \tag {1} +$$ + +Multi-Similarity The multi-similarity loss (Wang et al., 2019) introduces relative weighting to encourage positives (negatives) that are farthest from (closest to) the anchor to be pulled towards (pushed away from) the anchor by a higher weight. This loss is not additive over positives and negatives: + +$$ +\ell_ {\mathrm {M S}} (a; \theta) := \frac {1}{\beta} \log \left(1 + \sum_ {p \in P (a)} e ^ {- \beta (s (a, p) - m)}\right) + \frac {1}{\gamma} \log \left(1 + \sum_ {n \in N (a)} e ^ {\gamma (s (a, n) - m)}\right). \tag {2} +$$ + +Here, $\beta ,\gamma \in \mathbb{R}$ are scaling factors for positives, negatives respectively. + +Proxy Anchor The proxy anchor loss (Kim et al., 2020c) defines a learnable proxy in $\mathbb{R}^d$ for each class and only uses proxies as anchors. For a given anchor (proxy) $a \in \mathbb{R}^d$ , the loss has the same form as (2), although similarity $s$ is evaluated on $\mathbb{R}^d \times \mathcal{X}$ . + +# 3.2 GENERIC LOSS FORMULATION + +We observe that both additive (1) and non-additive (2) loss functions involve a sum over positives $P(a)$ and a sum over negatives $N(a)$ . They also involve a decreasing function of similarity $s(a, p)$ for each positive $p \in P(a)$ and an increasing function of similarity $s(a, n)$ for each negative $n \in N(a)$ . Let us denote by $\rho^{+}, \rho^{-}$ this function for positives, negatives respectively. Then, non-additive functions differ from additive by the use of a nonlinear function $\sigma^{+}, \sigma^{-}$ on positive and negative terms respectively, as well as possibly another nonlinear function $\tau$ on their sum: + +$$ +\ell (a; \theta) := \tau \left(\sigma^ {+} \left(\sum_ {p \in P (a)} \rho^ {+} (s (a, p))\right) + \sigma^ {-} \left(\sum_ {n \in N (a)} \rho^ {-} (s (a, n))\right)\right). \tag {3} +$$ + +With the appropriate choice for $\tau, \sigma^{+}, \sigma^{-}, \rho^{+}, \rho^{-}$ , this definition encompasses contrastive (1), multi-similarity (2) or proxy-anchor as well as many pair-based or proxy-based loss functions, as shown in Table 1. It does not encompass the triplet loss (Wang et al., 2014), which operates on pairs of positives and negatives, forming triplets with the anchor. The triplet loss is the most challenging in terms of mining because there is a very large number of pairs and only few contribute to the loss. We only use function $\tau$ to accommodate for lifted structure (Oh Song et al., 2016; Hermans et al., 2017), where $\tau(x) := [x]_{+}$ is reminiscent of the triplet loss. We observe that multi-similarity (Wang et al., 2019) differs from binomial deviance (Yi et al., 2014) only in the weights of the positive and negative terms. Proxy anchor (Kim et al., 2020c) is a proxy version of multi-similarity (Wang et al., 2019) on anchors and ProxyNCA (Movshovitz-Attias et al., 2017) is a proxy version of NCA (Goldberger et al., 2005) on positives/negatives. + +This generic formulation highlights the components of the loss functions that are additive over positives/negatives and paves the way towards incorporating mixup. + +# 3.3 IMPROVING REPRESENTATIONS USING MIXUP + +To improve the learned representations, we follow (Zhang et al., 2018; Verma et al., 2019) in mixing inputs and features from intermediate network layers, respectively. Both are developed for classification. + +Input mixup (Zhang et al., 2018) augments data by linear interpolation between a pair of input examples. Given two examples $x, x' \in \mathcal{X}$ we draw $\lambda \sim \mathrm{Beta}(\alpha, \alpha)$ as interpolation factor and mix $x$ with $x'$ using the standard mixup operation $\mathrm{mix}_{\lambda}(x, x') \coloneqq \lambda x + (1 - \lambda)x'$ . + +
LossANCHORPOS/NEGτ(x)σ+(x)σ-(x)ρ+(x)ρ-(x)
Contrastive (Hadsell et al., 2006)XXxxx-x[x-m]+
Lifted structure (Hermans et al., 2017)XX[x]+log(x)log(x)e-xex-m
Binomial deviance (Yi et al., 2014)XXxlog(1+x)log(1+x)e-β(x-m)eγ(x-m)
Multi-similarity (Wang et al., 2019)XXx1/β log(1+x)1/γ log(1+x)e-β(x-m)eγ(x-m)
Proxy anchor (Kim et al., 2020c)proxyXx1/β log(1+x)1/γ log(1+x)e-β(x-m)eγ(x-m)
NCA (Goldberger et al., 2005)XXx-log(x)log(x)exex
ProxyNCA (Movshovitz-Attias et al., 2017)Xproxyx-log(x)log(x)exex
ProxyNCA++ (Teh et al., 2020)Xproxyx-log(x)log(x)ex/Tex/T
+ +Table 1: Loss functions. Anchor/positive/negative: $X$ : embedding of input example from training set $X$ by $f$ ; proxy: learnable parameter in ${\mathbb{R}}^{d};T$ : temperature. All loss functions are encompassed by (3) using the appropriate definition of functions $\tau ,{\sigma }^{ + },{\sigma }^{ - },{\rho }^{ + },{\rho }^{ - }$ as given here. + +Manifold mixup (Verma et al., 2019) linearly interpolates between intermediate representations (features) of the network instead. Referring to 2D images, we define $g_{m}:\mathcal{X}\to \mathbb{R}^{c\times w\times h}$ as the mapping from the input to intermediate layer $m$ of the network and $f_{m}:\mathbb{R}^{c\times w\times h}\rightarrow \mathbb{R}^{d}$ as the mapping from intermediate layer $m$ to the embedding, where $c$ is the number of channels (feature dimensions) and $w\times h$ is the spatial resolution. Thus, our model $f$ can be expressed as the composition $f = f_{m}\circ g_{m}$ . + +For manifold mixup, we follow (Venkataramanan et al., 2021) and mix either features of intermediate layer $m$ or the final embeddings. Thus, we define three mixup types in total: + +$$ +f _ {\lambda} \left(x, x ^ {\prime}\right) := \left\{ \begin{array}{l l} f \left(\operatorname {m i x} _ {\lambda} \left(x, x ^ {\prime}\right)\right), & \text {i n p u t m i x u p} \\ f _ {m} \left(\operatorname {m i x} _ {\lambda} \left(g _ {m} (x), g _ {m} \left(x ^ {\prime}\right)\right)\right), & \text {f e a t u r e m i x u p} \\ \operatorname {m i x} _ {\lambda} \left(f (x), f \left(x ^ {\prime}\right)\right), & \text {e m b e d d i n g m i x u p .} \end{array} \right. \tag {4} +$$ + +Function $f_{\lambda} : \mathcal{X}^2 \to \mathbb{R}^d$ performs both mixup and embedding. We explore different mixup types in subsection B.4 of the Appendix. + +# 3.4 LABEL REPRESENTATION + +Classification In supervised classification, each example $x \in X$ is assigned an one-hot encoded label $y \in \{0,1\}^C$ , where $C$ is the number of classes. Label vectors are also linearly interpolated: given two labeled examples $(x,y), (x',y')$ , the interpolated label is $\mathrm{mix}_{\lambda}(y,y')$ . The loss (cross-entropy) is a continuous function of the label vector. We extend this idea to metric learning. + +Metric learning Positives $P(a)$ and negatives $N(a)$ of anchor $a$ are defined as having the same or different class label as the anchor, respectively. To every example in $P(a) \cup N(a)$ , we assign a binary (two-class) label $y \in \{0,1\}$ , such that $y = 1$ for positives and $y = 0$ for negatives: + +$$ +U ^ {+} (a) := \{(p, 1): p \in P (a) \} \tag {5} +$$ + +$$ +U ^ {-} (a) := \{(n, 0): n \in N (a) \} \tag {6} +$$ + +Thus, we represent both positives and negatives by $U(a) \coloneqq U^{+}(a) \cup U^{-}(a)$ . We now rewrite the generic loss function (3) as: + +$$ +\ell (a; \theta) := \tau \left(\sigma^ {+} \left(\sum_ {(x, y) \in U (a)} y \rho^ {+} (s (a, x))\right) + \sigma^ {-} \left(\sum_ {(x, y) \in U (a)} (1 - y) \rho^ {-} (s (a, x))\right)\right). \tag {7} +$$ + +Here, every labeled example $(x,y)$ in $U(a)$ appears in both positive and negative terms. However, because label $y$ is binary, only one of the two contributions is nonzero. Now, in the presence of mixup, we can linearly interpolate labels exactly as in classification. + +# 3.5 MIXED LOSS FUNCTION + +Mixup For every anchor $a$ , we are given a set $M(a)$ of pairs of examples to mix. This is a subset of $(S(a) \cup U(a)) \times U(a)$ where $S(a) := (a, 1)$ . That is, we allow mixing between positive-negative, positive-positive and negative-negative pairs, where the anchor itself is also seen as positive. We + +define the possible choices of mixing pairs $M(a)$ in subsection 4.1 and we assess them in subsection B.4 of the Appendix. Let $V(a)$ be the set of corresponding labeled mixed embeddings + +$$ +V (a) := \left\{\left(f _ {\lambda} \left(x, x ^ {\prime}\right), \operatorname {m i x} _ {\lambda} \left(y, y ^ {\prime}\right)\right): \left(\left(x, y\right), \left(x ^ {\prime}, y ^ {\prime}\right)\right) \in M (a), \lambda \sim \operatorname {B e t a} (\alpha , \alpha) \right\}, \tag {8} +$$ + +where $f_{\lambda}$ is defined by (4). With these definitions in place, the generic loss function $\widetilde{\ell}$ over mixed examples takes exactly the same form as (7), with only $U(a)$ replaced by $V(a)$ : + +$$ +\widetilde {\ell} (a; \theta) := \tau \left(\sigma^ {+} \left(\sum_ {(v, y) \in V (a)} y \rho^ {+} (s (a, v))\right) + \sigma^ {-} \left(\sum_ {(v, y) \in V (a)} (1 - y) \rho^ {-} (s (a, v))\right)\right), \tag {9} +$$ + +where similarity $s$ is evaluated on $\mathcal{X} \times \mathbb{R}^d$ for pair-based losses and on $\mathbb{R}^d \times \mathbb{R}^d$ for proxy anchor. Now, every labeled embedding $(v,y)$ in $V(a)$ appears in both positive and negative terms and both contributions are nonzero for positive-negative pairs, because after interpolation, $y \in [0,1]$ . + +Error function Parameters $\theta$ are learned by minimizing the error function, which is a linear combination of the clean loss (3) and the mixed loss (9), averaged over all anchors + +$$ +E (X; \theta) := \frac {1}{| X |} \sum_ {a \in X} \ell (a; \theta) + w \widetilde {\ell} (a; \theta), \tag {10} +$$ + +where $w \geq 0$ is the mixing strength. At least for manifold mixup, this combination comes at little additional cost, since clean embeddings are readily available. + +# 3.6 ANALYSIS: MIXED EMBEDDINGS AND POSITIVITY + +Let $\mathrm{Pos}(a,v)$ be the event that a mixed embedding $v$ behaves as "positive" for anchor $a$ , i.e., minimizing the loss $\widetilde{\ell}(a;\theta)$ will increase the similarity $s(a,v)$ . In subsection A.2 of the Appendix, we explain that this "positivity" is equivalent to $\partial \widetilde{\ell}(a;\theta) / \partial s(a,v) \leq 0$ . Under positive-negative mixing, i.e., $M(a) \subset U^{+}(a) \times U^{-}(a)$ , we then estimate the probability of $\mathrm{Pos}(a,v)$ as a function of $\lambda$ in the case of multi-similarity (2) with a single mixed embedding $v$ : + +$$ +\mathrm {P} (\operatorname {P o s} (a, v)) = F _ {\lambda} \left(\frac {1}{\beta + \gamma} \ln \left(\frac {\lambda}{1 - \lambda}\right) + m\right), \tag {11} +$$ + +where $F_{\lambda}$ is the CDF of similarities $s(a,v)$ between anchors $a$ and mixed embeddings $v$ with interpolation factor $\lambda$ . In Figure 2, we measure the probability of $\mathrm{Pos}(a,v)$ as a function of $\lambda$ in two ways, both purely empirically and theoretically by (11). Both measurements are increasing functions of $\lambda$ of sigmoidal shape, where a mixed embedding is mostly positive for $\lambda$ close to 1 and mostly negative for $\lambda$ close to 0. + +# 4 EXPERIMENTS + +# 4.1 SETUP + +Datasets We experiment on Caltech-UCSD Birds (CUB200) (Wah et al., 2011), Stanford Cars (Cars196) (Krause et al., 2013), Stanford Online Products (SOP) (Oh Song et al., 2016) and In-Shop Clothing retrieval (In-Shop) (Liu et al., 2016) image datasets. More details are in subsection B.1. + +Network, features and embeddings We use Resnet-50 (He et al., 2016) (R-50) pretrained on ImageNet (Russakovsky et al., 2015) as a backbone network. We obtain the intermediate representation (feature), a $7 \times 7 \times 2048$ tensor, from the last convolutional layer. Following (Kim et al., 2020c), we combine adaptive average pooling with max pooling, followed by a fully-connected layer to obtain the embedding of $d = 512$ dimensions. + +Loss functions We reproduce contrastive (Cont) (Hadsell et al., 2006), multi-similarity (MS) (Wang et al., 2019), proxy anchor (PA) (Kim et al., 2020c) and ProxyNCA++ (Teh et al., 2020) and we evaluate them under different mixup types. For MS (2), following Musgrave et al. (2020), we use $\beta = 18$ , $\gamma = 75$ and $m = 0.77$ . For PA, we use $\beta = \gamma = 32$ and $m = 0.1$ , as reported by the authors. Details on training are in subsection B.1 of the Appendix. + +Methods We compare our method, Matrix, with proxy synthesis (PS) (Gu et al., 2021), $i$ -mix (Lee et al., 2021) and MoCHi (Kalantidis et al., 2020). For PS, we adapt the official code1 to PA on all datasets, and use it with PA only, because it is designed for proxy-based losses. PS has been shown superior to (Ko & Gu, 2020; Gu & Ko, 2020), although in different networks. MoCHi and $i$ -mix are meant for contrastive representation learning. We evaluate using $\text{Recall} @ K$ (Oh Song et al., 2016): For each test example taken as a query, we find its $K$ -nearest neighbors in the test set excluding itself in the embedding space. We assign a score of 1 if an example of the same class is contained in the neighbors and 0 otherwise. $\text{Recall} @ K$ is the average of this score over the test set. + +Mixup settings For input mixup, we use the $k$ hardest negative examples for each anchor (each example in the batch) and mix them with positives or with the anchor. We use $k = 3$ by default. For manifold mixup, we focus on the last few layers instead, where features and embeddings are compact, and we mix all pairs. We use feature mixup by default and call it Metrix/feature or just Metrix, while input and embedding mixup are called Metrix/Input and Metrix/embed, respectively. For all mixup types, we use clean examples as anchors and we define a set $M(a)$ of pairs of examples to mix for each anchor $a$ , with their labels (positive or negative). By default, we mix positive-negative or anchor-negative pairs, by choosing uniformly at random between $M(a) \coloneqq U^{+}(a) \times U^{-}(a)$ and $M(a) \coloneqq S(a) \times U^{-}(a)$ , respectively, where + +![](images/4def7bd5c4019afb18e3f733eee758be32e2733935920c5904b57f14ccf7fa89.jpg) +Figure 2: "Positivity" of mixed embeddings vs. $\lambda$ . We measure $\mathrm{P}(\mathrm{Pos}(a,v))$ empirically as $\mathrm{P}(\partial \widetilde{\ell}_{\mathrm{MS}}(a;\theta) / \partial s(a,v)\leq 0)$ and theoretically by (11), where $F_{\lambda}$ is again measured from data. We use embedding mixup on MS (2) on CUB200 at epoch 0, based on the setup of subsection 4.1. + +$U^{-}(a)$ is replaced by hard negatives only for input mixup. More details are in subsection B.2. + +# 4.2 RESULTS + +Improving the state of the art As shown in Table 2, Metrox consistently improves the performance of all baseline losses (Cont, MS, PA, ProxyNCA++) across all datasets. More results in subsection B.3 of the Appendix reveal that the same is true for Metrox/Input and Metrox/embed too. Surprisingly, MS outperforms PA and ProxyNCA++ under mixup on all datasets but SOP, where the three losses are on par. This is despite the fact that baseline PA outperforms MS on CUB200 and Cars-196, while ProxyNCA++ outperforms MS on SOP and In-Shop. Both contrastive and MS are significantly improved by mixup. By contrast, improvements on PA and ProxyNCA++ are marginal, which may be due to the already strong performance of PA, or further improvement is possible by employing different mixup methods that take advantage of the image structure. + +In terms of Recall@1, our MS+Metrix is best overall, improving by $3.6\%$ ( $67.8 \rightarrow 71.4$ ) on CUB200, $1.8\%$ ( $87.8 \rightarrow 89.6$ ) on Cars196, $4.1\%$ ( $76.9 \rightarrow 81.0$ ) on SOP and $2.1\%$ ( $90.1 \rightarrow 92.2$ ) on In-Shop. The same solution sets new state of the art, outperforming the previously best PA by $1.7\%$ ( $69.7 \rightarrow 71.4$ ) on CUB200, MS by $1.8\%$ ( $87.8 \rightarrow 89.6$ ) on Cars196, ProxyNCA++ by $0.3\%$ ( $80.7 \rightarrow 81.0$ ) on SOP and SoftTriple by $1.2\%$ ( $91.0 \rightarrow 92.2$ ) on In-Shop. Importantly, while the previous state of the art comes from a different loss per dataset, MS+Metrix is almost consistently best across all datasets. + +Alternative mixing methods In Table 3, we compare Metrox/input with $i$ -Mix (Lee et al., 2021) and Metrox/embed with MoCHi (Kalantidis et al., 2020) using contrastive loss, and with PS (Gu et al., 2021) using PA. MoCHi and PS mix embeddings only, while labels are always negative. For $i$ -Mix, we mix anchor-negative pairs $(S(a)\times U^{-}(a))$ . For MoCHi, the anchor is clean and we mix negative-negative $(U^{-}(a)^{2})$ and anchor-negative $(S(a)\times U^{-}(a))$ pairs, where $U^{-}(a)$ is replaced by $k = 100$ hardest negatives and $\lambda \in (0,0.5)$ for anchor-negative. PS mixes embeddings of different classes and treats them as new classes. For clean anchors, this corresponds to positive-negative $(U^{+}(a)\times U^{-}(a))$ and negative-negative $(U^{-}(a)^{2})$ pairs, but PS also supports mixed anchors. + +
CUB200CARS196SOPIN-SHOP
METHODR@1R@2R@4R@1R@2R@4R@1R@10R@100R@1R@10R@20
Triplet (Weinberger & Saul, 2009)63.575.684.477.385.490.870.585.694.385.396.697.8
LiftedStructure (Oh Song et al., 2016)65.975.884.581.488.392.476.188.695.288.697.698.4
ProxyNCA (Movshovitz-Attias et al., 2017)65.275.683.881.287.992.673.287.094.486.295.997.0
Margin (Wu et al., 2017)65.076.284.682.188.792.774.887.894.888.697.097.8
SoftTriple (Qian et al., 2019)67.377.786.286.591.995.379.891.296.391.097.698.3
D&C (Sanakoyeu et al., 2019)*65.976.684.484.690.794.175.988.494.985.795.596.9
EPSHN (Xuan et al., 2020)*64.975.383.582.789.393.078.390.796.387.895.796.8
Cont (Hadsell et al., 2006)64.775.984.681.688.292.774.987.093.986.494.796.2
+Metrix67.477.985.785.191.194.677.589.195.589.195.797.1
+2.7+2.0+1.1+3.5+2.9+1.9+2.6+2.1+1.5+2.7+1.0+0.9
MS (Wang et al., 2019)67.877.885.687.892.795.376.989.895.990.197.698.4
+Metrix71.480.686.889.694.296.081.092.097.292.298.598.6
+3.6+2.8+1.2+1.8+1.5+0.7+4.1+2.2+1.3+2.1+0.9+0.2
PA (Kim et al., 2020c)*69.780.087.087.792.995.8------
PA (Kim et al., 2020c)69.579.387.087.692.395.579.190.896.290.097.498.2
+Metrix71.081.888.289.193.696.781.391.796.991.998.298.8
+1.3+1.8+1.2+1.4+0.7+0.9+2.2+0.9+0.7+1.9+0.8+0.6
ProxyNCA++ (Teh et al., 2020)*69.079.887.386.592.595.780.792.096.790.498.198.8
ProxyNCA++ (Teh et al., 2020)69.179.587.786.692.195.480.491.796.790.297.698.4
+Metrix70.480.688.788.593.496.581.392.797.191.998.198.8
+1.3+0.8+1.0+1.9+0.9+0.8+0.6+0.7+0.4+1.5+0.0+0.0
Gain over SOTA+1.7+1.8+0.5+1.8+1.3+0.9+0.6+0.7+0.5+1.2+0.4+0.0
+ +Table 2: Improving the SOTA with our Matrix (Matrix/feature) using Resnet-50 with embedding size $d = 512$ . R@K (%): Recall@K; higher is better. *: reported by authors. Bold black: best baseline (previous SOTA, one per column). Red: Our new SOTA. Gain over SOTA is over best baseline. MS: Multi-Similarity, PA: Proxy Anchor. Additional results are in subsection B.3 of the Appendix. + +In terms of Recall@1, Metric输入 outperforms $i$ -Mix with anchor-negative pairs by $0.5\%$ ( $65.8 \rightarrow 66.3$ ) on CUB200, $0.9\%$ ( $82.0 \rightarrow 82.9$ ) on Cars196, $0.6\%$ ( $75.2 \rightarrow 75.8$ ) and $0.6\%$ ( $87.1 \rightarrow 87.7$ ) on In-Shop. Metric/embed outperforms MoCHI with anchor-negative pairs by $1.2\%$ ( $65.2 \rightarrow 66.4$ ) on CUB200, $1.4\%$ ( $82.5 \rightarrow 83.9$ ) on Cars196, $0.9\%$ ( $75.8 \rightarrow 76.7$ ) and $1.2\%$ ( $87.2 \rightarrow 88.4$ ) on In-Shop. The gain over MoCHi with negative-negative pairs is significantly higher. Metric/embed also outperforms PS by $0.4\%$ ( $70.0 \rightarrow 70.4$ ) on CUB200, $1\%$ ( $87.9 \rightarrow 88.9$ ) on Cars196, $1\%$ ( $79.6 \rightarrow 80.6$ ) on SOP and $1.3\%$ ( $90.3 \rightarrow 91.6$ ) on In-Shop. + +Computational complexity We study the computational complexity of $\mathbf{Mat}$ rix in subsection B.3. + +Ablation study We study the effect of the number $k$ of hard negatives, mixup types (input, feature and embedding), mixing pairs and mixup strength $w$ in subsection B.4 of the Appendix. + +# 4.3 HOW DOES MIXUP IMPROVE REPRESENTATIONS? + +We analyze how Metrox improves representation learning, given the difference between distributions at training and inference. As discussed in section 1, since the classes at inference are unseen at training, one might expect interpolation-based data augmentation like mixup to be even more important than in classification. This is so because, by mixing examples during training, we are exploring areas of the embedding space beyond the training classes. We hope that this exploration would possibly lead the model to implicitly learn a representation more appropriate for the test classes, if the distribution of the test classes lies near these areas. + +Alignment and Uniformity In terms of quantitative measures of properties of the training and test distributions, we follow Wang & Isola (2020). This work introduces two measures - alignment and uniformity (the lower the better) to be used both as loss functions (on the training set) and as evaluation metrics (on the test set). Alignment measures the expected pairwise distance between positive examples in the embedding space. A small value of alignment indicates that the positive examples are clustered together. Uniformity measures the (log of the) expected pairwise similarity between all examples regardless of class, using a Gaussian kernel as similarity. A small value of uniformity indicates that the distribution is more uniform over the embedding space, which is particularly relevant to our problem. Meant for contrastive learning, (Wang & Isola, 2020) use the same training and test classes, while in our case they are different. + +
CUB200CARS196SOPIN-SHOP
METHODMIXING PAIRSR@1R@2R@4R@1R@2R@4R@1R@10R@100R@1R@10R@20
Cont (Hadsell et al., 2006)-64.775.984.681.688.292.774.987.093.986.494.796.3
+ i-Mix (Lee et al., 2021)anc-neg65.876.284.982.088.593.275.287.394.287.195.496.1
+ Metrix/Inputpos-neg / anc-neg66.377.185.282.989.393.775.887.894.687.795.996.5
+MoCHi (Kalantidis et al., 2020)neg-neg63.174.383.876.384.089.368.983.191.881.891.993.9
+MoCHi (Kalantidis et al., 2020)anc-neg65.275.884.282.588.092.975.887.194.887.292.894.9
+Metrix/embedpos-neg / anc-neg66.477.685.483.990.394.176.788.695.288.495.496.9
PA (Kim et al., 2020c)-69.780.087.087.692.395.579.190.896.290.097.498.2
+PS (Gu et al., 2021)pos-neg / neg-neg70.079.887.287.992.895.679.690.996.490.397.498.0
+Metrix/embedpos-neg / anc-neg70.481.187.988.993.396.480.691.796.691.698.398.3
+ +Table 3: Comparison of our Matrix/embed with other mixing methods using R-50 with embedding size $d = 512$ . R@K (%): Recall@K; higher is better. PA: Proxy Anchor, PS: Proxy Synthesis. + +By training with contrastive loss on CUB200 and then measuring on the test set, we achieve an alignment (lower the better) of 0.28 for contrastive loss, 0.28 for $i$ -Mix (Lee et al., 2021) and 0.19 for Metrix/Input. MoCHi (Kalantidis et al., 2020) and Metrix/embed achieve an alignment of 0.19 and 0.17, respectively. We also obtain a uniformity (lower the better) of $-2.71$ for contrastive loss, $-2.13$ for $i$ -Mix and $-3.13$ for Metrix/Input. The uniformity of MoCHi and Metrix/embed is $-3.18$ and $-3.25$ , respectively. This indicates that Metrix helps obtain a test distribution that is more uniform over the embedding space, where classes are better clustered and better separated. + +Utilization The measures proposed by (Wang & Isola, 2020) are limited to a single distribution or dataset, either the training set (as loss functions) or the test set (as evaluation metrics). It is more interesting to measure the extent to which a test example, seen as a query, lies near any of the training examples, clean or mixed. For this, we introduce the measure of utilization $u(Q,X)$ of the training + +$$ +\text {s e t} X \text {b y} Q \text {a s} +$$ + +$$ +u (Q, X) = \frac {1}{| Q |} \sum_ {q \in Q} \min _ {x \in X} \| f (q) - f (x) \| ^ {2} \tag {12} +$$ + +Utilization measures the average, over the test set $Q$ , of the minimum distance of a query $q$ to a training example $x \in X$ in the embedding space of the trained model $f$ (lower is better). A low value of utilization indicates that there are examples in the training set that are similar to test examples. When using mixup, we measure utilization as $u(Q, \hat{X})$ , where $\hat{X}$ is the augmented training set including clean and mixed examples over a number of epochs and $f$ remains fixed. Because $X \subset \hat{X}$ , we expect $u(Q, \hat{X}) < u(Q, X)$ , that is, the embedding space is better explored in the presence of mixup. + +By using contrastive loss on CUB200, utilization drops from 0.41 to 0.32 when using Metric. This indicates that test samples are indeed closer to mixed examples than clean in the embedding space. This validates our hypothesis that a representation more appropriate for test classes is implicitly learned during exploration of the embedding space in the presence of mixup. + +# 5 CONCLUSION + +Based on the argument that metric learning is binary classification of pairs of examples into "positive" and "negative", we have introduced a direct extension of mixup from classification to metric learning. Our formulation is generic, applying to a large class of loss functions that separate positives from negatives per anchor and involve component functions that are additive over examples. Those are exactly loss functions that require less mining. We contribute a principled way of interpolating labels, such that the interpolation factor affects the relative weighting of positives and negatives. Other than that, our approach is completely agnostic with respect to the mixup method, opening the way to using more advanced mixup methods for metric learning. + +We consistently outperform baselines using a number of loss functions on a number of benchmarks and we improve the state of the art using a single loss function on all benchmarks, while previous state of the art was not consistent in this respect. Surprisingly, this loss function, multisimilarity Wang et al. (2019), is not the state of the art without mixup. Because metric learning is about generalizing to unseen classes and distributions, our work may have applications to other such problems, including transfer learning, few-shot learning and continual learning. + +# 6 ACKNOWLEDGEMENT + +Shashanka's work was supported by the ANR-19-CE23-0028 MEERQAT project and was performed using the HPC resources from GENCI-IDRIS Grant 2021 AD011011709R1. Bill's work was partially supported by the EU RAMONES project grant No. 101017808 and was performed using the HPC resources from GRNET S.A. project pr011028. This work was partially done when Yannis was at Inria. + +# REFERENCES + +Christopher Beckham, Sina Honari, Vikas Verma, Alex Lamb, Farnoosh Ghadiri, R Devon Hjelm, Yoshua Bengio, and Christopher Pal. On adversarial mixup resynthesis. arXiv preprint arXiv:1903.02709, 2019. +David Berthelot, Colin Raffel, Aurko Roy, and Ian Goodfellow. Understanding and improving interpolation in autoencoders via an adversarial regularizer. arXiv preprint arXiv:1807.07543, 2018. +Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In ECCV, 2018. +Weihua Chen, Xiaotang Chen, Jianguo Zhang, and Kaiqi Huang. Beyond triplet loss: a deep quadruplet network for person re-identification. In CVPR, 2017. +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. +Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. +Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In ICML, 2014. +Jacob Goldberger, Sam Roweis, Geoffrey Hinton, and Ruslan Salakhutdinov. Neighbourhood components analysis. In NIPS, 2005. +Albert Gordo, Jon Almazán, Jerome Revaud, and Diane Larlus. Deep image retrieval: Learning global representations for image search. In ECCV, 2016. +Geonmo Gu and Byungsoo Ko. Symmetrical synthesis for deep metric learning. In AAAI, 2020. +Geonmo Gu, Byungsoo Ko, and Han-Gyu Kim. Proxy synthesis: Learning with synthetic classes for deep metric learning. In AAAI, 2021. +Raia Hadsell, Sumit Chopra, and Yann LeCun. Dimensionality reduction by learning an invariant mapping. In CVPR, 2006. +Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. +Dan Hendrycks, Norman Mu, Ekin D Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. *ICLR*, 2020. +Alexander Hermans, Lucas Beyer, and Bastian Leibe. In defense of the triplet loss for person re-identification. arXiv preprint arXiv:1703.07737, 2017. +Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. +Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. NeurIPS, 2020. + +Jang-Hyun Kim, Wonho Choo, and Hyun Oh Song. Puzzle mix: Exploiting saliency and local statistics for optimal mixup. In ICML, 2020a. +Jang-Hyun Kim, Wonho Choo, Hosan Jeong, and Hyun Oh Song. Co-mixup: Saliency guided joint mixup with supermodular diversity. In ICLR, 2021. +Sungnyun Kim, Gihun Lee, Sangmin Bae, and Se-Young Yun. Mixco: Mix-up contrastive learning for visual representation. NeurIPS Workshop on Self-Supervised Learning, 2020b. +Sungyeon Kim, Dongwon Kim, Minsu Cho, and Suha Kwak. Proxy anchor loss for deep metric learning. In CVPR, 2020c. +Byungsoo Ko and Geonmo Gu. Embedding expansion: Augmentation in embedding space for deep metric learning. In CVPR, 2020. +Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (bit): General visual representation learning. In ECCV, 2020. +Jonathan Krause, Michael Stark, Jia Deng, and Fei-Fei Li. 3d object representations for fine-grained categorization. ICCVW, 2013. +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. +Xiaofeng Liu, Yang Zou, Lingsheng Kong, Zhihui Diao, Junliang Yan, Jun Wang, Site Li, Ping Jia, and Jane You. Data augmentation via latent space interpolation for image classification. In ICPR, 2018. +Ziwei Liu, Ping Luo, Shi Qiu, Xiaogang Wang, and Xiaou Tang. Deepfashion: Powering robust clothes recognition and retrieval with rich annotations. In CVPR, 2016. +Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. *ICLR*, 2019. +Yair Movshovitz-Attias, Alexander Toshev, Thomas K Leung, Sergey Ioffe, and Saurabh Singh. No fuss distance metric learning using proxies. In ICCV, 2017. +Kevin Musgrave, Serge Belongie, and Ser-Nam Lim. A metric learning reality check. In ECCV, 2020. +Hyun Oh Song, Yu Xiang, Stefanie Jegelka, and Silvio Savarese. Deep metric learning via lifted structured feature embedding. In CVPR, 2016. +Qi Qian, Lei Shang, Baigui Sun, Juhua Hu, Hao Li, and Rong Jin. Softtriple loss: Deep metric learning without triplet sampling. In ICCV, 2019. +Jie Qin, Jiemin Fang, Qian Zhang, Wenyu Liu, Xingang Wang, and Xinggang Wang. Resizemix: Mixing data with preserved object information and true labels. arXiv preprint arXiv:2012.11101, 2020. +Nils Reimers and Iryna Gurevych. Sentence-bert: Sentence embeddings using siamese bert-networks. In EMNLP, 2019. +Joshua Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka. Contrastive learning with hard negative samples. *ICLR*, 2021. +Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 2015. +Artsiom Sanakoyeu, Vadim Tschernezki, Uta Buchler, and Bjorn Ommer. Divide and conquer the embedding space for metric learning. In CVPR, 2019. +Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In CVPR, 2015. + +Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In NIPS, 2016. +Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. arXiv preprint arXiv:2001.07685, 2020. +Eu Wern Teh, Terrance DeVries, and Graham W Taylor. Proxynca++: Revisiting and revitalizing proxy neighborhood component analysis. In ECCV, 2020. +A. F. M. Shahab Uddin, Sirazam Monira Mst., Wheemyung Shin, TaeChoong Chung, and Sung-Ho Bae. Saliencymix: A saliency guided data augmentation strategy for better regularization. In ICLR, 2021. +Shashanka Venkataramanan, Yannis Avrithis, Ewa Kijak, and Laurent Amsaleg. Alignmix: Improving representation by interpolating aligned features. arXiv preprint arXiv:2103.15375, 2021. +Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, David Lopez-Paz, and Yoshua Bengio. *Manifold mixup: Better representations by interpolating hidden states.* In ICML, 2019. +Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. arXiv preprint arXiv:1606.04080, 2016. +Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. +Jiang Wang, Yang Song, Thomas Leung, Chuck Rosenberg, Jingbin Wang, James Philbin, Bo Chen, and Ying Wu. Learning fine-grained image similarity with deep ranking. In CVPR, 2014. +Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, 2020. +Xun Wang, Xintong Han, Weilin Huang, Dengke Dong, and Matthew R Scott. Multi-similarity loss with general pair weighting for deep metric learning. In CVPR, 2019. +Kilian Q Weinberger and Lawrence K Saul. Distance metric learning for large margin nearest neighbor classification. JMLR, 2009. +Chao-Yuan Wu, R. Manmatha, Alexander J. Smola, and Philipp Krajhenbuhl. Sampling matters in deep embedding learning. In ICCV, 2017. +Eric P Xing, Michael I Jordan, Stuart J Russell, and Andrew Y Ng. Distance metric learning with application to clustering with side-information. In NIPS, 2003. +Hong Xuan, Abby Stylianou, and Robert Pless. Improved embeddings with easy positive triplet mining. In WACV, 2020. +Dong Yi, Zhen Lei, and Stan Z. Li. Deep metric learning for practical person re-identification. arXiv preprint arXiv:1703.07737, 2014. +Sangaroo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In ICCV, 2019. +Andrew Zhai and Hao-Yu Wu. Classification is a strong baseline for deep metric learning. arXiv preprint arXiv:1811.12649, 2018. +Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018. +Wenzhao Zheng, Zhaodong Chen, Jiwen Lu, and Jie Zhou. Hardness-aware deep metric learning. In CVPR, 2019. + +Jianchao Zhu, Liangliang Shi, Junchi Yan, and Hongyuan Zha. Automix: Mixup networks for sample interpolation via cooperative barycenter learning. In ECCV, 2020a. +Yuehua Zhu, Muli Yang, Cheng Deng, and Wei Liu. Fewer is more: A deep graph metric learning perspective using fewer proxies. NeurIPS, 2020b. + +# A MORE ON THE METHOD + +# A.1 MIXED LOSS FUNCTION + +Interpretation To better understand the two contributions of a labeled embedding $(v,y)$ in $V(a)$ to the positive and negative terms of (9), consider the case of positive-negative mixing pairs, $M(a)\subset U^{+}(a)\times U^{-}(a)$ . Then, for $((x,y),(x^{\prime},y^{\prime}))\in M(a)$ , the mixed label is $\mathrm{mix}_{\lambda}(y,y^{\prime}) = \mathrm{mix}_{\lambda}(1,0) = \lambda$ and (9) becomes + +$$ +\widetilde {\ell} (a; \theta) = \tau \left(\sigma^ {+} \left(\sum_ {(v, \lambda) \in V (a)} \lambda \rho^ {+} (s (a, v))\right) + \sigma^ {-} \left(\sum_ {(v, \lambda) \in V (a)} (1 - \lambda) \rho^ {-} (s (a, v))\right)\right). \tag {13} +$$ + +Thus, the mixed embedding $v$ is both positive (with weight $\lambda$ ) and negative (with weight $1 - \lambda$ ). Whereas for positive-positive mixing, that is, for $M(a) \subset U^{+}(a)^{2}$ , the mixed label is 1 and the negative term vanishes. Similarly, for negative-negative mixing, that is, for $M(a) \subset U^{-}(a)^{2}$ , the mixed label is 0 and the positive term vanishes. + +In the particular case of contrastive (1) loss, positive-negative mixing (13) becomes + +$$ +\widetilde {\ell} _ {\text {c o n t}} (a; \theta) := \sum_ {(v, \lambda) \in V (a)} - \lambda s (a, v) + \sum_ {(v, \lambda) \in V (a)} (1 - \lambda) [ s (a, v) - m ] _ {+}. \tag {14} +$$ + +Similarly, for multi-similarity (2), + +$$ +\begin{array}{l} \widetilde {\ell} _ {\mathrm {M S}} (a; \theta) := \frac {1}{\beta} \log \left(1 + \sum_ {(v, \lambda) \in V (a)} \lambda e ^ {- \beta (s (a, v) - m)}\right) + \tag {15} \\ \frac {1}{\gamma} \log \left(1 + \sum_ {(v, \lambda) \in V (a)} (1 - \lambda) e ^ {\gamma (s (a, v) - m)}\right). \\ \end{array} +$$ + +# A.2 ANALYSIS: MIXED EMBEDDINGS AND POSITIVITY + +Positivity Under positive-negative mixing, (13) shows that a mixed embedding $v$ with interpolation factor $\lambda$ behaves as both positive and negative to different extents, depending on $\lambda$ : mostly positive for $\lambda$ close to 1, mostly negative for $\lambda$ close to 0. The net effect depends on the derivative of the loss with respect to the similarity $\partial \widetilde{\ell}(a; \theta) / \partial s(a, v)$ : if the derivative is negative, then $v$ behaves as positive and vice versa. This is clear from the chain rule + +$$ +\frac {\partial \widetilde {\ell} (a ; \theta)}{\partial v} = \frac {\partial \widetilde {\ell} (a ; \theta)}{\partial s (a , v)} \cdot \frac {\partial s (a , v)}{\partial v}, \tag {16} +$$ + +because $\partial s(a,v) / \partial v$ is a vector pointing in a direction that makes $a, v$ more similar and the loss is being minimized. Let $\operatorname{Pos}(a,v)$ be the event that $v$ behaves as “positive”, i.e., $\partial \widetilde{\ell}(a;\theta) / \partial s(a,v) \leq 0$ and minimizing the loss will increase the similarity $s(a,v)$ . + +Multi-similarity We estimate the probability of $\operatorname{Pos}(a, v)$ as a function of $\lambda$ in the case of multi-similarity with a single embedding $v$ obtained by mixing a positive with a negative: + +$$ +\widetilde {\ell} _ {\mathrm {M S}} (a; \theta) = \frac {1}{\beta} \log \left(1 + \lambda e ^ {- \beta (s (a, v) - m)}\right) + \frac {1}{\gamma} \log \left(1 + (1 - \lambda) e ^ {\gamma (s (a, v) - m)}\right). \tag {17} +$$ + +In this case, $\operatorname{Pos}(a, v)$ occurs if and only if + +$$ +\frac {\partial \widetilde {\ell} _ {\mathrm {M S}} (a ; \theta)}{\partial s (a , v)} = \frac {- \lambda e ^ {- \beta (s (a , v) - m)}}{(1 + \lambda e ^ {- \beta (s (a , v) - m)})} + \frac {(1 - \lambda) e ^ {\gamma (s (a , v) - m)}}{(1 + (1 - \lambda) e ^ {\gamma (s (a , v) - m))}} \leq 0. \tag {18} +$$ + +![](images/abaa56cdee80d8d0dd8973321685f2d9149ee573966089b251348c99fdac4fd7.jpg) +(a) + +(b) +Figure 3: Exploring the embedding space when using (a) only clean examples (b) clean and mixed examples. Given a query $q$ , the distance $d$ to its nearest training embedding (clean or mixed) is smaller with mixup (b) than without (a). +![](images/61aa12a1088016596fadfe34641e8429387996f7700182f5293db0c824bcff84.jpg) +Clean train examples +Mixed train examples +Test examples + +By letting $t \coloneqq s(a, v) - m$ , this condition is equivalent to + +$$ +\frac {(1 - \lambda) e ^ {\gamma t}}{(1 + (1 - \lambda) e ^ {\gamma t})} \leq \frac {\lambda e ^ {- \beta t}}{(1 + \lambda e ^ {- \beta t})} \tag {19} +$$ + +$$ +(1 - \lambda) e ^ {\gamma t} (1 + \lambda e ^ {- \beta t}) \leq \lambda e ^ {- \beta t} (1 + (1 - \lambda) e ^ {\gamma t}) \tag {20} +$$ + +$$ +(1 - \lambda) e ^ {\gamma t} + \lambda (1 - \lambda) e ^ {(\gamma - \beta) t} \leq \lambda e ^ {- \beta t} + \lambda (1 - \lambda) e ^ {(\gamma - \beta) t} \tag {21} +$$ + +$$ +e ^ {(\beta + \gamma) t} \leq \frac {\lambda}{1 - \lambda} \tag {22} +$$ + +$$ +(\beta + \gamma) (s (a, v) - m) \leq \ln \left(\frac {\lambda}{1 - \lambda}\right) \tag {23} +$$ + +$$ +s (a, v) \leq \frac {1}{\beta + \gamma} \ln \left(\frac {\lambda}{1 - \lambda}\right) + m. \tag {24} +$$ + +Finally, the probability of $\mathrm{Pos}(a,v)$ as a function of $\lambda$ is + +$$ +\mathrm {P} (\operatorname {P o s} (a, v)) = F _ {\lambda} \left(\frac {1}{\beta + \gamma} \ln \left(\frac {\lambda}{1 - \lambda}\right) + m\right), \tag {25} +$$ + +where $F_{\lambda}$ is the CDF of similarities $s(a,v)$ between anchors $a$ and mixed embeddings $v$ with interpolation factor $\lambda$ . + +In Figure 2, we measure the probability of $\mathrm{Pos}(a,v)$ as a function of $\lambda$ in two ways. First, we measure the derivative $\partial \widetilde{\ell}_{\mathrm{MS}}(a;\theta) / \partial s(a,v)$ for anchors $a$ and mixed embeddings $v$ over the entire dataset and we report the empirical probability of this derivative being non-positive versus $\lambda$ . Second, we measure $\mathrm{P}(\mathrm{Pos}(a,v))$ theoretically using (25), where the CDF of similarities $s(a,v)$ is again measured empirically for $a$ and $v$ over the dataset, as a function of $\lambda$ . Despite the simplifying assumption of a single positive and a single negative in deriving (25), we observe that the two measurements agree in general. They are both increasing functions of $\lambda$ of sigmoidal shape, they roughly yield $\mathrm{P}(\mathrm{Pos}(a,v)) \geq 0.5$ for $\lambda \geq 0.5$ and they confirm that a mixed embedding is mostly positive for $\lambda$ close to 1 and mostly negative for $\lambda$ close to 0. + +# A.3 MORE ON UTILIZATION + +In subsection 4.3, we discuss that a representation more appropriate for test classes is implicitly learned during exploration of the embedding space in the presence of mixup. We provide an illustration of this exploration in Figure 3, where we visualize the embedding space using (a) only clean train examples and (b) clean and mixed train examples. In case (a), the model is trained using only clean examples, exploring a smaller area of the embedding space. In case (b), it is trained using both + +
DATASETCUB200 (Wah et al., 2011)CARS196 (Krause et al., 2013)SOP (Oh Song et al., 2016)IN-SHOP (Liu et al., 2016)
Objectsbirdscarshousehold furnitureclothes
# classes20019622, 6347, 982
# training images5, 8948, 09260, 02626, 356
# testing images5, 8948, 09360, 02726, 356
# training classes1009811, 3183991
# testing classes1009811, 3183991
samplingrandomrandombalancedbalanced
samples per class--55
classes per batch\(65^{\dagger}\)\(70^{\dagger}\)2020
learning rate\(1 \times 10^{-4}\)\(1 \times 10^{-4}\)\(3 \times 10^{-5}\)\(1 \times 10^{-4}\)
+ +Table 4: Statistics and settings for the four datasets we use in our experiments. ${}^{ \dagger }$ : average. + +mixed and clean examples, exploring a larger area. It is clear that the distance between a query and its nearest training example (clean or mixup) is smaller in the presence of mixup. Utilization is the average of this distance over the test set. This shows that the model implicitly learns a representation closer the test example in the presence of mixup during training and it partially explains why mixup leads to better performance. + +# B MORE ON EXPERIMENTS + +# B.1 SETUP + +Datasets and sampling Dataset statistics are summarized in Table 4. Since the number of classes is large compared to the batch size in SOP and In-Shop, batches would rarely contain a positive pair when sampled uniformly at random. Hence, we use balanced sampling (Zhai & Wu, 2018), i.e., a fixed number of classes and examples per class, as shown in Table 4. For fair comparison with baseline methods, images are randomly flipped and cropped to $224 \times 224$ at training. At inference, we resize to $256 \times 256$ and then center-crop to $224 \times 224$ . + +Training We train R-50 using AdamW (Loshchilov & Hutter, 2019) optimizer for 100 epochs with a batch size 100. The initial learning rate per dataset is shown in Table 4. The learning rate is decayed by 0.1 for Cont and by 0.5 for MS and PA on CUB200 and Cars196. For SOP and In-Shop, we decay the learning rate by 0.25 for all losses. The weight decay is set to 0.0001. + +# B.2 MIXUP SETTINGS + +In mixup for classification, given a batch of $n$ examples, it is standard to form $n$ pairs of examples by pairing the batch with a random permutation of itself, resulting in $n$ mixed examples, either for input or manifold mixup. In metric learning, it is common to obtain $n$ embeddings and then use all $\frac{1}{2} n(n - 1)$ pairs of embeddings in computing the loss. We thus treat mixup types differently. + +Input mixup Mixing all pairs would be computationally expensive in this case, because we would compute $\frac{1}{2} n(n - 1)$ embeddings. A random permutation would not produce as many hard examples as can be found in all pairs. Thus, for each anchor (each example in the batch), we use the $k$ hardest negative examples and mix them with positives or with the anchor. We use $k = 3$ by default. + +Manifold mixup Originally, manifold mixup (Verma et al., 2019) focuses on the first few layers of the network. Mixing all pairs would then be even more expensive than input mixup, because intermediate features (tensors) are even larger than input examples. Hence, we focus on the last few layers instead, where features and embeddings are compact, and we mix all pairs. We use feature mixup by default and call it Metric/feature or just Metric, while input and embedding mixup are called Metric/Input and Metric/embed, respectively. All options are studied in subsection B.4. + +Mixing pairs Whatever the mixup type, we use clean examples as anchors and we define a set $M(a)$ of pairs of examples to mix for each anchor $a$ , with their labels (positive or negative). By default, we mix positive-negative or anchor-negative pairs, according to $M(a) := U^{+}(a) \times U^{-}(a)$ + +
CUB200CARS196SOPIN-SHOP
Method12412411010011020
Triplet (Weinberger & Saul, 2009)63.575.684.477.385.490.870.585.694.385.396.697.8
LiftedStructure (Oh Song et al., 2016)65.975.884.581.488.392.476.188.695.288.697.698.4
ProxyNCA (Movshovitz-Attias et al., 2017)65.275.683.881.287.992.673.287.094.486.295.997.0
Margin (Wu et al., 2017)65.076.284.682.188.792.774.887.894.888.697.097.8
SoftTriple (Qian et al., 2019)67.377.786.286.591.995.379.891.296.391.097.698.3
D&C (Sanakoyeu et al., 2019)*65.976.684.484.690.794.175.988.494.985.795.596.9
EPSHN (Xuan et al., 2020)*64.975.383.582.789.393.078.390.796.387.895.796.8
ProxyNCA++ (Teh et al., 2020)*69.079.887.386.592.595.780.792.096.790.498.198.8
Cont (Hadsell et al., 2006)64.775.984.681.688.292.774.987.093.986.494.796.2
+Matrix/Input66.377.185.282.989.393.775.887.894.687.795.996.5
+1.6+1.2+0.6+1.3+1.1+1.0+0.9+0.8+0.7+1.3+1.2+0.3
+Matrix67.477.985.785.191.194.677.589.195.589.195.797.1
+2.7+2.0+1.1+3.5+2.9+1.9+2.6+2.1+1.5+2.7+1.0+0.9
+Matrix/embed66.477.685.483.990.394.176.788.695.288.495.496.8
+1.7+1.7+0.8+2.3+2.1+1.4+1.8+1.6+1.3+2.0+0.7+0.6
MS (Wang et al., 2019)67.877.885.687.892.795.376.989.895.990.197.698.4
+Matrix/Input69.079.186.089.093.496.077.990.695.991.898.098.9
+1.2+1.3+0.4+1.2+0.7+0.7+1.0+0.8+0.0+1.7+0.4+0.5
+Matrix71.480.686.889.694.296.081.092.097.292.298.598.6
+3.6+2.8+1.2+1.8+1.5+0.7+4.1+2.2+1.3+2.1+0.9+0.2
+Matrix/embed70.280.486.788.892.995.678.591.396.791.998.398.7
+2.4+2.6+1.1+1.0+0.2+0.3+1.6+1.5+0.8+1.8+0.7+0.3
PA (Kim et al., 2020c)*69.780.087.087.792.995.8------
PA (Kim et al., 2020c)69.579.387.087.692.395.579.190.896.290.097.498.2
+Matrix/Input70.581.287.888.293.296.279.891.496.590.998.198.4
+0.8+1.2+0.8+0.5+0.3+0.4+0.7+0.6+0.3+0.9+0.7+0.2
+Matrix71.081.888.289.193.696.781.391.796.991.998.298.8
+1.3+1.8+1.2+1.4+0.7+0.9+2.2+0.9+0.7+1.9+0.8+0.6
+Matrix/embed70.481.187.988.993.396.480.691.796.691.698.398.3
+0.7+1.1+0.9+1.2+0.4+0.6+1.5+0.9+0.4+1.6+0.9+0.1
ProxyNCA++ (Teh et al., 2020)*69.079.887.386.592.595.780.792.096.790.498.198.8
ProxyNCA++ (Teh et al., 2020)69.179.587.786.692.195.480.491.796.790.297.698.4
+Matrix/Input69.779.988.387.592.996.080.992.296.991.498.198.8
+0.6+0.1+0.6+0.9+0.4+0.3+0.2+0.2+0.2+1.0+0.0+0.0
+Matrix70.480.688.788.593.496.581.392.797.191.998.198.8
+1.3+0.8+1.0+1.9+0.9+0.8+0.6+0.7+0.4+1.5+0.0+0.0
+Matrix/ embed70.280.288.288.193.096.281.192.497.091.698.198.8
+1.1+0.4+0.5+1.5+0.5+0.5+0.4+0.4+0.3+1.2+0.0+0.0
Gain over SOTA+1.7+1.8+0.5+1.8+1.3+0.9+0.6+0.0+0.5+1.2+0.4+0.0
+ +Table 5: Improving the SOTA with our Metric (Metric/feature) using Resnet-50 with embedding size $d = 512$ . R@K (%): Recall@K; higher is better. *: reported by authors. Bold black: best baseline (previous SOTA, one per column). Red: Our new SOTA. Gain over SOTA is over best baseline. MS: Multi-Similarity, PA: Proxy Anchor + +and $M(a) \coloneqq S(a) \times U^{-}(a)$ , respectively, where $U^{-}(a)$ is replaced by hard negatives only for input mixup. The two options are combined by choosing uniformly at random in each iteration. More options are studied in subsection B.4. + +Hyper-parameters For any given mixup type or set of mixup pairs, the interpolation factor $\lambda$ is drawn from $\mathrm{Beta}(\alpha ,\alpha)$ with $\alpha = 2$ . We empirically set the mixup strength (10) to $w = 0.4$ for positive-negative pairs and anchor-negative pairs. + +# B.3 MORE RESULTS + +Computational complexity On CUB200 dataset, using a batch size of 100 on an NVIDIA RTX 2080 Ti GPU, the average training time in ms/batch is 586 for MS and 817 for MS+Metrix. The $39\%$ increase in complexity is reasonable for $3.6\%$ increase in R@1. Furthermore, the average training time in ms/batch is 483 for baseline PA, 965 for PA+Metrix and 1563 for PS (Gu et al., 2021). While the computation cost of PS is higher than Metrix by $62\%$ , Metrix outperforms PS by $0.4\%$ and $1.3\%$ in terms of R@1 and R@2 respectively (Table 3). At inference, the computational cost is equal for all methods. + +![](images/742aaefba162fec457483ab17611686ff02082a4d1086a2a3a74da9cb906587e.jpg) +Figure 4: Retrieval results on CUB200 using Contrastive loss, with and without mixup. For each query, the top-5 retrieved images are shown. Images highlighted in green (red) are correctly (incorrectly) retrieved images. + +Improving the state of the art Table 5 is an extension of Table 2 that includes all three mixup types (input, feature, embedding). It shows that not just feature mixup but all mixup types consistently improve the performance of all baseline losses (Cont, MS, PA, ProxyNCA++) across all datasets. It also shows that across all baseline losses and all datasets, feature mixup works best, followed by embedding and input mixup. This result confirms the findings of Table 6 on Cars196. + +Qualitative results of retrieval Figure 4 shows qualitative results of retrieval on CUB200 using Contrastive loss, with and without mixup. This dataset has large intra-class variations such as pose variation and background clutter. Baseline Contrastive loss may fail to retrieve the correct images due to these challenges. The ranking is improved in the presence of mixup. + +Visualization of embedding space We visualize CUB200 test examples for 10, 15 and 20 classes in the embedding space using Contrastive loss, with and without mixup in Figure 5. We observe that in the presence of mixup, the embeddings are more tightly clustered and more uniformly spread, despite the variations in pose and background in the test set. This finding validates our quantitative analysis of alignment and uniformity in subsection 4.3. + +# B.4 ABLATIONS + +We perform ablations on Cars196 using R-50 with $d = 512$ , applying mixup on contrastive loss. + +**Hard negatives** We study the effect of the number $k$ of hard negatives using different mixup types. The set of mixing pairs is chosen from (positive-negative, anchor-negative) uniformly at random per iteration. We choose $k = 3$ for input mixup. For feature/embedding mixup, we mix all pairs in a batch by default, but also study $k \in \{20, 40\}$ . As shown in Table 6, $k = 3$ for input and all pairs for feature/embedding mixup works best. Still, using few hard negatives for feature/embedding mixup is on par or outperforms input mixup. All choices significantly outperform the baseline. + +![](images/26bcc213b75b80cf453d54a347bf32d7cf5e9d124d05570df103a8fbc200f120.jpg) +Figure 5: Embedding space visualization of CUB200 test examples of a given number of classes using Contrastive loss, with and without mixup. + +Mixing pairs We study the effect of mixing pairs $M(a)$ , in particular, $U^{+}(a)^{2}$ (positive-positive), $U^{+}(a) \times U^{-}(a)$ (positive-negative) and $S(a) \times U^{-}(a)$ (anchor-negative), again using different mixup types. As shown in Table 6, when using a single set of mixing pairs during training, positive-negative and anchor-negative consistently outperform the baseline, while positive-positive is actually outperformed by the baseline. This may be due to the lack of negatives in the mixed loss (9), despite the presence of negatives in the clean loss (3). Hence, we only use positive-negative and anchor-negative by default, combined by choosing uniformly at random in each iteration. + +Mixup types We study the effect of mixup type (input, feature, embedding), when used alone. The set of mixing pairs is chosen from (positive-negative, anchor-negative) uniformly at random per iteration. As shown in both "hard negatives" and "mixing pairs" parts of Table 6, our default feature mixup works best, followed by embedding and input mixup. + +Mixup type combinations We study the effect of using more than one mixup type (input, feature, embedding), chosen uniformly at random per iteration. The set of mixing pairs is also chosen from (positive-negative, anchor-negative) uniformly at random per iteration. As shown in Table 6, mixing inputs, features and embeddings works best. Although this solution outperforms feature mixup alone by $0.2\%$ Recall@1 $(85.1 \rightarrow 85.3)$ , it is computationally expensive because of using input mixup. The next best efficient choice is mixing features and embeddings, which however is worse than mixing features alone (84.7 vs. 85.1). This is why we chose feature mixup by default. + +Mixup strength $w$ We study the effect of the mixup strength $w$ in the combination of the clean and mixed loss (10) for different mixup types. As shown in Figure 6, mixup consistently improves the baseline and the effect of $w$ is small, especially for input and embedding mixup. Feature mixup works best and is slightly more sensitive. + +Ablation on CUB200 We perform additional ablations on CUB200 using R-50 with $d = 128$ by applying contrastive loss. All results are shown in Table 7. One may draw the same conclusions as from Table 6 on Cars196 with $d = 512$ , which confirms that our choice of hard negatives and mixup pairs is generalizable across different datasets and embedding sizes. + +In particular, following the settings of subsection B.4, we observe in Table 7 that using $k = 3$ hard negatives for input mixup and all pairs for feature/embedding mixup achieves the best performance in terms of Recall@1. Similarly, using a single set of mixing pairs, positive-negative and anchor-negative consistently outperform the baseline, whereas positive-positive is inferior than the baseline. Furthermore, combining positive-negative and anchor-negative pairs by choosing uniformly at random in each iteration achieves the best overall performance. + +
STUDYHARD NEGATIVES kMIXING PAIRSMIXUP TYPER@1R@2R@4R@8
baseline81.688.292.795.8
hard negatives1pos-neg / anc-neginput82.089.193.196.1
2pos-neg / anc-neginput82.589.293.496.2
3pos-neg / anc-neginput82.989.393.795.5
20pos-neg / anc-negfeature83.590.194.096.5
40pos-neg / anc-negfeature84.090.494.296.8
allpos-neg / anc-negfeature85.191.194.697.0
20pos-neg / anc-negembed82.789.293.496.1
40pos-neg / anc-negembed83.090.093.896.4
allpos-neg / anc-negembed83.489.994.196.4
mixing pairs-pos-posinput81.088.292.695.6
3pos-neginput82.489.193.395.6
3anc-neginput81.889.093.695.4
-pos-posfeature81.188.392.995.8
allpos-negfeature84.090.294.296.6
allanc-negfeature83.790.194.496.7
-pos-posembed78.385.790.894.4
allpos-negembed83.190.093.996.6
allanc-negembed82.789.593.596.3
mixup type combinations{1, all}pos-neg / anc-neg{input, feature}83.794.295.996.7
{3, all}pos-neg / anc-neg{input, embed}83.090.994.196.4
{all, all}pos-neg / anc-neg{feature, embed}84.790.694.496.9
{1, all, all}pos-neg / anc-neg{input, feature, embed}85.394.996.297.1
+ +Table 6: Ablation study of our Metric using contrastive loss and R-50 with embedding size $d = {512}$ on Cars196. R@K (%): Recall@K; higher is better. + +![](images/500dad825432ec6d7273dbcec6997baddae315e6dea720d1a21a4ac27043a1be.jpg) +Figure 6: Effect of mixup strength for different mixup types using contrastive loss and R-50 with embedding size $d = 512$ on Cars196. Recall@ $K(\%)$ : higher is better. + +
STUDYHARD NEGATIVES kMIXING PAIRSMIXUP TYPER@1R@2R@4R@8
baseline61.673.783.690.1
hard negatives1pos-neg / anc-neginput62.473.983.089.7
2pos-neg / anc-neginput62.774.283.690.0
3pos-neg / anc-neginput63.174.583.590.3
20pos-neg / anc-negfeature63.975.083.989.9
40pos-neg / anc-negfeature63.575.283.589.8
allpos-neg / anc-negfeature64.575.484.390.6
20pos-neg / anc-negembed63.174.383.190.0
40pos-neg / anc-negembed63.574.783.690.1
allpos-neg / anc-negembed64.075.184.890.9
mixing pairs-pos-posinput58.770.780.187.1
3pos-neginput62.975.183.490.6
3anc-neginput62.874.783.690.1
-pos-posfeature61.073.182.589.7
allpos-negfeature63.975.083.989.9
allanc-negfeature63.874.883.690.2
-pos-posembed59.772.282.789.5
allpos-negembed63.875.183.390.5
allanc-negembed63.575.083.990.5
mixup type combinations{1, all}pos-neg / anc-neg{input, feature}63.975.184.990.5
{3, all}pos-neg / anc-neg{input, embed}63.474.984.590.1
{all, all}pos-neg / anc-neg{feature, embed}64.275.284.190.7
{1, all, all}pos-neg / anc-neg{input, feature, embed}65.376.284.491.2
+ +Table 7: Ablation study of our Metric using contrastive loss and R-50 with embedding size $d = 128$ on CUB200. R@K (%): Recall@K; higher is better. + +We also study the effect of using more than one mixup type (input, feature, embedding), chosen uniformly at random per iteration. The set of mixing pairs is also chosen from (positive-negative, anchor-negative) uniformly at random per iteration in this study. From Table 7, we observe that although mixing input, features and embedding works best with an improvement of $0.8\%$ over feature mixup alone $(64.5 \rightarrow 65.3)$ , it is computationally expensive due to using input mixup. The next best choice is mixing features and embeddings, which is worse than using feature mixup alone (64.2 vs. 64.5). This confirms our choice of using feature mixup as default. \ No newline at end of file diff --git a/ittakestwototangomixupfordeepmetriclearning/images.zip b/ittakestwototangomixupfordeepmetriclearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b07911020587727d44738cd2849c6d2c851ab60e --- /dev/null +++ b/ittakestwototangomixupfordeepmetriclearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77a8e0759bb120a55333c1e79f2f2948be6d3b7675abb8852e52b54bb7dc098c +size 1157391 diff --git a/ittakestwototangomixupfordeepmetriclearning/layout.json b/ittakestwototangomixupfordeepmetriclearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..86752d5aa78550bd7d9476fe3a216557e37806b3 --- /dev/null +++ b/ittakestwototangomixupfordeepmetriclearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c922759a41c98541ee252c370ad1ffc56c7768787b6c1f52775781aef94c4556 +size 755407 diff --git a/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_content_list.json b/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2c2b2382751733e590691cd92ef898dc7c6d5b15 --- /dev/null +++ b/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4c7ec00ff7337f28c1bad543bd8a826a7a0a4bd93205f135f68f876f848b7c5 +size 117658 diff --git a/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_model.json b/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_model.json new file mode 100644 index 0000000000000000000000000000000000000000..54f0fdcbb0a068d701652735411c8429bb216c7f --- /dev/null +++ b/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:241b7caf6e52d41873f22377ac911040926123e00069940b7f94f7e3f7e5e7be +size 137165 diff --git a/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_origin.pdf b/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e61b32883b83ab0a3f53705f69f5d8e3ffe5bd8b --- /dev/null +++ b/jointshapleyvaluesameasureofjointfeatureimportance/bf777e8e-60b1-4471-aa54-90c4a3ff8a52_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a0287bdaf4003231bbb51ba9dd6635424a4cd91a74589229d3245c665edd87d +size 373359 diff --git a/jointshapleyvaluesameasureofjointfeatureimportance/full.md b/jointshapleyvaluesameasureofjointfeatureimportance/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6a500ff65e8f670a4d30d4ba90f3f51ac6423b46 --- /dev/null +++ b/jointshapleyvaluesameasureofjointfeatureimportance/full.md @@ -0,0 +1,655 @@ +# JOINT SHAPLEY VALUES: A MEASURE OF JOINT FEATURE IMPORTANCE + +Chris Harris + +Tokyo, Japan + +Raptor Financial Technologies + +chrisharriscjh@gmail.com + +Richard Pymar + +Economics, Mathematics & Statistics + +Birkbeck College University of London, UK + +r.pymar@bbk.ac.uk + +Colin Rowat + +Economics + +University of Birmingham, UK + +c.rowat@bham.ac.uk + +# ABSTRACT + +The Shapley value is one of the most widely used measures of feature importance partly as it measures a feature's average effect on a model's prediction. We introduce joint Shapley values, which directly extend Shapley's axioms and intuitions: joint Shapley values measure a set of features' average contribution to a model's prediction. We prove the uniqueness of joint Shapley values, for any order of explanation. Results for games show that joint Shapley values present different insights from existing interaction indices, which assess the effect of a feature within a set of features. The joint Shapley values provide intuitive results in ML attribution problems. With binary features, we present a presence-adjusted global value that is more consistent with local intuitions than the usual approach. + +# 1 INTRODUCTION + +Game theory's Shapley value partitions the value arising from joint efforts among individual agents (Shapley, 1953). Specifically, denote by $N = \{1,\dots ,n\}$ a set of agents, and by $\mathcal{G}^N$ the set of games on $N$ , where a game is a set function $v$ from $2^{N}$ to $\mathbb{R}$ with $v(\varnothing) = 0$ . Then $v(S)$ is the worth created by coalition $S\subseteq N$ . When there is no risk of confusion, we omit braces to indicate singletons (e.g. $i$ rather than $\{i\}$ ) and denote a set's cardinality by the corresponding lower case letter (e.g. $s = |S|$ ). + +For any agent $i$ , Shapley's value is then + +$$ +\psi_ {i} (v) \equiv \sum_ {S \subseteq N \backslash \{i \}} \frac {s ! (n - s - 1) !}{n !} [ v (S \cup i) - v (S) ]. \tag {1} +$$ + +This is the average worth that $i$ adds to possible coalitions $S$ , weighted as follows: if the set of agents, $S$ , has already 'arrived', draw the next agent, $i$ , to arrive uniformly over the remaining $N \backslash S$ agents. + +Shapley's value is widely used in explainable AI's attribution problem, partitioning model predictions among individual features (q.v. Štrumbelj & Kononenko (2014); Lundberg & Lee (2017)) after the model has been trained. Evaluating the prediction function at a specific feature value corresponds to an agent's presence; evaluating it at a reference (or baseline) feature value corresponds to the agent's absence. A feature's Shapley value is its average marginal contribution to the model's predictions. + +When features are correlated, individual measures of importance may mislead (Bhatt et al., 2020; Patel et al., 2021), as measures of individual significance such as the $t$ -test do. Thus, Shapley's value has been extended to sets of features (Grabisch & Roubens, 1999a; Marichal et al., 2007; Alshebli et al., 2019; Dhamdhere et al., 2020). As these extensions introduce axioms not present in Shapley, they do not preserve the Shapley value's intuition. + +We extend Shapley's axioms to sets of features, randomizing over sets rather than individual features. The resulting joint Shapley value thus directly extends Shapley's value to a measure of sets of feature importance: the average marginal contribution of a set of features to a model's predictions. + +Our approach's novelty is seen in our extension of the null axiom: in Shapley (1953), a null agent contributes nothing to any set of agents to which it may belong; here, a null set contributes nothing to any set to which it may belong. By contrast, interaction indices (Grabisch & Roubens, 1999a; Alshebli et al., 2019; Dhamdhere et al., 2020) recursively decompose sets into individual elements, retaining the original Shapley null axiom. Thus, these indices measure sets' contributions relative to their constituent elements — so are complementary to the joint Shapley value. + +The generalised Shapley value (Marichal et al., 2007) is closer to our work, but differs in a number of respects: our probabilities are independent of the size of the set of features under consideration1; our efficiency axiom is fully joint, while theirs are based on singletons and pairs; our symmetry axiom provides uniqueness without reliance on recursion or partnership axioms. + +To illustrate, consider a null coalition, $T$ , whose individual members contribute positively to coalitions that they join. Interaction indices assign a negative value to $T$ , as the individual members act discordantly together. However, from a joint feature importance viewpoint, $T$ should be assigned value 0. The joint Shapley value matches this intuition. + +In the movie review application presented below, the joint Shapley values reveal contributions of collections of words, including grammatical features such as negation (\{disappointed\} versus \{\won't, disappointed\}), and adjectives (\{effort\} versus \{\terrific, effort\}). + +Like the Shapley-Taylor interaction index (Dhamdhere et al., 2020), our efficiency axiom depends on a positive integer $k$ , the order of explanation, which limits the number of joint Shapley values to those for subsets up to cardinality $k$ . As there are $2^{N} - 1$ non-empty subsets of $N$ , the full set of joint Shapley values rapidly becomes unmanageable otherwise. In practice, $k$ should be set to trade off insight (favouring higher $k$ ) against computational cost (favouring lower $k$ ). + +For each $k$ , the extended axioms yield a unique joint Shapley value. Unlike in Shapley (1953), the joint anonymity and symmetry axioms are not interchangeable: each imposes distinct restrictions. + +Section 2 presents and extends the original Shapley axioms. Section 3 introduces joint Shapley values, deriving them as the unique solution to the extended axioms. Section 4 illustrates joint Shapley values in the game theoretical environment and applies them to the Boston housing (Harrison & Rubinfeld, 1978) and Rotten Tomatoes movie review (Pang & Lee, 2005) datasets, comparing them to interaction indices and presenting a sampling technique to facilitate calculation. Section 5 concludes. The Appendix collects proofs and other supplemental material. + +# 2 EXTENDING SHAPLEY'S AXIOMS + +For a game $v \in \mathcal{G}^N$ , and a permutation $\sigma$ on $N$ , denote a permuted game by $\sigma v \in \mathcal{G}^N$ such that $\sigma v(\sigma(S)) = v(S), \forall S \subseteq N$ , where $\sigma(S) = \{\sigma(i) : i \in S\}$ . An index $\phi(v)$ of the game $v \in \mathcal{G}^N$ is any real-valued function on $2^N$ . + +The original axioms uniquely satisfied by the (standard) Shapley value $\psi$ , are: + +LII linearity: $\psi$ is a linear function on $\mathcal{G}^N$ , i.e. $\psi(v + w) = \psi(v) + \psi(w)$ and $\psi(av) = a\psi(v)$ for any $v, w \in \mathcal{G}^N$ and $a \in \mathbb{R}$ . + +NU null: An agent that adds no worth to any coalition has no value, i.e. if $v(S \cup \{i\}) = v(S)$ for all $S \subseteq N \setminus \{i\}$ , then $\psi_i(v) = 0$ . This axiom is sometimes called dummy. + +EF efficiency: The sum of the values of all agents is equal to the worth of the entire set, i.e. for all $v \in \mathcal{G}^N$ , $\sum_{i=1}^{n} \psi_i(v) = v(N)$ . + +AN anonymity: For any $\sigma$ on $N$ and any $v\in \mathcal{G}^N$ , $\psi_{i}(v) = \psi_{\sigma (i)}(\sigma v)$ , for all $i\in N$ . + +SY symmetry: If two agents add equal worth to all coalitions that they can both join then they receive equal value: if $v(S \cup \{i\}) = v(S \cup \{j\}) \forall S \subseteq N \setminus \{i, j\}$ then $\psi_i(v) = \psi_j(v)$ . This is strictly weaker than anonymity. + +Now extend each of these axioms in natural ways to conditions on sets rather than singletons. Below, $\phi_S(v)$ denotes an index for coalition $S$ on game $v$ . + +JLI joint linearity: $\phi$ is a linear function on $\mathcal{G}^N$ , i.e. $\phi(v + w) = \phi(v) + \phi(w)$ and $\phi(av) = a\phi(v)$ for any $v, w \in \mathcal{G}^N$ and $a \in \mathbb{R}$ . (This axiom has not been modified.) + +JNU joint null: A coalition that adds no worth to any coalition has no value, i.e. if $v(S \cup T) = v(S)$ for all $S \subseteq N \setminus T$ , then $\phi_T(v) = 0$ . + +JEF joint efficiency: The sum of the values of all coalitions up to cardinality $k$ is equal to the worth of the entire set, i.e. for all $v \in \mathcal{G}^N$ , + +$$ +\sum_{\substack{\varnothing \neq T\subseteq N:\\ |T|\leq k}}\phi_{T}(v) = v(N). +$$ + +JAN joint anonymity: For any $\sigma$ on $N$ and any $v\in \mathcal{G}^N$ , $\phi_T(v) = \phi_{\sigma (T)}(\sigma v)$ , for all $T\subseteq N$ . + +JSY joint symmetry: If two coalitions perform equally when joining coalitions that they can both join and for other coalitions they add no worth then they receive an equal value, i.e. if + +1. $v(S \cup T) = v(S \cup T')$ for all $S \subseteq N \setminus (T \cup T')$ , +2. $v(S \cup T) = v(S)$ for all $S \subseteq N \setminus T$ such that $S \cap T' \neq \emptyset$ , +3. $v(S \cup T') = v(S)$ for all $S \subseteq N \setminus T'$ such that $S \cap T \neq \emptyset$ , + +then $\phi_T(v) = \phi_{T'}(v)$ . + +Axiom JSY only equates the joint Shapley values for coalitions $T$ and $T'$ if they contribute identically to coalitions that they may both join, and contribute nothing to the other coalitions. Axioms JLI, JEF and JAN are all also used in Dhamdhere et al. (2020). Our joint null and joint symmetry notions appear to be new: they reflect our interest in a set of features' contribution to a model's predictions, so that the set's cardinality should not play a role in determining its value. + +# 3 JOINT SHAPLEY VALUES + +Our main result is that there is a unique solution to axioms JLI, JNU, JEF, JAN and JSY, the joint Shapley value. The uniqueness is up to the $k^{\mathrm{th}}$ order of explanation; we say nothing about $|T| > k$ . + +Theorem 1. For each order of explanation $k \in \{1, \dots, n\}$ , there is a unique (up to the $k^{\text{th}}$ order of explanation) index $\phi^J$ which satisfies axioms JLI, JNU, JEF, JAN and JSY. It has the form + +$$ +\phi_ {T} ^ {J} (v) = \sum_ {S \subseteq N \backslash T} q _ {| S |} [ v (S \cup T) - v (S) ] +$$ + +for each $\varnothing \neq T\subseteq N$ with $|T|\leq k$ , where $(q_0,\ldots ,q_{n - 1})$ uniquely solves the recursive system + +$$ +q _ {0} = \frac {1}{\sum_ {i = 1} ^ {k} \binom {n} {i}}, \quad q _ {r} = \frac {\sum_ {s = (r - k) \vee 0} ^ {r - 1} \binom {r} {s} q _ {s}}{\sum_ {s = 1} ^ {k \wedge (n - r)} \binom {n - r} {s}}; \tag {2} +$$ + +for all $r\in 1,\ldots ,n - 1$ + +When $k = 1$ , the joint Shapley values coincide with Shapley's values.2 When $k = n$ , we have + +$$ +q _ {r} = \sum_ {j = 0} ^ {r} \binom {r} {j} \frac {(- 2) ^ {r - j}}{2 ^ {n - j} - 1}, \quad \forall r \in \{0, \ldots , n - 1 \}. +$$ + +For each $k$ , the constants $q_{r}$ are non-negative and satisfy $\sum_{s=n-k}^{n-1} \binom{n}{s} q_{s} = 1$ . Further, as the joint Shapley value is similar in form to equation (1)'s standard Shapley value, the value of coalition $T$ + +depends on its marginal contribution to other coalitions; unlike interaction indices, it does not depend on the worth of its constituent agents. + +As with the Shapley value, the joint Shapley value can be seen as the worth brought by 'arriving' agents but, rather than arriving one at a time, they can now also arrive in coalitions. We develop this interpretation in Appendix A. + +We show here the implication of each of the joint axioms introduced above and prove Theorem 1. + +It is already known that joint linearity restricts measures to be linear combinations of worths: + +Lemma 1 (Grabisch & Roubens (1999a), Proposition 1). If $\phi$ satisfies JLI, then for every $\varnothing \neq T\subseteq N$ there exists a family of real constants $\{a_T^S\}_{S\subseteq N}$ such that for every $v\in \mathcal{G}^N$ + +$$ +\phi_ {T} (v) = \sum_ {S \subseteq N} a _ {S} ^ {T} v (S). +$$ + +Axiom JNU then constrains the values of the constants $\{a_S^T\}$ : + +Lemma 2. Suppose $\phi$ satisfies JLI and JNU and let $\{a_T^S\}_{S \subseteq N, \emptyset \neq T \subseteq N}$ be the constants from Lemma 1. Then for every $\emptyset \neq T \subseteq N$ and $\emptyset \neq S \subseteq N \setminus T$ , $a_S^T = -a_{S \cup T}^T$ . Further, for every $\emptyset \neq T \subseteq N$ , $S \subseteq N \setminus T$ , and $\emptyset \neq H \subsetneq T$ , $a_{S \cup H}^T = 0$ . + +SCombining these two lemmas yields: + +Proposition 1. Suppose $\phi$ satisfies JLI and JNU. Then there exist constants $\{p^T(S)\}$ that depend on $T$ and $S$ such that for every $\varnothing \neq T \subseteq N$ and $v \in \mathcal{G}^N$ + +$$ +\phi_ {T} (v) = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) [ v (S \cup T) - v (S) ]. \tag {3} +$$ + +Now establish a condition on the $\{p^T(S)\}$ values which must be satisfied under JEF: + +Proposition 2. For each order of explanation $k$ , $\phi$ satisfies axioms JLI, JNU and JEF if and only if for every $\emptyset \neq T \subseteq N$ with $|T| \leq k$ and $v \in \mathcal{G}^N$ , $\phi_T(v) = \sum_{S \subseteq N \setminus T} p^T(S)[v(S \cup T) - v(S)]$ with $\{p^T(S)\}$ satisfying + +$$ +\delta_ {N} (S) = \sum_ {\substack {\emptyset \neq T \subseteq S: \\ | T | \leq k}} p ^ {T} (S \setminus T) - \sum_ {\substack {\emptyset \neq T \subseteq N \setminus S: \\ | T | \leq k}} p ^ {T} (S), \tag{4} +$$ + +for all $\varnothing \neq S\subseteq N$ , where $\delta_N(S)$ equals 1 if $S = N$ and O otherwise. + +Recall that symmetry axiom SY is strictly weaker than anonymity axiom AN (Malawski, 2020). This is not the case for their joint counterparts: each imposes a different constraint on the constants $\{p^T(S)\}$ , as we shall see here. First, consider the effect of imposing JAN. + +Proposition 3. For each order of explanation $k$ , $\phi$ satisfies axioms JLI, JNU, JEF and JAN if and only if for every $\varnothing \neq T \subseteq N$ and $v \in \mathcal{G}^N$ , $\phi_T(v) = \sum_{S \subseteq N \setminus T} p^T(S)[v(S \cup T) - v(S)]$ with $\{p^T(S)\}$ satisfying (4) and + +$$ +p ^ {T} (S) = p ^ {T ^ {\prime}} \left(S ^ {\prime}\right) \forall \emptyset \neq T, T ^ {\prime} \subseteq N, S \subseteq N \backslash T, S ^ {\prime} \subseteq N \backslash T ^ {\prime} s. t. s = s ^ {\prime}, t = t ^ {\prime}. \tag {5} +$$ + +The analogous result for JSY is: + +Proposition 4. For each order of explanation $k$ , $\phi$ satisfies axioms JLI, JNU, JEF and JSY if and only if for every $\varnothing \neq T \subseteq N$ and $v \in \mathcal{G}^N$ , $\phi_T(v) = \sum_{S \subseteq N \setminus T} p^T(S)[v(S \cup T) - v(S)]$ with $\{p^T(S)\}$ satisfying (4) and + +$$ +p ^ {T} (S) = p ^ {T ^ {\prime}} (S) \forall \emptyset \neq T, T ^ {\prime} \subseteq N, S \subseteq N \backslash (T \cup T ^ {\prime}). \tag {6} +$$ + +Combining Propositions 2-4 completes the proof of Theorem 1. + +The computational complexity of deriving the $(q_0, \ldots, q_{n-1})$ is $\mathcal{O}(nk^2)$ . Once these have been determined, the joint Shapley values can be calculated; the complexity of doing so is $\mathcal{O}(3^n \wedge (2^n n^k))$ . + +# 4 EXPERIMENTS + +# 4.1 GAME THEORETICAL + +We present two game theoretical models from Dhamdhere et al. (2020) with known 'ground truths'. For each, we compare the joint Shapley value, the Shapley interaction index (Grabisch & Roubens, 1999b), the generalised Shapley value (Marichal et al., 2007), the added-value index (Alshebli et al., 2019), and the Shapley-Taylor interaction index (Dhamdhere et al., 2020), respectively: + +$$ +\phi_ {T} ^ {S I} \left(v\right) \equiv \sum_ {S \subseteq N \setminus T} \frac {1}{n - t + 1} \binom {n - t} {s} ^ {- 1} \sum_ {L \subseteq T} \left(- 1\right) ^ {t - l} v \left(S \cup L\right), \forall T \subseteq N; +$$ + +$$ +\phi_ {T} ^ {G S} (v) \equiv \sum_ {S \subseteq N \backslash T} \frac {(n - s - t) ! s !}{(n - t + 1) !} [ v (S \cup T) - v (S) ]; +$$ + +$$ +\phi_ {T} ^ {A V} (v) \equiv v (T) - \sum_ {i \in T} \frac {1}{2 ^ {n - 1}} \sum_ {S \subseteq N: i \in S} \sum_ {C \subseteq S \backslash i} \frac {c ! (s - c - 1) !}{s !} [ v (C \cup i) - v (C) ]; +$$ + +$$ +\phi_ {T} ^ {S T} \left(v; k\right) \equiv \left\{ \begin{array}{l l} \sum_ {L \subseteq T} \left(- 1\right) ^ {t - l} v \left(L\right) & \text {i f} t < k \\ \frac {k}{n} \sum_ {S \subseteq N \setminus T} \binom {n - 1} {s} ^ {- 1} \sum_ {L \subseteq T} \left(- 1\right) ^ {t - l} v \left(S \cup L\right) & \text {i f} t = k. \end{array} \right. +$$ + +Table 1: Joint and interaction measures in $n = 3$ game theory examples + +
TvShapley (k=1)φSIφGSφAVφST (vm; k)φJ (vm; k)
k=2k=3k=2k=3
The majority game: vm(T) = 1 when t ≥ 2, and is equal to 0 otherwise
i01/31/31/3-1/3001/92/21
i, j101/21/31/312/94/21
N1-210-23/21
A linear model with crosses: vc(T) = ∑i∈T 1 + c max {0, t-2} for c ∈ R
i11/3 (3+c)1/3 (3+c)1/3 (3+c)-1/12c115/18 (2+c)5/21 (2+c)
i, j21/3c1/2 (4+c)-1/6c1/3c01/18 (8+c)1/21 (8+c)
N3+cc3+c3/4cc3/21 (3+c)
+ +In the $n = 3$ majority game, Table 1 shows that, while Shapley-Taylor assigns 0 to singletons, the joint Shapley value recognises that singletons contribute positively when joining existing coalitions. The Shapley-Taylor and Shapley Interaction indices assign negative values to $N$ (for discordant interaction between members); the joint Shapley rewards $N$ for adding worth in its own right. + +In the linear model with crosses, joint Shapley values' signs can again differ from those of interaction indices: let $c = -2$ , which sets $\phi_1^J = 0$ : if $i = 1$ joins the empty coalition or either singleton, it adds unit worth; however, when $i = 1$ joins $\{2,3\}$ , it subtracts unit worth. Averaging (according to the arrival order), gives a net contribution of 0: coalition 1 does not contribute any worth in expectation. By contrast, the Shapley-Taylor value always (for $k > 1$ ) assigns value to singletons equal to their worth, as it is not (by design) capturing information about expected contributions of features. + +# 4.2 THE AI/ML Attribution PROBLEM + +Following Štrumbelj & Kononenko (2010), let $f$ be a prediction function, and $\boldsymbol{x} = (x_{1},\ldots ,x_{n})\in \mathcal{A}$ an instance from the feature space. For a set of features $S\subseteq N$ , define the prediction difference $v_{\boldsymbol{x}}(S)$ when only features in $S$ are known, as + +$$ +v _ {\boldsymbol {x}} (S) \equiv \frac {1}{| \mathcal {A} |} \sum_ {\boldsymbol {z} \in \mathcal {A}} [ f (\tau (\boldsymbol {x}, \boldsymbol {z}, S)) - f (\boldsymbol {z}) ], \tag {7} +$$ + +where $\tau (\pmb {x},\pmb {z},S)\in \mathcal{A}$ is defined as $\tau (\pmb {x},\pmb {z},S)_i$ equal to $x_{i}$ for $i\in S$ and $z_{i}$ otherwise. Thus $v_{\pmb{x}}(S)$ is the difference between the expected prediction when only the feature values of $\pmb{x}$ in $S$ are known, + +and the expected prediction when no feature values are known. Then for each $T \subseteq N$ , $\phi_T^J(v_x)$ is the contribution of features $T$ to the prediction $f(x)$ . To estimate $\phi_T^J(v_x)$ , let $X$ be a random variable whose law coincides with the law of the number of agents already present when $T$ arrives in the arrival interpretation (so that the law of $X$ depends on $t$ , the size of $T$ ): + +$$ +\mathbb {P} (X = i) = \binom {n - t} {i} q _ {i} \left(\sum_ {j = 0} ^ {n - t} \binom {n - t} {j} q _ {j}\right) ^ {- 1} +$$ + +for each $i \in \{0, \dots, n\}$ and $S$ be a random variable uniform on the set of subsets of $N \setminus T$ of size $X$ . Once $X$ is sampled, we can generate the set of agents already arrived, called $S$ , by choosing it uniformly from all subsets of $N \setminus T$ of size precisely $X$ . Then + +$$ +\phi_ {T} ^ {J} (v _ {\boldsymbol {x}}) = \sum_ {j = 0} ^ {n - t} \binom {n - t} {j} q _ {j} \mathbb {E} [ v _ {\boldsymbol {x}} (T \cup \mathcal {S}) - v _ {\boldsymbol {x}} (\mathcal {S}) ]. +$$ + +Thus, by the law of large numbers, we can estimate this expectation by taking an average of $v_{i}(T \cup S_{i}) - v_{i}(S_{i})$ where $S_{i}$ has the same distribution as $S$ and $v_{i}(S) = f(\tau(\boldsymbol{x}, z_{i}, S)) - f(z_{i})$ , where $z_{i}$ is chosen uniformly from the feature space. Refer to $\phi_T^J(v_{\boldsymbol{x}})$ as the local joint Shapley value of features $T$ at instance $\boldsymbol{x}$ . We can combine local values to obtain, for each feature, a global joint Shapley value. We do so in two ways. The first is the standard methodology (q.v. Lundberg & Lee (2017)), which averages the absolute values of locals. We introduce the second for models with exclusively binary variables by considering presence/absence of features $T$ in $\boldsymbol{x}$ . This presence-adjusted global joint Shapley value is defined as + +$$ +\tilde {\phi} _ {T} ^ {J} (f) = \frac {1}{| \mathcal {A} |} \sum_ {\boldsymbol {x} \in \mathcal {A}} (2 \cdot \mathbf {1} _ {\boldsymbol {x} (T) = 1} - 1) \phi_ {T} ^ {J} (v _ {x}), \tag {8} +$$ + +where $\mathbf{1}_{\boldsymbol{x}(T) = 1}$ is one if all features $T$ are present in $\boldsymbol{x}$ , and 0 otherwise. Covert et al. (2020) introduced SAGE (Shapley Additive Global Importance), a more sophisticated treatment of global influence measures that maintains efficiency at the global level. + +All experiments are run on a single Intel(R) Core(TM) i7-6820HQ CPU. Training details and tuning parameters are provided in the accompanying code. + +# 4.2.1 SIMULATED DATA + +Consider three features, $x_{1}, x_{2}$ and $x_{3}$ , each uniformly drawn from $(0, 1)$ and a dataset of 50 observations. We first consider independently drawn features; we then investigate correlation by fixing $x_{2} = 1 - x_{1}$ . We use simplified 'ML models', $f(x)$ , to obtain exact global joint Shapley values, averaging the absolute values of local joint Shapley values derived from equation (7). Table 2 displays the results. + +Table 2: Uniform random variables; $k = 3$ + +
x1x2x3x1, x2x1, x3x2, x3x1, x2, x3
independent features
f1(x) = x10.122000.0490.04900.037
f2(x) = x1 + x20.1220.11400.0610.0490.0450.046
f3(x) = x1 - x20.1220.11400.0620.0490.0450.047
correlated features: x2 = 1 - x1
f2(x)0.1220.122000.0490.0490
f3(x)0.1220.12200.0980.0490.0490.073
+ +Independent variables As only $x_{1}$ influences $f_{1}$ , only coalitions including it receive value; the more diluted its role, the lower the value; $x_{2}$ and $x_{3}$ are symmetrically irrelevant. For $f_{2}, x_{1}$ and $x_{2}$ play equal roles, and receive equal values (up to variance due to the sample size). For $f_{2}$ and $f_{3}$ , $\{x_{1}, x_{2}\}$ receives similar value, and more than in $f_{1}$ , where only $x_{1}$ influenced model predictions. Comparing $f_{2}$ and $f_{3}$ shows that values only differ for coalitions containing both $x_{1}$ and $x_{2}$ . + +Correlated features $f_{2}$ now exhibits what we term a cancellation effect between $x_{1}$ and $x_{2}$ , assigning a value of zero to coalitions containing both. Similarly, $f_{3}$ reveals an enhancement effect: values assigned to coalitions with both $x_{1}$ and $x_{2}$ are larger than in the independent case. + +Enhancement and cancellation effects do not uniquely identify underlying phenomena. To illustrate, let $x_{1}, x_{2}$ and $x_{3}$ be independent Bernoulli(0.5) random variables. Setting $k = 3$ and letting $n \to \infty$ , we obtain the exact presence-adjusted global joint Shapleys in Table 3. + +Table 3: Bernoulli(0.5) random variables; $k = 3$ + +
f(x)x1x2x3x1,x2x1,x3x2,x3x1,x2,x3
f1(x) = x15/21001/211/2101/56
f2(x) = x1 + x25/215/2102/211/211/211/28
f4(x) = x1x25/425/4201/141/421/423/112
+ +The joint Shapley values containing $x_{1}$ and $x_{2}$ are larger for models $f_{2}$ and $f_{4}$ than for model $f_{1}$ , a different sort of enhancement effect from that above. However, the joint Shapley value for $x_{1}$ is smaller in $f_{4}$ than it is in $f_{1}$ or $f_{2}$ , again a different type of cancellation effect. + +Finally, joint Shapley values can provide insight into the black-box model's structure. If, for example, $f$ can be decomposed as $f(\pmb{x}) = g(x_1) + h(x_2, \dots, x_n)$ with independent Bernoulli(0.5) random variables, then the presence-adjusted global joint Shapley value of $x_1$ is $1/2(g(1) - g(0))\sum_{s=0}^{n-1}\binom{n-1}{s}q_s = 5/21$ , as shown in the table. If the joint Shapley value deviates from this, we reject the decomposition, as in the case of $f_4$ . + +# 4.2.2 BOSTON HOUSING DATA + +For comparability, we follow Dhamdhere et al. (2020) by training a random forest on the Boston housing dataset (Harrison & Rubinfeld, 1978), computing global values using the first notion discussed above. Table 4 presents the largest and smallest global joint Shapley and Shapley-Taylor values. + +Table 4: Joint Shapley values for the Boston dataset + +
Shapley (k=1)φST(f;k)φJ(f;k)
k=2k=3k=2k=3
RM: 2.57RM: 3.12RM: 3.12LSTAT: 0.63LSTAT: 0.42
LSTAT: 2.47LSTAT: 2.04LSTAT: 2.04RM: 0.56RM: 0.34
AGE: 0.81DIS: 1.55DIS: 1.55LSTAT, RM: 0.30AGE: 0.11
DIS: 0.63CRIM: 1.37CRIM: 1.37AGE, LSTAT: 0.21LSTAT, RM: 0.11
CRIM: 0.46B: 1.31DIS, LSTAT: 1.33AGE, RM: 0.20NOX: 0.10
NOX: 0.44NOX: 1.15B: 1.31DIS, RM: 0.19DIS: 0.08
PTRATIO: 0.27::::
B: 0.24CHAS, RM: 0.15AGE, CRIM, RM: 0.21CHAS, TAX: 0.02RAD, TAX, ZN: 0.00
TAX: 0.22LSTAT, TAX: 0.15AGE, DIS, PTRATIO: 0.21RAD, ZN: 0.01CHAS: 0.00
INDUS: 0.19INDUS, RAD: 0.15DIS, LSTAT, PTRATIO: 0.21CHAS, RAD: 0.01CHAS, RAD, TAX: 0.00
RAD: 0.13NOX, TAX: 0.14AGE, LSTAT, PTRATIO: 0.20ZN: 0.01CHAS, RAD, ZN: 0.00
ZN: 0.07DIS, INDUS: 0.13AGE, NOX, RM: 0.20CHAS: 0.01CHAS, TAX, ZN: 0.00
CHAS: 0.07DIS, PTRATIO: 0.12B, CRIM, LSTAT: 0.19CHAS, ZN: 0.01CHAS, ZN: 0.00
+ +For $k = 1$ , the joint Shapley values are the classical Shapley values. The unimportance of CHAS seems to reflect its low variance (only 35 of 506 units back onto the Charles). + +For $k = 2$ , LSTAT and RM still have the largest joint Shapley values, with {LSTAT, RM} having third largest. The top pairs all involve LSTAT or RM, indicating that these variables also contribute to explaining house prices jointly with other variables. By contrast, {LSTAT, RM} is the 16th largest Shapley-Taylor interaction value. The $k = 2$ singleton joint Shapley values are fairly evenly distributed throughout the pairs; by contrast, the singleton $k = 2$ Shapley-Taylor values outrank all the pairs. This is consistent with our extension of axiom NU to not favour singletons. The largest joint Shapley value involving NOX is {NOX, LSTAT}, which is about five times as large as {NOX, DIS} + +and $\{\mathrm{NOX},\mathrm{RAD}\}$ . This is consistent with Harrison and Rubinfeld's observation that NOX offset RAD and DIS, but reinforced LSTAT: knowing the values of NOX and LSTAT adds a lot of predictive power; knowing the values of NOX and RAD or DIS tends to wash out additional predictive power. + +For $k = 3$ , singletons again dominate: the largest triple is {AGE, LSTAT, RM}, the three individually most important features. Continuing the above analysis, the joint Shapley value of {DIS, RAD} is about 0.015, while that of {DIS, NOX, RAD} is about 0.008, and that of {DIS, LSTAT, RAD} is about 0.022. We understand this to mean {DIS, NOX, RAD} contains the same sort of information as {DIS, RAD}, but with NOX offsetting the other variables, while LSTAT brings novel socio-economic information to the distance variables DIS and RAD, which it continues to partially offset. Similarly, the least important joint features include the individually unimportant CHAS and its variants — echoing the role played by RM and LSTAT at the top of the list. While {DIS, LSTAT} has a Shapley-Taylor value of 1.33 (indicating a large interaction between the pair but not its overall importance), its joint Shapley is 0.06 (ranked 18th) — directly assigning a value of importance. + +Table 4's values are exact. Figure 1 demonstrates the estimation procedure above, showing convergence of the sampled values as the iterations increase. As with other sampling procedures (e.g. Štrumbelj & Kononenko (2014)), this cuts the complexity to order $n$ to a linear power of $k$ ; as $k \to n$ , the complexity approaches $2^n$ times a polynomial in $n$ (compared to $3^n$ for the exact $\phi^J$ ). + +![](images/4e6e95c5d7a4d6c49f94d086f42227a034e5ac936b0d913df7c4d713d66365b7.jpg) +Figure 1: Sampled $\phi^J$ converges to exact $\phi^J$ with $L^2$ norm $\approx 1.45$ ; $k = 2$ Boston + +![](images/883d75e9c375c81e2806010b71835159dd75f1e708378934f71138528f693206.jpg) +Figure 2: Difference between consecutive $\phi^J$ samples averages converges to zero; $k = 2$ movie review #2 + +# 4.2.3 MOVIE REVIEWS + +We train a fully connected neural network (two hidden layers, 16 units per layer, ReLU activations) on the binary movie review classifications in Pang & Lee (2005). From the full set of reviews, we remove a test block of 100 (picked to include those in Table 1 of Dhamdhere et al. (2020)) for analysis. We encode reviews as the 1000 most common words in the corpus, augmented by key words in Table 1 of Dhamdhere et al. (2020) to aid comparison of measures, for a total of 1004. (The DSA features are drawn from positive reviews: {won't}, {disappointed}, {both}, {inspiring}, {a}, {crisp}, {excellent}, {youthful}, {John}, {terrific}.) Binary accuracy is typically c. $76\%$ after four epochs. + +Table 5's local joint Shapley values are tiny as each of the $2^{1004} - 1$ joint features has a tiny effect on the probability of a positive review. In the vein of Dhamdhere et al., we identify intuitive effects: + +1. negation: the negative local joint Shapley values for {disappointed} and {be, disappointed} become positive when negated by adding {won't} to the coalition. +2. enhancement: the positive local joint Shapley values for {both} and {and} are enhanced by the positive {and, both}. +3. context: the sign of local joint Shapley values involving {well} depend on the context; while {you, well} is positive, {left, well} is negative. +4. lost potential: the positive local joint Shapley values involving {fascinating} become negative when {been} is added. +5. adjectival: while {director} and {effort} are individually negative, they become positive when qualified with the adjectives {winning} and {terrific}, respectively. + +Table 5: Examples of local joint Shapley values in the Pang & Lee (2005) movie reviews + +
Reviewjoint Shapleys
1: negation: aficionados of the whodunit won't be disappointed{disappointed}: -2 × 10-5{won't}: 6 × 10-5{be, disappointed}: -9 × 10-8{won't, disappointed}: 6 × 10-8{won't, be, disappointed}: 5 × 10-9
2: enhancement: both inspiring and pure joy{both}: 2 × 10-4{and}: 6 × 10-5{and, both}: 1 × 10-6
3: context: you wish Jacquot had left well enough alone{you, well}: 9 × 10-7{left, well}: -3 × 10-7
4: lost potential: fascinating little thriller that would have been perfect{would}: -1 × 10-4{fascinating}: 2 × 10-4{would, fascinating}: 3 × 10-7{would, been, fascinating}: -1 × 10-8
5: adjectival: director ... award-winning ... make a terrific effort{effort}: -1 × 10-5{director}: -9 × 10-6{terrific, effort}: 8 × 10-7{winning, director}: 5 × 10-7
+ +For global values, as the features are binary, we compute the presence-adjusted global joint Shapleys, $\tilde{\phi}^J$ . Comparing the DSA features' global $\tilde{\phi}^J$ across the test reviews for $k = 1$ and $k = 2$ shows {terrific} to be the largest, followed by {both} then {excellent}. This reflects prevalence in the training set, where {terrific} appears four times as often in positive reviews. Similarly, on the negative $\tilde{\phi}^J$ side, {John} is followed by {disappointed}: {John} appears thrice as often in negative reviews. + +The largest pairs are {both, inspiring} followed by {excellent, youthful}. All of the pairs, except {John, terrific}, have a positive sign: these pairs typically do not appear outside the positive reviews from which they were drawn. As our encoding discards sequential information, the pairs are smaller than the singletons: a coalition merely indicates co-occurrence in a review, rather than a bigram. + +As the 10 DSA features are a very small subset of all 1004, we cannot assess whether JEF holds. However, as a health check note: the average presence-adjusted local joint Shapleys over the positive reviews is about $20\%$ larger than that over the negative reviews. They are both negative: as these features are drawn from positive reviews, but largely absent in any given review, their effect is negative. Further, Table 6 indicates that the ranking of single features is largely preserved as $k$ increases from 1 to 2: the exception is $\{\mathrm{a},\mathrm{crisp}\}$ : in the corpus, $\{\mathrm{crisp}\}$ is typically preceded by $\{\mathrm{a}\}$ . + +Figure 2 shows the estimated values' convergence. + +Table 6: Largest presence-adjusted global joint Shapley values on DSA features + +
k=1terrificbothexcellentwon’tcrispyouthfulainspiringdisappointedJohn
k=2terrificbothexcellentwon’tayouthfulinspiringcrispdisappointedJohn
+ +# 5 CONCLUSIONS + +The joint Shapley value directly extends Shapley's value to measure the effect of a set of features on a model's predictions. Further work is needed to maintain properties like global efficiency (Covert et al., 2020) and to make sampling more efficient (Williamson & Feng, 2020; Mitchell et al., 2021). We believe that understanding complex models is labor intensive. Nevertheless, we envisage a common workflow that computes $k = 1$ Shapley values, followed by $k = 2$ to identify strong pairwise effects; analyses for $k \geq 3$ then respond to the analyst's evolving questions about the model's functioning. + +# 6 ETHICS STATEMENT + +This paper contributes to the literature on explainable AI, an important component of the Fairness, Accountability and Transparency research agenda for ethical AI. It does not use human subjects; it only draws on publicly available datasets; the work has not been sponsored, and does not seek to promote any third organisations; none of the authors face any conflict of interest. + +# 7 REPRODUCIBILITY STATEMENT + +Our proofs and source code are available in the accompanying supplemental material; all data are taken from the public domain. + +# REFERENCES + +Bedoor K Alshebli, Tomasz P Michalak, Oskar Skibski, Michael Wooldridge, and Talal Rahwan. A measure of added value in groups. ACM Transactions on Autonomous and Adaptive Systems (TAAS), 13(4):1-46, 2019. +Umang Bhatt, Alice Xiang, Shubham Sharma, Adrian Weller, Ankur Taly, Yunhan Jia, Joydeep Ghosh, Ruchir Puri, José M. F. Moura, and Peter Eckersley. Explainable machine learning in deployment. In Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency, pp. 648-657, 2020. +Ian Covert, Scott Lundberg, and Su-In Lee. Understanding global feature contributions with additive importance measures. arXiv preprint arXiv:2004.00668, 2020. +Kedar Dhamdhere, Ashish Agarwal, and Mukund Sundararajan. The Shapley Taylor interaction index. In International Conference on Machine Learning, pp. 9259-9268. PMLR, 2020. +Michel Grabisch and Marc Roubens. An axiomatic approach to the concept of interaction among players in cooperative games. International Journal of Game Theory, 28(4):547-565, 1999a. +Michel Grabisch and Marc Roubens. Probabilistic interactions among players of a cooperative game. In Beliefs, Interactions and Preferences in Decision Making, pp. 205-216. Springer, 1999b. +David Harrison and Daniel L Rubinfeld. Hedonic housing prices and the demand for clean air. Journal of Environmental Economics and Management, 5(1):81-102, 1978. +Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems, pp. 4765-4774, 2017. +Marcin Malawski. A note on equal treatment and symmetry of values. In Transactions on Computational Collective Intelligence XXXV, pp. 76-84. Springer, 2020. +Jean-Luc Marichal, Ivan Kojadinovic, and Katsushige Fujimoto. Axiomatic characterizations of generalized values. Discrete Applied Mathematics, 155(1):26-43, 2007. +Rory Mitchell, Joshua Cooper, Eibe Frank, and Geoffrey Holmes. Sampling permutations for Shapley value estimation. arXiv preprint arXiv:2104.12199, 2021. +Bo Pang and Lillian Lee. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the ACL, 2005. +Neel Patel, Martin Strobel, and Yair Zick. High dimensional model explanations: an axiomatic approach. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, pp. 401-411, 2021. +Lloyd S. Shapley. A value for $n$ -person games. In Harold William Kuhn and Albert William Tucker (eds.), Contributions to the theory of games, volume II of Annals of Mathematical Studies, chapter 17, pp. 307-317. Princeton University Press, Princeton, 1953. + +Brian Williamson and Jean Feng. Efficient nonparametric statistical inference on population feature importance using Shapley values. In International Conference on Machine Learning, pp. 10282-10291. PMLR, 2020. + +Erik Štrumbelj and Igor Kononenko. An efficient explanation of individual classifications using game theory. The Journal of Machine Learning Research, 11:1-18, 2010. + +Erik Štrumbelj and Igor Kononenko. Explaining prediction models and individual predictions with feature contributions. Knowledge and Information Systems, 41(3):647-665, 2014. + +In this supplementary material we discuss the arrival order interpretation, present the proofs of all results, and discuss a notion of joint symmetry obtained by removing conditions 2 and 3 from JSY. + +# A ARRIVAL ORDER INTERPRETATION + +As discussed in the paper, the joint Shapley value can be viewed in terms of the worth brought by 'arriving' agents but, rather than arriving one at time, they can now also arrive in coalitions. To be precise, consider this procedure: at time 0, no agents have arrived; at each $t \in \{1,2,\ldots\}$ , the next set of agents to arrive is chosen uniformly from the set of non-empty subsets of size at most $k$ of the remaining (yet to arrive) agents. Then $\phi_T^J$ is the expected worth brought by coalition $T$ when it arrives (a coalition is assigned zero worth if it does not arrive at any time). To see this, denote by $A_i$ the coalition to arrive at time $i$ , by $B_i$ the union of all coalitions that have arrived up to time $i$ : $B_i = \bigcup_{j \leq i} A_j$ , and by $p_T$ the probability that at some time coalition $T$ arrives, $p_T = \mathbb{P}(\exists i : B_i = T)$ . We have the recursive relationship: + +$$ +\begin{array}{l} p_{T} = \sum_{i = 1}^{n}\sum_{\substack{S\subsetneq T:\\ |S|\geq |T| - k}}\mathbb{P}(B_{i - 1} = S)\mathbb{P}(A_{i} = T\setminus S\mid B_{i - 1} = S) \\ = \sum_{i = 1}^{n}\sum_{\substack{S\subsetneq T:\\ |S|\geq |T| - k}}\mathbb{P}(B_{i - 1} = S)\left(\sum_{r = 1}^{(n - |S|)\wedge k}\binom {n - |S|}{r}\right)^{-1}\\ = \sum_{s = (|T| - k)\lor 0}^{|T| - 1}\binom {t}{s}p_{S}\left(\sum_{r = 1}^{(n - s)\wedge k}\binom {n - s}{r}\right)^{-1}, \\ \end{array} +$$ + +where in the last line $S$ is any set of size $s$ . Thus we see that $p_T$ only depends on $T$ through its cardinality, and defining + +$$ +\hat {p} _ {t} := p _ {T} \left(\sum_ {r = 1} ^ {(n - t) \wedge k} \binom {n - t} {r}\right) ^ {- 1} +$$ + +for any $T$ with $|T| = t$ , the expected worth brought by coalition $T$ under this procedure is + +$$ +\sum_ {i = 1} ^ {n} \sum_ {S \subseteq N \setminus T} \mathbb {P} (B _ {i - 1} = S, A _ {i} = T) [ v (S \cup T) - v (S) ] = \sum_ {S \subseteq N \setminus T} \hat {p} _ {| S |} [ v (S \cup T) - v (S) ]. +$$ + +Further, we have the relationship + +$$ +\hat {p} _ {t} = \frac {\sum_ {s = (t - k) \lor 0} ^ {t - 1} \binom {t} {s} p _ {s}}{\sum_ {r = 1} ^ {(n - t) \land k} \binom {n - t} {r}} +$$ + +and since we know that $p_0 = 1$ (we start with no agents having arrived) and $p_n = 1$ (we finish with all agents having arrived) we also have the identities: + +$$ +1 = \sum_ {s = n - k} ^ {n - 1} \binom {n} {s} \hat {p} _ {s}, \quad 1 = \hat {p} _ {0} \sum_ {r = 1} ^ {k} \binom {n} {s}. +$$ + +By comparing with the identities defining $(q_0, \ldots, q_{n-1})$ , we deduce that $\hat{p}_t = q_t$ for all $t \in \{0, \ldots, n-1\}$ , which verifies this arrival interpretation. + +# B PROOFS + +Proof of Lemma 2. For the first statement, for each $\varnothing \neq S\subseteq N\setminus T$ consider the game + +$$ +v _ {S} (R) = \left\{ \begin{array}{l l} 1 & \text {i f} R = S \text {o r} R = S \cup T, \\ 0 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Then for such $S$ , by JNU, $\phi_T(v_S) = 0$ . By this equality, Lemma 1, and the definition of $v_{S}$ + +$$ +0 = \phi_ {T} (v _ {S}) = \sum_ {R \subseteq N} a _ {R} ^ {T} v _ {S} (R) = a _ {S} ^ {T} + a _ {S \cup T} ^ {T}. +$$ + +For the second statement, for each $\varnothing \neq H \subsetneq T$ let $\alpha_{H}$ be a constant and for $S \subseteq N \setminus T$ , consider the game + +$$ +x _ {S} ^ {\boldsymbol {\alpha}} (R) = \left\{ \begin{array}{l l} \alpha_ {H} & \text {i f} R = S \cup H \text {f o r s o m e} \varnothing \neq H \subsetneq T, \\ 0 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +By JNU, $\phi_T(x_S^\alpha) = 0$ for every $S\subseteq N\setminus T$ . Thus by Lemma 1 + +$$ +0 = \phi_ {T} (x _ {S} ^ {\boldsymbol {\alpha}}) = \sum_ {R \subseteq N} a _ {R} ^ {T} x _ {S} ^ {\boldsymbol {\alpha}} = \sum_ {\varnothing \neq H \subsetneq T} a _ {S \cup H} ^ {T} x _ {S} ^ {\boldsymbol {\alpha}} (S \cup H) = \sum_ {\varnothing \neq H \subsetneq T} a _ {S \cup H} ^ {T} \alpha_ {H}. +$$ + +Since this holds for every choice of constants $\alpha_{H}$ , it follows that $a_{S\cup H}^{T} = 0$ for all $S\subseteq N\setminus T$ and $\varnothing \neq H\subsetneq T$ , as required. + +Proof of Proposition 1. By Lemma 1 there exist constants $\{a_S^T\}_{S\subseteq N},\varnothing \neq T\subseteq N$ such that for every $v$ and $\varnothing \neq T\subseteq N$ + +$$ +\begin{array}{l} \phi_ {T} (v) = \sum_ {S \subseteq N} a _ {S} ^ {T} v (S) = \sum_ {S \subseteq N \backslash T} \left(a _ {S} ^ {T} v (S) + \sum_ {\varnothing \neq H \subsetneq T} a _ {S \cup H} ^ {T} v (S \cup H) + a _ {S \cup T} ^ {T} v (S \cup T)\right) \\ = \sum_ {S \subseteq N \backslash T} \left(a _ {S} ^ {T} v (S) + a _ {S \cup T} ^ {T} v (S \cup T)\right) = \sum_ {S \subseteq N \backslash T} a _ {S \cup T} ^ {T} [ v (S \cup T) - v (S) ]; \\ \end{array} +$$ + +where the last two equalities owe to Lemma 2. The proof is complete by setting $p^T(S) = a_{S \cup T}^T$ . + +Proof of Proposition 2. Suppose $\phi$ satisfies axioms JLI, JNU and JEF. Then by Proposition 1 the constants $\{p^T(S)\}$ exist, such that for every $v$ and $\varnothing \neq T \subseteq N$ , + +$$ +\phi_ {T} (v) = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) [ v (S \cup T) - v (S) ]. +$$ + +Now for each $\varnothing \neq R\subseteq N$ consider the identity game + +$$ +w _ {R} (S) = \left\{ \begin{array}{l l} 1 & \text {i f} S = R, \\ 0 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Then for every $\varnothing \neq T\subseteq N$ with $|T|\leq k$ + +$$ +\phi_ {T} (w _ {R}) = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) [ w _ {R} (S \cup T) - w _ {R} (S) ]. +$$ + +Note that the term $w_{R}(S \cup T) - w_{R}(S)$ in the above sum is equal to 1 only when $S \subseteq R$ and $T = R \setminus S$ , i.e. only when $S = R \setminus T$ and $\varnothing \neq T \subseteq R$ . Further note that this term is equal to $-1$ only when $S = R$ and $T \neq \emptyset$ , i.e. when $S = R$ and $\varnothing \neq T \subseteq N \setminus R$ (as must have $S \cap T = \emptyset$ ). In all other cases, this term is 0. Hence we deduce from JEF that + +$$ +\delta_{N}(R) = w_{R}(N) = \sum_{\substack{\varnothing \neq T\subseteq R:\\ |T|\leq k}}p^{T}(R\setminus T) - \sum_{\substack{\varnothing \neq T\subseteq N\setminus R:\\ |T|\leq k}}p^{T}(R). +$$ + +Now we show the implication in the other direction. If $\phi_T(v) = \sum_{S \subseteq N \setminus T} p^T(S)[v(S \cup T) - v(S)]$ then it is immediate that JLI and JNU are satisfied. For JEF, we wish to show that for every $v$ , + +$$ +\sum_{\substack{\varnothing \neq T\subset N\colon S\subseteq N\setminus T\\ |T|\leq k}}\sum_{S\subseteq N\setminus T}p^{T}(S)[v(S\cup T) - v(S)] = v(N). +$$ + +Note that for each $\varnothing \neq R\subseteq N$ , the coefficient of $v(R)$ on the left-hand side in the above equation is + +$$ +\sum_{\substack{\varnothing \neq T\subseteq R:\\ |T|\leq k}}p^{T}(R\setminus T) - \sum_{\substack{\varnothing \neq T\subseteq N\setminus R:\\ |T|\leq k}}p^{T}(R). +$$ + +But by equation (4), this is equal to $\delta_N(R)$ . + +![](images/81bc55a848af820ae3886624ebdb2dc25f21213033e5d20dc85a4393f1f6d6e9.jpg) + +Proof of Proposition 3. In light of Proposition 2 we just have to consider JAN. + +Only if: Suppose $\phi$ satisfies JLI, JNU, JEF and JAN. First, we shall establish that + +$$ +p ^ {T} (S) = p ^ {T} \left(S ^ {\prime}\right) \forall \emptyset \neq T \subseteq N, S, S ^ {\prime} \subseteq N \backslash T \text {s . t .} s = s ^ {\prime}. \tag {9} +$$ + +Fix such a $T$ , $S$ and $S'$ . Consider again the identity game, $w_{S}$ and let $\sigma$ be a self-inverse permutation such that $S \mapsto S'$ , $S' \mapsto S$ , and $\sigma(\{i\}) = \{i\}$ for all $i \notin S \cup S'$ . As $T \subseteq N \setminus (S \cup S')$ and $\sigma(T) = T$ , we have by JAN + +$$ +\phi_ {T} \left(w _ {S}\right) = \phi_ {\sigma^ {- 1} (T)} \left(w _ {S}\right) = \phi_ {T} \left(\sigma w _ {S}\right) +$$ + +where + +$$ +\sigma w _ {S} \left(R\right) = w _ {S} \left(\sigma^ {- 1} \left(R\right)\right) = \left\{ \begin{array}{l l} 1 & \text {i f} R = \sigma \left(S\right) = S ^ {\prime} \\ 0 & \text {o t h e r w i s e} \end{array} \right\} = w _ {S ^ {\prime}} \left(R\right). +$$ + +Hence we obtain $\phi_T(w_S) = \phi_T(\sigma w_S) = \phi_T(w_{S'})$ . Next, from Proposition 1 we have + +$$ +\phi_ {T} \left(w _ {S}\right) = \sum_ {Q \subseteq N \backslash T} p ^ {T} (Q) \left[ w _ {S} (Q \cup T) - w _ {S} (Q) \right] = - p ^ {T} (S), +$$ + +and similarly $\phi_T(w_{S'}) = -p^T(S')$ . Hence we obtain $p^T(S) = p^T(S')$ , showing (9). + +Using induction on $s$ , we now establish that (5) holds. Fix $T$ and $T'$ of the same size. For the base case, suppose $s = s' = n - t$ . For $S \subseteq N \setminus T$ and $S' \subseteq N \setminus T'$ , this forces $S = N \setminus T$ and $S' = N \setminus T'$ . Now consider the game + +$$ +x _ {n} \left(R\right) = \left\{ \begin{array}{l l} 1 & \text {i f} r = n \\ 0 & \text {o t h e r w i s e ,} \end{array} \right. +$$ + +so that $x_{n}(R) = 1$ if and only if $R = N$ . Define a self-inverse permutation $\sigma$ so that $\sigma(T) = T'$ , $\sigma(T') = T$ and $\sigma(\{i\}) = \{i\}$ for all $i \notin (T \cup T')$ . Then by JAN and as $\sigma x_{n} = x_{n}$ , + +$$ +\phi_ {T} (x _ {n}) = \phi_ {\sigma^ {- 1} (T ^ {\prime})} (x _ {n}) = \phi_ {T ^ {\prime}} (\sigma x _ {n}) = \phi_ {T ^ {\prime}} (x _ {n}). +$$ + +Next, from Proposition 1, + +$$ +\phi_ {T} \left(x _ {n}\right) = \sum_ {Q \subseteq N \backslash T} p ^ {T} (Q) \left[ x _ {n} (T \cup Q) - x _ {n} (Q) \right] = p ^ {T} (N \backslash T), +$$ + +and similarly $\phi_{T'}(w_n) = p^{T'}(N \setminus T')$ . Hence we obtain $p^T(N \setminus T) = p^{T'}(N \setminus T')$ which establishes the base case. + +We now suppose that $p^T(S) = p^{T'}(S')$ for all $s = s' \geq n - c$ where $S \subseteq N \setminus T$ , $S' \subseteq N \setminus T'$ and $c$ is a positive integer. We shall show that $p^T(S) = p^{T'}(S')$ for all $s = s' \geq n - c - 1$ where where $S \subseteq N \setminus T$ and $S' \subseteq N \setminus T'$ . To this end, consider the game + +$$ +x \left(R\right) = \left\{ \begin{array}{l l} 1 & \text {i f} r \geq n - c - 1 + t, \\ 0 & \text {o t h e r w i s e} \end{array} \right.. +$$ + +Thus, as before, we may write + +$$ +\phi_{T}\left(x\right) = \sum_{Q\subseteq N\setminus T}p^{T}\left(Q\right)\left[x\left(Q\cup T\right) - x\left(Q\right)\right] = \sum_{\substack{Q\subseteq N\setminus T\\ n - c - 1\leq q < n - c - 1 + t}}p^{T}\left(Q\right). +$$ + +Similarly, + +$$ +\phi_{T^{\prime}}\left(x\right) = \sum_{\substack{Q^{\prime}\subseteq N\setminus T^{\prime}\\ n - c - 1\leq q^{\prime} < n - c - 1 + t}}p^{T}\left(Q\right). +$$ + +Again, by JAN, we prove that $\phi_T(x) = \phi_{T'}(x)$ . Define a self-inverse permutation $\sigma$ so that $\sigma(T) = T'$ , $\sigma(T') = T$ and $\sigma(\{i\}) = \{i\}$ for all $i \notin (T \cup T')$ . As worth in game $x$ depends only on a coalition's cardinality, we have $\sigma x = x$ . Thus, by JAN, $\phi_T(x) = \phi_{\sigma(T)}(\sigma x) = \phi_{\sigma(T)}(x) = \phi_{T'}(x)$ . + +However, + +$$ +\phi_{T}\left(x\right) = \sum_{\substack{Q\subseteq N\setminus T\\ q = n - c - 1}}p^{T}\left(Q\right) + \sum_{\substack{Q\subseteq N\setminus T\\ n - c - 1 < q < n - c - 1 + t}}p^{T}\left(Q\right) = \sum_{\substack{Q\subseteq N\setminus T\\ q = n - c - 1}}p^{T}\left(Q\right) + \sum_{\substack{Q^{\prime}\subseteq N\setminus T^{\prime}\\ n - c - 1 < q^{\prime} < n - c - 1 + t}}p^{T^{\prime}}\left(Q^{\prime}\right); +$$ + +and + +$$ +\phi_{T^{\prime}}\left(x\right) = \sum_{\substack{Q^{\prime}\subseteq N\setminus T^{\prime}\\ q^{\prime} = n - c - 1}}p^{T^{\prime}}\left(Q^{\prime}\right) + \sum_{\substack{Q^{\prime}\subseteq N\setminus T^{\prime}\\ n - c - 1 < q^{\prime} < n - c - 1 + t}}p^{T^{\prime}}\left(Q^{\prime}\right) +$$ + +which gives, by the inductive hypothesis and $\phi_T(x) = \phi_{T'}(x)$ , + +$$ +\sum_{\substack{Q\subseteq N\setminus T\\ q = n - c - 1}}p^{T}\left(Q\right) = \sum_{\substack{Q^{\prime}\subseteq N\setminus T^{\prime}\\ q^{\prime} = n - c - 1}}p^{T^{\prime}}\left(Q^{\prime}\right). +$$ + +But by (9), $p^T(Q) = p^T(Q')$ if $q = q'$ . Thus the above equation becomes + +$$ +\left( \begin{array}{c} n - t \\ n - c - 1 \end{array} \right) p ^ {T} (Q) = \left( \begin{array}{c} n - t \\ n - c - 1 \end{array} \right) p ^ {T ^ {\prime}} (Q ^ {\prime}) +$$ + +for any $Q \subseteq N \setminus T$ and $Q' \subseteq N \setminus T'$ with $q = q' = n - c - 1$ . Thus, $p^T(Q) = p^{T'}(Q')$ , completing the inductive step, and the 'only if' statement. + +If: Suppose (5) is satisfied. Fix a permutation $\sigma$ on $N$ and game $v\in \mathcal{G}^N$ . Then for any $\varnothing \neq T\subseteq N$ + +$$ +\begin{array}{l} \phi_ {T} (\sigma v) = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) [ \sigma v (S \cup T) - \sigma v (S) ] = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) [ v (\sigma^ {- 1} (S \cup T)) - v (\sigma^ {- 1} (S)) ] \\ = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) \left[ v \left(\sigma^ {- 1} (S) \cup \sigma^ {- 1} (T)\right) - v \left(\sigma^ {- 1} (S)\right) \right]. \\ \end{array} +$$ + +Defining the set $S' = \sigma^{-1}(S)$ allows us to rewrite the above as + +$$ +\begin{array}{l} \phi_ {T} (\sigma v) = \dots = \sum_ {S ^ {\prime} \subseteq N \backslash \sigma^ {- 1} (T)} p ^ {T} (\sigma (S ^ {\prime})) [ v (S ^ {\prime} \cup \sigma^ {- 1} (T)) - v (S ^ {\prime}) ] \\ = \sum_ {S ^ {\prime} \subseteq N \backslash \sigma^ {- 1} (T)} p ^ {\sigma^ {- 1} (T)} \left(S ^ {\prime}\right) \left[ v \left(S ^ {\prime} \cup \sigma^ {- 1} (T)\right) - v \left(S ^ {\prime}\right) \right] = \phi_ {\sigma^ {- 1} (T)} (v), \\ \end{array} +$$ + +with the penultimate step due to condition (5). + +![](images/704e4f683f2f35799e395e9158ab35a78a63e4c5f94f9be2f62513341d2e53f0.jpg) + +Proof of Proposition 4. In light of Proposition 2 we just have to consider JSY. + +Only if: Suppose $\phi$ satisfies JLI, JNU, JEF and JSY, fix $\varnothing \neq T, T' \subseteq N$ , and consider again the identity game $w_{R}$ . Then for any $\varnothing \neq R \subseteq N \setminus (T \cup T')$ , + +$$ +\cdot w _ {R} (S \cup T) = 0 = w _ {R} (S \cup T ^ {\prime}) \text {f o r a l l} S \subseteq N \backslash (T \cup T ^ {\prime}), +$$ + +- $w_{R}(S \cup T) = 0 = w_{R}(S)$ for all $S \subseteq N \setminus T$ such that $S \cap T' \neq \emptyset$ , +- $w_{R}(S \cup T') = 0 = w_{R}(S)$ for all $S \subseteq N \setminus T'$ such that $S \cap T \neq \emptyset$ . + +Hence by JSY $\phi_T(w_R) = \phi_{T'}(w_R)$ . But $\phi_T(w_R) = p^T(R)$ and $\phi_{T'}(w_R) = p^T(R)$ . This shows that $p^T(R) = p^{T'}(R)$ for all $\varnothing \neq R \subseteq N \setminus (T \cup T')$ . To show that $p^T(\varnothing) = p^{T'}(\varnothing)$ we consider the game + +$$ +w ^ {*} (S) = \left\{ \begin{array}{l l} 1 & \text {i f} S \neq \varnothing , \\ 0 & \text {o t h e r w i s e .} \end{array} \right. +$$ + +Then + +- $w^{*}(S \cup T) = 1 = w^{*}(S \cup T')$ for all $S \subseteq N \setminus (T \cup T')$ , +- $w^{*}(S \cup T) = 1 = w^{*}(S)$ for all $S \subseteq N \setminus T$ such that $S \cap T' \neq \emptyset$ (since then $S \neq \emptyset$ ), +- $w^{*}(S \cup T') = 1 = w^{*}(S)$ for all $S \subseteq N \setminus T'$ such that $S \cap T \neq \emptyset$ (since then $S \neq \emptyset$ ). + +It thus follows by JSY that $\phi_T(w^*) = \phi_{T'}(w^*)$ . However, $\phi_T(w^*) = p^T(\emptyset)$ and $\phi_{T'}(w^*) = p^{T'}(\emptyset)$ , which gives the required identity and shows that (6) holds. + +If: Now we show the implication in the other direction. Suppose (6) holds and $v \in \mathcal{G}^N$ satisfies the three conditions in JSY. Then + +$$ +\begin{array}{l} \phi_ {T} (v) = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) [ v (S \cup T) - v (S) ] = \sum_ {S \subseteq N \backslash (T \cup T ^ {\prime})} p ^ {T} (S) [ v (S \cup T) - v (S) ] \\ = \sum_ {S \subseteq N \backslash (T \cup T ^ {\prime})} p ^ {T ^ {\prime}} (S) [ v (S \cup T ^ {\prime}) - v (S) ] = \sum_ {S \subseteq N \backslash T ^ {\prime}} p ^ {T ^ {\prime}} (S) [ v (S \cup T ^ {\prime}) - v (S) ] = \phi_ {T ^ {\prime}} (v). \\ \end{array} +$$ + +Hence JSY is satisfied. + +![](images/9d092c1fe8f76dc19878c84fdd562f26984242d50f6a3bf3fe0ddbca302b6461.jpg) + +Proof of Theorem 1. We have to show that there exists exactly one choice of constants $\{p^T(S)\}$ which satisfy equations (4)-(6). Notice that satisfying (5) and (6) is equivalent to satisfying + +$$ +p ^ {T} (S) = p ^ {T ^ {\prime}} (S) \forall S \subseteq N \setminus T, S ^ {\prime} \subseteq N \setminus T ^ {\prime} \mathrm {s . t .} s = s ^ {\prime}. +$$ + +Thus $p^T(S)$ does not depend on $T$ at all, and only depends on the cardinality of $S$ . Let $q_s$ denote $p^T(S)$ for any $S \subseteq N \setminus T$ . Then we can re-write equation (4) in terms of $q_s$ as + +$$ +1 = \sum_ {i = n - k} ^ {n - 1} \binom {n} {i} q _ {i}, \tag {10} +$$ + +$$ +q _ {s} = \frac {\sum_ {i = (s - k) \vee 0} ^ {s - 1} \binom {s} {i} q _ {i}}{\sum_ {i = 1} ^ {k \wedge (n - s)} \binom {n - s} {i}} \quad \forall s \in \{1, \dots , n - 1 \}. \tag {11} +$$ + +Note that for any $q_0$ , equation (11) fully determines all other $q_i$ , for $i \in \{1, \dots, n-1\}$ and $q_0$ is then determined by (10). Thus there is at most one solution. However, we have already identified (see the arrival-order discussion in Appendix A) that a solution to this recurrence is given by $(q_0, \dots, q_{n-1}) = (\hat{p}_0, \dots, \hat{p}_{n-1})$ , for which $\hat{p}_0 = \left( \sum_{i=1}^k \binom{n}{i} \right)^{-1}$ . + +# C STRONG JOINT SYMMETRY + +We examine the effect of removing conditions 2 and 3 from JSY. As it turns out, this leads to the non-existence of an index. To be precise, we consider replacing axioms JAN and JSY with: + +SJS strong joint symmetry: fix $\varnothing \neq T, T' \subseteq N$ . Then + +$$ +\begin{array}{l} v \left(S \cup T\right) = v \left(S \cup T ^ {\prime}\right) \forall S \subseteq N \backslash \left(T \cup T ^ {\prime}\right) \\ \Rightarrow \phi_ {T} (v) = \phi_ {T ^ {\prime}} (v). \\ \end{array} +$$ + +Proposition 5. There is no index $\phi$ satisfying axioms JLI, JNU, JEF, and SJS that is guaranteed to exist for all games. + +Proof. Since $\phi$ satisfies JLI, JNU, and JEF, by Proposition 2, + +$$ +\phi_ {T} (v) = \sum_ {S \subseteq N \backslash T} p ^ {T} (S) [ v (S \cup T) - v (S) ] +$$ + +with $\{p^T(S)\}$ satisfying (4), for any game $v \in \mathcal{G}^N$ . We consider two games $v_1, v_2 \in \mathcal{G}^{\{1,2\}}$ . As $N = \{1,2\}$ , (4) gives $p^{\{1\}}(\emptyset) = p^{\{2\}}(\{1\})$ , $p^{\{2\}}(\emptyset) = p^{\{1\}}(\{2\})$ , and $p^{\{1,2\}}(\emptyset) + p^{\{1\}}(\emptyset) + p^{\{2\}}(\emptyset) = 1$ . + +Suppose $v_{1}(\{1\}) = v_{1}(\{1,2\}) = 1$ , $v_{1}(\{2\}) = 0$ . SJS thus gives that $\phi_{\{1\}}(v_1) = \phi_{\{1,2\}}(v_1)$ , i.e. $p^{\{1,2\}}(\varnothing) = p^{\{1\}}(\varnothing) + p^{\{2\}}(\varnothing)$ which implies $p^{\{1,2\}}(\varnothing) = 1 / 2$ . + +Suppose also that $v_{2}(\{1\}) = v_{2}(\{1,2\}) = v_{2}(\{2\}) = 1$ . SJS gives that $\phi_{\{1\}}(v_2) = \phi_{\{2\}}(v_2) = \phi_{\{1,2\}}(v_2)$ , i.e. $p^{\{1,2\}}(\varnothing) = p^{\{1\}}(\varnothing) = p^{\{2\}}(\varnothing)$ which implies $p^{\{1,2\}}(\varnothing) = 1/3$ , giving a contradiction. + +Thus, SJS is too strong a notion of symmetry, imposing linear restrictions on sets of unequal sizes. \ No newline at end of file diff --git a/jointshapleyvaluesameasureofjointfeatureimportance/images.zip b/jointshapleyvaluesameasureofjointfeatureimportance/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..500f38c2bc74af5d9e2c11ceff1b512fc8722fa4 --- /dev/null +++ b/jointshapleyvaluesameasureofjointfeatureimportance/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b21ea2e2c46a9bd34db65c78b10d74eadbf68257dd0c7dd2b52611407ac18c17 +size 757661 diff --git a/jointshapleyvaluesameasureofjointfeatureimportance/layout.json b/jointshapleyvaluesameasureofjointfeatureimportance/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..250d2f423aba851765408ab08f404cc6cb7b2ae8 --- /dev/null +++ b/jointshapleyvaluesameasureofjointfeatureimportance/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:019cb6a18e93f0b1083b211054bafaf1feeac26b9716f29fb1b7ffe7aa95c074 +size 870171 diff --git a/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_content_list.json b/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..772744e9063f3fd2d2bbb14a7cd7122494045bd6 --- /dev/null +++ b/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35473a4ddeb91fbe8a7657b79605dbff922b2e5f2e2c67e97c8d64ab374efa90 +size 144235 diff --git a/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_model.json b/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..540b218ae857a30dab46cfee66ec7c5ac396473f --- /dev/null +++ b/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eab7fda0d5d76194d60f836428646811c9df2ccb28f28fa774eb21f376a8efbc +size 169755 diff --git a/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_origin.pdf b/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..354eeaecb94c003b72de86aa4d6e366de6caedc7 --- /dev/null +++ b/klguideddomainadaptation/d1ca2fde-aabc-44f3-97bf-a3568a61e9aa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acbb6de650eb1b63a44d5a7610f36ee4a38c7cd59cdf12a2d2e220fbf3e06610 +size 838204 diff --git a/klguideddomainadaptation/full.md b/klguideddomainadaptation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ea94023d52dc35ed57b23a440aa309fcbe00924c --- /dev/null +++ b/klguideddomainadaptation/full.md @@ -0,0 +1,690 @@ +# KL GUIDED DOMAIN ADAPTATION + +A. Tuan Nguyen*† + +Toan Tran + +Yarin Gal + +Philip H. S. Torr + +Atthm Gunes Baydin + +# ABSTRACT + +Domain adaptation is an important problem and often needed for real-world applications. In this problem, instead of i.i.d. training and testing datapoints, we assume that the source (training) data and the target (testing) data have different distributions. With that setting, the empirical risk minimization training procedure often does not perform well, since it does not account for the change in the distribution. A common approach in the domain adaptation literature is to learn a representation of the input that has the same (marginal) distribution over the source and the target domain. However, these approaches often require additional networks and/or optimizing an adversarial (minimax) objective, which can be very expensive or unstable in practice. To improve upon these marginal alignment techniques, in this paper, we first derive a generalization bound for the target loss based on the training loss and the reverse Kullback-Leibler (KL) divergence between the source and the target representation distributions. Based on this bound, we derive an algorithm that minimizes the KL term to obtain a better generalization to the target domain. We show that with a probabilistic representation network, the KL term can be estimated efficiently via minibatch samples without any additional network or a minimax objective. This leads to a theoretically sound alignment method which is also very efficient and stable in practice. Experimental results also suggest that our method outperforms other representation-alignment approaches. + +# 1 INTRODUCTION + +With advances in neural network architectures (He et al., 2016; Vaswani et al., 2017), machine learning algorithms have achieved state-of-the-art performance in many tasks such as object classification, object detection and natural language processing. However, machine learning models have been focusing mostly on the case of independent and identically distributed (i.i.d.) datapoints; and such an assumption often does not hold in practice. When the i.i.d. assumption is violated and the target domain has a different distribution compared to the source domain, a typical learner trained on the source data via empirical risk minimization would not perform well at test time, since it does not account for the distribution shift. To tackle this problem, many methods have been proposed for domain adaptation (Zhao et al., 2019; Zhang et al., 2019; Combes et al., 2020; Tanwani, 2020) and domain generalization (Khosla et al., 2012; Muandet et al., 2013; Ghifary et al., 2015), the goal of which is to train a machine learning algorithm that can generalize well to the target domain. + +A common approach to tackle these problems is to learn a representation such that its distribution does not change across domains. There are two types of distribution alignment: marginal alignment (aligning the marginal distribution of the representation) and conditional alignment (aligning the conditional distribution of the label given the representation) (Nguyen et al., 2021; Tanwani, 2020). For domain adaptation and domain generalization problems with multiple source domains, we can use the data and labels to align both the marginal and the conditional distributions across the source domains, aiming to generalize to the target domain. However, in a single-source domain adaptation problem, with only unlabeled data from the target domain, it is often only possible to align the marginal distribution of the representation. This marginal alignment should help the classifier avoid out-of-distribution data at test time. + +This paper focuses on such a single-source domain adaption problem, which is also one of the most common settings in practice. Current marginal alignment techniques usually require additional computation (e.g., of an additional network) (Ganin et al., 2016; Li et al., 2018) and/or a minimax objective (Ganin et al., 2016; Shen et al., 2018), leading to an expensive and/or unstable training procedure (Goodfellow, 2016; Kodali et al., 2017). For example, DANN (Ganin et al., 2016) employs an adversarial training procedure, with a domain discriminator that classifies the domain of the representation, and maximizes the adversarial loss of the discriminator. When the discriminator is completely fooled, the marginal distribution of the representation is aligned across domains. MMD (Gretton et al., 2012; Li et al., 2018) utilizes maximum mean discrepancy to align the representation distribution. This does not use a minimax objective, thus leading to a more stable training; however, it does require additional computation of several Gaussian kernels. While more sophisticated (non-marginal-alignment) methods have been proposed recently to achieve better results in the domain adaptation problem, we argue that studying the family of plain marginal-alignment techniques is still an important task, since they are the backbones that most other domain adaptation (and domain generalization) methods are built upon. + +To address the above issues of existing marginal-alignment techniques, we first derive a generalization bound on the loss of the target domain using the training loss and a reverse Kullback-Leibler (KL) divergence between the source and target distributions. There are existing bounds of the target loss in the literature (Ben-David et al., 2010), however, these analyses focus mostly on the case of binary classification and the bounds use a total variation distance or a $\mathcal{H}$ -divergence between the distributions, which are not easy to estimate in practice (for example, Ajakan et al. (2014) require an adversarial network to estimate the $\mathcal{H}$ -divergence). In this paper, we show that with a probabilistic representation network, we can estimate the KL divergence easily using samples, leading to an alignment method that requires virtually no additional computation nor a minimax objective. Therefore, our training procedure is simple and stable in practice. Moreover, the reverse KL has the zero-forcing effect (Minka et al., 2005), which is very effective to alleviate the out-of-distribution problem in practice. This can be explained as follows: the out-of-distribution problem arises when the classifier faces a new representation at test time that is in a (near) zero mass region of the source representation distribution (and thus it never faced before). The reverse KL tends to force the target representation distribution to have (near) zero mass wherever the source distribution has (near) zero mass (this is the zero-forcing property), which helps the classifier avoid out-of-distribution data. The reverse KL also has the mode-seeking effect (Minka et al., 2005) which allows for a more flexible alignment of the representation (to one or some of the modes of the source domain). For example, consider the classification problem of buildings (houses, hotels, etc.) where source images are collected from urban and remote areas of a country (two modes); while the target images are collected from urban areas but from a different country. Ideally, we want to match the representation distribution of the target domain to that of the first mode of the source domain since they are both from urban areas. The reverse KL allows this flexible alignment (as it results in a relatively small value of the reverse KL) due to its mode-seeking property. Meanwhile, other distance metrics/divergences aim to match the whole source and target representation distribution, which might collapse the two modes of the source domains. + +Our contributions in this work are: + +- We construct a generalization bound of the test loss in the domain adaptation problem using the reverse KL divergence. +- We propose to reduce the generalization bound by minimizing the above KL term. Furthermore, we show that with a probabilistic representation, the KL term can be estimated easily using minibatches, without any additional computation or a minimax objective as opposed to most existing works. +- We conduct extensive experiments and show that our method significantly outperforms relevant baselines, namely ERM (Bousquet et al., 2003), DANN (Ganin et al., 2016), MMD (Gretton et al., 2012; Li et al., 2018), CORAL (Sun and Saenko, 2016) and WD (Shen et al., 2018). We empirically show that the reverse KL divergence is very effective for representation alignment since it is very stable and efficient to compute in practice. + +# 2 RELATED WORK + +Generalization bound for the distribution shift problem There exist works studying bounds for the distribution shift problem in the literature (Ben-David et al., 2010; Mansour et al., 2009). How- + +ever, their analyses of the classification problem are limited to the case of binary labels. Moreover, these bounds are only applicable or practical for deterministic labeling functions, which is not the case for most datasets in practice. Therefore, their analyses cannot be generalized to the general case of supervised learning. The differences between our bound and theirs are as follows. First of all, our bound works for the general case of supervised learning: it works for both the classification (including multiclass classification) and regression problems, it makes no assumptions about the labeling mechanism (can be probabilistic or deterministic), and it works for virtually all predictive distributions commonly used in practice. Secondly, our bound uses a different divergence, namely the KL divergence, which is easier to estimate in practice compared to total variation or $\mathcal{H}$ -divergence. We provide a brief review of the above bounds and discuss their differences to ours in more detail in the appendix. Recently, Acuna et al. (2021) revise the previous domain adaptation bounds and generalize them to a multi-class classification setting, as well as to the class of $f$ -divergence (including KL divergence). However, their setting is still very restricted: the loss function needs to satisfy the triangle inequality (which does not hold for many loss functions in practice), and they need to know the true labeling function (optimal Bayes classifier) for a probabilistic labeling mechanism (which is often not available). We also provide further analysis, that under some reasonable assumptions, the conditional misalignment in the representation space is bounded by the conditional misalignment in the input space, which allows for a sound marginal alignment method. This can be seen as an improvement over prior works. Some specific cases of distribution shift have also been studied. For example, Cortes et al. (2010) and Johansson et al. (2019) study the generalization bound for the covariate shift problem, i.e., $p_T(x) \neq p_S(x)$ but $p_T(y|x) = p_S(y|x)$ , where $p_S$ is the source distribution and $p_T$ is the target distribution. In contrast, Azizzadenesheli et al. (2019) provide a generalization bound for the label shift problem, i.e., $p_T(y) \neq p_S(y)$ but $p_T(x|y) = p_S(x|y)$ . + +Domain adaptation While the literature on the domain adaptation problem is vast, we cover the most closely related works to ours here. A common method for the domain adaptation problem is to align the marginal distribution of the representation between the source and target domains. DANN (Ganin et al., 2016) employs a domain discriminator to classify the domain of a representation and maximizes its adversarial loss (a minimax game). WD (Shen et al., 2018) uses a neural network function $f$ (which is 1-Lipschitz continuous) to calculate the Wasserstein distance between two distributions and minimizes it. This is also a minimax game since the Wasserstein distance is the supremum over the search space of $f$ . MMD (Gretton et al., 2012; Li et al., 2018) uses the maximum mean discrepancy to align the representation distribution. This method does not need a minimax objective; however, it requires the additional computation of several Gaussian kernels. Finally, CORAL (Sun and Saenko, 2016) matches the first two moments of the distribution; and while being a simple method, it fails to align more complex distributions. We consider these marginal alignment techniques our main baselines since our method falls into this category, and investigate the effectiveness of the reverse KL divergence in aligning the distributions of representation. Recently, more sophisticated alignment methods (Kang et al., 2019; Xu et al., 2019; Zhu et al., 2020) have been proposed for the domain adaptation problem, which achieve state-of-the-art performance. Instead of simply aligning the marginal distribution of the representation, these methods minimize the intra-class distance of the representation across domains, and possibly maximize the inter-class distance between them, using the MMD or L2 distance. However, they require pseudo labels for the target domain (often obtained via clustering). Moreover, they are complementary to our method, as we conjecture that our method can also be used in conjunction with these, leading to the same algorithms but with the KL distance instead of MMD or L2. + +# 3 APPROACH + +# 3.1 PROBLEM STATEMENT + +In this paper, we consider one of the most common domain adaptation settings, which consists of a single-source domain $S$ with the joint data distribution $p_S(x,y)$ and a target domain $T$ with the data distribution $p_T(x,y)$ , where $x$ denotes the input sample and $y$ is the label. We assume that these two domains have the same support sets $\mathcal{X},\mathcal{Y}$ . Regarding the training process of the domain adaptation problem, we further denote a labeled dataset of size $N_{S}$ sampled from the source domain $(x_S^{(i)},y_S^{(i)})_{i = 1}^{N_S}$ , where $(x_S^{(i)},y_S^{(i)})\sim p_S(x,y)$ , and an unlabeled dataset of size $N_{T}$ from the target domain $(x_T^{(i)})_{i = 1}^{N_T}$ , where $x_{T}^{(i)}\sim p_{T}(x)$ . + +The goal of a typical domain adaptation framework is to train a model with the labeled dataset of the source domain together with the unlabeled dataset from the target domain, so that the model will + +![](images/7a9c0ba2607b9bff7de25d09de3cfc4ea7183dd217abc63d11ac1dc6d794b331.jpg) +Figure 1: Graphical model. Note that the distribution $p(z|x)$ (green edge), corresponding to our representation network, is shared between the source and target domains. + +![](images/a8d4cbaa7f30cd17b7d7dc2ef4b2116508afc0331f24f7077a194398c6717f36.jpg) + +perform decently in the target domain. Note that this is only effective if the labeling mechanism is not too different between the source and the target domains (Ben-David et al., 2010). + +In the domain adaption problem, we expect the changes in the marginal distribution so that $p_S(x) \neq p_T(x)$ , or the conditional distribution so that $p_S(y|x) \neq p_T(y|x)$ , or both, which often render the typical empirical risk minimization training procedure ineffective. This motivates a line of approaches that learn a representation $z$ of $x$ whose marginal and conditional distributions are more aligned across the domains and use it for the prediction task, aiming at a better generalization performance to the target domain. + +The general representation learning framework aims to learn a representation $z$ from $x$ with the mapping $p(z|x)$ , which can be deterministic or probabilistic. That latent representation $z$ is expected to contain the label-related information; and is then used to predict the label $y$ (by a classifier). Note that since the source and target domains have the same support set for $x$ and share the representation mapping $p(z|x)$ , they also have the same support set for $z$ , denoted by $\mathcal{Z}$ . Given the representation $z$ , we learn a classifier to predict $y$ through the predictive distribution $\hat{p}(y|z)$ that is an approximation of the ground truth conditional distribution $p_S(y|z)$ . During training, the representation network $p(z|x)$ and the classifier $\hat{p}(y|z)$ are trained jointly on the source domain and we "hope" that they can generalize to the target domain, meaning that both $p(z|x)$ and $\hat{p}(y|z)$ are kept unchanged between training and testing. The graphical model of that representation learning process is represented in Figure 1. In this paper, we consider a probabilistic representation mapping; specifically, the representation network will output $\mu(x)$ and $\sigma^2(x)$ and $p(z|x) = \mathcal{N}(z; \mu(x), \mathrm{diag}(\sigma^2(x)))$ , where $\mathcal{N}$ denotes a Gaussian distribution. This can also be thought of as a generalization of a deterministic representation, as we recover the deterministic case if $\sigma^2(x) \to 0$ . Also, note that our method is not limited to the choice of this representation distribution, i.e., the discussion in this section holds for virtually any other distribution. + +The joint distributions of $x, y, z$ for the source and target domains can be represented as follows + +$$ +p _ {S} (x, y, z) = p _ {S} (x, y) p (z | x), \quad p _ {T} (x, y, z) = p _ {T} (x, y) p (z | x). \tag {1} +$$ + +and we define the predictive distribution of $y$ given $x$ as + +$$ +\hat {p} (y | x) = \mathbb {E} _ {p (z | x)} [ \hat {p} (y | z) ]. \tag {2} +$$ + +Remark 1. On the inference complexity of a probabilistic representation. + +Using a probabilistic representation, we need to sample multiple $z$ from $p(z|x)$ to estimate Eq. 2 during test time. However, this is not a big issue for the representation learning framework, since we only need to run the representation network $p(z|x)$ (which is usually deep) once to get a distribution of $z$ . After sampling multiple $z$ from that distribution, we only need to rerun the classifier $\hat{p}(y|z)$ which is usually a small network (e.g., often contains one layer). Furthermore, we can also run $\hat{p}(y|z)$ (a small network) in parallel for multiple $z$ to reduce inference time if necessary. + +During training, we usually sample a single $z$ from $p(z|x)$ for each $x$ . The training objective is + +$$ +l _ {t r a i n} = \mathbb {E} _ {x, y \sim p s (x, y), z \sim p (z | x)} [ - \log \hat {p} (y | z) ] \tag {3} +$$ + +(this is also the upper bound of $\mathbb{E}_{p_S(x,y)}[-\log \hat{p}(y|x)]$ via Jensen Inequality) + +$$ += \mathbb {E} _ {p _ {S} (z, y)} [ - \log \hat {p} (y | z) ] \tag {4} +$$ + +where $-\log \hat{p}(y|z)$ is the loss of a "data point" $(z,y)$ . For common choices of the predictive distribution in the classification and regression problems, this is a non-negative quantity. For example, for a classification problem with a categorical predictive distribution, this becomes the cross-entropy + +loss, while for a regression problem with a Gaussian predictive distribution (with a fixed variance), it becomes the squared error (with an additive constant). + +Minimizing $l_{train}$ will enforce $\hat{p}(y|z) \approx p_S(y|z)$ . + +We consider the below two assumptions of the representation $z$ on the source domain: + +Assumption 1. $I_S(z,y) = I_S(x,y)$ , where $I_S(\cdot, \cdot)$ is the mutual information term, calculated on the source domain. In particular: + +$$ +I _ {S} (z, y) = \mathbb {E} _ {p _ {S} (z, y)} \left[ \log \frac {p _ {S} (z , y)}{p _ {S} (z) p _ {S} (y)} \right]; \quad I _ {S} (x, y) = \mathbb {E} _ {p _ {S} (x, y)} \left[ \log \frac {p _ {S} (x , y)}{p _ {S} (x) p _ {S} (y)} \right] \tag {5} +$$ + +This is often referred to as the "sufficiency assumption" since it indicates that the representation $z$ has the same information about the label $y$ as the original input $x$ , and is sufficient for this prediction task (in the source domain). Note that the data processing inequality indicates that $I_S(z, y) \leq I_S(x, y)$ , so here we assume that $z$ contains maximum information about $y$ . + +Remark 2. Assumption 1 is an optimization goal of the training process on the source domain. + +In particular, $l_{train}$ (with an additive constant) is an upper bound of $-I_S(z,y)$ , which is an upper bound of $-I_S(x,y)$ . Thus, minimizing $l_{train}$ will enforce $I_S(z,y)$ to be equal to $I_S(x,y)$ . For a more detailed discussion of this, please refer to, for example, Alemi et al. (2016). + +Assumption 2. $p_S(y|x) = \mathbb{E}_{p(z|x)}[p_S(y|z)]\quad \forall x,y\in \mathcal{X},\mathcal{Y}$ + +When this assumption holds, the predictive distribution in Eq. 2 will approximate $p_S(y|x)$ , as long as $\hat{p}(y|z)$ approximates $p_S(y|z)$ . + +Remark 3. Assumption 2 is also an optimization goal of the training process on the source domain. + +This is because $l_{train}$ is an upper bound of $\mathbb{E}_{p_S(x,y)}[-\log \hat{p}(y|x)]$ , which is an upper bound of $\mathbb{E}_{p_S(x,y)}[-\log p_S(y|x)]$ . Thus, minimizing $l_{train}$ will enforce $\hat{p}(y|x)$ to be equal to $p_S(y|x)$ . Therefore, $p_S(y|x) \approx \hat{p}(y|x) = \mathbb{E}_{p(z|x)}[\hat{p}(y|z)] \approx \mathbb{E}_{p(z|x)}[p_S(y|z)]$ . + +These two assumptions ensure that our network has good performance on the source domain. Note also that we only make the above two assumptions about the source domain, where we can enforce them through the training process. We do not make these assumptions about the target domain, since we have no access to the full target distribution. These two assumptions will also be used to prove our later theoretical result (Proposition 2). + +# 3.2 KL GUIDED DOMAIN ADAPTATION + +Now we will consider the test loss in the domain adaptation problem, and how we can reduce it. The test loss (of the target domain) is: + +$$ +\begin{array}{l} l _ {t e s t} = \mathbb {E} _ {p _ {T} (x, y)} [ - \log \hat {p} (y | x) ] = \mathbb {E} _ {p _ {T} (x, y)} [ - \log \mathbb {E} _ {p (z | x)} [ \hat {p} (y | z) ] ] (6) \\ \leq \mathbb {E} _ {p _ {T} (x, y)} \left[ \mathbb {E} _ {p (z | x)} [ - \log \hat {p} (y | z) ] \right] \quad (\text {J e s s e n I n e q u a l i t y}) (7) \\ = \mathbb {E} _ {p T (z, y)} [ - \log \hat {p} (y | z) ] (8) \\ \end{array} +$$ + +Note that if the representation $z$ is invariant (both marginally and conditionally), then $p_T(z, y) = p_S(z, y)$ and Eq. 8 becomes $l_{train}$ , and we have a perfect generalization between the source domain and the target domain. However, there is no way to guarantee the invariance, since we do not know the target domain and the target data distribution. In that case, we introduce the following proposition that ensures a generalization bound of the test loss based on the training loss and the KL divergence: + +Proposition 1. If the loss $-\log \hat{p}(y|z)$ is bounded by $M^1 \forall z \in \mathcal{Z}, y \in \mathcal{Y}$ , we have: + +$$ +\begin{array}{l} l _ {t e s t} \leq l _ {t r a i n} + \frac {M}{\sqrt {2}} \sqrt {\mathrm {K L} [ p _ {T} (y , z) | p _ {S} (y , z) ]} (9) \\ = l _ {t r a i n} + \frac {M}{\sqrt {2}} \sqrt {\mathrm {K L} [ p _ {T} (z) | p _ {S} (z) ] + \mathbb {E} _ {p _ {T} (z)} [ \mathrm {K L} [ p _ {T} (y | z) | p _ {S} (y | z) ] ]} (10) \\ \end{array} +$$ + +Proof. provided in the appendix. + +![](images/3a9b70acc55c5dc3c123636ae704ec7722a0724398f7c5f71eacfa7768b9f18d.jpg) + +This bound is similar to other bounds in the literature (e.g., Ben-David et al. (2010)) in the sense that it also contains the training loss, a marginal misalignment term and a conditional misalignment term $\mathrm{KL}[p_T(z)|p_S(z)]$ and $\mathbb{E}_{p_T(z)}[\mathrm{KL}[p_T(z)|p_S(z)]]$ respectively in our case). However, Ben-David et al. (2010) consider a binary classification problem and their bounds are only practical for a deterministic labeling function (requires knowing the true labeling function, which is unknown for a probabilistic labeling mechanism, to compute the bound); while our bound works for the general case of supervised learning with any labeling mechanism. For a brief review of these bounds and a detailed discussion about their differences to ours, please refer to the appendix. Note that the bound in Proposition 1 is also true when applying to the input space directly (e.g., replacing $z$ with $x$ ). However, we are more interested in the bound in the representation space, since we can reduce it by regularizing the KL term. + +To reduce the generalization gap, we want $p_T(z,y)$ to be close to $p_S(z,y)$ . Aligning the marginal distribution (i.e., $p_S(z)\approx p_T(z)$ ) helps the classifier network $\hat{p} (y|z)$ avoid out-of-distribution data since the target representations it faces at test time belong to the source representation distribution which it was trained on; while aligning the conditional distribution $(p_{S}(y|z)\approx p_{T}(y|z))$ makes sure the classifier gives more accurate predictions on the target domain since $\hat{p} (y|z)$ was trained to approximate $p_S(y|z)$ . In the domain adaptation problem, since we only have the unlabeled data from the target domain, we often align the marginal distribution of $z$ only. However, one problem is that the conditional misalignment also depends on the representation $z$ , and when learning a representation $z$ that aligns the marginal, we might accidentally increase $\mathbb{E}_{p_T(z)}\left[\mathrm{KL}\big[p_T(y|z)|p_S(y|z)\big]\right]$ at the same time, leading to a net increase in the above generalization bound. For example, what if (and is it possible that) the conditional misalignment increases to infinity while we learn a representation $z$ ? + +Therefore, it is crucial that we can bound the above conditional misalignment. The below proposition handles this problem. + +Proposition 2. If Assumption 1 and 2 hold, and if $\frac{p_T(x,y)}{p_S(x,y)} < \infty$ (i.e., there exists $N$ , which can be arbitrarily large, such that $\frac{p_T(x,y)}{p_S(x,y)} < N \forall x \in \mathcal{X}, y \in \mathcal{Y}$ ), we have: + +$$ +\mathbb {E} _ {p _ {T} (z)} \left[ \mathrm {K L} \left[ p _ {T} (y | z) \mid p _ {S} (y | z) \right] \right] \leq \mathbb {E} _ {p _ {T} (x)} \left[ \mathrm {K L} \left[ p _ {T} (y | x) \mid p _ {S} (y | x) \right] \right] \tag {11} +$$ + +Proof. provided in the appendix. + +![](images/d0866a402374a4a25cdebbc0e106f8ae5064880a2eb676a175c9fdaa9f7b62e6.jpg) + +This shows that the conditional misalignment in the representation space is bounded by the conditional misalignment in the input space. This can also be viewed as an improvement over the analyses of Ben-David et al. (2010), where it is not clear if the conditional misalignment in the representation space is bounded or not. It then follows that: + +$$ +l _ {t e s t} \leq l _ {t r a i n} + \frac {M}{\sqrt {2}} \sqrt {\operatorname {K L} [ p _ {T} (z) | p _ {S} (z) ] + \mathbb {E} _ {p _ {T} (x)} [ \operatorname {K L} [ p _ {T} (y | x) | p _ {S} (y | x) ] ]}. \tag {12} +$$ + +As mentioned earlier, in order for domain adaptation to be effective, we should expect that the labeling mechanism does not change too much (Ben-David et al., 2010). Thus, the conditional misalignment $\mathbb{E}_{p_T(x)}[\mathrm{KL}[p_T(y|x)|p_S(y|x)]]$ is often small (and fixed - not dependent on the representation $z$ ). Therefore, to reduce the generalization bound, we can focus on minimizing $\mathrm{KL}[p_T(z)|p_S(z)]$ with the objective: + +$$ +l _ {\text {t r a i n}} + \beta \mathrm {K L} [ p _ {T} (z) | p _ {S} (z) ] \tag {13} +$$ + +where $\beta$ is a hyper-parameter. + +Discussion on the use of reverse KL: Our derivation leads to the reverse KL term $\mathrm{KL}[p_T(z)|p_S(z)]$ as a regularizer of the distance between the two domains representations. We argue that there are several reasons that make this a good choice as a divergence between the source and target representation distributions. (1) First of all, as mentioned earlier, the KL term can be computed easily without any additional network or a minimax objective (details in Subsection 3.3). This leads to an efficient and stable training procedure, which often results in improved performance. (2) Secondly, the reverse KL has the zero-forcing/mode-seeking effect (Minka et al., 2005) that helps to alleviate the out-of-distribution problem. Specifically, the reverse KL forces the target representation distribution to have zero mass wherever the source distribution has zero mass (zero-forcing), thus + +![](images/508cbf2377e09a321f3d986c3b3cdcb9c2ce43eb3652eaa54bfe1501a0631361.jpg) +Figure 2: Reverse KL allows a flexible alignment of the representation while still effectively preventing the out-of-distribution problem. (a) Source representation distribution (black). Consider the case where the data distribution $p_S(x)$ of the source domain has two modes, then the representation distribution $p_S(z)$ will likely also have two modes; and consider the case where the target distribution has only one mode. (b) An acceptable target representation distribution (green) that helps the classifier avoid the out-of-distribution problem. Reverse KL allows for this type of flexible alignment (match to one/some of the modes) due to its mode-seeking nature. (c) A problematic target representation distribution (red), since the classification network will face out-of-distribution data at test time, in the area between the two modes. Reverse KL will prevent this due to its zero-forcing nature. + +![](images/f0b08be2999dee5ae4405fbcfb570221fe0075085f940bf7f142eb1747c812d3.jpg) + +![](images/7c6d2a005d2321274807c6f97b9f1d51a2ceb9b3eb4397c268b55ada74c61514.jpg) + +preventing the out-of-distribution data at test time (Figure 2c). On the other hand, its mode-seeking nature allows flexible alignment of the representation. For example, consider the case where the source domain is a mixture of two components (Figure 2a, i.e., it has two modes), and the target distribution is close to one of the two components. Ideally, we want to learn a representation network that matches the representation of the target domain to that of the corresponding component on the source mixture (Figure 2b). This representation will still perform well at test time since we would not have the out-of-distribution problem (the classification network is already trained on this mode of the source distribution). This flexible alignment (to one or some of the modes) is accepted by the reverse KL since it leads to a relatively small reverse KL value. Meanwhile, other methods such as DANN, MMD, CORAL and WD aim to match the representation distribution of the target domain and that of the whole source domain together, which could compress the representation too much, negatively affecting its expressive power. For instance, in the above example, trying to match the whole distribution of source and target domains based on other distance metrics might force the two modes of the source domain to collapse. The flexible alignment of the reverse KL (while still being very effective to prevent out-of-distribution data) might be beneficial in some practical cases. + +We also empirically found that adding an auxiliary term $\mathrm{KL}[p_S(z)|p_T(z)]$ (forward KL) with a small coefficient $\beta_{aux}$ to the objective can help to align the distribution faster, leading to the objective: + +$$ +l _ {t r a i n} + \beta \mathrm {K L} [ p _ {T} (z) | p _ {S} (z) ] + \beta_ {a u x} \mathrm {K L} [ p _ {S} (z) | p _ {T} (z) ] \tag {14} +$$ + +In practice, setting $\beta_{aux}$ to a (very) small value or zero often leads to the best results (using larger $\beta_{aux}$ can hurt the performance). Note that this does not invalidate our earlier discussion, as with such small values of $\beta_{aux}$ , the alignment behavior is still dominated by the reverse KL. + +# 3.3 OPTIMIZATION + +In practice, we estimate Eq. 14 using minibatches. In particular, given a labelled minibatch $(\tilde{x}_S^{(i)},\tilde{y}_S^{(i)})_{i = 1}^B$ of the source domain and an unlabelled one $(\tilde{x}_T^{(i)})_{i = 1}^B$ of the target domain, and a single sampled representation for each $x$ : $(\tilde{z}_S^{(i)})_{i = 1}^B$ and $(\tilde{z}_T^{(i)})_{i = 1}^B$ , we can get an unbiased estimator of the objective 14 as follows: + +$$ +\begin{array}{l} l _ {t r a i n} + \beta \mathrm {K L} [ p _ {T} (z) | p _ {S} (z) ] + \beta_ {a u x} \mathrm {K L} [ p _ {S} (z) | p _ {T} (z) ] \\ = \mathbb {E} _ {p _ {S} (z, y)} [ - \log \hat {p} (y | z) ] + \beta \mathbb {E} _ {p _ {T} (z)} [ \log p _ {T} (z) - \log p _ {S} (z) ] + \beta_ {a u x} \mathbb {E} _ {p _ {S} (z)} [ \log p _ {S} (z) - \log p _ {T} (z) ] \\ \approx \frac {1}{B} \sum_ {i = 1} ^ {B} - \log \hat {p} \left(\tilde {y} _ {S} ^ {(i)} | \tilde {z} _ {S} ^ {(i)}\right) + \beta \frac {1}{B} \sum_ {i = 1} ^ {B} \left[ \log p _ {T} \left(\tilde {z} _ {T} ^ {(i)}\right) - \log p _ {S} \left(\tilde {z} _ {T} ^ {(i)}\right) \right] \\ + \beta_ {a u x} \frac {1}{B} \sum_ {i = 1} ^ {B} \left[ \log p _ {S} \left(\tilde {z} _ {S} ^ {(i)}\right) - \log p _ {T} \left(\tilde {z} _ {S} ^ {(i)}\right) \right] \tag {15} \\ \end{array} +$$ + +However, it still requires knowing $p_S(z)$ and $p_T(z)$ to compute Eq. 15. We also use the minibatch to approximate these quantities: + +$$ +p _ {S} (z) = \mathbb {E} _ {p _ {S} (x)} [ p (z | x) ] \approx \frac {1}{B} \sum_ {i = 1} ^ {B} p (z | x _ {S} ^ {(i)}); \quad p _ {T} (z) = \mathbb {E} _ {p _ {T} (x)} [ p (z | x) ] \approx \frac {1}{B} \sum_ {i = 1} ^ {B} p (z | x _ {T} ^ {(i)}). \tag {16} +$$ + +Intuitively, we use a minibatch of data to construct a distribution of the representation $z$ (which is a mixture of $B$ components), and match that distribution for the two domains with the KL divergence. As mentioned earlier, we use a Gaussian distribution with a diagonal covariance matrix for $p(z|x)$ in practice, and employ the reparameterization trick (Kingma and Welling, 2013) to sample $z$ . + +Although the estimator in Eq. 15 is unbiased, the approximations in Eq. 16 will introduce some bias into our estimator (however, the estimator is still consistent, i.e., it becomes exact when $B \to \infty$ ). Therefore, the batch size might have an effect on the performance of the model. However, via an ablation study, we found that the effect of this bias estimator is not severe in practice, and our model achieves good performance even with a batch size of 64. For detailed results and discussion of this ablation study, please refer to the appendix C.4. + +# 4 EXPERIMENTS + +# 4.1 DATASETS + +RotatedMNIST consists of 70,000 MNIST (LeCun et al., 2010) images that are divided into six domains, each with 11,666 images. The images in each domain are rotated counterclockwise by $0^{\circ}, 15^{\circ}, 30^{\circ}, 45^{\circ}, 60^{\circ}$ and $75^{\circ}$ respectively. We denote the six domains as $\mathcal{M}_0, \mathcal{M}_{15}, \mathcal{M}_{30}, \mathcal{M}_{45}, \mathcal{M}_{60}$ and $\mathcal{M}_{75}$ . We use $\mathcal{M}_0$ as the source domain, and perform five experiments, each with $\mathcal{M}_{15}, \mathcal{M}_{30}, \mathcal{M}_{45}, \mathcal{M}_{60}$ or $\mathcal{M}_{75}$ as the target domain. The task is classification of the ten digit labels. + +DIGITS is a common domain adaptation dataset, with 3 digit classification sub-datasets, namely MNIST, USPS (Hull, 1994) and SVHN (Netzer et al., 2011). Three common adaptation experiments are MNIST $\rightarrow$ USPS, USPS $\rightarrow$ MNIST and SVHN $\rightarrow$ MNIST. + +VisDA17 (Peng et al., 2017) is a challenging real-world classification dataset with a simulation-to-real adaptation task. This dataset contains over 280K images from 12 classes. The source domain contains renderings of 3D models, while the target domain contains real images. + +Please refer to the appendix for results of datasets with more domains such as PACS (Li et al., 2017). + +# 4.2 BASELINES + +We consider all common marginal alignment methods for domain adaptation as our baselines, including DANN, MMD, CORAL and WD. We also consider ERM (empirical risk minimization) and its variant ERM (prob) (same as ERM but with the probabilistic representation network used in our model). For ERM, DANN, MMD and CORAL, we follow the implementation by Gulrajani and Lopez-Paz (2020); while for ERM (prob) and WD, we use our own implementation in Pytorch (Paszke et al., 2019). Note that we do not include methods that are not from the marginal-alignment family since they are out of the scope of this paper. For the full description of these baselines, please refer to our appendix and the official code at https://github.com/atuannnguyen/KL. + +# 4.3 EXPERIMENTAL SETTING + +For the RotatedMNIST and DIGITS experiments, we use a simple convolutional neural network with four $3 \times 3$ convolutional layers (followed by an average pooling layer) as the representation network. For VisDA17, we use a Resnet50 as the representation network. Only the last layer of the representation network differs for a deterministic representation (ERM, DANN, CORAL, MMD, WD) and a probabilistic one (ERM (prob) and KL (ours)). For a representation of size $d_z$ , the last layer's dimension of a deterministic representation network is $d_z$ , while that of a probabilistic network is $2 \cdot d_z$ ( $d_z$ for $\mu$ and $d_z$ for $\sigma^2$ ). Please refer to the appendix for the detailed experimental setting (including data split, hyper-parameter tuning for each model, evaluation protocol, etc.) + +Table 1: Rotated MNIST experiments with ${\mathcal{M}}_{0}$ as the source domain. + +
ModelTarget DomainAverage
M15M30M45M60M75
ERM97.5±0.284.1±0.853.9±0.734.2±0.422.3±0.558.4
ERM (prob)96.8±0.383.2±1.651.3±0.931.4±1.120.7±0.756.7
DANN97.3±0.490.6±1.168.7±4.230.8±0.619.0±0.661.3
MMD97.5±0.195.3±0.473.6±2.144.2±1.832.1±2.168.6
CORAL97.1±0.382.3±0.356.0±2.430.8±0.227.1±1.758.7
WD96.7±0.393.1±1.264.1±3.341.4±7.627.6±2.064.6
KL (ours)97.8±0.197.1±0.293.4±0.875.5±2.468.1±1.886.4
+ +Table 2: DIGITS and VisDA17 experiments. + +
ModelDIGITSVisDA17
M → UU → MS → MAverageS → R
ERM73.1±4.254.8±6.265.9±1.464.639.1±0.5
ERM (prob)70.3±3.259.0±8.367.6±1.365.637.2±2.2
DANN90.7±0.491.2±0.871.1±0.584.357.7±1.3
MMD91.8±0.394.4±0.582.8±0.389.762.8±1.1
CORAL88.0±1.983.3±0.169.3±0.680.239.5±4.5
WD88.2±0.660.2±1.868.4±2.572.338.9±4.8
KL (ours)98.2±0.297.3±0.592.5±0.996.070.6±0.5
+ +# 4.4 RESULTS + +RotatedMNIST and DIGITS: Table 1 and Table 2 show the results for the RotatedMNIST and DIGITS experiments. It is clear that in these experiments, aligning the representation between domains does help improve the generalization performance. Among the baselines (DANN, MMD, CORAL, WD), MMD performs the best, which we attribute to the fact that it does not use a minimax objective, leading to more stable optimization. Meanwhile, CORAL performs the worst, since it only matches the first two moments of the distributions and might fail to align complex distributions. Our method, KL, largely outperforms the baselines, indicating its effectiveness. Visualization of the representation space also shows that our method aligns the representation better than existing methods. This visualization can be found in the appendix. + +VisDA17 (Table 2): In this challenging dataset, many marginal alignment techniques (CORAL, WD) fail the adaptation task (achieve similar accuracy as the ERM baselines). MMD and KL (ours) are again the best performers, confirming that a stable training objective is beneficial in practice. Our method outperforms all other marginal-alignment approaches significantly, suggesting the effectiveness of the KL divergence in representation alignment. + +# 5 CONCLUSION + +In conclusion, in this paper, we derive a generalization bound of the target loss in the domain adaptation problem using the reverse KL divergence. We then show that with a probabilistic representation, the KL divergence can easily be estimated using Monte Carlo (minibatch) samples, without any additional computation or adversarial objective. By minimizing the KL divergence, we can reduce the generalization bound and have a better guarantee about the test loss. We also empirically show that our method outperforms relevant baselines with large margins, which we attribute to its simple and stable training procedure and the mode-seeking/zero-forcing nature of the reverse KL. We conclude that KL divergence is very effective as a tool for representation alignment. In general, a limitation of marginal alignment methods (ours included) is that when the conditional distribution changes significantly from the source domain to the target domain, aligning the marginal would not help the target domain's performance. This is also reflected in our generalization bound. For future work, we would want to investigate the use of KL divergence in other types of alignment. For example, we can follow the algorithm in Kang et al. (2019) to minimize the intra-class distance of the representation across domains and maximize the inter-class distance between them, but using the KL divergence instead of MMD as the distance between representation distributions. Another direction would be using KL divergence to align the conditional distribution across domains in a multi-source setting. + +Acknowledgments This work is supported by the UKRI grant: Turing AI Fellowship EP/W002981/1 and EPSRC/MURI grant: EP/N019474/1. We would also like to thank the Royal Academy of Engineering and FiveAI. + +# REFERENCES + +D. Acuna, G. Zhang, M. T. Law, and S. Fidler. f-domain-adversarial learning: Theory and algorithms. arXiv preprint arXiv:2106.11344, 2021. +H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, and M. Marchand. Domain-adversarial neural networks. arXiv preprint arXiv:1412.4446, 2014. +A. A. Alemi, I. Fischer, J. V. Dillon, and K. Murphy. Deep variational information bottleneck. arXiv preprint arXiv:1612.00410, 2016. +K. Azizzadenesheli, A. Liu, F. Yang, and A. Anandkumar. Regularized learning for domain adaptation under label shifts. arXiv preprint arXiv:1903.09734, 2019. +S. Ben-David, J. Blitzer, K. Crammer, A. Kulesza, F. Pereira, and J. W. Vaughan. A theory of learning from different domains. Machine learning, 79(1):151-175, 2010. +J. Bergstra and Y. Bengio. Random search for hyper-parameter optimization. Journal of machine learning research, 13(2), 2012. +O. Bousquet, S. Boucheron, and G. Lugosi. Introduction to statistical learning theory. In Summer School on Machine Learning, pages 169-207. Springer, 2003. +R. T. d. Combes, H. Zhao, Y.-X. Wang, and G. Gordon. Domain adaptation with conditional distribution matching and generalized label shift. arXiv preprint arXiv:2003.04475, 2020. +C. Cortes, Y. Mansour, and M. Mohri. Learning bounds for importance weighting. In Nips, volume 10, pages 442-450. Citeseer, 2010. +Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096-2030, 2016. +M. Ghifary, W. B. Kleijn, M. Zhang, and D. Balduzzi. Domain generalization for object recognition with multi-task autoencoders. In Proceedings of the IEEE International Conference on Computer Vision, pages 2551-2559, 2015. +I. Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016. +A. Gretton, K. M. Borgwardt, M. J. Rasch, B. Scholkopf, and A. Smola. A kernel two-sample test. The Journal of Machine Learning Research, 13(1):723-773, 2012. +I. Gulrajani and D. Lopez-Paz. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020. +K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016. +J. J. Hull. A database for handwritten text recognition research. IEEE Transactions on Pattern Analysis and Machine Intelligence, 16(5):550-554, 1994. doi: 10.1109/34.291440. +F. D. Johansson, D. Sontag, and R. Ranganath. Support and invertibility in domain-invariant representations. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 527-536. PMLR, 2019. +G. Kang, L. Jiang, Y. Yang, and A. G. Hauptmann. Contrastive adaptation network for unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4893-4902, 2019. +A. Khosla, T. Zhou, T. Malisiewicz, A. A. Efros, and A. Torralba. Undoing the damage of dataset bias. In European Conference on Computer Vision, pages 158-171. Springer, 2012. + +D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. +N. Kodali, J. Abernethy, J. Hays, and Z. Kira. On convergence and stability of gans. arXiv preprint arXiv:1705.07215, 2017. +Y. LeCun, C. Cortes, and C. Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010. +D. Li, Y. Yang, Y.-Z. Song, and T. Hospedales. Deeper, broader and artier domain generalization. In International Conference on Computer Vision, 2017. +H. Li, S. J. Pan, S. Wang, and A. C. Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5400-5409, 2018. +Y. Mansour, M. Mohri, and A. Rostamizadeh. Domain adaptation: Learning bounds and algorithms. arXiv preprint arXiv:0902.3430, 2009. +T. Minka et al. Divergence measures and message passing. Technical report, Citeseer, 2005. +K. Muandet, D. Balduzzi, and B. Scholkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning, pages 10-18. PMLR, 2013. +Y. Netzer, T. Wang, A. Coates, A. Bissacco, B. Wu, and A. Y. Ng. Reading digits in natural images with unsupervised feature learning. 2011. +A. T. Nguyen, T. Tran, Y. Gal, and A. G. Baydin. Domain invariant representation learning with domain density transformations. arXiv preprint arXiv:2102.05082, 2021. +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 H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024-8035. 2019. +X. Peng, B. Usman, N. Kaushik, J. Hoffman, D. Wang, and K. Saenko. Visda: The visual domain adaptation challenge, 2017. +K. Saenko, B. Kulis, M. Fritz, and T. Darrell. Adapting visual category models to new domains. In European conference on computer vision, pages 213-226. Springer, 2010. +J. Shen, Y. Qu, W. Zhang, and Y. Yu. Wasserstein distance guided representation learning for domain adaptation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +B. Sun and K. Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pages 443-450. Springer, 2016. +A. K. Tanwani. Domain-invariant representation learning for sim-to-real transfer. arXiv preprint arXiv:2011.07589, 2020. +L. Van der Maaten and G. Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. +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. +X. Xu, X. Zhou, R. Venkatesan, G. Swaminathan, and O. Majumder. d-sne: Domain adaptation using stochastic neighborhood embedding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2497-2506, 2019. +Y. Zhang, T. Liu, M. Long, and M. Jordan. Bridging theory and algorithm for domain adaptation. In International Conference on Machine Learning, pages 7404-7413. PMLR, 2019. + +H. Zhao, R. T. Des Combes, K. Zhang, and G. Gordon. On learning invariant representations for domain adaptation. In International Conference on Machine Learning, pages 7523-7532. PMLR, 2019. +Y. Zhu, F. Zhuang, J. Wang, G. Ke, J. Chen, J. Bian, H. Xiong, and Q. He. Deep subdomain adaptation network for image classification. IEEE transactions on neural networks and learning systems, 32(4):1713-1722, 2020. + +# A PROOFS + +For the following proofs, we treat the variables as continuous variables and always use the integral. If one or some of the variables are discrete, it is straight-forward to replace the corresponding integral(s) with summation sign(s) and the proofs still hold. + +# A.1 PROPOSITION 1 + +Proof. We have: + +$$ +\begin{array}{l} l _ {t e s t} \leq \mathbb {E} _ {p _ {T} (z, y)} [ - \log \hat {p} (y | z) ] (17) \\ = \int - \log \hat {p} (y | z) p _ {T} (z, y) d z d y (18) \\ = \int - \log \hat {p} (y | z) p _ {S} (z, y) d z d y + \int - \log \hat {p} (y | z) [ p _ {T} (z, y) - p _ {S} (z, y) ] d z d y (19) \\ = l _ {\text {t r a i n}} + \int - \log \hat {p} (y | z) [ p _ {T} (z, y) - p _ {S} (z, y) ] d z d y (20) \\ \end{array} +$$ + +Let $\mathcal{A} = \{(z,y)|p_T(z,y) - p_S(z,y)\geq 0\}$ and $\mathcal{B} = \{(z,y)|p_T(z,y) - p_S(z,y) < 0\}$ , using the fact that $-\log \hat{p} (y|z)\geq 0\forall z\in \mathcal{Z},y\in \mathcal{V}$ we have: + +$$ +\begin{array}{l} \int - \log \hat {p} (y | z) [ p _ {T} (z, y) - p _ {S} (z, y) ] d z d y (21) \\ = \int_ {\mathcal {A}} - \log \hat {p} (y | z) [ p _ {T} (z, y) - p _ {S} (z, y) ] d z d y + \int_ {\mathcal {B}} - \log \hat {p} (y | z) [ p _ {T} (z, y) - p _ {S} (z, y) ] d z d y (22) \\ \leq \int_ {\mathcal {A}} - \log \hat {p} (y | z) [ p _ {T} (z, y) - p _ {S} (z, y) ] d z d y (23) \\ = \int_ {\mathcal {A}} - \log \hat {p} (y | z) \left| p _ {T} (z, y) - p _ {S} (z, y) \right| d z d y (24) \\ \leq M \int_ {\mathcal {A}} | p _ {T} (z, y) - p _ {S} (z, y) | d z d y (25) \\ \left(\text {s i n c e} - \log \hat {p} (y | z) \leq M\right) (26) \\ \end{array} +$$ + +where $|.|$ is the absolute value. + +Here, $\int_{A} |p_T(z,y) - p_S(z,y)| dz dy$ is also called the total variation of the two distributions $p_T(z,y)$ and $p_S(z,y)$ . + +Note that: + +$$ +\int p _ {T} (z, y) - p _ {S} (z, y) d z d y = 0 \tag {27} +$$ + +$$ +\Leftrightarrow \int_ {\mathcal {A}} p _ {T} (z, y) - p _ {S} (z, y) d z d y + \int_ {\mathcal {B}} p _ {T} (z, y) - p _ {S} (z, y) d z d y = 0 \tag {28} +$$ + +$$ +\Leftrightarrow \int_ {\mathcal {A}} p _ {T} (z, y) - p _ {S} (z, y) d z d y = \int_ {\mathcal {B}} p _ {S} (z, y) - p _ {T} (z, y) d z d y \tag {29} +$$ + +$$ +\Leftrightarrow \int_ {A} | p _ {T} (z, y) - p _ {S} (z, y) | d z d y = \int_ {\mathcal {B}} | p _ {T} (z, y) - p _ {S} (z, y) | d z d y \tag {30} +$$ + +$$ +\Leftrightarrow \int_ {A} | p _ {T} (z, y) - p _ {S} (z, y) | d z d y = \frac {1}{2} \int | p _ {T} (z, y) - p _ {S} (z, y) | d z d y \tag {31} +$$ + +Therefore: + +$$ +l _ {t e s t} \leq l _ {t r a i n} + M \int_ {\mathcal {A}} | p _ {T} (z, y) - p _ {S} (z, y) | d z d y \tag {32} +$$ + +$$ += l _ {t r a i n} + \frac {M}{2} \int \left| p _ {T} (z, y) - p _ {S} (z, y) \right| d z d y \tag {33} +$$ + +Using the Pinsker's inequality, we have: + +$$ +\left(\int \left| p _ {T} (z, y) - p _ {S} (z, y) \right| d z d y\right) ^ {2} \leq 2 \int p _ {T} (z, y) \log \frac {p _ {T} (z , y)}{p _ {S} (z , y)} d z d y \tag {34} +$$ + +Therefore, we finally have: + +$$ +l _ {t e s t} \leq l _ {t r a i n} + \frac {M}{2} \sqrt {2 \int p _ {T} (z , y) \log \frac {p _ {T} (z , y)}{p _ {S} (z , y)} d z d y} \tag {35} +$$ + +$$ += l _ {\text {t r a i n}} + \frac {M}{\sqrt {2}} \sqrt {\mathrm {K L} [ p _ {T} (z , y) | p _ {S} (z , y) ]} \tag {36} +$$ + +Which concludes our proof. + +Also note that the KL divergence between $p_T(z,y)$ and $p_S(z,y)$ can further be decomposed into the marginal misalignment and conditional misalignment as follow: + +$$ +\begin{array}{l} \operatorname {K L} \left[ p _ {T} (z, y) \mid p _ {S} (z, y) \right] = \mathbb {E} _ {p _ {T} (z, y)} \left[ \log p _ {T} (z, y) - \log p _ {S} (z, y) \right] (37) \\ = \mathbb {E} _ {p _ {T} (z, y)} [ \log p _ {T} (z) + \log p _ {T} (y | z) - \log p _ {S} (z) - \log p _ {S} (y | z) ] (38) \\ = \mathbb {E} _ {p _ {T} (z, y)} [ \log p _ {T} (z) - \log p _ {S} (z) ] + \mathbb {E} _ {p _ {T} (z, y)} [ \log p _ {T} (y | z) - \log p _ {S} (y | z) ] (39) \\ = \mathbb {E} _ {p _ {T} (z)} [ \log p _ {T} (z) - \log p _ {S} (z) ] \\ + \mathbb {E} _ {p _ {T} (z)} \left[ \mathbb {E} _ {p _ {T} (y | z)} [ \log p _ {T} (y | z) - \log p _ {S} (y | z) ] \right] (40) \\ = \operatorname {K L} [ p _ {T} (z) | p _ {S} (z) ] + \mathbb {E} _ {p _ {T} (z)} \left[ \operatorname {K L} [ p _ {T} (y | z) | p _ {S} (y | z) ] \right] (41) \\ \end{array} +$$ + +# A.2 PROPOSITION 2 + +Proof. According to Assumption 1, we have: + +$$ +\begin{array}{l} I _ {S} (z, y) = I _ {S} (x, y) (42) \\ \Leftrightarrow H _ {S} (y) - H _ {S} (y | z) = H _ {S} (y) - H _ {S} (y | x) (43) \\ \Leftrightarrow H _ {S} (y | z) = H _ {S} (y | x) (44) \\ \Leftrightarrow \mathbb {E} _ {p _ {S} (z, y)} [ \log p _ {S} (y | z) ] = \mathbb {E} _ {p _ {S} (x, y)} [ \log p _ {S} (y | x) ] (45) \\ \Leftrightarrow \mathbb {E} _ {p _ {S} (x, z, y)} [ \log p _ {S} (y | z) ] = \mathbb {E} _ {p _ {S} (x, y)} [ \log p _ {S} (y | x) ] (46) \\ \Leftrightarrow \mathbb {E} _ {p _ {S} (x, y)} \left[ \mathbb {E} _ {p (z | x)} [ \log p _ {S} (y | z) ] \right] = \mathbb {E} _ {p _ {S} (x, y)} [ \log p _ {S} (y | x) ] (47) \\ \Leftrightarrow \mathbb {E} _ {p _ {S} (x, y)} \left[ \log p _ {S} (y | x) - \mathbb {E} _ {p (z | x)} [ \log p _ {S} (y | z) ] \right] = 0 (48) \\ \end{array} +$$ + +According to Assumption 2, $\forall x\in \mathcal{X},y\in \mathcal{Y}$ we have: + +$$ +p _ {S} (y | x) = \mathbb {E} _ {p (z | x)} [ p _ {S} (y | z) ] \tag {49} +$$ + +$$ +\Leftrightarrow \log p _ {S} (y | x) = \log \mathbb {E} _ {p (z | x)} [ p _ {S} (y | z) ] \tag {50} +$$ + +$$ +\Rightarrow \log p _ {S} (y | x) \geq \mathbb {E} _ {p (z | x)} [ \log p _ {S} (y | z) ] \tag {51} +$$ + +Since $\frac{p_T(x,y)}{p_S(x,y)} < \infty$ , there exists $N > 0$ such that $\frac{p_T(x,y)}{p_S(x,y)} \leq N \forall x \in \mathcal{X}, y \in \mathcal{Y}$ . Therefore: + +$$ +\mathbb {E} _ {p _ {T} (x, y)} \left[ \log p _ {S} (y | x) - \mathbb {E} _ {p (z | x)} [ \log p _ {S} (y | z) ] \right] \tag {52} +$$ + +$$ += \mathbb {E} _ {p _ {S} (x, y)} \left[ \left(\log p _ {S} (y | x) - \mathbb {E} _ {p (z | x)} [ \log p _ {S} (y | z) ]\right) \frac {p _ {T} (x , y)}{p _ {S} (x , y)} \right] \tag {53} +$$ + +$$ +\leq N. \mathbb {E} _ {p _ {S} (x, y)} \left[ \log p _ {S} (y | x) - \mathbb {E} _ {p (z | x)} [ \log p _ {S} (y | z) ] \right] \tag {54} +$$ + +$$ += 0 \tag {55} +$$ + +Therefore: + +$$ +\mathbb {E} _ {p _ {T} (x, y)} \left[ \log p _ {S} (y | x) - \mathbb {E} _ {p (z | x)} [ \log p _ {S} (y | z) ] \right] = 0 \tag {56} +$$ + +$$ +\Leftrightarrow \mathbb {E} _ {p _ {T} (x, y)} [ \log p _ {S} (y | x) ] = \mathbb {E} _ {p _ {T} (x, y, z)} [ \log p _ {S} (y | z) ] \tag {57} +$$ + +$$ +\Leftrightarrow \mathbb {E} _ {p _ {T} (x, y)} [ \log p _ {S} (y | x) ] = \mathbb {E} _ {p _ {T} (z, y)} [ \log p _ {S} (y | z) ] \tag {58} +$$ + +We have: + +$$ +\mathbb {E} _ {p _ {T} (z)} \left[ \mathrm {K L} [ p _ {T} (y | z) | p _ {S} (y | z) ] \right] \leq \mathbb {E} _ {p _ {T} (x)} \left[ \mathrm {K L} [ p _ {T} (y | x) | p _ {S} (y | x) ] \right] \tag {59} +$$ + +$$ +\Leftrightarrow \mathbb {E} _ {p _ {T} (z, y)} [ \log p _ {T} (y | z) - \log p _ {S} (y | z) ] \leq \mathbb {E} _ {p _ {T} (x, y)} [ \log p _ {T} (y | x) - \log p _ {S} (y | x) ] \tag {60} +$$ + +Using Eq 58, we now only need to prove that: + +$$ +\mathbb {E} _ {p _ {T} (z, y)} \left[ \log p _ {T} (y | z) \right] \leq \mathbb {E} _ {p _ {T} (x, y)} \left[ \log p _ {T} (y | x) \right] \tag {61} +$$ + +$$ +\Leftrightarrow - H _ {T} (y | z) \leq - H _ {T} (y | x) \tag {62} +$$ + +$$ +\Leftrightarrow H _ {T} (y) - H _ {T} (y | z) \leq H _ {T} (y) - H _ {T} (y | x) \tag {63} +$$ + +$$ +\Leftrightarrow I _ {T} (z, y) \leq I _ {T} (x, y) \tag {64} +$$ + +(always true based on the Data Processing Inequality) (65) + +![](images/ec1d248522521fc921d45aef1cf38d188195394fa396607159e88d45d0b83130.jpg) + +# B REVIEW OF EXISTING GENERALIZATION BOUNDS + +There have been several works studying the generalization bounds of the Domain Adaptation problem. We briefly review the most important and common ones here with a discussion about their differences to our proposed bound. + +# B.1 BEN-DAVID ET AL. (2010) + +Ben-David et al. (2010) consider a binary classification problem. Let $x$ be the input with the support set $\mathcal{X}$ and $y$ be the binary label with the support set $\mathcal{Y} = \{0,1\}$ . Consider a source domain with a distribution $P_X^s$ over the input $x$ and the true labeling function $f^s: \mathcal{X} \to \{0,1\}$ ; and similarly a target domain with a distribution $P_X^t$ over the input $x$ and the true labeling function $f^t: \mathcal{X} \to \{0,1\}$ . Note that the authors claim that this labeling function can be probabilistic; in that case, $f: \mathcal{X} \to [0,1]$ denoting the probability. However, we argue that this probabilistic setting is impractical since we would not know that true underlying function in order to calculate/estimate the bounds in practice). Therefore, we found that the bound is only practical for the case of a deterministic labeling mechanism. + +The error of the classifier $h$ , which is also a deterministic labeling function, on the source domain is: + +$$ +\epsilon^ {s} (h) = \mathbb {E} _ {x \sim P _ {\hat {X}} ^ {s}} [ | h (x) - f ^ {s} (x) | ], \tag {66} +$$ + +and similarly for the target domain: + +$$ +\epsilon^ {t} (h) = \mathbb {E} _ {x \sim P _ {X} ^ {t}} [ | h (x) - f ^ {t} (x) | ]. \tag {67} +$$ + +Here $|.|$ is the absolute value, which means the loss of a data point is the L1 distance of the labels. + +Consider a hypothesis space $\mathcal{H}$ and let a classifier $h$ be any function from that space. The first theorem in Ben-David et al. (2010) offers a bound of the target loss $\epsilon^t(h)$ based on the source loss $\epsilon^s(h)$ , and the total variation between $P_X^s$ and $P_X^t$ , and the difference between the two labeling function $f^s$ and $f^t$ : + +Theorem 1 (Ben-David et al. (2010)) + +$$ +\epsilon^ {t} (h) \leq \epsilon^ {s} (h) + 2 d _ {1} \left(P _ {X} ^ {s}, P _ {X} ^ {t}\right) + \min _ {P _ {X} \in \left\{P _ {X} ^ {s}, P _ {X} ^ {t} \right\}} \mathbb {E} _ {x \sim P _ {X}} \left[ | f ^ {s} (x) - f ^ {t} (x) | \right] \tag {68} +$$ + +where $d_{1}(P_{X}^{s}, P_{X}^{t})$ is the total variational distance, i.e., $d_{1}(P_{X}^{s}, P_{X}^{t}) \coloneqq \sup_{\mathcal{A} \in \mathcal{X}} [P_{X}^{s}(\mathcal{A}) - P_{X}^{t}(\mathcal{A})]$ , and $\mathcal{X}$ is the sigma-field of $\mathcal{X}$ (set of all subsets of $\mathcal{X}$ ). + +In this theorem, the term $2d_{1}(P_{X}^{s}, P_{X}^{t})$ presents the marginal misalignment and $\min_{P_X \in \{P_X^s, P_X^t\}} \mathbb{E}_{x \sim P_X} [|f^s(x) - f^t(x)|]$ is the conditional misalignment. + +Ben-David et al. (2010) also propose another bound based on a variant of the $\mathcal{H}$ -divergence, which is presented in the following theorem: + +Theorem 2 (Ben-David et al. (2010)) + +$$ +\epsilon^ {t} (h) \leq \epsilon^ {s} (h) + d _ {\mathcal {H} \Delta \mathcal {H}} \left(P _ {X} ^ {s}, P _ {X} ^ {t}\right) + \lambda_ {\mathcal {H}} \tag {69} +$$ + +where the $\mathcal{H}\Delta \mathcal{H}$ -divergence $d_{\mathcal{H}\Delta \mathcal{H}}(P_X^s,P_X^t)\coloneqq \sup_{h_1,h_2\in \mathcal{H}}|\operatorname*{Pr}_{x\sim P_X^s}[h_1(x)\neq h_2(x)] - \operatorname*{Pr}_{x\sim P_X^t}[h_1(x)\neq h_2(x)]|$ replaces the total variation to measure the marginal misalignment of the two domains. Meanwhile, $\lambda_{\mathcal{H}} = \inf_{h\in \mathcal{H}}[\epsilon^{s}(h) + \epsilon^{t}(h)]$ measures the conditional misalignment of the two domains (if the two true labeling functions $f^{s}$ and $f^{t}$ are the same and belong to the hypothesis space $\mathcal{H}$ , this quantity is zero). + +The above bounds can also be applied to the representation space (similar to ours), leading to the same bounds where the input $x$ is replaced by its representation $z$ . However, as mentioned in the main text, it is not clear if the conditional misalignment in the representation space (e.g., $\min_{P_Z \in \{P_Z^s, P_Z^t\}} \mathbb{E}_{z \sim P_Z} [|g^s(z) - g^t(z)|]$ ) is bounded or not. + +Difference to our bound First of all, Ben-David et al. (2010) only consider a binary classification problem. Moreover, as discussed above, the bounds in Ben-David et al. (2010) are only practical with deterministic labeling mechanisms for both domains. This assumption is hard to be true for most datasets since the labeling mechanism is usually probabilistic. This makes it not generalizable to the general case of supervised learning. Furthermore, the loss function is a $L_{1}$ distance between the labeling function, which is also not a common choice in practice, which makes it challenging to generalize to the multiclass classification set-up (even if there exists a deterministic labeling function for a multiclass dataset, using the $L_{1}$ loss for the one-hot encoded labels would be unreasonable; the common loss function in practice for the multiclass classification problem is the cross-entropy loss). Finally, the total variation and $\mathcal{H}$ -divergence might be hard to estimate in practice since it requires the computation of a supremum. + +# B.2 MANSOUR ET AL. (2009) + +Mansour et al. (2009) consider a more flexible problem set-up than Ben-David et al. (2010). Specifically, instead of $\mathcal{V} = \{0,1\}$ , they consider the cases where $\mathcal{V} = \{0,1\}$ (for binary classification) or $\mathcal{V}$ is a measurable subset of $\mathbb{R}$ (for regression). Note that their bound still cannot work for multiclass classification. They also generalize the L1 loss function to a loss function $L:\mathcal{V}\times \mathcal{V}\to \mathbb{R}$ ; however, this loss function must obey the triangle inequality. Although the L1 distance satisfies this inequality, it is not generally true for other common loss functions in practice (e.g., cross-entropy). They still consider deterministic labeling function $f^{s}$ and $f^{t}$ for the source and target domain. + +Similar to Ben-David et al. (2010), with a hypothesis $h$ from the hypothesis space $\mathcal{H}$ , the error of the source and target domain are: + +$$ +\epsilon^ {s} (h) = \mathbb {E} _ {x \sim P _ {X} ^ {s}} [ L (h (x), f ^ {s} (x)) ] \tag {70} +$$ + +$$ +\epsilon^ {t} (h) = \mathbb {E} _ {x \sim P _ {X} ^ {t}} [ L (h (x), f ^ {t} (x)) ] \tag {71} +$$ + +For convenience, denote also the error between two labeling function $h$ and $h'$ in the source and target distribution as: + +$$ +\epsilon^ {s} (h, h ^ {\prime}) = \mathbb {E} _ {x \sim P _ {X} ^ {n}} [ L (h (x), h ^ {\prime} (x)) ] \tag {72} +$$ + +$$ +\epsilon^ {t} (h, h ^ {\prime}) = \mathbb {E} _ {x \sim P _ {X} ^ {t}} [ L (h (x), h ^ {\prime} (x)) ] \tag {73} +$$ + +(which means $\epsilon^s (h) = \epsilon^s (h,f^s)$ and $\epsilon^t (h) = \epsilon^t (h,f^t)$ ). + +Also, let $h^{*s}$ and $h^{*t}$ be the minimizer of $\epsilon^s (h)$ and $\epsilon^t (h)$ respectively. In particular: + +$$ +h ^ {* s} = \arg \min _ {h \in \mathcal {H}} \epsilon^ {s} (h) = \arg \min _ {h \in \mathcal {H}} \mathbb {E} _ {x \sim P _ {X} ^ {s}} [ L (h (x), f ^ {s} (x)) ] \tag {74} +$$ + +$$ +h ^ {* t} = \arg \min _ {h \in \mathcal {H}} \epsilon^ {t} (h) = \arg \min _ {h \in \mathcal {H}} \mathbb {E} _ {x \sim P _ {X} ^ {t}} [ L (h (x), f ^ {t} (x)) ] \tag {75} +$$ + +Mansour et al. (2009) introduce a generalization bound as follow: + +Theorem 3 (Mansour et al. (2009)) Assume that the loss function $L$ is symmetric and obeys the triangle inequality. Then, for any hypothesis $h \in \mathcal{H}$ , the following holds + +$$ +\epsilon^ {t} (h) \leq \epsilon^ {t} \left(h ^ {* t}\right) + \epsilon^ {s} \left(h, h ^ {* s}\right) + \operatorname {d i s c} \left(P _ {X} ^ {s}, P _ {X} ^ {t}\right) + \epsilon^ {t} \left(h ^ {* s}, h ^ {* t}\right) \tag {76} +$$ + +where $\mathrm{disc}(P_X^s,P_X^t)\coloneqq \sup_{h,h'\in \mathcal{H}}|\epsilon^s (h,h') - \epsilon^t (h,h')|$ , which is a generalized version of the $\mathcal{H}\Delta \mathcal{H}$ -divergence. + +Here, the first term $\epsilon^t (h^{*t})$ is the ideal target loss (will be zero if the hypothesis space $\mathcal{H}$ contains $f_{t}$ ), the second term $\epsilon^s (h,h^{*s})$ will be zero if we choose $h = h^{*s}$ (which is the common practice, e.g., train the classifier $h$ on the source domain), the third term $\mathrm{disc}(P_X^s,P_X^t)$ measures the marginal misalignment, and the final term $\epsilon^t (h^{*s},h^{*t})$ is somewhat an indicator of the conditional misalignment (becomes zero if $f^{s} = f^{t}\in \mathcal{H}$ ). + +Difference to our bound The above bound is based on the ideal target loss, while our bound is based on the source loss. In practice, we have (an estimate) of the source loss calculated on the source domain's training set; meanwhile, the ideal target loss is unknown. This makes the above bound less useful in practice compared to ours. Furthermore, the above bound has similar problems as the ones in Ben-David et al. (2010): it does not work for multiclass classification, it assumes a deterministic labeling mechanism (which does not hold in practice), it assumes the loss function obeys the triangle inequality (which generally is not true in practice), and it contains terms that are not easy to compute in practice (supremum and infimum). + +# C ADDITIONAL EXPERIMENTAL RESULTS + +# C.1 VISUALIZATION OF THE ROTATEDMNIST EXPERIMENTS + +Figure 3 shows the representation space (for the RotatedMNIST experiment with source $\mathcal{M}_0$ and target $\mathcal{M}_{45}$ ) of our method compared to the baselines, visualized using t-SNE (Van der Maaten and Hinton, 2008). We can clearly see that the color clusters (which correspond to the digit classes) of our method are much more aligned when compared to other baselines such as MMD, DANN and ERM. This illustrates the effectiveness of our method in aligning the representation in the domain adaptation problem. + +# C.2 PACS + +Table 3 presents the results for PACS, which is a challenging real-world dataset for domain adaptation/generalization. In this dataset, our model outperforms the ERM baselines by roughly $9\%$ + +![](images/780169ac75a6b753e92c0df93843dacf38357a9ab06ed475d51a87de45bc8db1.jpg) + +![](images/8d7ef8e63a6672bb90a7785671b9ed3c7a84e5c66af79a6f5aead3ff5079bc6b.jpg) + +![](images/c98a74a0f0b1fad96480b3a4334b9012a818d7df6c84f96fd34e002a39bd42f4.jpg) + +![](images/7cb66e08cb7cdee160eb03cb870a2341c20469a0d8086f6c34349b63f28fe19b.jpg) + +![](images/39e2d60282bf132eda6dab139ee0eaaac75e3102d4bc9b5ad352067101fd799e.jpg) +(a) KL + +![](images/4892b541d4faa56297cc284fc54f60005d3e1376169bbbf7ee0e6955e480fc53.jpg) +(c) DANN + +![](images/501c20a76f00eb68ae0df213190b41c1dcc4620de37760e70b9cb0611add187d.jpg) +(d) ERM + +![](images/00b135aeda54577a536cf9207b5339b8940190964d65435d18ce5ff28682d1b0.jpg) +Figure 3: Visualization using t-SNE of the representation space of our method KL and the baselines MMD, DANN, ERM. For each method, the left subfigure corresponds to the source domain $\mathcal{M}_0$ and the right one corresponds to the target domain $\mathcal{M}_{45}$ . Each color represents a digit class. + +on average, indicating the effectiveness of our representation-alignment technique. Our method is the best performer (with a large margin) on 8 out of 12 experiments, showing a clear benefit over other representation alignment techniques. Together with our method, MMD again performs the best among the representation-alignment baselines (DANN, MMD, CORAL and WD), confirming that a stable training procedure (with no minimax objectives in MMD and our model) is important and often leads to better results. It is also worth noting that our model still outperforms MMD despite being less computationally expensive (in this implementation, MMD needs to compute seven Gaussian kernels for each of three pairs of representation sets in each minibatch). + +It is interesting that the ERM baselines perform the best in some experiments (e.g., $\mathrm{S} \rightarrow \mathrm{C}$ , $\mathrm{S} \rightarrow \mathrm{P}$ ). This result also agrees with the one observed in Gulrajani and Lopez-Paz (2020) that domain generalization/adaptation techniques might have negative effects when applied unsuccessfully. It should be noted that the S (sketch) domain is undoubtedly the most different compared to others (only black sketch on a white background while other domains have colors), which might explain the difficulty when learning to transfer between domains. + +# C.3 OFFICE-31 + +We also provide additional results on the Office-31 dataset Saenko et al. (2010). Table 4 presents the performance of our model and two of the best performing baselines, namely MMD and DANN. Although our method is not state-of-the-art in this dataset (and understandingly so), it significantly outperforms the relevant baselines considered in this paper. + +# C.4 ABLATION STUDY: EFFECT OF BATCH SIXE + +In this subsection, we conduct an ablation study to investigate the effect of the batch size on our model's performance. Table 5 shows the performance of our method on the RotatedMNIST dataset, with $\mathcal{M}_0$ as the source domain and $\mathcal{M}_{45}$ as the target domain and with various choices of the batch size. As expected, our model's performance tends to benefit from a bigger batch size, since it would alleviate the bias of our objective estimator. We therefore recommend increasing the batchsize whenever possible. However, our model performs well even for a batch size as small as 64 (which is considered small in this era of deep learning). + +Table 3: PACS experiments. + +
ExperimentsModel
ERMERM (prob)DANNMMDCORALWDKL (ours)
A → C66.1±1.363.5±0.871.0±3.279.5±0.462.7±10.476.2±0.973.1±3.4
A → P94.3±0.693.5±1.394.5±0.594.5±1.186.3±6.892.4±1.395.4±1.2
A → S53.6±0.860.9±3.558.6±12.862.1±2.046.2±3.553.9±2.767.4±1.9
C → A69.7±1.170.8±2.376.4±1.779.5±3.075.9±0.969.0±2.183.3±1.1
C → P82.0±0.981.5±2.178.6±3.480.8±2.378.3±3.672.9±8.683.1±7.4
C → S72.2±1.470.4±1.576.1±1.074.1±1.356.9±11.048.7±6.168.2±0.5
P → A65.7±2.363.3±1.268.0±2.767.7±1.870.0±1.562.6±1.575.5±2.5
P → C29.1±1.927.2±3.350.7±5.047.4±0.847.5±8.656.1±1.467.7±1.2
P → S38.0±1.035.9±2.329.3±9.859.7±4.815.8±5.322.3±15.064.5±2.1
S → A41.3±6.540.9±3.939.2±3.540.0±3.339.1±4.836.1±9.548.2±2.4
S → C66.7±1.067.9±1.464.3±2.065.7±2.359.9±1.560.5±2.063.5±0.4
S → P49.3±3.346.0±4.744.3±4.045.1±0.937.4±2.738.5±5.639.1±3.4
Average60.660.262.666.356.357.469.1
+ +Table 4: Office-31 experiments + +
ModelA→DA→WD→AD→WW→AW→DAverage
DANN79.7±0.482.0±0.468.2±0.496.9±0.267.4±0.599.1±0.182.2
MMD75.5±0.673.4±0.460.8±1.097.4±0.561.5±1.199.5±0.278.0
KL85.6±0.687.9±0.470.1±1.199.0±0.269.3±0.7100.0±0.085.3
+ +Table 5: Ablation study: Effect of batch size. Rotated MNIST experiments with ${\mathcal{M}}_{0}$ source and ${\mathcal{M}}_{45}$ target. + +
Batch size2561286432
KL (ours)93.4±0.893.4±1.293.3±0.389.5±0.9
+ +Table 6: Ablation study: Effect of auxiliary term. RotatedMNIST. + +
ModelM15M30M45M60M75Average
KL (βaux = 0)97.8±0.596.6±0.492.0±0.468.8±4.662.3±4.283.5
KL (reported in the paper)97.8±0.197.1±0.293.4±0.875.5±2.468.1±1.886.4
+ +Table 7: Ablation study: Effect of auxiliary term. DIGITS and VisDA17. + +
ModelDIGITSVisDA17
M → UU → MS → MAverageS → R
KL (βaux = 0)98.2±0.297.1±0.490.0±1.195.167.8
KL (reported in the paper)98.2±0.297.3±0.5292.5±0.996.070.5
+ +# C.5 ABLATION STUDY: EFFECT OF THE AUXILIARY FORWARD KL + +In this subsection, we investigate the contribution of the auxiliary forward KL term, by considering a variant of our method without this term $(\beta_{aux} = 0)$ . Table 6 and Table 7 show the results for this ablation experiment. Clearly, most of the improvement comes from the reverse KL regularizer term. And even without the auxiliary forward KL term, our results are still significantly higher than the baselines. Note that the auxiliary term requires virtually no extra computation, so we believe adding the auxiliary term is reasonable. + +# D DETAILED EXPERIMENTAL SETTINGS + +In each experiment, we split both the source and the target data into two portions: $80\%$ and $20\%$ . We use $80\%$ of the source domain data and $80\%$ of the target domain data (without the labels) as the training data. We use the remaining $20\%$ of the source data as the validation set, and the remaining $20\%$ of the target domain data as the test set. Note that we do not use the labeled data from the target domain during training or validation. This evaluation protocol is recommended by Gulrajani and Lopez-Paz (2020). + +# D.1 BASELINES + +ERM Bousquet et al. (2003) is the typical empirical risk minimization training procedure, meaning that the model is trained normally in the training data and does not account for the distribution shift (domain adaptation). + +ERM (prob): since we use a probabilistic network, we also include the probabilistic version of ERM. This is similar to ERM but uses a probabilistic representation network (same as ours). + +DANN Ganin et al. (2016) utilizes a discriminator to distinguish the representation from the source and target domains. It uses an adversarial loss to enforce that the distributions of the representation from the source domain and the target domain are the same. + +MMD Li et al. (2018) uses the maximum mean discrepancy (MMD) to align the representation's distributions. + +CORAL Sun and Saenko (2016) aligns the representation distributions of the source and target domains by matching their first two moments. + +WD Shen et al. (2018) uses the Wasserstein distance to match the distribution of the representation. + +# D.2 REPRESENTATION NETWORK USED IN ROTATEDMNIST AND DIGITS + +We use a simple CNN as the representation network in this experiment. This network is exactly the same as the one used in Gulrajani and Lopez-Paz (2020). + +Our code is in PyTorch. The network is constructed by the following layers, where output_dim=256 for a deterministic representation network and output_dim=512 for a probabilistic representation network (256 for $\mu$ and 256 for $\sigma^2$ ): + +```txt +- Conv2d(in_channels=1,out_channels=64,kernel_size=3,stride=1,padding=1) +-ReLU() +-GroupNorm(num_groups=8,num_channels=64) +-Conv2d(in_channels=64,out_channels=128,kernel_size=3,stride=2,padding=1) +-ReLU() +-GroupNorm(num_groups=8,num_channels=128) +-Conv2d(in_channels=128,out_channels=128,kernel_size=3,stride=1,padding=1) +-ReLU() +-GroupNorm(num_groups=8,num_channels=128) +-Conv2d(in_channels=128,out_channels=output_dim,kernel_size=3,stride=1,padding=1) +-ReLU() +-GroupNorm(num_groups=8,num_channels=output_dim) +-AdaptiveAvgPool2d(output_size=(1,1)) +``` + +# D.3 HYPER-PARAMETERS TUNING + +We train each model for 100 epochs. To avoid hyperparameter bias, we tune the hyperparameters (learning rate, regularizer coefficients, weight decay, representation dimension and dropout rate) for each method and dataset independently. Following Gulrajani and Lopez-Paz (2020), we perform a random search (Bergstra and Bengio, 2012) to tune hyperparameters for the baselines. We use the Adam optimizer Kingma and Ba (2014) for all the models. We re-run each set of hyperparameters three times. We train all models on an NVIDIA Quadro RTX 6000 GPU. + +The readers can also refer to our source code for the experiment setting. + +Below are the hyper-parameters considered by the random search in our experiments for each baseline. $\{.\}$ means a set of hyper-parameters considered, while $[.,.]$ means a range of hyper-parameters considered. + +# D.3.1 ROTATEDMNIST AND DIGITS + +The representation's dimension is 128 (details in Section D.2). For even more details about the below hyper-parameters, please refer to our provided code. + +- ERM: learning rate: $[10^{-4.5}, 10^{-2.5}]$ , weight decay: 0.0, dropout rate: 0.0, batch size: [8, 512], number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3. +- ERM (prob): learning rate: $[10^{-4.5}, 10^{-2.5}]$ , weight decay: 0.0, dropout rate: 0.0, batch size: [8, 512], number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3. +- DANN Ganin et al. (2016): learning rate: $[10^{-4.5}, 10^{-2.5}]$ , weight decay: 0.0, dropout rate: 0.0, batch size: [8, 512], number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3, adversarial loss coefficient: $[10^{-2}, 10^2]$ , weight decay of discriminator: $[10^{-6}, 10^{-2}]$ , number of discriminator steps per generator steps: $\{1, 2, 4, 8\}$ , grad penalty coefficient: $[10^{-2}, 10^1]$ +- MMD Li et al. (2018): learning rate: $[10^{-4.5}, 10^{-2.5}]$ , weight decay: 0.0, dropout rate: 0.0, batch size: [8, 512], number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3, MMD coefficient: $[10^{-3}, 10^{-1}]$ +- CORAL Sun and Saenko (2016): learning rate: $[10^{-4.5}, 10^{-2.5}]$ , weight decay: 0.0, dropout rate: 0.0, batch size: [8, 512], number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3, CORAL loss coefficient: $[10^{-3}, 10^{-1}]$ +- WD Shen et al. (2018): learning rate: $[10^{-4.5}, 10^{-2.5}]$ , weight decay: 0.0, dropout rate: 0.0, batch size: [8, 512], number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3, wasserstein distance coefficient: $[10^{-2}, 10^{2}]$ , weight decay of network $f$ : $[10^{-6}, 10^{-2}]$ , number of $f$ optimization steps per normal optimization steps: $\{1, 2, 4, 8\}$ , grad penalty coefficient: $[10^{-2}, 10^{1}]$ +- KL (ours): learning rate: $[10^{-4.5}, 10^{-2.5}]$ , weight decay: 0.0, dropout rate: 0.0, batch size: 256, number of layers of the classifier ( $\hat{p}(y|z)$ ): 1, $\beta : 0.3$ , $\beta_{aux} : 0.1$ + +# D.3.2 VISDA17 AND PACS + +The representation network for VisDA17 is a Resnet50, while the one for PACS is a Resnet18. For even more details about the below hyper-parameters, please refer to our provided code. + +- ERM: learning rate: $[10^{-5}, 10^{-3.5}]$ , weight decay: $[10^{-6}, 10^{-2}]$ , dropout rate: $\{0.0, 0.1, 0.5\}$ , batch size: $[8, 45]$ , representation dimension: $\{16, 128, 256, 512\}$ , number of layers of the classifier $(\hat{p}(y|z))$ : 1 or 3. +- ERM (prob): learning rate: $[10^{-5}, 10^{-3.5}]$ , weight decay: $[10^{-6}, 10^{-2}]$ , dropout rate: $\{0.0, 0.1, 0.5\}$ , batch size: $[8, 45]$ , representation dimension: $\{16, 128, 256, 512\}$ , number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3. +- DANN Ganin et al. (2016): learning rate: $[10^{-5}, 10^{-3.5}]$ , weight decay: $[10^{-6}, 10^{-2}]$ , dropout rate: $\{0.0, 0.1, 0.5\}$ , batch size: [8, 45], representation dimension: $\{16, 128, 256, 512\}$ , number of layers of the classifier $(\hat{p}(y|z))$ : 1 or 3, adversarial loss coefficient: $[10^{-2}, 10^{2}]$ , weight decay of discriminator: $[10^{-6}, 10^{-2}]$ , number of discriminator steps per generator steps: $\{1, 2, 4, 8\}$ , grad penalty coefficient: $[10^{-2}, 10^{1}]$ +- MMD Li et al. (2018): learning rate: $[10^{-5}, 10^{-3.5}]$ , weight decay: $[10^{-6}, 10^{-2}]$ , dropout rate: $\{0.0, 0.1, 0.5\}$ , batch size: $[8, 45]$ , representation dimension: $\{16, 128, 256, 512\}$ , number of layers of the classifier ( $\hat{p}(y|z)$ ): 1 or 3, MMD coefficient: $[10^{-3}, 10^{-1}]$ +- CORAL Sun and Saenko (2016): learning rate: $[10^{-5}, 10^{-3.5}]$ , weight decay: $[10^{-6}, 10^{-2}]$ , dropout rate: $\{0.0, 0.1, 0.5\}$ , batch size: [8, 45], representation dimension: $\{16, 128, 256, 512\}$ , number of layers of the classifier $(\hat{p}(y|z))$ : 1 or 3, CORAL loss coefficient: $[10^{-3}, 10^{-1}]$ +- WD Shen et al. (2018): learning rate: $[10^{-5}, 10^{-3.5}]$ , weight decay: $[10^{-6}, 10^{-2}]$ , dropout rate: $\{0.0, 0.1, 0.5\}$ , batch size: [8, 45], representation dimension: $\{16, 128, 256, 512\}$ , number of layers of the classifier $(\hat{p}(y|z))$ : 1 or 3, Wasserstein distance coefficient: $[10^{-2}, 10^2]$ , weight decay of network $f$ : $[10^{-6}, 10^{-2}]$ , number of $f$ optimization steps per normal optimization steps: $\{1, 2, 4, 8\}$ , grad penalty coefficient: $[10^{-2}, 10^1]$ +- KL (ours): learning rate: $10^{-4}$ , weight decay: $[10^{-6}, 10^{-2}]$ , dropout rate: 0.0, batch size: 256, representation dimension: 16, number of layers of the classifier $(\hat{p}(y|z))$ : 1, $\beta : \{0.1, 0.05, 0.001\}$ , $\beta_{aux} : \{0.1, 0.05, 0.01, 0.0\}$ \ No newline at end of file diff --git a/klguideddomainadaptation/images.zip b/klguideddomainadaptation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..090eeaf67d20a0473e868f494db685de1bc04a22 --- /dev/null +++ b/klguideddomainadaptation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:687f9f89a3c2d1515c72b0445b2ebc8abc4e7b2dfa421d28d810660ba93b47c0 +size 992971 diff --git a/klguideddomainadaptation/layout.json b/klguideddomainadaptation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4d60d1bbbbc9c300a183aef219e3401e9c6e45e0 --- /dev/null +++ b/klguideddomainadaptation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ea066042ee8d0b63119a2b4ba49dcfd7f37c0dfc7b3fd82e68387544fc3b55b +size 858174 diff --git a/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_content_list.json b/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a8552d3283fc96182d27452d4d59e422a864c832 --- /dev/null +++ b/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5280b2b2307827c0f7e06bbd2d81d11f5454a3591ac9bdd75ccb08146cc244f1 +size 140475 diff --git a/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_model.json b/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a4656662839da6d26322ebe62aa951c8172f4f76 --- /dev/null +++ b/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebee8decd8a2982450db1f53566265859fc71a1e4a39efdfb28a0a8d0b54ce4b +size 172154 diff --git a/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_origin.pdf b/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8d1c450a068c2e3fa0e1984e7d68505788e1d8ac --- /dev/null +++ b/knowledgeinfuseddecoding/e3c4358c-ae3a-4e28-bec5-a05ae920593a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce69583212e5e65a713d1dec69a54b7610a8cd12adae3d2fdeebb64a97e6045e +size 654486 diff --git a/knowledgeinfuseddecoding/full.md b/knowledgeinfuseddecoding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9652304df91a0e0555689ffaec00e731d04635bd --- /dev/null +++ b/knowledgeinfuseddecoding/full.md @@ -0,0 +1,394 @@ +# KNOWLEDGE INFUSED DECODING + +Ruibo Liu $\clubsuit$ , Guoqing Zheng $\clubsuit$ , Shashank Gupta $\clubsuit$ , Radhika Gaonkar $\clubsuit$ , Chongyang Gao $\clubsuit$ , Soroush Vosoughi $\clubsuit$ , Milad Shokouhi $\clubsuit$ , Ahmed Hassan Awadallah $\clubsuit$ + +$\spadesuit$ Dartmouth College, $\spadesuit$ Microsoft, $\spadesuit$ Northwestern University +$\spadesuit$ {ruibo.liu.gr, soroush.vosoughi}@dartmouth.edu +$\spadesuit$ {zheng, shagup, ragaonka, milads, hassanam}@microsoft.com +$\spadesuit$ cygao@u.northwestern.edu + +# ABSTRACT + +Pre-trained language models (LMs) have been shown to memorize a substantial amount of knowledge from the pre-training corpora; however, they are still limited in recalling factually correct knowledge given a certain context. Hence, they tend to suffer from counterfactual or hallucinatory generation when used in knowledge-intensive natural language generation (NLG) tasks. Recent remedies to this problem focus on modifying either the pre-training or task fine-tuning objectives to incorporate knowledge, which normally require additional costly training or architecture modification of LMs for practical applications. + +We present Knowledge Infused Decoding (KID)—a novel decoding algorithm for generative LMs, which dynamically infuses external knowledge into each step of the LM decoding. Specifically, we maintain a local knowledge memory based on the current context, interacting with a dynamically created external knowledge trie, and continuously update the local memory as a knowledge-aware constraint to guide decoding via reinforcement learning. On six diverse knowledge-intensive NLG tasks, task-agnostic LMs (e.g., GPT-2 and BART) armed with KID outperform many task-optimized state-of-the-art models, and show particularly strong performance in few-shot scenarios over seven related knowledge-infusion techniques. Human evaluation confirms KID's ability to generate more relevant and factual language for the input context when compared with multiple baselines. Finally, KID also alleviates exposure bias and provides stable generation quality when generating longer sequences. Code for KID is available at https://github.com/microsoft/KID. + +# 1 INTRODUCTION + +Pre-trained language models (LMs) have been shown to capture rich semantic and syntactic features, as demonstrated by the state-of-the-art performance on many generation tasks such as abstractive summarization (Zhang et al., 2020b; Chu & Liu, 2019) and dialogue generation (Roller et al., 2021; Zhang et al., 2020c). Their generations, however, can be quite limited in scenarios requiring knowledge—they frequently struggle with issues such as being easily misguided by phrase cooccurrence (e.g., "Talk? Birds can talk"), failing to handle negation (e.g., "The theory of relativity was not developed by Einstein.") (Kassner & Schütze, 2020), and being unable to compare commonsense concepts, such as time (Qin et al., 2021) and digits (Talmor et al., 2020). + +To enhance the performance of LMs on knowledge-intensive NLG tasks1, prior studies have proposed to re-train LMs with knowledge-aware objectives (Zhou et al., 2021; Xiong et al., 2020; Zhang et al., 2019; Khandelwal et al., 2020) or add special architectures to encode knowledge (Bosselut et al., 2019; Logan et al., 2019; Peters et al., 2019b) from external resources (e.g., knowledge graphs such as CONCEPTNET (Speer et al., 2017) and ATOMIC (Sap et al., 2019)). These methods, though yielding impressive results on many downstream tasks, can be computationally expensive. More importantly, + +knowledge implicitly parameterized in LM architectures is difficult to revise and expand (Lewis et al., 2020b), and wrong generations are hard to diagnose due to lack of interpretation (Talmor et al., 2020), which heavily limits their real-world applications. + +More recent retrieval-based models try to tackle these problems by augmenting inputs with retrieved knowledge evidence (Lee et al., 2019; Guu et al., 2020). For example, RAG (Lewis et al., 2020b) leverages non-parametric memory to access extensive knowledge (in the form of unstructured documents), and jointly fine-tunes a parametric LM (i.e., BART (Lewis et al., 2020a)) to enable knowledge-aware generation. A key limitation of such methods is that they retrieve documents only once while grounding them in the input static context, and thus cannot support the dynamic nature of the context as new tokens are generated. The static knowledge becomes a major problem for tasks where longer and abstractive generation is expected, such as open-ended story generation (Mostafazadeh et al., 2016), multi-turn dialogues (Zhao et al., 2020), and conversation summarization (Gliwa et al., 2019). Moreover, in a recent study, Krishna et al. (2021) replaced the knowledge retriever in RAG with a random retriever and found little difference in the resulting performance on a long-form QA task named ELI5 (Fan et al., 2019b), indicating the model may not be actually grounding its text generation to the retrieved documents. + +To address these limitations, in this work, we present a novel decoding algorithm KID, aiming to better infuse knowledge into generation in a dynamic manner. Instead of solely relying on the static knowledge retrieved at beginning, during each step of LM decoding, KID dynamically searches promising continuation from retrieved knowledge, to guide the current step generation. Specifically, KID maintains a local knowledge memory, interacts it with a knowledge trie dynamically created from retrieved supporting documents, and updates the local memory as a knowledge-aware constraint to guide the generation. The key intuition behind KID is that existing LM pre-training objectives are usually defined at the token level yet do not explicitly model concept-centric knowledge (Xiong et al., 2020) — thus motivating us to reshape the probability mass at each step decoding towards the distribution of entities in knowledge. + +The contribution of this work is three-fold: First, we introduce KID as a model and task agnostic decoding method that integrates knowledge on the fly and can be applied to various knowledge-intensive tasks with different generative LMs. Second, from a decoding perspective, on six knowledge-intensive NLG tasks, GPT2 (Radford et al., 2019) and BART (Lewis et al., 2020a) equipped with KID significantly outperform conventional beam search or sampling decoding by a large margin. Third, from a knowledge infusion perspective, unlike seven strong knowledge-infusion baselines which require either additional retraining or special architecture modifications, KID leverages knowledge more effectively as a light-weight knowledge infusion solution. Additionally, in few-shot scenarios KID significantly improves over them, demonstrating its generalization ability in low-resource and domain shifting regimes. + +# 2 RELATED WORK + +We briefly review existing work enhancing LMs with external knowledge and representative decoding algorithms for generation. + +Enhancing Language Model with Knowledge. Large language models implicitly encode knowledge in their parameters but with limits (Petroni et al., 2019; Kassner & Schütze, 2020; Lin et al., 2020a). Several architectures and objective functions have been proposed to explicitly encode external knowledge (Sun et al., 2020; Logan et al., 2019; Roberts et al., 2020; Levine et al., 2020), or to augment LM pre-training data with retrieved knowledge (Lewis et al., 2020b; Guu et al., 2020; Lee et al., 2019). However, Talmor et al. (2020) notes that the reasoning ability of such LMs is strongly tied to the context seen during pre-training and is thus hard to generalize to new domains. Built on LMs, KID incorporates extra knowledge from external resources (Wikipedia) and thus shows strong performance in knowledge-intensive NLG tasks. + +Better Decoding Algorithm. Two common strategies dominate the decoding algorithms used by most generative models: beam search which maximizes likelihood in a local horizon (due to finite beam size), and sampling decoding (e.g., top- $k$ sampling (Fan et al., 2018; Holtzman et al., 2018)) which relies on randomness. Holtzman et al. (2020) find beam search often produces generic and repetitive generation, while top- $k$ sampling tends to pick unlikely tokens which creates incoherent and + +unrelated sequences. Existing attempts to mitigate these problems include reranking (Adiwardana et al., 2020; Shao et al., 2017), adding control signals (Zhang et al., 2018; Xing et al., 2017), and self-adaptive truncation (Welleck et al., 2020; Peters et al., 2019a). None of these decoding algorithms consider integrating knowledge in the generation process. Reflective decoding (West et al., 2021) and DeLorean (Qin et al., 2020) are two recent decoding algorithms that focus on abductive commonsense reasoning. Reflective decoding in particular has the potential to be extended to other knowledge-intensive tasks. We compare it with KID in our experiments. + +# 3 KNOWLEDGE INFUSED DECODING + +We detail the implementation of KID in this section. As shown in Figure 1, KID comprises of three steps: retrieving relevant knowledge (§3.1), constructing external and local knowledge memory (§3.2), and guiding current step decoding under the constraint of the knowledge trie (§3.3). + +# 3.1 RETRIE VING EXTENSIVE KNOWLEDGE FROM WIKIPEDIA + +The first step of KID is to retrieve several context-relevant documents to ground the following generation. We use DPR (Karpukhin et al., 2020) as our general-purpose knowledge retriever, which projects contexts and relevant documents to a 768-dim shared embedding space using a bi-encoder network (i.e., two independent BERTs (Devlin et al., 2019)). Here, the documents refer to the 100-word chunks of Wikipedia passages released by RAG (Lewis et al., 2020b), a total of 21M documents as our knowledge source $\mathbb{Z}$ . We pre-load the weights from the latest checkpoint of DPR (March 2021), as it improves retrieval performance by using mined negative samples and contrastive learning, which is also suggested by Jernite (2020). During retrieval, we perform a maximum inner-product search (MIPS) with faiss $^2$ accelerated by GPU (Johnson et al., 2019). Formally, we retrieve $k$ most relevant document $z_{[1,\dots,k]} \in \mathbb{Z}$ for context $x_{\text{context}}$ as: + +$$ +z _ {[ 1, \dots , k ]} = \left\{z _ {i} \in \mathbb {Z} \mid \operatorname {t o p k} \left\{\mathrm {B E R T} \left(x _ {\text {c o n t e x t}}\right) ^ {\top} \cdot \mathrm {B E R T} \left(z _ {i}\right) \right\} \right\} \tag {1} +$$ + +where $\mathrm{BERT}(\cdot)$ means the vectors encoded by BERT. The number of retrieved documents $k$ is a task-specific hyper-parameter—we discuss its impact on performance in §4.3. + +# 3.2 CONSTRUCTING EXTERNAL AND LOCAL KNOWLEDGE MEMORIES + +We convert multi-document input retrieved from previous step into compressed knowledge memories, in order to 1) allow relevant knowledge to be easily identified, 2) reduce the memory footprint of the knowledge, whose size grows linearly with the number of retrieved documents. + +Following design choice of previous successful methods (Bosselut et al., 2021; Huang et al., 2020; Fan et al., 2019a), we adopt co-reference resolution and open information extraction (OpenIE) (Stanovsky et al., 2018) to convert plain text into triplet form3. For example, knowledge statement like "Iceland is a Nordic island country in the North Atlantic Ocean and it is the most sparsely populated country in Europe." will be converted to subject-relation-object triplets such as $\langle \text{subj:Iceland, rel:is}, \text{obj:Nordic island country} \rangle$ , $\langle \text{subj:Iceland, rel:is}, \text{obj:most sparsely populated country in Europe} \rangle$ , etc. To account for overlapping elements from these triplets, we use a prefix tree (namely Knowledge Trie $G_{\text{ext}}$ ) to store and organize the extracted triplets, by setting the subject in each triplet as the key in the $G_{\text{ext}}$ . Note that unlike common character-level dictionary tries (Chen et al., 2020; Germann et al., 2009), in $G_{\text{ext}}$ each triplet is stored in token unit as our goal is to efficiently query and traverse the knowledge triplets stored in it. + +A tree structure encoding knowledge is appealing to knowledge intensive NLG tasks, since 1) the non-cyclic structure helps reduce repetitions in generations, and 2) querying a prefix tree can be efficiently completed in constant time $(O(|x_{\mathrm{context}}|))$ which does not involve any costly traversal on the graph (Ji et al., 2020; Zhang et al., 2020a), regardless of the scale of grounding knowledge (normally $|x_{\mathrm{context}}| \ll |k$ Wiki docs|). We also maintain a local memory $G_{\mathrm{loc}}$ (a first-in-first-out list) + +![](images/942ee0a1574ddc2624c0bb28c2a2e7ed857607a749440ac4a72f2a5e38651008.jpg) +Step 1. Knowledge Retrieval + +![](images/e593a749b01fddba04b90f1aa19865bbf9c492af043cfe5c93e4f46ea771d091.jpg) +Figure 1: Overview of our KID decoding algorithm. For a given context $x_{\mathrm{context}}$ , we first retrieve $k$ most relevant Wikipedia documents $z_{[1,\dots,k]}$ with a knowledge retriever (Step 1), and then convert them into compressed knowledge trie $G_{\mathrm{ext}}$ (Step 2). Meanwhile, the local memory $G_{\mathrm{loc}}$ which is a first-in-first-out list will keep track of entities in current context, and in the final step (Step 3), it will continuously query the knowledge trie with max number of hops $h_{\mathrm{max}}$ . Current step LM decoding will be guided by the query results with policy gradient, to generate new token $y_i$ . + +![](images/a9d27949f4df9e71e2bfef40df041cccfe7c489f858d904dfcd9b5e3d5c6efea.jpg) +Step 2. Memory Construction +Step 3. Interaction Guided Decoding + +that records all the mentioned entities in current context, to focus on concept-centric knowledge (Zhou et al., 2021; Lin et al., 2020b). More details about how we construct and query these knowledge memories can be found in §A.2 of Appendix. + +# 3.3 KNOWLEDGE TRIE CONSTRAINED DECODING VIA POLICY GRADIENT + +Background. Current generative LMs are trained to maximize the probability of generating ground-truth tokens at each decoding step. Assuming $\boldsymbol{y}_{1:T}^{*} = \{y_{1}^{*}, y_{2}^{*}, \dots, y_{T}^{*}\}$ is the ground-truth output sequence for a given context $x_{\text{context}}$ , the MLE objective minimizes the following loss: + +$$ +J _ {\mathrm {M L E}} = - \sum_ {i = 1} ^ {T} \log p \left(y _ {t} ^ {*} \mid y _ {1} ^ {*}, \dots , y _ {t - 1} ^ {*}, x _ {\text {c o n t e x t}}\right). \tag {2} +$$ + +In knowledge-intensive NLG tasks, however, it is reported that the MLE training goal does not explicitly model knowledge, and thus the LM often produces counterfactual generation by surface-level misguidance (Zhou et al., 2021; Petroni et al., 2019). Furthermore, the teacher-forcing algorithm used by MLE training leads to the exposure bias problem (Ranzato et al., 2016), as the LM has access to ground truth sequence up to the next token during training, but does not have such signal during testing, which causes accumulated errors when generating longer sequence (Paulus et al., 2018). Both problems heavily limit the performance of popular LMs on diverse knowledge-intensive NLG tasks. One remedy is to learn a generation policy that not only maximizes knowledge correctness but also alleviates exposure bias in longer generation, which can be made possible with policy gradient in reinforcement learning (RL). + +Knowledge Tri Constrained Decoding. To formulate NLG as a RL problem, we define the state as the generated tokens before $t$ (i.e., $s_t = y_{